50 const char param_file[] =
"param_file.petsc";
54 auto core_log = logging::core::get();
55 core_log->add_sink(LogManager::createSink(LogManager::getStrmWorld(),
"EP"));
56 LogManager::setLog(
"EP");
62 MOFEM_LOG(
"EP", Sev::inform) <<
"Python initialised";
64 MOFEM_LOG(
"EP", Sev::inform) <<
"Python NOT initialised";
70 LogManager::createSink(LogManager::getStrmSync(),
"EPSYNC"));
71 LogManager::setLog(
"EPSYNC");
77 PetscBool flg = PETSC_TRUE;
83 char restart_file[255];
84 PetscBool restart_flg = PETSC_TRUE;
91 DMType dm_name =
"DMMOFEM";
98 ParallelComm *pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
100 pcomm =
new ParallelComm(&moab, PETSC_COMM_WORLD);
103 if(pcomm->proc_config().proc_size() == 1)
106 option =
"PARALLEL=READ_PART;"
107 "PARALLEL_RESOLVE_SHARED_ENTS;"
108 "PARTITION=PARALLEL_PARTITION";
125 CHKERR ep.getSpatialDispBc();
126 CHKERR ep.getSpatialRotationBc();
127 CHKERR ep.getSpatialTractionBc();
128 CHKERR ep.getSpatialTractionFreeBc();
131 CHKERR ep.addVolumeFiniteElement();
132 CHKERR ep.addBoundaryFiniteElement();
135 enum MaterialModel { StVenantKirchhoff, MooneyRivlin, Hencky, LastMaterial };
136 const char *list_materials[LastMaterial] = {
"stvenant_kirchhoff",
137 "mooney_rivlin",
"hencky"};
138 PetscInt choice_material = MooneyRivlin;
140 LastMaterial, &choice_material, PETSC_NULL);
142 switch (choice_material) {
143 case StVenantKirchhoff:
145 <<
"StVenantKirchhoff material model";
150 MOFEM_LOG(
"EP", Sev::inform) <<
"MooneyRivlin material model";
155 MOFEM_LOG(
"EP", Sev::inform) <<
"Hencky material model";
156 CHKERR ep.addMaterial_Hencky(5., 0.25);
164 CHKERR ep.setElasticElementToTs(ep.dmElastic);
169 CHKERR VecSetOption(f_elastic, VEC_IGNORE_NEGATIVE_INDICES, PETSC_TRUE);
175 CHKERR PetscViewerBinaryOpen(PETSC_COMM_WORLD, restart_file,
176 FILE_MODE_READ, &viewer);
177 CHKERR VecLoad(x_elastic, viewer);
178 CHKERR PetscViewerDestroy(&viewer);
183 auto ts_elastic =
createTS(PETSC_COMM_WORLD);
184 CHKERR TSSetType(ts_elastic, TSBEULER);
187 CHKERR TSGetAdapt(ts_elastic, &adapt);
191 CHKERR TSSetTime(ts_elastic, time);
192 CHKERR ep.solveElastic(ts_elastic, m_elastic, f_elastic, x_elastic);
200 if (Py_FinalizeEx() < 0) {