37 GAUSS>::OpGradTensorGrad<1, SPACE_DIM, SPACE_DIM, 1>;
79 boost::shared_ptr<MatrixDouble>
matDPtr;
87 auto set_material_stiffness = [&]() {
98 auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(*
matDPtr);
105 matGradPtr = boost::make_shared<MatrixDouble>();
108 matDPtr = boost::make_shared<MatrixDouble>();
117 CHKERR set_material_stiffness();
169 auto time_scale = boost::make_shared<TimeScale>();
180 pipeline_mng->getOpBoundaryRhsPipeline(),
mField,
"U", {time_scale},
181 "FORCE", Sev::inform);
185 pipeline_mng->getOpDomainRhsPipeline(),
mField,
"U", {time_scale},
186 "BODY_FORCE", Sev::inform);
190 simple->getProblemName(),
"U");
192 auto get_bc_hook_rhs = [&]() {
194 mField, pipeline_mng->getDomainRhsFE(), {time_scale},
false);
198 auto get_bc_hook_lhs = [&]() {
200 mField, pipeline_mng->getDomainLhsFE(), {time_scale},
false);
204 pipeline_mng->getDomainRhsFE()->preProcessHook = get_bc_hook_rhs();
205 pipeline_mng->getDomainLhsFE()->preProcessHook = get_bc_hook_lhs();
217 auto add_domain_base_ops = [&](
auto &pipeline) {
237 auto add_domain_ops_lhs = [&](
auto &pipeline) {
247 auto add_domain_ops_rhs = [&](
auto &pipeline) {
256 CHKERR add_domain_base_ops(pipeline_mng->getOpDomainLhsPipeline());
257 CHKERR add_domain_ops_lhs(pipeline_mng->getOpDomainLhsPipeline());
258 CHKERR add_domain_base_ops(pipeline_mng->getOpDomainRhsPipeline());
259 CHKERR add_domain_ops_rhs(pipeline_mng->getOpDomainRhsPipeline());
280 "out_step_" + boost::lexical_cast<std::string>(
ts_step) +
".h5m");
287 boost::shared_ptr<PostProcEle>
postProc;
296 auto dm =
simple->getDM();
297 auto ts = pipeline_mng->createTSIM();
300 auto post_proc_fe = boost::make_shared<PostProcEle>(
mField);
303 post_proc_fe->getOpPtrVector(), {H1});
305 post_proc_fe->getOpPtrVector().push_back(
308 post_proc_fe->getOpPtrVector().push_back(
310 post_proc_fe->getOpPtrVector().push_back(
312 post_proc_fe->getOpPtrVector().push_back(
314 post_proc_fe->getOpPtrVector().push_back(
316 post_proc_fe->getOpPtrVector().push_back(
319 auto u_ptr = boost::make_shared<MatrixDouble>();
320 post_proc_fe->getOpPtrVector().push_back(
325 post_proc_fe->getOpPtrVector().push_back(
329 post_proc_fe->getPostProcMesh(), post_proc_fe->getMapGaussPts(),
335 {{
"GRAD", commonHenckyDataPtr->matGradPtr},
336 {
"FIRST_PIOLA", commonHenckyDataPtr->getMatFirstPiolaStress()}},
345 boost::shared_ptr<FEMethod> null_fe;
346 auto monitor_ptr = boost::make_shared<Monitor>(dm, post_proc_fe);
348 null_fe, monitor_ptr);
351 CHKERR TSSetDuration(ts, PETSC_DEFAULT, ftime);
352 CHKERR TSSetExactFinalTime(ts, TS_EXACTFINALTIME_MATCHSTEP);
357 CHKERR TSSetFromOptions(ts);
360 CHKERR TSGetTime(ts, &ftime);
362 PetscInt steps, snesfails, rejects, nonlinits, linits;
363 CHKERR TSGetTimeStepNumber(ts, &steps);
364 CHKERR TSGetSNESFailures(ts, &snesfails);
365 CHKERR TSGetStepRejections(ts, &rejects);
366 CHKERR TSGetSNESIterations(ts, &nonlinits);
367 CHKERR TSGetKSPIterations(ts, &linits);
369 "steps %D (%D rejected, %D SNES fails), ftime %g, nonlinits "
371 steps, rejects, snesfails, ftime, nonlinits, linits);
380 PetscBool test_flg = PETSC_FALSE;
388 CHKERR VecNorm(T, NORM_2, &nrm2);
389 MOFEM_LOG(
"EXAMPLE", Sev::inform) <<
"Regression norm " << nrm2;
390 constexpr double regression_value = 1.09572;
391 if (fabs(nrm2 - regression_value) > 1e-2)
393 "Regression test field; wrong norm value.");
408int main(
int argc,
char *argv[]) {
415 auto core_log = logging::core::get();
424 DMType dm_name =
"DMMOFEM";
429 moab::Core mb_instance;
430 moab::Interface &moab = mb_instance;
#define MOFEM_LOG_C(channel, severity, format,...)
void simple(double P1[], double P2[], double P3[], double c[], const int N)
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
ElementsAndOps< SPACE_DIM >::BoundaryEle BoundaryEle
Kronecker Delta class symmetric.
#define CATCH_ERRORS
Catch errors.
@ 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_ATOM_TEST_INVALID
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FormsIntegrators< DomainEleOp >::Assembly< A >::LinearForm< I >::OpGradTimesSymTensor< 1, SPACE_DIM, SPACE_DIM > OpInternalForce
constexpr double shear_modulus_G
constexpr double bulk_modulus_K
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
auto smartCreateDMVector(DM dm)
Get smart vector from DM.
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
FTensor::Index< 'k', 3 > k
FormsIntegrators< DomainEleOp >::Assembly< USER_ASSEMBLE >::LinearForm< GAUSS >::OpSource< 1, 3 > OpBodyForce
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
PetscErrorCode DMMoFEMTSSetMonitor(DM dm, TS ts, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
Set Monitor To TS solver.
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
static constexpr int approx_order
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'i', 3 > i
MoFEMErrorCode boundaryCondition()
MoFEMErrorCode assembleSystem()
MoFEMErrorCode readMesh()
boost::shared_ptr< MatrixDouble > matGradPtr
boost::shared_ptr< MatrixDouble > matStressPtr
boost::shared_ptr< MatrixDouble > matStrainPtr
MoFEMErrorCode checkResults()
MoFEMErrorCode solveSystem()
MoFEMErrorCode createCommonData()
Example(MoFEM::Interface &m_field)
MoFEMErrorCode runProblem()
MoFEM::Interface & mField
MoFEMErrorCode setupProblem()
MoFEMErrorCode outputResults()
boost::shared_ptr< MatrixDouble > matDPtr
boost::shared_ptr< HenckyOps::CommonData > commonHenckyDataPtr
Add operators pushing bases from local to physical configuration.
Simple interface for fast problem set-up.
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Deprecated interface functions.
Definition of the displacement bc data structure.
Data on single entity (This is passed as argument to DataOperator::doWork)
Class (Function) to enforce essential constrains.
structure for User Loop Methods on finite elements
default operator for TRI element
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
Get values at integration pts for tensor filed rank 1, i.e. vector field.
Post post-proc data at points from hash maps.
PipelineManager interface.
MoFEM::FaceElementForcesAndSourcesCore FaceEle
MoFEM::EdgeElementForcesAndSourcesCore EdgeEle
Simple interface for fast problem set-up.
intrusive_ptr for managing petsc objects
PetscInt ts_step
time step number
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
Volume finite element base.
Monitor(SmartPetscObj< DM > dm, boost::shared_ptr< PostProcEle > post_proc)
MoFEMErrorCode postProcess()
function is run at the end of loop
boost::shared_ptr< PostProcEle > postProc
static char help[]
[Check]
constexpr double poisson_ratio
constexpr double shear_modulus_G
constexpr double bulk_modulus_K
constexpr double young_modulus