Commit 133bef85 authored by Gilles MARCKMANN's avatar Gilles MARCKMANN

Refactoring 2019 : take into account new libs of Xfiles and new namespaces

parent 1cd7ac98
cmake_minimum_required(VERSION 2.6)
message(STATUS "=================== --")
message(STATUS "PROJECT: TLSDuctile --")
message(STATUS "=================== --")
message(STATUS "======================== --")
message(STATUS "PROJECT: TLSElementBased --")
message(STATUS "======================== --")
project(TLSDuctile CXX C)
project(TLSElementBased CXX C)
# BEGIN options and parameters
#================================================================================
#ADDITIONAL OPTIONS
#================================================================================
option(TLSDUCTILE_ATOMIC_TEST "include atomic test" OFF)
option(TLSDUCTILE_TEST_DAM "include test dam" ON )
option(TLSDUCTILE_TEST_DYN "include test dyn" OFF)
option(TLSDUCTILE_TEST_PLAST "include test plast" OFF)
option(TLSDUCTILE_TEST_ANIMESH_DAM "include test animesh dam" OFF)
option(TLSDUCTILE_TEST_INFINITE_DAM "include test infinite dam" OFF)
option(FASTMARCHINGINTERFACE "include FastMarchingInterface" ON )
option(TLSELEMENTBASED_ATOMIC_TEST "include atomic test" OFF)
option(TLSELEMENTBASED_TEST_DAM "include test dam" ON )
option(TLSELEMENTBASED_TEST_DYN "include test dyn" OFF)
option(TLSELEMENTBASED_TEST_PLAST "include test plast" OFF)
option(TLSELEMENTBASED_TEST_ANIMESH_DAM "include test animesh dam" OFF)
option(TLSELEMENTBASED_TEST_INFINITE_DAM "include test infinite dam" OFF)
option(FASTMARCHINGINTERFACE "include FastMarchingInterface" ON )
# END
......@@ -30,43 +30,40 @@ define_archos_suffixe(ARCHOS)
find_package(EXLIBRISTYPES REQUIRED )
find_package(EXLIBRISTOOLS REQUIRED)
find_package(XAOMDInterfaceGeneral REQUIRED)
find_package(DISTMESH REQUIRED )
find_package(xTool REQUIRED)
find_package(xInterfaceAOMDGeneral REQUIRED)
find_package(xDistMesh REQUIRED )
find_package(Trellis REQUIRED )
find_package(SolverBase REQUIRED )
find_package(InterfaceLapack REQUIRED )
find_package(InterfaceSuperLu REQUIRED )
find_package(InterfaceTaucs REQUIRED )
find_package(Xfem REQUIRED )
find_package(Xext REQUIRED )
find_package(Geom REQUIRED )
find_package(xTLS REQUIRED )
find_package(Xcut REQUIRED )
find_package(ANN REQUIRED )
find_package(CGAL REQUIRED )
find_package(BLAS2 REQUIRED )
find_package(LAPACK2 REQUIRED )
find_package(METIS REQUIRED )
find_package(xSolverBase REQUIRED )
find_package(xInterfaceLapack REQUIRED )
find_package(xInterfaceSuperLu REQUIRED )
find_package(xInterfaceTaucs REQUIRED )
find_package(xFEM REQUIRED )
find_package(xExt REQUIRED )
find_package(xGeom REQUIRED )
find_package(xTLS REQUIRED )
find_package(xDoubleCut REQUIRED )
find_package(ANN REQUIRED )
find_package(CGAL REQUIRED )
find_package(BLAS2 REQUIRED )
find_package(LAPACK2 REQUIRED )
find_package(METIS REQUIRED )
file(GLOB SOURCES src/*)
list(APPEND EXTERNAL_INCLUDES
${EXLIBRISTYPES_INCLUDE_DIR}
${EXLIBRISTOOLS_INCLUDE_DIR}
${XAOMDInterfaceGeneral_INCLUDE_DIR}
${DISTMESH_INCLUDE_DIR}
${TRELLIS_INCLUDE_DIR}
${SolverBase_INCLUDE_DIR}
${InterfaceSuperLu_INCLUDE_DIR}
${InterfaceTaucs_INCLUDE_DIR}
${InterfaceLapack_INCLUDE_DIR}
${XFEM_INCLUDE_DIR}
${XEXT_INCLUDE_DIR}
${GEOM_INCLUDE_DIR}
# ${CGAL_INCLUDE_DIR}
${xTool_INCLUDE_DIR}
${xInterfaceAOMDGeneral_INCLUDE_DIR}
${xDistMesh_INCLUDE_DIR}
${Trellis_INCLUDE_DIR}
${xSolverBase_INCLUDE_DIR}
${xInterfaceSuperLu_INCLUDE_DIR}
${xInterfaceTaucs_INCLUDE_DIR}
${xInterfaceLapack_INCLUDE_DIR}
${xFEM_INCLUDE_DIR}
${xExt_INCLUDE_DIR}
${xGeom_INCLUDE_DIR}
${xTLS_INCLUDE_DIR}
${PARMETIS_INCLUDE_DIR}
src
......@@ -74,43 +71,43 @@ list(APPEND EXTERNAL_INCLUDES
)
list(APPEND EXTERNAL_LIBRARIES
TLSDuctile
Tlselementbased
${xTLS_LIBRARIES}
${XCUT_LIBRARIES}
${XEXT_LIBRARIES}
${GEOM_LIBRARIES}
${XFEM_LIBRARIES}
${TRELLIS_LIBRARIES}
${SolverBase_LIBRARIES}
${InterfaceLapack_LIBRARIES}
${xGeom_LIBRARIES}
${xFEM_LIBRARIES}
${Trellis_LIBRARIES}
${xSolverBase_LIBRARIES}
${xInterfaceLapack_LIBRARIES}
${LAPACK_LIBRARIES}
${BLAS_LIBRARIES}
${InterfaceSuperLu_LIBRARIES}
${xInterfaceSuperLu_LIBRARIES}
${SUPERLU_LIBRARIES}
${InterfaceTaucs_LIBRARIES}
${xInterfaceTaucs_LIBRARIES}
${TAUCS_LIBRARIES}
${PARMETIS_LIBRARIES}
${METIS_LIBRARIES}
${ANN_LIBRARIES}
${DISTMESH_LIBRARIES}
${EXLIBRISTOOLS_LIBRARIES}
${xDistMesh_LIBRARIES}
${xTool_LIBRARIES}
${MPI_CXX_LIBRARIES}
${CGAL_LIBRARIES}
)
if(FASTMARCHINGINTERFACE)
add_definitions(-DHAVE_FASTMARCHING)
find_package(FastMarching REQUIRED )
list(APPEND EXTERNAL_INCLUDES ${FASTMARCHING_INCLUDE_DIR})
find_package(xFastMarching REQUIRED )
list(APPEND EXTERNAL_INCLUDES ${xFastMarching_INCLUDE_DIR})
set(CXXFLAGS "${CXXFLAGS} -std=c++11")
endif(FASTMARCHINGINTERFACE)
add_library(TLSDuctile ${BUILD_LIBS} ${SOURCES})
add_library(TLSElementBased ${BUILD_LIBS} ${SOURCES})
include_directories(${EXTERNAL_INCLUDES})
set_target_properties(TLSDuctile PROPERTIES COMPILE_FLAGS "${CXXFLAGS}" LINKER_LANGUAGE CXX)
set_target_properties(TLSElementBased PROPERTIES COMPILE_FLAGS "${CXXFLAGS}" LINKER_LANGUAGE CXX)
if(TLSDUCTILE_ATOMIC_TEST)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/atomic_test)
......
cmake_minimum_required(VERSION 2.6)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../Util/cmakeUtil/)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../xUtil/cmakeUtil/)
include(common_functions)
include(devel_common_functions)
......
......@@ -19,8 +19,8 @@
#include "xGenericSparseMatrix.h"
#include "xGenericSparseMatrixTraitPolicy.h"
namespace lalg {
typedef xGenericSparseMatrix<double,
namespace xlinalg {
typedef xlinalg::xGenericSparseMatrix<double,
xTraitMatrixNonSingular,
xTraitMatrixUnSym,
xTraitMatrixSparceCSC,
......@@ -28,7 +28,7 @@ namespace lalg {
}
using namespace xfem;
using namespace lalg;
// using namespace xlinalg;
using Trellis_Util::mPoint;
using AOMD::mEntity;
using AOMD::mVertex;
......@@ -43,13 +43,13 @@ int main(int argc, char* argv[]) {
xMesh mesh(argv[1]);
// domain creation
xGrownHalfLine grown(mPoint(0.5, 0.5, 0.), xVector(1.,0.,0.), 0.26);
xGrownHalfLine grown(Trellis_Util::mPoint(0.5, 0.5, 0.), xtensor::xVector(1.,0.,0.), 0.26);
xLevelSet level_set(&mesh, xCompl(grown));
// xPlane p1(mPoint(0.1,0.1,0.), xVector(1.,0.,0.));
// xPlane p2(mPoint(0.205,0.205,0.), xVector(-1.,0.,0.));
// xPlane p1(Trellis_Util::mPoint(0.1,0.1,0.), xtensor::xVector(1.,0.,0.));
// xPlane p2(Trellis_Util::mPoint(0.205,0.205,0.), xtensor::xVector(-1.,0.,0.));
// xLevelSet level_set(&mesh, xUnion(p1, p2));
xPhysSurfByTagging phys_surf(level_set);
xEntityFilter filter=std::bind1st(std::mem_fun(&xPhysSurfByTagging::strictOut), &phys_surf);
xcut::xPhysSurfByTagging phys_surf(level_set);
xEntityFilter filter=std::bind1st(std::mem_fun(&xcut::xPhysSurfByTagging::strictOut), &phys_surf);
xSubMesh domain("domain", mesh);
xSubMesh bnd("bnd", mesh);
xSubMesh interior("interior", mesh);
......@@ -103,9 +103,9 @@ int main(int argc, char* argv[]) {
vals[0]->setVal(1.*level_set(*it));
}
xEvalField<xIdentity<double> > eval_field(field);
xEvalField<xtool::xIdentity<double> > eval_field(field);
xIntegrationRuleBasic integ_rule(1);
xExportGmshAscii pexport;
xexport::xExportGmshAscii pexport;
Export(eval_field, pexport, "phi_given", integ_rule, all.begin(), all.end());
std::function<double (const AOMD::mVertex&)> f_func=[](const AOMD::mVertex&){ return 1.; };
......@@ -145,7 +145,7 @@ int main(int argc, char* argv[]) {
Export(eval_one, pexport, "interior_in", integ_rule, interior_in.begin(), interior_in.end());
// modes creation
xDenseMatrix coeffs(bnd_in.size(0), region.size(0));
xlinalg::xDenseMatrix coeffs(bnd_in.size(0), region.size(0));
FastMarchingModeExtension([&field](mVertex* v){ std::vector<double> vals; field.getVals(v, vals); return vals[0]; },
[&field](mVertex* v, double val){ field.setVal(v, val); },
region,
......
......@@ -28,8 +28,8 @@ int main()
// ------- IN TLS DUCTILE ------
// Tensors
//xTensor2 eps(0);
// xTensor2 sig(0);
//xtensor::xTensor2 eps(0);
// xtensor::xTensor2 sig(0);
Display::init();
......@@ -64,10 +64,10 @@ int main()
int nb_incr(1000);
// Strain increment
xVector lign1(0.0005, 0.0000, 0.);
xVector lign2(0.0000, 0.0000, 0.);
xVector lign3(0. , 0. , 0.);
xTensor2 d_eps(lign1, lign2, lign3);
xtensor::xVector lign1(0.0005, 0.0000, 0.);
xtensor::xVector lign2(0.0000, 0.0000, 0.);
xtensor::xVector lign3(0. , 0. , 0.);
xtensor::xTensor2 d_eps(lign1, lign2, lign3);
double d_d;
// Strain increment
......@@ -135,7 +135,7 @@ int main()
cout << "damage:" << new_tensors_ptr->scalar("d") << endl;
cout << "cumulated plastic strain:" << new_tensors_ptr->scalar("p") << endl;
cout << "plastic strain:" << new_tensors_ptr->tensor2("eps_p") << endl;
xTensor2 stress;
xtensor::xTensor2 stress;
mate_ptr->sensitivityTo("stress", stress);
cout << "stress:" << stress << endl;
Display::stepOut("New variables");
......
......@@ -80,7 +80,7 @@ void Display::stepOut(string str) {
PostProcessing::PostProcessing(const xParseData& parse_data_, xExport &pexport_, xEntityFilter filter) :
PostProcessing::PostProcessing(const xParseData& parse_data_, xexport::xExport &pexport_, xEntityFilter filter) :
parse_data(parse_data_),
export_manager(GetNbDigits(parse_data.getInt("nb_step_max"))),
filter(filter) ,
......@@ -117,11 +117,11 @@ void PostProcessing::exportOnTime(const std::string name, const double time, con
sensor_manager.measureAll(eval, time, name);
}
void PostProcessing::exportOnTime(const std::string name, const double time, const xEval<xVector>& eval) {
void PostProcessing::exportOnTime(const std::string name, const double time, const xEval<xtensor::xVector>& eval) {
sensor_manager.measureAll(eval, time, name);
}
void PostProcessing::exportOnTime(const std::string name, const double time, const xEval<xTensor2>& eval) {
void PostProcessing::exportOnTime(const std::string name, const double time, const xEval<xtensor::xTensor2>& eval) {
sensor_manager.measureAll(eval, time, name);
}
......
......@@ -54,9 +54,9 @@ inline int GetNbDigits(int nb) {
class PostProcessing {
public:
PostProcessing(const xParseData&,xfem::xExport &, xfem::xEntityFilter=xfem::xAcceptAll() );
PostProcessing(const xParseData&,xexport::xExport &, xfem::xEntityFilter=xfem::xAcceptAll() );
// init and reinit xGeomElem used by xSensors to measure.
// init and reinit xfem::xGeomElem used by xexport::xSensors to measure.
void init(xfem::xMesh&);
void reinit(xfem::xMesh&);
......@@ -73,22 +73,22 @@ public:
}
template<typename ITER>
void exportOnSpace(const std::string export_name, const int step, const xfem::xEval<xfem::xVector>& eval,
void exportOnSpace(const std::string export_name, const int step, const xfem::xEval<xtensor::xVector>& eval,
const xfem::xIntegrationRule& integration_rule, ITER begin, ITER end) {
if(export_manager.toExport(export_name, step, "")) {
exportOnSpace(export_name, eval, integration_rule, begin, end);
}
for(int i=0; i<3; ++i) {
if(export_manager.toExport(export_name+"_"+std::to_string(i+1), step, "")) {
xfem::xExtractCompVector extract(i);
xfem::xEvalUnary<xfem::xExtractCompVector> evalex(extract, eval);
xtensor::xExtractCompVector extract(i);
xfem::xEvalUnary<xtensor::xExtractCompVector> evalex(extract, eval);
exportOnSpace(export_name, evalex, integration_rule, begin, end);
}
}
}
template<typename ITER>
void exportOnSpace(const std::string export_name, const int step, const xfem::xEval<xfem::xTensor2>& eval,
void exportOnSpace(const std::string export_name, const int step, const xfem::xEval<xtensor::xTensor2>& eval,
const xfem::xIntegrationRule& integration_rule, ITER begin, ITER end) {
if(export_manager.toExport(export_name, step, "")) {
exportOnSpace(export_name, eval, integration_rule, begin, end);
......@@ -96,18 +96,18 @@ public:
for(int i=0; i<3; ++i) {
for(int j=0; j<3; ++j) {
if(export_manager.toExport(export_name+"_"+std::to_string(i+1)+std::to_string(j+1), step, "")) {
xfem::xExtractCompTensor extract(i,j);
xfem::xEvalUnary<xfem::xExtractCompTensor> evalex(extract, eval);
xtensor::xExtractCompTensor extract(i,j);
xfem::xEvalUnary<xtensor::xExtractCompTensor> evalex(extract, eval);
exportOnSpace(export_name, evalex, integration_rule, begin, end);
}
}
}
if(export_manager.toExport(export_name+"_tr", step, "")) {
xfem::xEvalUnary<xfem::xTrace> evaltr(eval);
xfem::xEvalUnary<xtensor::xTrace> evaltr(eval);
exportOnSpace(export_name, evaltr, integration_rule, begin, end);
}
if(export_manager.toExport(export_name+"_dev", step, "")) {
xfem::xEvalUnary<xfem::xDeviatoric> evaldev(eval);
xfem::xEvalUnary<xtensor::xDeviatoric> evaldev(eval);
exportOnSpace(export_name, evaldev, integration_rule, begin, end);
}
}
......@@ -128,8 +128,8 @@ public:
void exportOnTime(const std::string name, const double time, const double val);
void exportOnTime(const std::string name, const double time, const xfem::xEval<double>& eval);
void exportOnTime(const std::string name, const double time, const xfem::xEval<xfem::xVector>& eval);
void exportOnTime(const std::string name, const double time, const xfem::xEval<xfem::xTensor2>& eval);
void exportOnTime(const std::string name, const double time, const xfem::xEval<xtensor::xVector>& eval);
void exportOnTime(const std::string name, const double time, const xfem::xEval<xtensor::xTensor2>& eval);
void saveMesh(std::string export_name, int step, xfem::xMesh& mesh);
void saveField(std::string export_name, int step, const xfem::xField& field, xfem::xRegion reg);
......@@ -167,9 +167,9 @@ private:
}
const xParseData& parse_data;
xfem::xExportManager export_manager;
xfem::xExportSensors sensor_manager;
xfem::xExport &pexport;
xexport::xExportManager export_manager;
xexport::xExportSensors sensor_manager;
xexport::xExport &pexport;
xfem::xEntityFilter filter;
};
......
......@@ -7,6 +7,8 @@
#ifndef _FastMarchingInterface_h_
#define _FastMarchingInterface_h_
// Xfem
#include "xRegion.h"
//
......@@ -75,9 +77,9 @@ void FastMarchingReinit(std::function<double (AOMD::mVertex*)> get_val,
std::cout << "FastMarchingReinit requires HAVE_FASTMARCHING defined to work" << std::endl;
throw;
#else
meshinterfacexRegion mi(region);
entitystorage<meshinterfacexRegion, AOMD::mVertex, double> ls(mi);
entitystorage<meshinterfacexRegion, AOMD::mVertex, vector3d<double> > gls(mi);
xfastmarching::meshinterfacexRegion mi(region);
xfastmarching::entitystorage<xfastmarching::meshinterfacexRegion, AOMD::mVertex, double> ls(mi);
xfastmarching::entitystorage<xfastmarching::meshinterfacexRegion, AOMD::mVertex, xfastmarching::vector3d<double> > gls(mi);
for(auto it=known_begin; it!=known_end; ++it) {
auto v=static_cast<AOMD::mVertex*>(*it);
ls.set(*v, get_val(v));
......@@ -89,12 +91,12 @@ void FastMarchingReinit(std::function<double (AOMD::mVertex*)> get_val,
for(auto it=tofind_begin; it!=tofind_end; ++it) {
ls.set(*static_cast<AOMD::mVertex*>(*it), std::numeric_limits<double>::max());
}
entitytovertexiteratorconvertor<ITERKNOWN> trial_known_conv_begin(known_begin);
entitytovertexiteratorconvertor<ITERKNOWN> trial_known_conv_end(known_end);
entitytovertexiteratorconvertor<ITERKNOWNV> trial_known_volatil_conv_begin(known_volatil_begin);
entitytovertexiteratorconvertor<ITERKNOWNV> trial_known_volatil_conv_end(known_volatil_end);
entitytovertexiteratorconvertor<ITERKNOWNT> known_conv_it(known_it);
fmeik(mi, ls, trial_known_conv_begin, trial_known_conv_end,trial_known_volatil_conv_begin, trial_known_volatil_conv_end, known_conv_it, f_func, epsilon_ratio, gls);
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWN> trial_known_conv_begin(known_begin);
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWN> trial_known_conv_end(known_end);
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWNV> trial_known_volatil_conv_begin(known_volatil_begin);
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWNV> trial_known_volatil_conv_end(known_volatil_end);
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWNT> known_conv_it(known_it);
xfastmarching::fmeik(mi, ls, trial_known_conv_begin, trial_known_conv_end,trial_known_volatil_conv_begin, trial_known_volatil_conv_end, known_conv_it, f_func, epsilon_ratio, gls);
for(auto it=region.begin(0); it!=region.end(0); ++it) {
auto v=static_cast<AOMD::mVertex*>(*it);
double val;
......@@ -119,10 +121,10 @@ void FastMarchingModeExtension(std::function<double (AOMD::mVertex*)> get_val,
std::cout << "FastMarchingModeExtension requires HAVE_FASTMARCHING defined to work" << std::endl;
throw;
#else
meshinterfacexRegion mi(region);
entitystorage<meshinterfacexRegion, AOMD::mVertex, double> ls(mi);
entitystorage<meshinterfacexRegion, AOMD::mVertex, vector3d<double> > gls(mi);
entitystorage<meshinterfacexRegion, AOMD::mVertex, modesValues> vn(mi);
xfastmarching::meshinterfacexRegion mi(region);
xfastmarching::entitystorage<xfastmarching::meshinterfacexRegion, AOMD::mVertex, double> ls(mi);
xfastmarching::entitystorage<xfastmarching::meshinterfacexRegion, AOMD::mVertex, xfastmarching::vector3d<double> > gls(mi);
xfastmarching::entitystorage<xfastmarching::meshinterfacexRegion, AOMD::mVertex, modesValues> vn(mi);
const int nb_modes=coeffs.nline();
int i=0;
for(auto it=known_begin; it!=known_end; ++it, ++i) {
......@@ -136,13 +138,13 @@ void FastMarchingModeExtension(std::function<double (AOMD::mVertex*)> get_val,
ls.set(*static_cast<AOMD::mVertex*>(*it), std::numeric_limits<double>::max());
}
const std::set<const AOMD::mVertex*> empty;
entitytovertexiteratorconvertor<ITERKNOWN> known_conv_begin(known_begin);
entitytovertexiteratorconvertor<ITERKNOWN> known_conv_end(known_end);
entitytovertexiteratorconvertor< std::set<const AOMD::mVertex*>::const_iterator> known_volatil_conv_begin(empty.begin());
entitytovertexiteratorconvertor< std::set<const AOMD::mVertex*>::const_iterator> known_volatil_conv_end(empty.end());
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWN> known_conv_begin(known_begin);
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWN> known_conv_end(known_end);
xfastmarching::entitytovertexiteratorconvertor< std::set<const AOMD::mVertex*>::const_iterator> known_volatil_conv_begin(empty.begin());
xfastmarching::entitytovertexiteratorconvertor< std::set<const AOMD::mVertex*>::const_iterator> known_volatil_conv_end(empty.end());
std::vector<const AOMD::mVertex*> vec;
vec.reserve(nb_modes);
entitytovertexiteratorconvertor<std::back_insert_iterator<std::vector<const AOMD::mVertex*>>> dummy_it(std::back_inserter(vec));
xfastmarching::entitytovertexiteratorconvertor<std::back_insert_iterator<std::vector<const AOMD::mVertex*>>> dummy_it(std::back_inserter(vec));
fmeik(mi, ls, known_conv_begin, known_conv_end,known_volatil_conv_begin, known_volatil_conv_end, dummy_it, f_func, epsilon_ratio, gls, vn);
int j=0;
for(auto it=region.begin(0); it!=region.end(0); ++it, ++j) {
......
......@@ -57,7 +57,7 @@ void Formulation::addMeasureFunction(std::function<void (int)> measure_fct) {
}
std::string Formulation::getMaterialClass() const {
xGeomElem geo_integ(*geom.begin());// this is a hack to get the (unique) material.
xfem::xGeomElem geo_integ(*geom.begin());// this is a hack to get the (unique) material.
const xTensors& props = *(xMaterialManagerSingleton::instance().getMaterial(&geo_integ)->getProperties());
return props.astring("MATERIAL_CLASS");
}
......@@ -93,7 +93,7 @@ void Formulation::transferDispField(double coeff) {
deleteDispField("int_fds");
applyEssentialEnv(coeff);
declareDofs();
xEvalField<xIdentity<xVector> > eval_disp_field(disp_field);
xEvalField<xtool::xIdentity<xtensor::xVector> > eval_disp_field(disp_field);
post_pro.exportOnSpace("transfered_disp", Observer::tell<int>("step"), eval_disp_field, geom.getIntegRuleBasic(0), geom.begin(), geom.end());
}
......@@ -163,21 +163,21 @@ void Formulation::writeCurrentToOldMaterialVariables() {
ApplyCommandOnIntegrationRule(visit_command, geom.getIntegRuleSmart(), geom.begin(), geom.end());
}
void Formulation::readDisp(lalg::xCSRVector& vec) {
void Formulation::readDisp(xlinalg::xCSRVector& vec) {
Visit(xReadVectorVisitor<>(vec.begin()), double_manager.begin(dofs), double_manager.end(dofs));
}
void Formulation::writeDisp(const lalg::xCSRVector& vec) {
void Formulation::writeDisp(const xlinalg::xCSRVector& vec) {
Visit(xWriteSolutionVisitor<>(vec.begin()), double_manager.begin(dofs), double_manager.end(dofs));
}
void Formulation::addDisp(const lalg::xCSRVector& vec) {
void Formulation::addDisp(const xlinalg::xCSRVector& vec) {
Visit(xAddSolutionVisitor<>(vec.begin()), double_manager.begin(dofs), double_manager.end(dofs));
}
void Formulation::writeStrain(std::string name, std::string domain_name) {
OldAndCurrent_c::current();
SetMaterialVariablesVisitor_c<xEvalGradField<xSymmetrize>> set_visitor(name, disp_field);
SetMaterialVariablesVisitor_c<xEvalGradField<xtensor::xSymmetrize>> set_visitor(name, disp_field);
UpdateMaterialVariablesVisitor_c update_visitor(name);
xeCompositeMaterialVariablesVisitor_c composite_visitor(set_visitor, update_visitor);
VisitMaterialVariablesCommand_c visit_command(composite_visitor, variab_manager);
......@@ -189,20 +189,20 @@ void Formulation::assembleGraphMatrix(LinearSystem& system) {
}
void Formulation::assembleStiffnessMatrix(LinearSystem& system, std::string matrix_name, std::string domain_name) {
NonUniformMaterialSensitivity_c<xTensor4> eval_stiffness(matrix_name, variab_manager);
xFormBilinearWithLaw<xGradOperator<xSymmetrize>, xEval<xTensor4>, xGradOperator<xSymmetrize>> form_bilinear(eval_stiffness);
NonUniformMaterialSensitivity_c<xtensor::xTensor4> eval_stiffness(matrix_name, variab_manager);
xFormBilinearWithLaw<xGradOperator<xtensor::xSymmetrize>, xEval<xtensor::xTensor4>, xGradOperator<xtensor::xSymmetrize>> form_bilinear(eval_stiffness);
Assemble(form_bilinear, system.getAssembler(), geom.getIntegRuleSmart(), disp_field, disp_field, geom.begin(domain_name), geom.end(domain_name));
}
void Formulation::assembleMassMatrix(LinearSystem& system) {
xUniformMaterialSensitivity<double> eval_density("density");
xFormBilinearWithLaw<xValOperator<xIdentity<xVector>>, xEval<double>, xValOperator<xIdentity<xVector>>> form_bilinear(eval_density);
xFormBilinearWithLaw<xValOperator<xtool::xIdentity<xtensor::xVector>>, xEval<double>, xValOperator<xtool::xIdentity<xtensor::xVector>>> form_bilinear(eval_density);
Assemble(form_bilinear, system.getAssemblerLumpedEqu(), geom.getIntegRuleSmart(), disp_field, disp_field, geom.begin(), geom.end());
}
void Formulation::assembleInternalForce(LinearSystem& system, std::string vector_name, std::string domain_name) {
NonUniformMaterialSensitivity_c<xTensor2> eval_stress(vector_name, variab_manager);
xFormLinearWithLoad<xGradOperator<xSymmetrize>, xEval<xTensor2> > form_linear(eval_stress);
NonUniformMaterialSensitivity_c<xtensor::xTensor2> eval_stress(vector_name, variab_manager);
xFormLinearWithLoad<xGradOperator<xtensor::xSymmetrize>, xEval<xtensor::xTensor2> > form_linear(eval_stress);
Assemble(form_linear, system.getAssembler(), geom.getIntegRuleSmart(), disp_field, geom.begin(domain_name), geom.end(domain_name));
}
......@@ -215,27 +215,27 @@ void Formulation::assembleNaturalEnv(LinearSystem& system) {
std::string phys=env.Phys;
if(strncmp(phys.c_str(), "TRACTION", 8)==0) {
assert(env.Type==FIX || env.Type==FIX_AND_MEASURE);
xVector val;
xtensor::xVector val;
if(phys[9]=='X') { val(0)=env.getValue(); }
else if(phys[9]=='Y') { val(1)=env.getValue(); }
else if(phys[9]=='Z') { val(2)=env.getValue(); }
xEvalConstant<xVector> flux(val);
xFormLinearWithLoad<xValOperator<xIdentity<xVector> >, xEvalConstant<xVector> > lin(flux);
xEvalConstant<xtensor::xVector> flux(val);
xFormLinearWithLoad<xValOperator<xtool::xIdentity<xtensor::xVector> >, xEvalConstant<xtensor::xVector> > lin(flux);
xClassRegion bc(&mesh, env.Entity, env.getDimension());
Assemble(lin, system.getAssembler(), geom.getIntegRuleBasic(bc_integ_order), disp_field, bc.begin(), bc.end(), xUpperAdjacency());
}
else if(phys=="PRESSURE") {
assert(env.Type==FIX || env.Type==FIX_AND_MEASURE);
xEvalNormal eval_normal;
xScale<xVector> scale(env.getValue());
xEvalUnary<xScale<xVector> > eval_pressure(scale, eval_normal);
xFormLinearWithLoad<xValOperator<xIdentity<xVector> >, xEval<xVector> > lin(eval_pressure);
xtool::xScale<xtensor::xVector> scale(env.getValue());
xEvalUnary<xtool::xScale<xtensor::xVector> > eval_pressure(scale, eval_normal);
xFormLinearWithLoad<xValOperator<xtool::xIdentity<xtensor::xVector> >, xEval<xtensor::xVector> > lin(eval_pressure);
xClassRegion bc(&mesh, env.Entity, env.getDimension());
Assemble(lin, system.getAssembler(), geom.getIntegRuleBasic(bc_integ_order), disp_field, bc.begin(), bc.end(), xUpperAdjacency());
}
else if(strncmp(phys.c_str(), "STRESS", 6)==0) {
assert(env.Type==FIX || env.Type==FIX_AND_MEASURE);
xTensor2 val;
xtensor::xTensor2 val;
if(phys[7]=='X' && phys[8]=='X') { val(0,0)=env.getValue(); }
else if(phys[7]=='X' && phys[8]=='Y') { val(0,1)=env.getValue(); val(1,0)=env.getValue(); }
else if(phys[7]=='X' && phys[8]=='Z') { val(0,2)=env.getValue(); val(2,0)=env.getValue(); }
......@@ -243,9 +243,9 @@ void Formulation::assembleNaturalEnv(LinearSystem& system) {
else if(phys[7]=='Y' && phys[8]=='Z') { val(1,2)=env.getValue(); val(2,1)=env.getValue(); }
else if(phys[7]=='Z' && phys[8]=='Z') { val(2,2)=env.getValue(); }
xEvalNormal eval_normal;
xEvalConstant<xTensor2> eval_stress(val);
xEvalBinary<xMult<xTensor2, xVector, xVector> > eval_traction(eval_stress, eval_normal);
xFormLinearWithLoad<xValOperator<xIdentity<xVector> >, xEval<xVector> > lin(eval_traction);
xEvalConstant<xtensor::xTensor2> eval_stress(val);
xEvalBinary<xtool::xMult<xtensor::xTensor2, xtensor::xVector, xtensor::xVector> > eval_traction(eval_stress, eval_normal);
xFormLinearWithLoad<xValOperator<xtool::xIdentity<xtensor::xVector> >, xEval<xtensor::xVector> > lin(eval_traction);
xClassRegion bc(&mesh, env.Entity, env.getDimension());
Assemble(lin, system.getAssembler(), geom.getIntegRuleBasic(bc_integ_order), disp_field, bc.begin(), bc.end(), xUpperAdjacency());
}
......@@ -291,25 +291,25 @@ void Formulation::exportStep(int step) {
auto begin=geom.begin();
auto end=geom.end();
xGeomElem geo_integ(*begin);// this is a hack to get the (unique) material.
xfem::xGeomElem geo_integ(*begin);// this is a hack to get the (unique) material.
xTensorsSignature& tensor_sig = *(xMaterialManagerSingleton::instance().getMaterial(&geo_integ)->getVariablesSignature());
for(xTensorsSignature::const_iterator it=tensor_sig.begin_scalar(); it!=tensor_sig.end_scalar(); ++it) {
SmoothMaterialVariable_c<double> eval(it->first, variab_manager);
post_pro.exportOnSpace(it->first, step, eval, integ_rule, begin, end);
}
for(xTensorsSignature::const_iterator it=tensor_sig.begin_tensor2(); it!=tensor_sig.end_tensor2(); ++it) {
SmoothMaterialVariable_c<xTensor2> eval(it->first, variab_manager);
SmoothMaterialVariable_c<xtensor::xTensor2> eval(it->first, variab_manager);
post_pro.exportOnSpace(it->first, step, eval, integ_rule, begin, end);
}
for(auto str: {"strain", "stress"}) {
// SmoothApproNonUniformMaterialSensitivity_c<xTensor2> eval(str, variab_manager);
// SmoothApproNonUniformMaterialSensitivity_c<xtensor::xTensor2> eval(str, variab_manager);
// post_pro.exportOnSpace(str, step, eval, integ_rule, begin, end);
SmoothNonUniformMaterialSensitivity_c<xTensor2> eval(str, variab_manager);
SmoothNonUniformMaterialSensitivity_c<xtensor::xTensor2> eval(str, variab_manager);
post_pro.exportOnSpace(str, step, eval, geom.getIntegRuleSmart(), begin, end);
}
CustomValueDoubleSelector::which_val=size_disp_value;
xEvalField<xIdentity<xVector> > eval_disp(disp_field);
xEvalField<xtool::xIdentity<xtensor::xVector> > eval_disp(disp_field);
post_pro.exportOnSpace("disp", step, eval_disp, integ_rule, begin, end);
post_pro.exportOnSpace("disp_basic", step, eval_disp, geom.getIntegRuleBasic(0), begin, end);
post_pro.exportOnTime("disp", step, eval_disp);
......
......@@ -21,7 +21,7 @@ namespace xtls {
class xEvalTLSDamageFunction;
}
class xParseData;
namespace lalg {
namespace xlinalg {
class xCSRVector;
}
......@@ -89,14 +89,14 @@ public:
// gives the prescribed value from main.dat.
virtual void applyEssentialEnv(double);
// Reads from disp field dof values to xCSRVector.
void readDisp(lalg::xCSRVector&);
// Reads from disp field dof values to xlinalg::xCSRVector.
void readDisp(xlinalg::xCSRVector&);
// Writes to disp field dof values from xCSRVector.
void writeDisp(const lalg::xCSRVector&);
// Writes to disp field dof values from xlinalg::xCSRVector.
void writeDisp(const xlinalg::xCSRVector&);
// Appends to disp field dof values from xCSRVector.
void addDisp(const lalg::xCSRVector&);
// Appends to disp field dof values from xlinalg::xCSRVector.
void addDisp(const xlinalg::xCSRVector&);
// Export function
void exportStep(int);
......
......@@ -26,7 +26,7 @@
#include "NonUniformMaterialSensitivity.h"
using namespace xfem;
using namespace lalg;
// using namespace xlinalg;
using namespace xtls;
DynFormulation::DynFormulation(TLSGeom& geom, TLSSolver& tls_solver,
......@@ -52,13 +52,13 @@ DynFormulation::DynFormulation(TLSGeom& geom, TLSSolver& tls_solver,
tls_solver.registerMeanVector("mean_Dd");
}
void DynFormulation::readSpeed(lalg::xCSRVector& vec) {
void DynFormulation::readSpeed(xlinalg::xCSRVector& vec) {
CustomValueDoubleSelector::which_val=1;
readDisp(vec);
CustomValueDoubleSelector::which_val=0;
}
void DynFormulation::writeSpeed(const lalg::xCSRVector& vec) {
void DynFormulation::writeSpeed(const xlinalg::xCSRVector& vec) {
CustomValueDoubleSelector::which_val=1;
writeDisp(vec);
CustomValueDoubleSelector::which_val=0;
......@@ -105,11 +105,11 @@ void DynFormulation::computeLSAdvanceMeanFields() {
void DynFormulation::computeDeltaLevelSetField(double time_step) {
OldAndCurrent_c::current();
const xCSRVector& Y=tls_solver.getMeanVector("mean_Y");
const xCSRVector& Yc=tls_solver.getMeanVector("mean_Yc");
const xCSRVector& Dd=tls_solver.getMeanVector("mean_Dd");
xCSRVector& delta_phi=tls_solver.getMeanVector("delta_phi");
xGeomElem geo_integ(*geom.begin());// this is a hack to get the (unique) material.
const xlinalg::xCSRVector& Y=tls_solver.getMeanVector("mean_Y");
const xlinalg::xCSRVector& Yc=tls_solver.getMeanVector("mean_Yc");
const xlinalg::xCSRVector& Dd=tls_solver.getMeanVector("mean_Dd");
xlinalg::xCSRVector& delta_phi=tls_solver.getMeanVector("delta_phi");
xfem::xGeomElem geo_integ(*geom.begin());// this is a hack to get the (unique) material.
xUniformMaterialSensitivity<double> eval_celerity("rayleigh_celerity");
double cr;
eval_celerity(&geo_integ, &geo_integ, cr);
......@@ -122,7 +122,7 @@ void DynFormulation::computeDeltaLevelSetField(double time_step) {
}
double DynFormulation::getTimeStep() const {
xGeomElem geo_integ(*geom.begin());// this is a hack to get the (unique) material.
xfem::xGeomElem geo_integ(*geom.begin());// this is a hack to get the (unique) material.
xUniformMaterialSensitivity<double> eval_celerity("long_celerity");
double c;
eval_celerity(&geo_integ, &geo_integ, c);
......@@ -147,9 +147,9 @@ void DynFormulation::exportStep(int step, double time) {
post_pro.exportOnSpace(str, step, eval, geom.getIntegRuleSmart(),