17 "incremental_optimization",
20 "test_topological_derivative",
21 "test_incremental_optimization_hessian",
22 "test_incremental_optimization_layout",
23 "test_incremental_optimization_transaction",
24 "test_incremental_optimization_objective_derivative",
25 "test_incremental_optimization_preparation",
26 "test_incremental_optimization_history_transaction",
27 "test_incremental_optimization_tao_failure",
28 "test_incremental_optimization_trust_solve"};
117 static inline std::vector<std::string>
136 "Broken HDIV base not implemented");
144 static boost::function<
double(
const double)>
f;
151 static inline constexpr double v_max = 24;
155 double e =
static_cast<double>(std::exp(
v_max));
157 return 0.5 * e * dv * dv + e * dv + e;
159 return static_cast<double>(std::exp(
v));
165 double e =
static_cast<double>(std::exp(
v_max));
169 return static_cast<double>(std::exp(
v));
175 return static_cast<double>(std::exp(
v_max));
177 return static_cast<double>(std::exp(
v));
182 const double transition_stretch = std::exp(
v_max);
183 if (stretch <= transition_stretch) {
184 return std::log(stretch);
186 return v_max - 1. + std::sqrt(2. * stretch / transition_stretch - 1.);
190 const double transition_stretch = std::exp(
v_max);
191 if (stretch <= transition_stretch) {
194 const double root = std::sqrt(2. * stretch / transition_stretch - 1.);
195 return 1. / (transition_stretch * root);
199 const double transition_stretch = std::exp(
v_max);
200 if (stretch <= transition_stretch) {
201 return -1. / (stretch * stretch);
203 const double root = std::sqrt(2. * stretch / transition_stretch - 1.);
204 return -1. / (transition_stretch * transition_stretch * root * root * root);
207 static double f_log_e(
const double v) {
return std::exp(
v); }
228 MoFEMErrorCode
query_interface(boost::typeindex::type_index type_index,
229 UnknownInterface **iface)
const;
241 boost::shared_ptr<ForcesAndSourcesCore>
244 SmartPetscObj<DM>
dM;
318 boost::shared_ptr<AnalyticalDisplacementBcVec>
332 const int meshset_id,
333 const std::string ¶m_name) {
334 const auto string_params =
336 type_name, meshset_id);
337 if (
const auto it = string_params.find(param_name);
338 it != string_params.end()) {
346 const std::string ¶m_name,
347 std::string ¶m_value) {
351 std::regex((boost::format(
"%s(.*)") % type_name).str()))) {
353 type_name, it->getMeshsetId(), param_name);
354 if (block_param.empty()) {
357 if (!param_value.empty() && param_value != block_param) {
359 "JSON %s blocksets specify different '%s' values",
360 type_name.c_str(), param_name.c_str());
362 param_value = block_param;
367 template <
typename BC>
368 MoFEMErrorCode
getBc(boost::shared_ptr<BC> &bc_vec_ptr,
369 const std::string block_name,
const int nb_attributes) {
374 (boost::format(
"%s(.*)") % block_name).str()
379 std::vector<double> block_attributes;
380 CHKERR it->getAttributes(block_attributes);
381 if (block_attributes.size() <
static_cast<size_t>(nb_attributes)) {
383 "In block %s expected %d attributes, but given %ld",
384 it->getName().c_str(), nb_attributes, block_attributes.size());
389 bc_vec_ptr->emplace_back(
390 it->getName(), block_attributes, faces,
407 <<
"Found spatial rotation BC on block " << bc.blockName;
408 MOFEM_LOG(
"EP", Sev::inform) <<
" with attributes: " << bc.vals;
409 MOFEM_LOG(
"EP", Sev::inform) <<
" and rotation angle: " << bc.theta;
410 MOFEM_LOG(
"EP", Sev::inform) <<
" and nb of faces: " << bc.faces.size();
414 boost::make_shared<DynamicRelaxationTimeScale>(
"rotation_history.txt");
416 if (!bc.loadHistoryFile.empty()) {
418 <<
"Rotation load history from JSON for " << bc.blockName <<
": "
419 << bc.loadHistoryFile;
421 boost::make_shared<DynamicRelaxationTimeScale>(bc.loadHistoryFile);
424 GetBlockScalingMethod<DynamicRelaxationTimeScale>::get(
425 ts_rotation,
"rotation_history",
".txt", bc.blockName);
445 boost::shared_ptr<TractionFreeBc> &bc_ptr,
446 const std::string contact_set_name);
448 inline MoFEMErrorCode
451 boost::shared_ptr<TractionFreeBc>(
new TractionFreeBc());
460 MoFEMErrorCode
addFields(
const EntityHandle meshset = 0,
461 const bool add_bubble =
true);
467 const bool add_bubble =
true);
469 MoFEMErrorCode
addDMs(
const BitRefLevel
bit = BitRefLevel().set(0),
470 const EntityHandle meshset = 0);
473 const int tag,
const bool do_rhs,
const bool do_lhs,
474 const bool calc_rates,
475 boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe,
476 const bool add_bubble =
true);
479 const int tag,
const bool add_elastic,
const bool add_material,
480 boost::shared_ptr<VolumeElementForcesAndSourcesCore> &fe_rhs,
481 boost::shared_ptr<VolumeElementForcesAndSourcesCore> &fe_lhs);
484 pushVolumeA00Ops(boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe_lhs);
487 boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe_lhs);
490 boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe_lhs);
494 boost::shared_ptr<FaceElementForcesAndSourcesCore> &fe_rhs,
495 boost::shared_ptr<FaceElementForcesAndSourcesCore> &fe_lhs);
499 boost::shared_ptr<ForcesAndSourcesCore> &fe_contact_tree
571 std::vector<Tag> tags_to_transfer = {});
574 Vec f_residual = PETSC_NULLPTR,
575 Vec var_vec = PETSC_NULLPTR,
577 std::vector<Tag> tags_to_transfer = {},
578 TS ts = PETSC_NULLPTR);
580 const int tag,
const std::string file, Vec f_residual = PETSC_NULLPTR,
581 std::vector<Tag> tags_to_transfer = {}, TS ts = PETSC_NULLPTR);
584 boost::shared_ptr<double> &area_ptr);
594 virtual MoFEMErrorCode
setUp(TS) = 0;
602 using TimeScale::TimeScale;
608 return TimeScale::getScale(time);
613 const int tag, TS ts,
614 SmartPetscObj<Vec> *adjoint_gradient_vector =
nullptr);
630 boost::shared_ptr<ParentFiniteElementAdjacencyFunctionSkeleton<2>>
651 Mat
S = PETSC_NULLPTR;
655 std::vector<boost::shared_ptr<Range>>
662 static inline int stress(
const int o) {
return o; }
663 static inline int bubble(
const int o) {
return o; }
664 static inline int disp(
const int o) {
return o - 1; }
665 static inline int rot(
const int o) {
return o - 1; }
666 static inline int stretch(
const int o) {
return o; }
670 static inline int hybrid(
const int o) {
return o - 1; }
674 static inline int stress(
const int o) {
return o; }
675 static inline int bubble(
const int o) {
return o + 1; }
676 static inline int disp(
const int o) {
return o - 1; }
677 static inline int rot(
const int o) {
return o; }
678 static inline int stretch(
const int o) {
return o + 1; }
682 static inline int hybrid(
const int o) {
return o; }
SmartPetscObj< Vec > gradient
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 logDeviator(const int o)
static int logJacobian(const int o)
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 auxiliaryLogStress(const int o)
static int logJacobian(const int o)
static int stretch(const int o)
static int disp(const int o)
static int stress(const int o)
static int logDeviator(const int o)
static int auxiliaryLogStress(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)
SmartPetscObj< Vec > incrementalTrialControl
std::vector< boost::shared_ptr< Range > > a00RangeList
MoFEMErrorCode setElasticElementOps(const int tag)
boost::shared_ptr< ExternalStrainVec > externalStrainVecPtr
static PetscBool physicalH1Update
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_dd_f_linear(const double)
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 inv_d_f_linear(const double)
double dynamicInitialResidual
static double dd_f_linear(const double)
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
std::map< std::string, boost::shared_ptr< ScalingMethod > > timeScaleMap
static enum SolverType solverType
MoFEMErrorCode postProcessSkeletonResults(const int tag, const std::string file, Vec f_residual=PETSC_NULLPTR, std::vector< Tag > tags_to_transfer={}, TS ts=PETSC_NULLPTR)
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
boost::shared_ptr< Range > plasticVolumes
boost::shared_ptr< TractionFreeBc > bcSpatialFreeTractionVecPtr
static const char * listSolvers[]
const std::string materialH1Positions
static int nbJIntegralContours
static bool noCrackExtension
MoFEMErrorCode applyTestSolverMonitorOptions(TS ts)
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.
MoFEMErrorCode applyProjectionSolverMonitorOptions()
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={})
MoFEMErrorCode pushVolumeA00Ops(boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe_lhs)
const std::string elementVolumeName
static double dd_f_log_e(const double v)
static double d_f_linear(const double)
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)
static double inv_dd_f_log_e_quadratic(const double stretch)
static bool isIncrementalOptimizationTestSolver(const SolverType type)
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)
@ TestIncrementalOptimizationTrustSolve
@ TestIncrementalOptimizationLayout
@ TestIncrementalOptimizationHessian
@ TestIncrementalOptimizationHistoryTransaction
@ TestIncrementalOptimizationTaoFailure
@ TestIncrementalOptimizationTransaction
@ TestIncrementalOptimizationObjectiveDerivative
@ IncrementalOptimization
@ TestTopologicalDerivative
@ TestIncrementalOptimizationPreparation
boost::shared_ptr< NormalDisplacementBcVec > bcSpatialNormalDisplacementVecPtr
static double crackingStartTime
const std::string logDeviator
MoFEMErrorCode getOptions()
MoFEMErrorCode calculateCrackArea(boost::shared_ptr< double > &area_ptr)
const std::string plasticHField
const std::string piolaStress
MoFEMErrorCode setElasticElementToTs(DM dm)
static double inv_d_f_log_e(const double v)
std::string getStringArgumentFromJsonBlockset(const std::string &type_name, const int meshset_id, const std::string ¶m_name)
int contactRefinementLevels
static int physicalStepNumber
MoFEMErrorCode gettingNorms()
[Getting norms]
const std::string logJacobian
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
MoFEMErrorCode solveIncrementalOptimizationTAO(TS ts, Vec x, int start_step, double start_time)
Solve the incremental constitutive optimization with TAO.
boost::shared_ptr< AnalyticalDisplacementBcVec > bcSpatialAnalyticalDisplacementVecPtr
const std::string plasticFlowField
SmartPetscObj< DM > dmMaterial
Material problem.
MoFEMErrorCode calculateOrientation(const int tag, bool set_orientation)
MoFEMErrorCode runIncrementalOptimizationTAO(TS ts, Vec x)
boost::shared_ptr< VolumeElementForcesAndSourcesCore > elasticFeLhs
MoFEMErrorCode resolveDissipationEntities(const EntityHandle meshset=0)
MoFEMErrorCode setNewFrontCoordinates()
boost::shared_ptr< ParentFiniteElementAdjacencyFunctionSkeleton< 2 > > parentAdjSkeletonFunctionDim2
MoFEMErrorCode solveTestIncrementalOptimization(TS ts, Vec x, int start_step, double start_time)
static double crackingAddTime
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)
static double currentPhysicalTime
boost::shared_ptr< AnalyticalExprPython > AnalyticalExprPythonPtr
boost::shared_ptr< SpringBcVec > bcSpatialSpringVecPtr
static constexpr enum SymmetrySelector symmetrySelector
const std::string auxiliaryLogStress
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
SmartPetscObj< DM > dmIncrementalHistory
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.
const std::string contactDisp
static std::string internalStressTagName
CommInterface::EntitiesPetscVector edgeExchange
double alphaOmegaPrec
Rotation-gradient shift of the Schur preconditioner.
static boost::function< double(const double)> f
MoFEMErrorCode solveTestTopologicalDerivative(TS ts, Vec x, int start_step, double start_time)
static int nbStepsNoCrackExtension
boost::shared_ptr< BcDispVec > bcSpatialDispVecPtr
static double finalPhysicalTime
boost::shared_ptr< ForcesAndSourcesCore > contactTreeRhs
Make a contact tree.
const std::string skinElement
static PetscBool internalStressVoigt
MoFEMErrorCode addVolumeFiniteElement(const EntityHandle meshset=0, const bool add_bubble=true)
MoFEMErrorCode getSpatialTractionFreeBc(const EntityHandle meshset=0)
static double inv_dd_f_log_e(const double v)
MoFEMErrorCode getExternalStrain()
MoFEMErrorCode getSpatialTractionBc()
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
static PetscBool plasticVolume
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 double inv_f_log_e_quadratic(const double stretch)
MoFEMErrorCode addDMs(const BitRefLevel bit=BitRefLevel().set(0), const EntityHandle meshset=0)
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.
MoFEMErrorCode getStringArgumentFromJsonBlocksets(const std::string &type_name, const std::string ¶m_name, std::string ¶m_value)
static double d_f_log_e_quadratic(const double v)
CommInterface::EntitiesPetscVector volumeExchange
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 bool potentialCrackArrest
static int addCrackMeshsetId
static PetscBool propagateUnderCompression
static double inv_f_log_e(const double v)
MoFEMErrorCode createExchangeVectors(Sev sev)
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
static boost::function< double(const double)> inv_d_f
boost::shared_ptr< PressureBcVec > bcSpatialPressureVecPtr
static int meshTransferInterpOrder
const std::string hybridSpatialDisp
SmartPetscObj< Vec > solTSStep
static double inv_d_f_log_e_quadratic(const double stretch)
CommInterface::EntitiesPetscVector faceExchange
SmartPetscObj< DM > dmElastic
Elastic problem.
static std::string meshTransferSourceMeshFileName
const std::string plasticKappaField
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)
SmartPetscObj< DM > dmIncrementalOptimization
MoFEMErrorCode addFields(const EntityHandle meshset=0, const bool add_bubble=true)
const std::string plasticLatentField
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.