Commit e58d67d6 authored by Gilles MARCKMANN's avatar Gilles MARCKMANN

Refactoring 2019 : takes into account new libs in Xfiles and new namespaces

parent 2135976b
......@@ -4,38 +4,39 @@
#------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.6)
project(DamageBandDyn)
project(TLSExplicit)
message(STATUS "-------------------------")
message(STATUS "PROJECT: DamageBandDyn --")
message(STATUS "-------------------------")
message(STATUS "================================ --")
message(STATUS "PROJECT: TLSExplicit/TLSExplicit --")
message(STATUS "================================ --")
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)
#include(devel_common_functions)
find_devroot(DEVROOT)
#find_devroot(DEVROOT)
define_archos_suffixe(ARCHOS)
enable_testing()
option(USE_TRELLIS "use Trellis" ON)
option(USE_XINTERFACE "use Xinterface" ON)
option(USE_XCRACK "use Xcrack" OFF)
option(USE_SUPERLU "Use SuperLu interface" ON )
option(USE_TAUCS "Use Taucs interface" ON )
option(USE_XCRACK "use xCrack" OFF)
option(USE_XTLS "use xTLS" ON)
option(USE_XCUT "use Xcut" ON)
option(USE_GEOM "use Geom" ON)
option(USE_OCTREE "use Octree" ON)
option(USE_XDOUBLECUT "use xDoubleCut" ON)
option(USE_XGEOM "use xGeom" ON)
option(USE_XOCTREE "use xOctree" ON)
option(USE_MATLIB "use MatLib" ON)
if(USE_OCTREE OR USE_MATLIB)
if(USE_XOCTREE OR USE_MATLIB)
set(USE_XINTERFACE ON)
endif(USE_OCTREE OR USE_MATLIB)
endif(USE_XOCTREE OR USE_MATLIB)
option(TIME_MONITORING "use time monitoring" ON)
option(USE_ANN "use library ANN" ON)
option(USE_CGAL "use library CGAL" ON)
if(USE_ANN OR USE_CGAL)
set(USE_GEOM ON)
set(USE_XGEOM ON)
endif(USE_ANN OR USE_CGAL)
option(USE_TR1 "use TR1" ON)
option(USE_MTL "use library MTL" OFF)
......@@ -48,66 +49,83 @@ option(TIME_MEASURE "use time monitoring" ON)
option(STATE_RESTORATION "use state restoration" ON)
option(EXTENDED_EXPORT "use extended export possibility" ON)
set_internal_def()
#set_internal_def()
set_external_def()
find_and_set(Xfem XFEM DAMAGEBANDDYN_EXTERNAL_INCLUDES NOTHING)
find_and_set(xFEM xFEM TLSEXPLICIT_EXTERNAL_INCLUDES NOTHING)
if(USE_TRELLIS)
add_definitions( -DHAVE_AOMD)
find_and_set(Trellis TRELLIS DAMAGEBANDDYN_EXTERNAL_INCLUDES NOTHING)
find_and_set(Trellis Trellis TLSEXPLICIT_EXTERNAL_INCLUDES NOTHING)
endif(USE_TRELLIS)
if(USE_XINTERFACE)
find_package(Xinterfaces)
set_from_prefix(Xinterfaces DAMAGEBANDDYN_EXTERNAL_INCLUDES NOTHING)
# temporary
list(APPEND DAMAGEBANDDYN_EXTERNAL_INCLUDES
${XINTERFACES_INCLUDE_DIR}
${SolverBase_INCLUDE_DIR}
${SOLVERINTERFACES_INCLUDE_DIR}
${SuperLu_INCLUDE_DIR}
${Taucs_INCLUDE_DIR}
)
endif(USE_XINTERFACE)
find_package(xTool REQUIRED)
find_package(xSolverBase REQUIRED)
find_package(xInterfaceLapack REQUIRED)
list(APPEND TLSEXPLICIT_EXTERNAL_INCLUDES
${xTool_INCLUDE_DIR}
${MPI_CXX_INCLUDE_PATH}
${xSolverBase_INCLUDE_DIR}
${xInterfaceLapack_INCLUDE_DIR}
)
if(USE_SUPERLU)
add_definitions( -DWITH_DSUPERLU)
find_package(xInterfaceSuperLu REQUIRED)
list(APPEND TLSEXPLICIT_EXTERNAL_INCLUDES ${xInterfaceSuperLu_INCLUDE_DIR} ${SuperLu_INCLUDE_DIR} )
endif(USE_SUPERLU)
if(USE_TAUCS)
if ( PARSEQ OR PARDIST)
message(WARNING "Selecting Taucs with PARSEQ or PARDIST is useless => switching to false for PARXXX")
set(PARSEQ OFF CACHE BOOL "Parallel computing in sequencial frame " FORCE)
set(PARDIST OFF CACHE BOOL "Parallel computing in parallele frame" FORCE)
endif( PARSEQ OR PARDIST)
add_definitions( -DWITH_DTAUCS)
find_package(xInterfaceTaucs REQUIRED)
list(APPEND TLSEXPLICIT_EXTERNAL_INCLUDES ${xInterfaceTaucs_INCLUDE_DIR} ${Taucs_INCLUDE_DIR} )
else(USE_TAUCS)
message(FATAL_ERROR "DamageBand need Taucs: set option USE_TAUCS to ON.")
endif(USE_TAUCS)
if(USE_XCRACK)
add_definitions( -DHAVE_XCRACK)
find_and_set(Xcrack XCRACK DAMAGEBANDDYN_EXTERNAL_INCLUDES NOTHING)
find_and_set(xCrack XCRACK TLSEXPLICIT_EXTERNAL_INCLUDES NOTHING)
endif(USE_XCRACK)
if(USE_XTLS)
find_and_set(xTLS xTLS DAMAGEBANDDYN_EXTERNAL_INCLUDES NOTHING)
find_and_set(xTLS xTLS TLSEXPLICIT_EXTERNAL_INCLUDES NOTHING)
endif(USE_XTLS)
if(USE_XCUT)
find_and_set(Xcut XCUT DAMAGEBANDDYN_EXTERNAL_INCLUDES NOTHING)
endif(USE_XCUT)
if(USE_XDOUBLECUT)
find_and_set(xDoubleCut xDoubleCut TLSEXPLICIT_EXTERNAL_INCLUDES NOTHING)
endif(USE_XDOUBLECUT)
if(USE_GEOM)
find_and_set(Geom GEOM DAMAGEBANDDYN_EXTERNAL_INCLUDES NOTHING)
endif(USE_GEOM)
if(USE_XGEOM)
find_and_set(xGeom xGeom TLSEXPLICIT_EXTERNAL_INCLUDES NOTHING)
endif(USE_XGEOM)
if(USE_OCTREE)
if(USE_XOCTREE)
add_definitions( -DHAVE_OCTREE)
find_and_set(Octree OCTREE DAMAGEBANDDYN_EXTERNAL_INCLUDES NOTHING)
endif(USE_OCTREE)
find_and_set(xOctree XOCTREE TLSEXPLICIT_EXTERNAL_INCLUDES NOTHING)
find_and_set(xOctreeInterface xOctreeInterface TLSEXPLICIT_EXTERNAL_INCLUDES NOTHING)
endif(USE_XOCTREE)
if(USE_MATLIB)
add_definitions( -DHAVE_MATLIB)
find_package(MATLIB)
list(APPEND DAMAGEBANDDYN_EXTERNAL_INCLUDES ${MATLIB_INCLUDE_DIR} ${MatLibInterface_INCLUDE_DIR})
list(APPEND TLSEXPLICIT_EXTERNAL_INCLUDES ${MATLIB_INCLUDE_DIR} ${MatLibInterface_INCLUDE_DIR})
endif(USE_MATLIB)
if(USE_ANN)
add_definitions( -DHAVE_ANN)
find_package(ANN)
list(APPEND DAMAGEBANDDYN_EXTERNAL_INCLUDES ${ANN_INCLUDE_DIR})
list(APPEND TLSEXPLICIT_EXTERNAL_INCLUDES ${ANN_INCLUDE_DIR})
endif(USE_ANN)
if(USE_CGAL)
add_definitions( -DHAVE_CGAL)
find_and_set(CGAL CGAL DAMAGEBANDDYN_EXTERNAL_INCLUDES NOTHING)
find_and_set(CGAL CGAL TLSEXPLICIT_EXTERNAL_INCLUDES NOTHING)
endif(USE_CGAL)
if(USE_TR1)
......@@ -117,7 +135,7 @@ endif(USE_TR1)
if(USE_MTL)
add_definitions( -DHAVE_MTL)
find_package(MTL)
list(APPEND DAMAGEBANDDYN_EXTERNAL_INCLUDES ${MTL_INCLUDE_DIR}/..)
list(APPEND TLSEXPLICIT_EXTERNAL_INCLUDES ${MTL_INCLUDE_DIR}/..)
endif(USE_MTL)
if(MAKE_DOC)
......@@ -151,15 +169,19 @@ file(GLOB src_files src/*)
if(MAKE_TAGS)
add_custom_target(tags
COMMAND echo "Generating DamageBandDyn Tags"
COMMAND etags --members --declarations ${src_files} --append --output ${DEVROOT}/Applis/DamageBandDyn/tags/TAGS)
COMMAND echo "Generating TLSExplicit Tags"
COMMAND etags --members --declarations ${src_files} --append --output ${DEVROOT}/Applis/TLSExplicit/tags/TAGS)
endif(MAKE_TAGS)
add_library(DamageBandDyn ${BUILD_SHARED_LIBS} ${src_files})
add_library(TLSExplicit ${BUILD_SHARED_LIBS} ${src_files})
include_directories(${DAMAGEBANDDYN_EXTERNAL_INCLUDES})
set_target_properties(DamageBandDyn PROPERTIES COMPILE_FLAGS "-w -Wno-deprecated ${CXXFLAGS}")
message("########################################")
list(APPEND TLSEXPLICIT_EXTERNAL_INCLUDES xFEM_INCLUDE_DIR )
install(TARGETS DamageBandDyn DESTINATION ${DEVROOT}/Applis/DamageBandDyn/DamageBandDyn/lib/${ARCHOS})
include_directories(${TLSEXPLICIT_EXTERNAL_INCLUDES})
set_target_properties(TLSExplicit PROPERTIES COMPILE_FLAGS "-w -Wno-deprecated ${CXXFLAGS}")
install(TARGETS TLSExplicit DESTINATION ${DEVROOT}/Applis/TLSExplicit/TLSExplicit/lib/${ARCHOS})
......@@ -10,41 +10,54 @@
#ifndef _Algorithm_h
#define _Algorithm_h
// DamageBandDyn
#include "EntityFilter.h"
#include "EntityToEntity.h"
// Geom
#include "xDistanceNearestPointGenerator.h"
#include "xDistanceNearestPoint.h"
// Xfem
#include "xAlgorithm.h"
#include "xDoubleManager.h"
#include "xEntityFilter.h"
#include "xAssembler.h"
//#include "xIntegrationRule.h"
#include "xData.h"
//#include "xAlgorithm.h"
//#include "xDoubleManager.h"
//#include "xEntityFilter.h"
#include "xEval.h"
#include "xField.h"
#include "xForm.h"
#include "xAttachableChar.h"
#include "xSubMesh.h"
#include "xOperators.h"
#include "xLevelSet.h"
//#include "xAttachableChar.h"
//#include "xSubMesh.h"
//#include "xOperators.h"
//#include "xLevelSet.h"
// TLSExplicit
#include "EntityFilter.h"
#include "EntityToEntity.h"
// Geom
//#include "xDistanceNearestPointGenerator.h"
//#include "xDistanceNearestPoint.h"
// Xtensor
#include "xVector.h"
#include "Export.h"
//class PostProcessing;
class PostProcessing;
namespace xfem
{
class xAssembler;
class xData;
class xField;
class xIntegrationRule;
class xBoundary;
class xLevelSet;
template <typename T>
class xValue;
class xValKey;
class xIntegrationRule;
class xBoundary;
class xLevelSet;
template <typename T>
class xValue;
class xValKey;
}
/// Hacked version of TreatmentOfNatEnv for dynamics (to have
/// 1D and spatial partitioning)
void TreatmentOfNatEnv(const xfem::xField& displacement_field, xfem::xAssembler& assembler, const xfem::xIntegrationRule& integration_rule, const xfem::xData& data, const xfem::xBoundary& groups, double time, double time_step, const xfem::xEval<xfem::xVector>& eval_velocity, PostProcessing& post_processing, const xfem::xEntityFilter filter=xfem::xAcceptAll());
void TreatmentOfNatEnv(const xfem::xField& displacement_field, xfem::xAssemblerBasic<>& assembler, const xfem::xIntegrationRule& integration_rule, const xfem::xData& data, const xfem::xBoundary& groups, double time, double time_step, const xfem::xEval<xtensor::xVector>& eval_velocity, PostProcessing& post_processing, const xfem::xEntityFilter filter=xfem::xAcceptAll());
/// Treatement of Dirichlet boundary conditions in a dynamics context
void TreatmentOfEssEnv(const xfem::xField& displacement_field, const xfem::xField& velocity_field, const xfem::xField& acceleration_field, const xfem::xData& data, const double& time);
......@@ -58,7 +71,7 @@ void TreatmentOfRigidMotion(const xfem::xData& data_, xfem::xField& displacement
/// Treatment of additional mass when imposing Neumann boundary
/// conditions in a dynamics context
void TreatmentOfAdditionalMass(const xfem::xData& data_, xfem::xField& displacement_field_, xfem::xField& acceleration_field_, xfem::xAssembler& assembler_mass_, xfem::xEntityFilter filter_);
void TreatmentOfAdditionalMass(const xfem::xData& data_, xfem::xField& displacement_field_, xfem::xField& acceleration_field_, xfem::xAssemblerBasic<>& assembler_mass_, xfem::xEntityFilter filter_);
///
// void TreatmentOfContact(const xfem::xField& displacement_field, const xfem::xField& velocity_field, const xfem::xData& data, const xfem::xBoundary& groups, double time_step, const xfem::xEntityFilter filter=xfem::xAcceptAll());
......
......@@ -5,49 +5,56 @@
conditions.
*/
#ifndef _Algorithm_imp_h
#define _Algorithm_imp_h
#include <iostream>
// Xfem
#include "xAlgorithm.h"
#include "xAssembler.h"
#include "xData.h"
#include "xSimpleGeometry.h"
//#include "xAssembler.h"
//#include "xAlgorithm.h"
//#include "xAssembler.h"
//#include "xData.h"
//#include "xMesh.h"
//#include "xSimpleGeometry.h"
// SolverBase
#include "xCSRVector.h"
#include "xCSRMatrix.h"
//#include "xCSRVector.h"
//#include "xCSRMatrix.h"
#include "xLinearSystemSolverSuperLU.h"
// DamageBandDyn
#include "Algorithm.h"
#include "CommandOnGeomElem.h"
#include "EntityToEntity.h"
#include "Eval.h"
#include "LevelSetOperators.h"
// TLSExplicit
//#include "Algorithm.h"
//#include "CommandOnGeomElem.h"
//#include "EntityToEntity.h"
//#include "Eval.h"
//#include "LevelSetOperators.h"
using namespace xfem;
template <typename ITER>
void TreatmentOfProjection(xfem::xField& displacement_field_, xfem::xField& velocity_field_, const std::string& sub_, ITER begin_, ITER end_)
{
xfem::xEvalField<xfem::xIdentity<xfem::xVector> > eval_displacement(displacement_field_);
xfem::xEvalField<xfem::xIdentity<xfem::xVector> > eval_velocity(velocity_field_);
xfem::xEvalField<xtool::xIdentity<xtensor::xVector> > eval_displacement(displacement_field_);
xfem::xEvalField<xtool::xIdentity<xtensor::xVector> > eval_velocity(velocity_field_);
xfem::xAttached attached(AOMD_Util::Instance()->lookupMeshDataId("adapt_tag"));
// xfem::xEvalRedirectApproRedirectInteg<xfem::xVector> eval_redirect_disp(eval_displacement, attached, xfem::xIdentity<AOMD::mEntity*>());
// xfem::xEvalRedirectApproRedirectInteg<xfem::xVector> eval_redirect_velo(eval_velocity, attached, xfem::xIdentity<AOMD::mEntity*>());
xfem::xEvalRedirectAppro<xfem::xVector> eval_redirect_disp(eval_displacement, attached);
xfem::xEvalRedirectAppro<xfem::xVector> eval_redirect_velo(eval_velocity, attached);
xfem::xFormBilinearWithoutLaw<xfem::xValOperator<xfem::xIdentity<xfem::xVector> >, xfem::xValOperator<xfem::xIdentity<xfem::xVector> > > l2;
xfem::xFormLinearWithLoad<xfem::xValOperator<xfem::xIdentity<xfem::xVector> >, xfem::xEval<xfem::xVector> > l2_rhs_disp(eval_redirect_disp);
xfem::xFormLinearWithLoad<xfem::xValOperator<xfem::xIdentity<xfem::xVector> >, xfem::xEval<xfem::xVector> > l2_rhs_velo(eval_redirect_velo);
// xfem::xEvalRedirectApproRedirectInteg<xtensor::xVector> eval_redirect_disp(eval_displacement, attached, xtool::xIdentity<AOMD::mEntity*>());
// xfem::xEvalRedirectApproRedirectInteg<xtensor::xVector> eval_redirect_velo(eval_velocity, attached, xtool::xIdentity<AOMD::mEntity*>());
xfem::xEvalRedirectAppro<xtensor::xVector> eval_redirect_disp(eval_displacement, attached);
xfem::xEvalRedirectAppro<xtensor::xVector> eval_redirect_velo(eval_velocity, attached);
xfem::xFormBilinearWithoutLaw<xfem::xValOperator<xtool::xIdentity<xtensor::xVector> >, xfem::xValOperator<xtool::xIdentity<xtensor::xVector> > > l2;
xfem::xFormLinearWithLoad<xfem::xValOperator<xtool::xIdentity<xtensor::xVector> >, xfem::xEval<xtensor::xVector> > l2_rhs_disp(eval_redirect_disp);
xfem::xFormLinearWithLoad<xfem::xValOperator<xtool::xIdentity<xtensor::xVector> >, xfem::xEval<xtensor::xVector> > l2_rhs_velo(eval_redirect_velo);
xfem::xAssemblerLumped<> assembler_disp;
xfem::xAssemblerLumped<> assembler_velo;
xfem::xDoubleManager* disp_double_manager = displacement_field_.getDoubleManager();
xfem::xDoubleManager* velo_double_manager = velocity_field_.getDoubleManager();
lalg::xCSRVector disp_b(disp_double_manager->size(sub_));
lalg::xCSRVector disp_sol(disp_double_manager->size(sub_));
lalg::xCSRMatrix disp_A(disp_double_manager->size(sub_));
lalg::xCSRVector velo_b(velo_double_manager->size(sub_));
lalg::xCSRVector velo_sol(velo_double_manager->size(sub_));
lalg::xCSRMatrix velo_A(velo_double_manager->size(sub_));
xlinalg::xCSRVector disp_b(disp_double_manager->size(sub_));
xlinalg::xCSRVector disp_sol(disp_double_manager->size(sub_));
xlinalg::xCSRMatrix disp_A(disp_double_manager->size(sub_));
xlinalg::xCSRVector velo_b(velo_double_manager->size(sub_));
xlinalg::xCSRVector velo_sol(velo_double_manager->size(sub_));
xlinalg::xCSRMatrix velo_A(velo_double_manager->size(sub_));
assembler_disp.setTarget(disp_A, disp_b);
assembler_velo.setTarget(velo_A, velo_b);
// xfem::xIntegrationRuleBasic integration_rule(2);
......@@ -56,15 +63,15 @@ void TreatmentOfProjection(xfem::xField& displacement_field_, xfem::xField& velo
xfem::Assemble(l2_rhs_disp, assembler_disp, integration_rule, displacement_field_, begin_, end_);
xfem::Assemble(l2, assembler_velo, integration_rule, velocity_field_, velocity_field_, begin_, end_);
xfem::Assemble(l2_rhs_velo, assembler_velo, integration_rule, velocity_field_, begin_, end_);
lalg::xLinearSystemSolverSuperLU<> solver;
xlinalg::xLinearSystemSolverSuperLU<> solver;
solver.connectMatrix(disp_A);
solver.solve(disp_b, disp_sol);
// disp_b.PrintArray("disp_rhs.debug");
// disp_sol.PrintArray("disp.debug");
xfem::Visit(xfem::xWriteSolutionVisitor<lalg::xCSRVector>(disp_sol.begin()), disp_double_manager->begin(sub_), disp_double_manager->end(sub_));
xfem::Visit(xfem::xWriteSolutionVisitor<xlinalg::xCSRVector>(disp_sol.begin()), disp_double_manager->begin(sub_), disp_double_manager->end(sub_));
solver.connectMatrix(velo_A);
solver.solve(velo_b, velo_sol);
xfem::Visit(xfem::xWriteSolutionVisitor<lalg::xCSRVector>(velo_sol.begin()), velo_double_manager->begin(sub_), velo_double_manager->end(sub_));
xfem::Visit(xfem::xWriteSolutionVisitor<xlinalg::xCSRVector>(velo_sol.begin()), velo_double_manager->begin(sub_), velo_double_manager->end(sub_));
}
template <typename ITERVERTEX>
......@@ -72,8 +79,8 @@ void TreatmentOfProjection(xfem::xField& displacement_field_, xfem::xField& velo
{
xfem::xDoubleManager* displacement_double_manager = displacement_field_.getDoubleManager();
xfem::xDoubleManager* velocity_double_manager = velocity_field_.getDoubleManager();
xfem::xEvalField<xfem::xIdentity<xfem::xVector> > eval_disp(displacement_field_);
xfem::xEvalField<xfem::xIdentity<xfem::xVector> > eval_velo(velocity_field_);
xfem::xEvalField<xtool::xIdentity<xtensor::xVector> > eval_disp(displacement_field_);
xfem::xEvalField<xtool::xIdentity<xtensor::xVector> > eval_velo(velocity_field_);
for (ITERVERTEX it=begin_; it!=end_; ++it)
{
AOMD::mVertex* v = static_cast<AOMD::mVertex*>(*it);
......@@ -87,7 +94,7 @@ void TreatmentOfProjection(xfem::xField& displacement_field_, xfem::xField& velo
xfem::xGeomElem geom_elem(elt);
if (!geom_elem.PointInElement(pt)) std::cerr << "Warning! vertex " << v->getId() << " not in element" << std::endl;
geom_elem.setUVWForXYZ(pt);
xfem::xVector vec;
xtensor::xVector vec;
eval_disp(&geom_elem, &geom_elem, vec);
xfem::xFiniteElementKeysOnly disp_FEM;
disp_FEM.setKeys(v, displacement_field_.begin(), displacement_field_.end());
......
......@@ -11,23 +11,23 @@
#include "refactoring.h"
#ifdef PLANESTRESS
EvalPlaneStressAsymetricStress::EvalPlaneStressAsymetricStress(const xfem::xEval<double>& eval_strain_trace_, const xfem::xEval<xTensor2>& eval_strain_pos_part_, const xfem::xEval<xTensor2>& eval_strain_neg_part_, const xfem::xEval<double>& eval_damage_, const xfem::xEval<double>& eval_lambda_, const xfem::xEval<double>& eval_mu_) :
EvalPlaneStressAsymetricStress::EvalPlaneStressAsymetricStress(const xfem::xEval<double>& eval_strain_trace_, const xfem::xEval<xtensor::xTensor2>& eval_strain_pos_part_, const xfem::xEval<xtensor::xTensor2>& eval_strain_neg_part_, const xfem::xEval<double>& eval_damage_, const xfem::xEval<double>& eval_lambda_, const xfem::xEval<double>& eval_mu_) :
eval_strain_trace(eval_strain_trace_),
eval_strain_pos_part(eval_strain_pos_part_),
eval_strain_neg_part(eval_strain_neg_part_),
eval_damage(eval_damage_),
eval_lambda(eval_lambda_),
eval_mu(eval_mu_),
id(xfem::xVector(1.,0.,0.), xfem::xVector(0.,1.,0.), xfem::xVector(0.,0.,1.))
id(xtensor::xVector(1.,0.,0.), xtensor::xVector(0.,1.,0.), xtensor::xVector(0.,0.,1.))
{
xfem::xTensorProduct tens_prod;
e3e3 = tens_prod(xfem::xVector(0.,0.,1.), xfem::xVector(0.,0.,1.));
e3e3 = tens_prod(xtensor::xVector(0.,0.,1.), xtensor::xVector(0.,0.,1.));
}
void EvalPlaneStressAsymetricStress::operator()(const xfem::xGeomElem* geo_appro, const xfem::xGeomElem* geo_integ, result_type& res) const
{
double d, lambda, mu, tr, pos_part_tr, neg_part_tr;//, eps33;
xfem::xTensor2 pos_part, neg_part;
xtensor::xTensor2 pos_part, neg_part;
eval_strain_trace(geo_appro, geo_integ, tr);
eval_strain_pos_part(geo_appro, geo_integ, pos_part);
eval_strain_neg_part(geo_appro, geo_integ, neg_part);
......@@ -41,7 +41,7 @@ void EvalPlaneStressAsymetricStress::operator()(const xfem::xGeomElem* geo_appro
res(2,2) = 0.;
}
EvalPlaneStressAsymmetricStrain::EvalPlaneStressAsymmetricStrain(const xfem::xEval<xfem::xTensor2>& eval_strain_, const xfem::xEval<double>& eval_damage_) :
EvalPlaneStressAsymmetricStrain::EvalPlaneStressAsymmetricStrain(const xfem::xEval<xtensor::xTensor2>& eval_strain_, const xfem::xEval<double>& eval_damage_) :
eval_strain(eval_strain_),
eval_damage(eval_damage_)
{}
......
......@@ -25,7 +25,7 @@ class EvalStress : public xfem::xEval<TENSOR2>
{
public:
typedef TENSOR2 result_type;
typedef boost::function<double (double)> DamageFct;
typedef std::function<double (double)> DamageFct;
EvalStress(const xfem::xEval<result_type>& eval_strain_pos_part_,
const xfem::xEval<result_type>& eval_strain_neg_part_,
const xfem::xEval<double>& eval_damage_,
......@@ -51,7 +51,7 @@ class EvalStressRateBefore : public xfem::xEval<TENSOR2>
{
public:
typedef TENSOR2 result_type;
typedef boost::function<double (double)> DamageFctDerivative;
typedef std::function<double (double)> DamageFctDerivative;
EvalStressRateBefore(const xfem::xEval<result_type>& eval_strain_pos_part_,
const xfem::xEval<result_type>& eval_strain_neg_part_,
const xfem::xEval<double>& eval_damage_,
......@@ -79,7 +79,7 @@ class EvalStressRateAfter : public xfem::xEval<TENSOR2>
{
public:
typedef TENSOR2 result_type;
typedef boost::function<double (double)> DamageFct;
typedef std::function<double (double)> DamageFct;
EvalStressRateAfter(const xfem::xEval<result_type>& eval_strain_rate_pos_part_,
const xfem::xEval<result_type>& eval_strain_rate_neg_part_,
const xfem::xEval<double>& eval_damage_,
......@@ -105,7 +105,7 @@ class EvalEnergyReleaseRate : public xfem::xEval<double>
{
public:
typedef TENSOR2 Tensor2;
typedef boost::function<double (double)> DamageFctDerivative;
typedef std::function<double (double)> DamageFctDerivative;
EvalEnergyReleaseRate(const xfem::xEval<Tensor2>& eval_strain_pos_part_,
const xfem::xEval<Tensor2>& eval_strain_neg_part_,
const xfem::xEval<double>& eval_damage_,
......@@ -129,33 +129,33 @@ private:
// Note: optimisation that as been made on plane strain asumption as well as the
// templetisation of the Tensor2 type can be done to plane stress asumption too.
#ifdef PLANESTRESS // TODO
class EvalPlaneStressAsymetricStress : public xfem::xEval<xfem::xTensor2>
class EvalPlaneStressAsymetricStress : public xfem::xEval<xtensor::xTensor2>
{
public:
EvalPlaneStressAsymetricStress(const xfem::xEval<double>& eval_strain_trace_, const xfem::xEval<xTensor2>& eval_strain_pos_part_, const xfem::xEval<xTensor2>& eval_strain_neg_part_, const xfem::xEval<double>& eval_damage_, const xfem::xEval<double>& eval_lambda_, const xfem::xEval<double>& eval_mu_);
EvalPlaneStressAsymetricStress(const xfem::xEval<double>& eval_strain_trace_, const xfem::xEval<xtensor::xTensor2>& eval_strain_pos_part_, const xfem::xEval<xtensor::xTensor2>& eval_strain_neg_part_, const xfem::xEval<double>& eval_damage_, const xfem::xEval<double>& eval_lambda_, const xfem::xEval<double>& eval_mu_);
void operator()(const xfem::xGeomElem* geo_appro, const xfem::xGeomElem* geo_integ, result_type& res) const;
private:
const xfem::xEval<double>& eval_strain_trace;
const xfem::xEval<xTensor2>& eval_strain_pos_part;
const xfem::xEval<xTensor2>& eval_strain_neg_part;
const xfem::xEval<xtensor::xTensor2>& eval_strain_pos_part;
const xfem::xEval<xtensor::xTensor2>& eval_strain_neg_part;
const xfem::xEval<double>& eval_damage;
const xfem::xEval<double>& eval_lambda;
const xfem::xEval<double>& eval_mu;
xfem::xTensor2 id, e3e3;
xfem::xPositivePart<double> pospart;
xtensor::xTensor2 id, e3e3;
xtool::xPositivePart<double> pospart;
xfem::xNegativePart<double> negpart;
xfem::xTensorContraction contract_prod;
xtensor::xTensorContraction contract_prod;
};
class EvalPlaneStressAsymmetricStrain : public xfem::xEval<xfem::xTensor2>
class EvalPlaneStressAsymmetricStrain : public xfem::xEval<xtensor::xTensor2>
{
public:
EvalPlaneStressAsymmetricStrain(const xfem::xEval<xfem::xTensor2>& eval_strain_, const xfem::xEval<double>& eval_damage_);
EvalPlaneStressAsymmetricStrain(const xfem::xEval<xtensor::xTensor2>& eval_strain_, const xfem::xEval<double>& eval_damage_);
void operator()(const xfem::xGeomElem* geo_appro, const xfem::xGeomElem* geo_integ, result_type& res) const;
private:
const xfem::xEval<xTensor2>& eval_strain;
const xfem::xEval<xtensor::xTensor2>& eval_strain;
const xfem::xEval<double>& eval_damage;
xfem::xPositivePart<double> pospart;
xtool::xPositivePart<double> pospart;
xfem::xNegativePart<double> negpart;
};
#endif
......@@ -168,9 +168,9 @@ public:
typedef STRESSTENSOR StressTensor;
typedef typename TLSSOLVER::IterDomain IterDomain;
typedef typename TLSSOLVER::IterOldDomain IterOldDomain;
typedef boost::function<double (double)> DamageFct;
typedef boost::function<double (double)> DamageFctDerivative;
typedef boost::function<boost::shared_ptr<xfem::xEval<double> >
typedef std::function<double (double)> DamageFct;
typedef std::function<double (double)> DamageFctDerivative;
typedef std::function<boost::shared_ptr<xfem::xEval<double> >
(const xfem::xEval<double>&)> EvalWrapper;
AsymmetricBehaviour(TLSSOLVER& tls_solver_,
......@@ -272,9 +272,9 @@ private:
#else
EvalPlaneStressAsymetricStress eval_stress;
#endif
xfem::xEvalBinary<xfem::xContraction<StressTensor> > eval_strain_energy_double;
xfem::xScale<double> half_scale;
xfem::xEvalUnary<xfem::xScale<double> > eval_strain_energy;
xfem::xEvalBinary<xtensor::xContraction<StressTensor> > eval_strain_energy_double;
xtool::xScale<double> half_scale;
xfem::xEvalUnary<xtool::xScale<double> > eval_strain_energy;
EvalWrapper eval_damage_rate_wrapper;
......@@ -288,15 +288,15 @@ public:
typedef STRESSTENSOR StressTensor;
typedef typename TLSSOLVER::IterDomain IterDomain;
typedef typename TLSSOLVER::IterOldDomain IterOldDomain;
typedef boost::function<double (double)> DamageFct;
typedef boost::function<double (double)> DamageFctDerivative;
typedef boost::function<boost::shared_ptr<xfem::xEval<double> >
typedef std::function<double (double)> DamageFct;
typedef std::function<double (double)> DamageFctDerivative;
typedef std::function<boost::shared_ptr<xfem::xEval<double> >
(const xfem::xEval<double>&)> EvalWrapper;
AsymmetricRateBehaviour(TLSSOLVER& tls_solver_,
const xfem::xEval<StressTensor>& eval_strain_,
const xfem::xEval<StressTensor>& eval_strain_rate_,
const xfem::xEval<xTensor2>& eval_spin_rate_,
const xfem::xEval<xtensor::xTensor2>& eval_spin_rate_,
const xfem::xEval<double>& eval_lambda_,
const xfem::xEval<double>& eval_mu_,
const xfem::xEval<double>& eval_critical_energy_release_rate_,
......@@ -412,9 +412,9 @@ private:
asymmetric_behaviour::EvalStressRateAfter<StressTensor> eval_stress_rate_contrib_after_ls_advance;
JaumannTimeIntegration jaumann_time_integration;
EvalFieldPointwise<StressTensor> eval_stress;
xfem::xEvalBinary<xfem::xContraction<StressTensor> > eval_strain_energy_double;
xfem::xScale<double> half_scale;
xfem::xEvalUnary<xfem::xScale<double> > eval_strain_energy;
xfem::xEvalBinary<xtensor::xContraction<StressTensor> > eval_strain_energy_double;
xtool::xScale<double> half_scale;
xfem::xEvalUnary<xtool::xScale<double> > eval_strain_energy;
EvalWrapper eval_damage_rate_wrapper;
......
......@@ -36,7 +36,7 @@ operator()(const xfem::xGeomElem* geo_appro, const xfem::xGeomElem* geo_integ, r
eval_damage(geo_appro, geo_integ, buf);
#ifdef DEADZONESPECIALLAW
if (buf==1.) {
res=xfem::xTensor2(0.);
res=xtensor::xTensor2(0.);
return;
}
#endif
......@@ -158,7 +158,7 @@ operator()(const xfem::xGeomElem* geo_appro, const xfem::xGeomElem* geo_integ, r
{
eval_damage_rate(geo_appro, geo_integ, d_dot);
if (d_dot==0.) {
res=xfem::xTensor2(0.);
res=xtensor::xTensor2(0.);
return;
}
eval_damage(geo_appro, geo_integ, buf);
......
......@@ -12,6 +12,7 @@
#include "xLapackInterface.h"
// Xfem
#include "xAlgorithm.h"
#include "xAssembler.h"
// AOMD
#include "mPoint.h"
#include "mEntity.h"
......@@ -104,7 +105,7 @@ class FromEigenValueProblemTimeStepGenerator : public TimeStepGenerator
public:
typedef typename GEOM::IterDomain_t IterDomain_t;
FromEigenValueProblemTimeStepGenerator(const xfem::xEval<double>& eval_density_, const xfem::xEval<xfem::xTensor4>& eval_elasticity_tensor_, const KINEMATIC& kinematic_, GEOM& geom_) :
FromEigenValueProblemTimeStepGenerator(const xfem::xEval<double>& eval_density_, const xfem::xEval<xtensor::xTensor4>& eval_elasticity_tensor_, const KINEMATIC& kinematic_, GEOM& geom_) :
eval_density(eval_density_),
eval_elasticity_tensor(eval_elasticity_tensor_),
kinematic(kinematic_),
......@@ -117,21 +118,21 @@ public:
const xfem::xField& field = kinematic.getDisplacementField();
int nb_dofs = field.getValueManager()->size(kinematic.getSub());
// matrix