95 {
97 MOFEM_LOG(
"EP", Sev::inform) <<
"Pre step";
98
99 double time;
100 CHKERR TSGetTime(ts, &time);
101
103
104 auto debug_crack = [&]() {
106
107 PetscBool debug_crack_mesh = PETSC_FALSE;
109 &debug_crack_mesh, PETSC_NULLPTR);
110 if (debug_crack_mesh) {
111
112 auto get_meshsets_from_block =
114 std::vector<EntityHandle>
r) {
115
116 auto mesh_mng = m_field.
getInterface<MeshsetsManager>();
117 auto bcs = mesh_mng->getCubitMeshsetPtr(
118
119 std::regex((boost::format("%s(.*)") % block_name).str())
120
121 );
122
123 for (auto bc : bcs) {
124 r.push_back(bc->getMeshset());
125 }
126
128 };
129
131
136 }
137
141 *meshset_ptr, 3, tets);
143
144 std::vector<EntityHandle> meshsets;
145 meshsets.push_back(*meshset_ptr);
146
147 meshsets =
148 get_meshsets_from_block(
epPtr->
mField,
"CRACK", 2, meshsets);
149 meshsets =
150 get_meshsets_from_block(
epPtr->
mField,
"FRONT", 1, meshsets);
151 meshsets =
152 get_meshsets_from_block(
epPtr->
mField,
"EDGE", 1, meshsets);
153
154 int time_step = 0;
155 CHKERR TSGetStepNumber(ts, &time_step);
156 std::string file_name =
157 "crack_meshsets_" + std::to_string(time_step) + ".h5m";
159 file_name.c_str(), "MOAB", nullptr, meshsets.data());
160 }
161 }
162
164 };
165
170 }
171
172 Vec T;
173 CHKERR TSGetSolution(ts, &T);
174
175 auto zero_filled = [&](auto name) {
178 SmartPetscObj<IS> is;
179 CHKERR is_mng->isCreateProblemFieldAndRankLocal(
181 const int *index_ptr;
182 CHKERR ISGetIndices(is, &index_ptr);
183 int size;
184 CHKERR ISGetLocalSize(is, &size);
187 for (
auto i = 0;
i != size;
i++) {
189 }
191 CHKERR ISRestoreIndices(is, &index_ptr);
193 };
194
197 break;
199 MOFEM_LOG(
"EP", Sev::verbose) <<
"Zeroing (large) fields";
202 break;
204 MOFEM_LOG(
"EP", Sev::verbose) <<
"Zeroing (moderate) fields";
207 break;
209 MOFEM_LOG(
"EP", Sev::verbose) <<
"Zeroing (small) fields";
212 break;
213 }
214
217 SCATTER_FORWARD);
219
221 }
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
FTensor::Index< 'i', SPACE_DIM > i
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
auto get_temp_meshset_ptr(moab::Interface &moab)
Create smart pointer to temporary meshset.
MoFEMErrorCode projectGeometry(const EntityHandle meshset=0)
static enum RotSelector gradApproximator
boost::shared_ptr< Range > maxMovedFaces
MoFEMErrorCode setNewFrontCoordinates()
const std::string rotAxis
MoFEMErrorCode addCrackSurfaces(const bool debug=false)
static int addCrackMeshsetId
const std::string stretchTensor
virtual moab::Interface & get_moab()=0
virtual int get_comm_rank() const =0
Deprecated interface functions.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.