28 "test_topological_derivative"};
96 static inline std::vector<std::string>
115 "Broken HDIV base not implemented");
124 static boost::function<
double(
const double)>
f;
132 static inline constexpr double v_max = 24;
137 double e =
static_cast<double>(std::exp(
v_max));
139 return 0.5 * e * dv * dv + e * dv + e;
141 return static_cast<double>(std::exp(
v));
147 double e =
static_cast<double>(std::exp(
v_max));
151 return static_cast<double>(std::exp(
v));
157 return static_cast<double>(std::exp(
v_max));
159 return static_cast<double>(std::exp(
v));
181 return std::exp(
v_max);
209 return 1. / exp(
v_min);
213 return -1. / (
v *
v);
253 MoFEMErrorCode
query_interface(boost::typeindex::type_index type_index,
254 UnknownInterface **iface)
const;
266 boost::shared_ptr<ForcesAndSourcesCore>
269 SmartPetscObj<DM>
dM;
317 boost::shared_ptr<AnalyticalDisplacementBcVec>
330 template <
typename BC>
331 MoFEMErrorCode
getBc(boost::shared_ptr<BC> &bc_vec_ptr,
332 const std::string block_name,
const int nb_attributes) {
337 (boost::format(
"%s(.*)") % block_name).str()
342 std::vector<double> block_attributes;
343 CHKERR it->getAttributes(block_attributes);
344 if (block_attributes.size() < nb_attributes) {
346 "In block %s expected %d attributes, but given %ld",
347 it->getName().c_str(), nb_attributes, block_attributes.size());
352 bc_vec_ptr->emplace_back(it->getName(), block_attributes, faces);
367 <<
"Found spatial rotation BC on block " << bc.blockName;
368 MOFEM_LOG(
"EP", Sev::inform) <<
" with attributes: " << bc.vals;
369 MOFEM_LOG(
"EP", Sev::inform) <<
" and rotation angle: " << bc.theta;
370 MOFEM_LOG(
"EP", Sev::inform) <<
" and nb of faces: " << bc.faces.size();
374 boost::make_shared<DynamicRelaxationTimeScale>(
"rotation_history.txt");
377 GetBlockScalingMethod<DynamicRelaxationTimeScale>::get(
378 ts_rotation,
"rotation_history",
".txt", bc.blockName);
397 boost::shared_ptr<TractionFreeBc> &bc_ptr,
398 const std::string contact_set_name);
400 inline MoFEMErrorCode
403 boost::shared_ptr<TractionFreeBc>(
new TractionFreeBc());
412 const bool add_bubble =
true);
418 const bool add_bubble =
true);
420 MoFEMErrorCode
addDMs(
const BitRefLevel
bit = BitRefLevel().set(0),
429 boost::weak_ptr<MatOps::PhysicalEquations> mat_physical_equations_ptr);
432 const int tag,
const bool do_rhs,
const bool do_lhs,
433 const bool calc_rates,
434 boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe,
435 const bool add_bubble =
true);
438 const int tag,
const bool add_elastic,
const bool add_material,
439 boost::shared_ptr<VolumeElementForcesAndSourcesCore> &fe_rhs,
440 boost::shared_ptr<VolumeElementForcesAndSourcesCore> &fe_lhs);
443 boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe_lhs);
447 boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe_lhs);
450 boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe_lhs);
453 boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe_lhs);
457 boost::shared_ptr<FaceElementForcesAndSourcesCore> &fe_rhs,
458 boost::shared_ptr<FaceElementForcesAndSourcesCore> &fe_lhs);
461 const bool add_elastic,
const bool add_material,
462 boost::shared_ptr<FaceElementForcesAndSourcesCore> &fe_rhs,
463 boost::shared_ptr<FaceElementForcesAndSourcesCore> &fe_lhs);
467 boost::shared_ptr<ForcesAndSourcesCore> &fe_contact_tree
531 std::vector<Tag> tags_to_transfer = {});
534 Vec f_residual = PETSC_NULLPTR,
535 Vec var_vec = PETSC_NULLPTR,
536 Vec gradient = PETSC_NULLPTR,
537 std::vector<Tag> tags_to_transfer = {},
538 TS ts = PETSC_NULLPTR);
541 Vec f_residual = PETSC_NULLPTR,
542 std::vector<Tag> tags_to_transfer = {});
545 boost::shared_ptr<double>& area_ptr);
555 virtual MoFEMErrorCode
setUp(TS) = 0;
563 using TimeScale::TimeScale;
569 return TimeScale::getScale(time);
574 const int tag, TS ts,
575 SmartPetscObj<Vec> *adjoint_gradient_vector =
nullptr);
591 boost::shared_ptr<ParentFiniteElementAdjacencyFunctionSkeleton<2>>
612 Mat
S = PETSC_NULLPTR;
616 std::vector<boost::shared_ptr<Range>>
623 static inline int stress(
const int o) {
return o; }
624 static inline int bubble(
const int o) {
return o; }
625 static inline int disp(
const int o) {
return o - 1; }
626 static inline int rot(
const int o) {
return o - 1; }
627 static inline int stretch(
const int o) {
return o; }
628 static inline int hybrid(
const int o) {
return o - 1; }
632 static inline int stress(
const int o) {
return o; }
633 static inline int bubble(
const int o) {
return o + 1; }
634 static inline int disp(
const int o) {
return o - 1; }
635 static inline int rot(
const int o) {
return o; }
636 static inline int stretch(
const int o) {
return o + 1; }
637 static inline int hybrid(
const int o) {
return o; }
FieldApproximationBase
approximation base
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MOFEM_LOG(channel, severity)
Log.
const double v
phase velocity of light in medium (cm/ns)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
double getScale(const double time) override
static int disp(const int o)
static int stress(const int o)
static int bubble(const int o)
static int rot(const int o)
static int stretch(const int o)
static int hybrid(const int o)
static int stretch(const int o)
static int disp(const int o)
static int stress(const int o)
static int bubble(const int o)
static int hybrid(const int o)
static int rot(const int o)
virtual MoFEMErrorCode setUp(TS)=0
static boost::shared_ptr< SetUpSchur > createSetUpSchur(MoFEM::Interface &m_field, EshelbianCore *ep_core_ptr)
std::vector< boost::shared_ptr< Range > > a00RangeList
MoFEMErrorCode setElasticElementOps(const int tag)
boost::shared_ptr< ExternalStrainVec > externalStrainVecPtr
static PetscBool physicalH1Update
static constexpr bool use_quadratic_exp
static enum StretchSelector stretchSelector
boost::shared_ptr< Range > frontAdjEdges
MoFEMErrorCode createCrackSurfaceMeshset()
static int interfaceRemoveLevel
MoFEMErrorCode addBoundaryFiniteElement(const EntityHandle meshset=0)
const std::string skeletonElement
static double inv_f_linear(const double v)
MoFEMErrorCode getSpatialRotationBc()
boost::shared_ptr< TractionBcVec > bcSpatialTractionVecPtr
boost::shared_ptr< Range > contactFaces
static double dd_f_log_e_quadratic(const double v)
static double dd_f_log(const double v)
BitRefLevel bitAdjEnt
bit ref level for parent
static boost::function< double(const double)> inv_dd_f
MoFEM::Interface & mField
static constexpr double v_max
const std::string spatialL2Disp
static double inv_d_f_log(const double v)
std::map< std::string, boost::shared_ptr< ScalingMethod > > timeScaleMap
MoFEMErrorCode addMaterial_Hencky(double E, double nu)
static enum SolverType solverType
friend struct solve_elastic_set_up
static PetscBool l2UserBaseScale
SmartPetscObj< DM > dM
Coupled problem all fields.
boost::shared_ptr< FaceElementForcesAndSourcesCore > elasticBcRhs
MoFEMErrorCode solveSchapeOptimisation(TS ts, Vec x, int start_step, double start_time)
Solve shape optimisation problem.
SmartPetscObj< IS > crackHybridIs
static enum StretchHandling stretchHandling
boost::shared_ptr< TractionFreeBc > bcSpatialFreeTractionVecPtr
static const char * listSolvers[]
const std::string materialH1Positions
static int nbJIntegralContours
MoFEMErrorCode setBlockTagsOnSkin()
std::vector< Tag > listTagsToTransfer
list of tags to transfer to postprocessor
boost::shared_ptr< FaceElementForcesAndSourcesCore > elasticBcLhs
static PetscBool crackingOn
MoFEMErrorCode getTractionFreeBc(const EntityHandle meshset, boost::shared_ptr< TractionFreeBc > &bc_ptr, const std::string contact_set_name)
Remove all, but entities where kinematic constrains are applied.
static double griffithEnergy
Griffith energy.
boost::shared_ptr< VolumeElementForcesAndSourcesCore > elasticFeRhs
MoFEMErrorCode postProcessRestartMesh(const int tag, const std::string file, std::vector< Tag > tags_to_transfer={})
const std::string elementVolumeName
static double dd_f_log_e(const double v)
static enum RotSelector rotSelector
MoFEMErrorCode addDebugModel(TS ts)
Add debug to model.
static enum RotSelector gradApproximator
PetscBool loadFactorTSSolveExecuted
MoFEMErrorCode postProcessResults(const int tag, const std::string file, Vec f_residual=PETSC_NULLPTR, Vec var_vec=PETSC_NULLPTR, Vec gradient=PETSC_NULLPTR, std::vector< Tag > tags_to_transfer={}, TS ts=PETSC_NULLPTR)
MoFEMErrorCode getBc(boost::shared_ptr< BC > &bc_vec_ptr, const std::string block_name, const int nb_attributes)
CommInterface::EntitiesPetscVector vertexExchange
static std::vector< std::string > listTagsToProject
boost::shared_ptr< BcRotVec > bcSpatialRotationVecPtr
boost::shared_ptr< Range > maxMovedFaces
static std::string heterogeneousYoungModTagName
const std::string spatialH1Disp
static FieldApproximationBase brokenHdivBase
static double maxCrackExtension
static int physicalMaxSteps
MoFEMErrorCode solveElastic(TS ts, Vec x)
@ TestTopologicalDerivative
static double d_f_log(const double v)
boost::shared_ptr< NormalDisplacementBcVec > bcSpatialNormalDisplacementVecPtr
static double crackingStartTime
static enum MaterialModel materialModel
MoFEMErrorCode getOptions()
MoFEMErrorCode calculateCrackArea(boost::shared_ptr< double > &area_ptr)
const std::string piolaStress
MoFEMErrorCode setElasticElementToTs(DM dm)
static double inv_d_f_log_e(const double v)
MoFEMErrorCode setFaceInterfaceOps(const bool add_elastic, const bool add_material, boost::shared_ptr< FaceElementForcesAndSourcesCore > &fe_rhs, boost::shared_ptr< FaceElementForcesAndSourcesCore > &fe_lhs)
int contactRefinementLevels
static int physicalStepNumber
MoFEMErrorCode gettingNorms()
[Getting norms]
boost::shared_ptr< Range > interfaceFaces
std::vector< std::string > a00FieldList
MoFEMErrorCode setVolumeElementOps(const int tag, const bool add_elastic, const bool add_material, boost::shared_ptr< VolumeElementForcesAndSourcesCore > &fe_rhs, boost::shared_ptr< VolumeElementForcesAndSourcesCore > &fe_lhs)
static PetscBool physicalTimeFlg
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Getting interface of core database.
const std::string bubbleField
boost::shared_ptr< AnalyticalDisplacementBcVec > bcSpatialAnalyticalDisplacementVecPtr
SmartPetscObj< DM > dmMaterial
Material problem.
MoFEMErrorCode calculateOrientation(const int tag, bool set_orientation)
static double inv_f_log(const double v)
boost::shared_ptr< VolumeElementForcesAndSourcesCore > elasticFeLhs
MoFEMErrorCode setNewFrontCoordinates()
boost::shared_ptr< ParentFiniteElementAdjacencyFunctionSkeleton< 2 > > parentAdjSkeletonFunctionDim2
static double crackingAddTime
static double exponentBase
static double dd_f_linear(const double v)
MoFEMErrorCode setFaceElementOps(const bool add_elastic, const bool add_material, boost::shared_ptr< FaceElementForcesAndSourcesCore > &fe_rhs, boost::shared_ptr< FaceElementForcesAndSourcesCore > &fe_lhs)
MoFEMErrorCode projectGeometry(const EntityHandle meshset=0, double time=0)
MoFEMErrorCode postProcessSkeletonResults(const int tag, const std::string file, Vec f_residual=PETSC_NULLPTR, std::vector< Tag > tags_to_transfer={})
static double currentPhysicalTime
boost::shared_ptr< AnalyticalExprPython > AnalyticalExprPythonPtr
static constexpr enum SymmetrySelector symmetrySelector
static double crackingAtol
Cracking absolute tolerance.
MoFEMErrorCode projectMaterialTags(const EntityHandle meshset=0)
boost::shared_ptr< Range > skeletonFaces
static double crackingRtol
Cracking relative tolerance.
boost::shared_ptr< PhysicalEquations > physicalEquations
const std::string rotAxis
static double inv_d_f_linear(const double v)
static PetscBool meshTransferHybridInterp
BitRefLevel bitAdjParentMask
bit ref level for parent parent
MoFEMErrorCode solveDynamicRelaxation(TS ts, Vec x, int start_step, double start_time)
Solve problem using dynamic relaxation method.
static double inv_dd_f_log(const double v)
const std::string contactDisp
static std::string internalStressTagName
CommInterface::EntitiesPetscVector edgeExchange
SmartPetscObj< DM > dmPrjSpatial
Projection spatial displacement.
static boost::function< double(const double)> f
MoFEMErrorCode solveTestTopologicalDerivative(TS ts, Vec x, int start_step, double start_time)
boost::shared_ptr< BcDispVec > bcSpatialDispVecPtr
static double finalPhysicalTime
boost::shared_ptr< ForcesAndSourcesCore > contactTreeRhs
Make a contact tree.
const std::string skinElement
static PetscBool internalStressVoigt
static double inv_dd_f_linear(const double v)
MoFEMErrorCode addVolumeFiniteElement(const EntityHandle meshset=0, const bool add_bubble=true)
MoFEMErrorCode addMaterial_Core(boost::weak_ptr< MatOps::PhysicalEquations > mat_physical_equations_ptr)
MoFEMErrorCode getSpatialTractionFreeBc(const EntityHandle meshset=0)
static double inv_dd_f_log_e(const double v)
MoFEMErrorCode getExternalStrain()
MoFEMErrorCode getSpatialTractionBc()
MoFEMErrorCode pushNoStretchVolumeA00Ops(boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe_lhs)
static PetscBool setSingularity
MoFEMErrorCode setBaseVolumeElementOps(const int tag, const bool do_rhs, const bool do_lhs, const bool calc_rates, boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe, const bool add_bubble=true)
static double d_f_log_e(const double v)
boost::shared_ptr< AnalyticalTractionBcVec > bcSpatialAnalyticalTractionVecPtr
boost::shared_ptr< double > currentCrackAreaPtr
static PetscBool meshTransferSourceMeshFileSpecified
static double f_log_e_quadratic(const double v)
double avgGriffithsEnergy
MoFEMErrorCode addCrackSurfaces(const bool debug=false)
static bool hasNonHomogeneousMaterialBlock
MoFEMErrorCode addDMs(const BitRefLevel bit=BitRefLevel().set(0), const EntityHandle meshset=0)
MoFEMErrorCode solveCohesiveCrackGrowth(TS ts, Vec x, int start_step, double start_time)
Solve cohesive crack growth problem.
MoFEMErrorCode getSpatialDispBc()
[Getting norms]
BitRefLevel bitAdjParent
bit ref level for parent
MoFEMErrorCode setContactElementRhsOps(boost::shared_ptr< ForcesAndSourcesCore > &fe_contact_tree)
static PetscBool interfaceCrack
MoFEMErrorCode solveLoadFactor(TS ts, Vec x, int start_step, double start_time)
Solve load factor crack growth problem.
static double d_f_log_e_quadratic(const double v)
CommInterface::EntitiesPetscVector volumeExchange
MoFEMErrorCode saveOrgCoords()
const std::string naturalBcElement
MoFEMErrorCode calculateFaceMaterialForce(const int tag, TS ts, SmartPetscObj< Vec > *adjoint_gradient_vector=nullptr)
static boost::function< double(const double)> dd_f
static double f_log_e(const double v)
static constexpr double v_min
static int addCrackMeshsetId
static double inv_f_log_e(const double v)
MoFEMErrorCode createExchangeVectors(Sev sev)
MoFEMErrorCode pushStretchVolumeA00Ops(boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe_lhs)
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
boost::shared_ptr< Range > crackFaces
static boost::function< double(const double)> d_f
boost::shared_ptr< Range > frontVertices
static enum EnergyReleaseSelector energyReleaseSelector
MoFEMErrorCode addMaterial_HMHNeohookean(const int tape, const double c10, const double K)
static boost::function< double(const double)> inv_d_f
boost::shared_ptr< PressureBcVec > bcSpatialPressureVecPtr
static double d_f_linear(const double v)
static int meshTransferInterpOrder
const std::string hybridSpatialDisp
SmartPetscObj< Vec > solTSStep
static double f_log(const double v)
CommInterface::EntitiesPetscVector faceExchange
SmartPetscObj< DM > dmElastic
Elastic problem.
static std::string meshTransferSourceMeshFileName
boost::shared_ptr< Range > frontEdges
static boost::function< double(const double)> inv_f
const std::string stretchTensor
BitRefLevel bitAdjEntMask
bit ref level for parent parent
static double f_linear(const double v)
MoFEMErrorCode addFields(const EntityHandle meshset=0, const bool add_bubble=true)
MoFEMErrorCode withFieldOrders(Op &&op) const
MoFEMErrorCode pushStressGramOps(boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe_lhs)
const std::string contactElement
MoFEMErrorCode pushPiolaStressGramOps(boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe_lhs)
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
Deprecated interface functions.
base class for all interface classes
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.