v0.16.0
Loading...
Searching...
No Matches
PipelineManager.cpp
Go to the documentation of this file.
1/** \file PipelineManager.cpp
2 * \brief Implementation of basic interface
3 * \ingroup mofem_basic_interface
4 */
5
6
7namespace MoFEM {
8
13 const auto type = numeredEntFiniteElementPtr->getEntType();
14 if (type != MBENTITYSET) {
15 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
16 "Expected entity set as a finite element");
17 }
20 }
21 MoFEMErrorCode preProcess() { return 0; }
23};
24
25boost::shared_ptr<FEMethod> &
26PipelineManager::createMeshsetFEPipeline(boost::shared_ptr<FEMethod> &fe) {
27 if (!fe)
28 fe = boost::make_shared<MeshsetFE>(cOre);
29 return fe;
30}
31
32boost::ptr_deque<PipelineManager::UserDataOperator> &
34 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
36 ->getOpPtrVector();
37}
38
39boost::ptr_deque<PipelineManager::UserDataOperator> &
41 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
43 ->getOpPtrVector();
44}
45
46boost::ptr_deque<PipelineManager::UserDataOperator> &
48 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
50 ->getOpPtrVector();
51}
52
54PipelineManager::query_interface(boost::typeindex::type_index type_index,
55 UnknownInterface **iface) const {
56 *iface = const_cast<PipelineManager *>(this);
57 return 0;
58}
59
61 : cOre(const_cast<Core &>(core)) {}
62
65 Interface &m_field = cOre;
66 Simple *simple = m_field.getInterface<Simple>();
67 if (!dm)
68 dm = simple->getDM();
71 MOFEM_LOG("WORLD", Sev::warning)
72 << "PipelineManager::loopFiniteElements called with no active finite "
73 "element pipelines (all are null)";
74 }
75
76 // Add element to calculate lhs of stiff part
77 if (feDomainLhs)
78 CHKERR DMoFEMLoopFiniteElements(dm, simple->getDomainFEName(), feDomainLhs);
79 if (feBoundaryLhs)
80 CHKERR DMoFEMLoopFiniteElements(dm, simple->getBoundaryFEName(),
82 if (feSkeletonLhs)
83 CHKERR DMoFEMLoopFiniteElements(dm, simple->getSkeletonFEName(),
85 if (feMeshsetLhs)
86 CHKERR DMoFEMLoopFiniteElements(dm, simple->getMeshsetFEName(),
88
89 // Add element to calculate rhs of stiff part
90 if (feDomainRhs)
91 CHKERR DMoFEMLoopFiniteElements(dm, simple->getDomainFEName(), feDomainRhs);
92 if (feBoundaryRhs)
93 CHKERR DMoFEMLoopFiniteElements(dm, simple->getBoundaryFEName(),
95 if (feSkeletonRhs)
96 CHKERR DMoFEMLoopFiniteElements(dm, simple->getSkeletonFEName(),
98 if (feMeshsetRhs)
99 CHKERR DMoFEMLoopFiniteElements(dm, simple->getMeshsetFEName(),
101
103}
104
108 Interface &m_field = cOre;
109 Simple *simple = m_field.getInterface<Simple>();
110 if (!dm)
111 dm = simple->getDM();
113 MOFEM_LOG("WORLD", Sev::warning)
114 << "PipelineManager::loopFiniteElementsPostProc called with no active "
115 "finite element pipelines (all are null)";
116 }
117
119 CHKERR DMoFEMLoopFiniteElements(dm, simple->getDomainFEName(),
122 CHKERR DMoFEMLoopFiniteElements(dm, simple->getBoundaryFEName(),
124
126}
127
130 Interface &m_field = cOre;
131 Simple *simple = m_field.getInterface<Simple>();
132 if (!dm)
133 dm = simple->getDM();
134 if (!feDomainPostProc) {
135 MOFEM_LOG("WORLD", Sev::warning)
136 << "PipelineManager::loopDomainPostProc called with no active finite "
137 "element pipeline (domain postprocessing is null)";
138 }
139
141 CHKERR DMoFEMLoopFiniteElements(dm, simple->getDomainFEName(),
143
145}
146
149 Interface &m_field = cOre;
150 Simple *simple = m_field.getInterface<Simple>();
151 if (!dm)
152 dm = simple->getDM();
153 if (!feBoundaryPostProc) {
154 MOFEM_LOG("WORLD", Sev::warning)
155 << "PipelineManager::loopBoundaryPostProc called with no active finite "
156 "element pipeline (boundary postprocessing is null)";
157 }
158
160 CHKERR DMoFEMLoopFiniteElements(dm, simple->getBoundaryFEName(),
162
164}
165
169 Interface &m_field = cOre;
170 Simple *simple = m_field.getInterface<Simple>();
171 if (!dm)
172 dm = simple->getDM();
173 if (!feEvaluation) {
174 MOFEM_LOG("WORLD", Sev::warning)
175 << "PipelineManager::loopFiniteElementsEvaluation called with no "
176 "active "
177 "finite element pipelines (all are null)";
178 }
179
180 if (feEvaluation)
181 CHKERR DMoFEMLoopFiniteElements(dm, simple->getDomainFEName(),
183
185}
186
188 Interface &m_field = cOre;
189 Simple *simple = m_field.getInterface<Simple>();
190
191 auto copy_dm_struture = [&](auto simple_dm) {
192 MPI_Comm comm;
193 CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
194 DMType type;
195 CHKERR DMGetType(simple_dm, &type);
196 dm = createDM(comm, type);
197 CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
198 return dm;
199 };
200
201 if (!dm)
202 dm = copy_dm_struture(simple->getDM());
203
204 const MoFEM::Problem *prb_ptr;
205 CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
206
207 auto set_dm_section = [&](auto dm) {
209 auto section =
210 m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
211 CHKERR DMSetSection(dm, section);
213 };
214 CHKERR set_dm_section(dm);
215
216 boost::shared_ptr<FEMethod> null;
217
218 getDMKspCtx(dm)->clearLoops();
219
220 // Add element to calculate lhs of stiff part
221 if (feDomainLhs)
222 CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getDomainFEName(),
223 feDomainLhs, null, null);
224 if (feBoundaryLhs)
225 CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getBoundaryFEName(),
226 feBoundaryLhs, null, null);
227 if (feSkeletonLhs)
228 CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getSkeletonFEName(),
229 feSkeletonLhs, null, null);
230 if (feMeshsetLhs)
231 CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getMeshsetFEName(),
232 feMeshsetLhs, null, null);
233
234 // Add element to calculate rhs of stiff part
235 if (feDomainRhs)
236 CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getDomainFEName(), feDomainRhs,
237 null, null);
238 if (feBoundaryRhs)
239 CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getBoundaryFEName(),
240 feBoundaryRhs, null, null);
241 if (feSkeletonRhs)
242 CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getSkeletonFEName(),
243 feSkeletonRhs, null, null);
244 if (feMeshsetRhs)
245 CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getMeshsetFEName(), feMeshsetRhs,
246 null, null);
247
248 auto ksp = MoFEM::createKSP(m_field.get_comm());
249 CHKERR KSPSetDM(ksp, dm);
250 return ksp;
251}
252
254 Interface &m_field = cOre;
255 Simple *simple = m_field.getInterface<Simple>();
256
257 auto copy_dm_struture = [&](auto simple_dm) {
258 MPI_Comm comm;
259 CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
260 DMType type;
261 CHKERR DMGetType(simple_dm, &type);
262 dm = createDM(comm, type);
263 CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
264 return dm;
265 };
266
267 if (!dm)
268 dm = copy_dm_struture(simple->getDM());
269
270 const MoFEM::Problem *prb_ptr;
271 CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
272
273 auto set_dm_section = [&](auto dm) {
275 auto section =
276 m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
277 CHKERR DMSetSection(dm, section);
279 };
280 CHKERR set_dm_section(dm);
281
282 getDMSnesCtx(dm)->clearLoops();
283
284 boost::shared_ptr<FEMethod> null;
285
286 // Add element to calculate lhs of stiff part
287 if (feDomainLhs)
288 CHKERR DMMoFEMSNESSetJacobian(dm, simple->getDomainFEName(), feDomainLhs,
289 null, null);
290 if (feBoundaryLhs)
291 CHKERR DMMoFEMSNESSetJacobian(dm, simple->getBoundaryFEName(),
292 feBoundaryLhs, null, null);
293 if (feSkeletonLhs)
294 CHKERR DMMoFEMSNESSetJacobian(dm, simple->getSkeletonFEName(),
295 feSkeletonLhs, null, null);
296 if (feMeshsetLhs)
297 CHKERR DMMoFEMSNESSetJacobian(dm, simple->getMeshsetFEName(), feMeshsetLhs,
298 null, null);
299
300 // Add element to calculate rhs of stiff part
301 if (feDomainRhs)
302 CHKERR DMMoFEMSNESSetFunction(dm, simple->getDomainFEName(), feDomainRhs,
303 null, null);
304 if (feBoundaryRhs)
305 CHKERR DMMoFEMSNESSetFunction(dm, simple->getBoundaryFEName(),
306 feBoundaryRhs, null, null);
307 if (feSkeletonRhs)
308 CHKERR DMMoFEMSNESSetFunction(dm, simple->getSkeletonFEName(),
309 feSkeletonRhs, null, null);
310 if (feMeshsetRhs)
311 CHKERR DMMoFEMSNESSetFunction(dm, simple->getMeshsetFEName(), feMeshsetRhs,
312 null, null);
313
314 auto snes = MoFEM::createSNES(m_field.get_comm());
315 CHKERR SNESSetDM(snes, dm);
316 return snes;
317}
318
321 switch (type) {
322 case EX:
323 return createTSEX(dm);
324 break;
325 case IM:
326 return createTSIM(dm);
327 break;
328 case IM2:
329 return createTSIM2(dm);
330 break;
331 case IMEX:
332 return createTSIMEX(dm);
333 break;
334 default:
336 "TS solver handling not implemented");
337 break;
338 }
339 return SmartPetscObj<TS>();
340}
341
343 Interface &m_field = cOre;
344 Simple *simple = m_field.getInterface<Simple>();
345
346 auto copy_dm_struture = [&](auto simple_dm) {
347 MPI_Comm comm;
348 CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
349 DMType type;
350 CHKERR DMGetType(simple_dm, &type);
351 dm = createDM(comm, type);
352 CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
353 return dm;
354 };
355
356 if (!dm)
357 dm = copy_dm_struture(simple->getDM());
358
359 const MoFEM::Problem *prb_ptr;
360 CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
361
362 auto set_dm_section = [&](auto dm) {
364 auto section =
365 m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
366 CHKERR DMSetSection(dm, section);
368 };
369 CHKERR set_dm_section(dm);
370
371 boost::shared_ptr<FEMethod> null;
372
373 getDMTsCtx(dm)->clearLoops();
374
375 // Add element to calculate rhs of slow part
377 CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getDomainFEName(),
378 feDomainExplicitRhs, null, null);
380 CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getBoundaryFEName(),
381 feBoundaryExplicitRhs, null, null);
383 CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getSkeletonFEName(),
384 feSkeletonExplicitRhs, null, null);
385 if (feMeshsetRhs)
386 CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getMeshsetFEName(),
387 feMeshsetExplicitRhs, null, null);
388
389 // Note: More cases for explict, and implicit time interation cases can be
390 // implemented here.
391
392 auto ts = MoFEM::createTS(m_field.get_comm());
393 CHKERR TSSetDM(ts, dm);
394 return ts;
395}
396
398 Interface &m_field = cOre;
399 Simple *simple = m_field.getInterface<Simple>();
400
401 auto copy_dm_struture = [&](auto simple_dm) {
402 MPI_Comm comm;
403 CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
404 DMType type;
405 CHKERR DMGetType(simple_dm, &type);
406 dm = createDM(comm, type);
407 CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
408 return dm;
409 };
410
411 if (!dm)
412 dm = copy_dm_struture(simple->getDM());
413
414 const MoFEM::Problem *prb_ptr;
415 CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
416
417 auto set_dm_section = [&](auto dm) {
419 auto section =
420 m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
421 CHKERR DMSetSection(dm, section);
423 };
424 CHKERR set_dm_section(dm);
425
426 boost::shared_ptr<FEMethod> null;
427
428 // Add element to calculate lhs of stiff part
429 if (feDomainLhs)
430 CHKERR DMMoFEMTSSetIJacobian(dm, simple->getDomainFEName(), feDomainLhs,
431 null, null);
432 if (feBoundaryLhs)
433 CHKERR DMMoFEMTSSetIJacobian(dm, simple->getBoundaryFEName(), feBoundaryLhs,
434 null, null);
435 if (feSkeletonLhs)
436 CHKERR DMMoFEMTSSetIJacobian(dm, simple->getSkeletonFEName(), feSkeletonLhs,
437 null, null);
438 if (feMeshsetLhs)
439 CHKERR DMMoFEMTSSetIJacobian(dm, simple->getMeshsetFEName(), feMeshsetLhs,
440 null, null);
441
442 // Add element to calculate rhs of stiff part
443 if (feDomainRhs)
444 CHKERR DMMoFEMTSSetIFunction(dm, simple->getDomainFEName(), feDomainRhs,
445 null, null);
446 if (feBoundaryRhs)
447 CHKERR DMMoFEMTSSetIFunction(dm, simple->getBoundaryFEName(), feBoundaryRhs,
448 null, null);
449 if (feSkeletonRhs)
450 CHKERR DMMoFEMTSSetIFunction(dm, simple->getSkeletonFEName(), feSkeletonRhs,
451 null, null);
452 if (feMeshsetRhs)
453 CHKERR DMMoFEMTSSetIFunction(dm, simple->getMeshsetFEName(), feMeshsetRhs,
454 null, null);
455
456 // Note: More cases for explict, and implicit time interation cases can be
457 // implemented here.
458
459 auto ts = MoFEM::createTS(m_field.get_comm());
460 CHKERR TSSetDM(ts, dm);
461 return ts;
462}
463
465 Interface &m_field = cOre;
466 Simple *simple = m_field.getInterface<Simple>();
467
468 auto copy_dm_struture = [&](auto simple_dm) {
469 MPI_Comm comm;
470 CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
471 DMType type;
472 CHKERR DMGetType(simple_dm, &type);
473 dm = createDM(comm, type);
474 CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
475 return dm;
476 };
477
478 if (!dm)
479 dm = copy_dm_struture(simple->getDM());
480
481 const MoFEM::Problem *prb_ptr;
482 CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
483
484 auto set_dm_section = [&](auto dm) {
486 auto section =
487 m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
488 CHKERR DMSetSection(dm, section);
490 };
491 CHKERR set_dm_section(dm);
492
493 boost::shared_ptr<FEMethod> null;
494
495 // Add element to calculate lhs of stiff part
496 if (feDomainLhs)
497 CHKERR DMMoFEMTSSetI2Jacobian(dm, simple->getDomainFEName(), feDomainLhs,
498 null, null);
499 if (feBoundaryLhs)
500 CHKERR DMMoFEMTSSetI2Jacobian(dm, simple->getBoundaryFEName(),
501 feBoundaryLhs, null, null);
502 if (feSkeletonLhs)
503 CHKERR DMMoFEMTSSetI2Jacobian(dm, simple->getSkeletonFEName(),
504 feSkeletonLhs, null, null);
505 if (feMeshsetLhs)
506 CHKERR DMMoFEMTSSetI2Jacobian(dm, simple->getMeshsetFEName(), feMeshsetLhs,
507 null, null);
508
509 // Add element to calculate rhs of stiff part
510 if (feDomainRhs)
511 CHKERR DMMoFEMTSSetI2Function(dm, simple->getDomainFEName(), feDomainRhs,
512 null, null);
513 if (feBoundaryRhs)
514 CHKERR DMMoFEMTSSetI2Function(dm, simple->getBoundaryFEName(),
515 feBoundaryRhs, null, null);
516 if (feSkeletonRhs)
517 CHKERR DMMoFEMTSSetI2Function(dm, simple->getSkeletonFEName(),
518 feSkeletonRhs, null, null);
519 if (feMeshsetRhs)
520 CHKERR DMMoFEMTSSetI2Function(dm, simple->getMeshsetFEName(), feMeshsetRhs,
521 null, null);
522
523 // Note: More cases for explict, and implicit time interation cases can be
524 // implemented here.
525
526 auto ts = MoFEM::createTS(m_field.get_comm());
527 CHKERR TSSetDM(ts, dm);
528 return ts;
529}
530
532 Interface &m_field = cOre;
533 Simple *simple = m_field.getInterface<Simple>();
534
535 auto copy_dm_struture = [&](auto simple_dm) {
536 MPI_Comm comm;
537 CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
538 DMType type;
539 CHKERR DMGetType(simple_dm, &type);
540 dm = createDM(comm, type);
541 CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
542 return dm;
543 };
544
545 if (!dm)
546 dm = copy_dm_struture(simple->getDM());
547
548 const MoFEM::Problem *prb_ptr;
549 CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
550
551 auto set_dm_section = [&](auto dm) {
553 auto section =
554 m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
555 CHKERR DMSetSection(dm, section);
557 };
558 CHKERR set_dm_section(dm);
559
560 boost::shared_ptr<FEMethod> null;
561
562 // Add element to calculate lhs of stiff part
563 if (feDomainLhs)
564 CHKERR DMMoFEMTSSetIJacobian(dm, simple->getDomainFEName(), feDomainLhs,
565 null, null);
566 if (feBoundaryLhs)
567 CHKERR DMMoFEMTSSetIJacobian(dm, simple->getBoundaryFEName(), feBoundaryLhs,
568 null, null);
569 if (feSkeletonLhs)
570 CHKERR DMMoFEMTSSetIJacobian(dm, simple->getSkeletonFEName(), feSkeletonLhs,
571 null, null);
572 if (feMeshsetLhs)
573 CHKERR DMMoFEMTSSetIJacobian(dm, simple->getMeshsetFEName(), feMeshsetLhs,
574 null, null);
575
576 // Add element to calculate rhs of stiff part
577 if (feDomainRhs)
578 CHKERR DMMoFEMTSSetIFunction(dm, simple->getDomainFEName(), feDomainRhs,
579 null, null);
580 if (feBoundaryRhs)
581 CHKERR DMMoFEMTSSetIFunction(dm, simple->getBoundaryFEName(), feBoundaryRhs,
582 null, null);
583 if (feSkeletonRhs)
584 CHKERR DMMoFEMTSSetIFunction(dm, simple->getSkeletonFEName(), feSkeletonRhs,
585 null, null);
586 if (feMeshsetRhs)
587 CHKERR DMMoFEMTSSetIFunction(dm, simple->getMeshsetFEName(), feMeshsetRhs,
588 null, null);
589
590 // Add element to calculate rhs of stiff part
592 CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getDomainFEName(),
593 feDomainExplicitRhs, null, null);
595 CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getBoundaryFEName(),
596 feBoundaryExplicitRhs, null, null);
598 CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getSkeletonFEName(),
599 feSkeletonExplicitRhs, null, null);
601 CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getMeshsetFEName(),
602 feMeshsetExplicitRhs, null, null);
603
604 // Note: More cases for explict, and implicit time interation cases can be
605 // implemented here.
606
607 auto ts = MoFEM::createTS(m_field.get_comm());
608 CHKERR TSSetDM(ts, dm);
609 return ts;
610}
611
612} // namespace MoFEM
std::string type
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition acoustic.cpp:69
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
PetscErrorCode DMMoFEMSNESSetFunction(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set SNES residual evaluation function
Definition DMMoFEM.cpp:708
PetscErrorCode DMMoFEMTSSetIFunction(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set TS implicit function evaluation function
Definition DMMoFEM.cpp:790
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
Definition DMMoFEM.cpp:422
PetscErrorCode DMMoFEMSNESSetJacobian(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set SNES Jacobian evaluation function
Definition DMMoFEM.cpp:749
PetscErrorCode DMMoFEMKSPSetComputeRHS(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set KSP right hand side evaluation function
Definition DMMoFEM.cpp:627
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
Definition DMMoFEM.cpp:576
PetscErrorCode DMMoFEMTSSetIJacobian(DM dm, 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 TS Jacobian evaluation function
Definition DMMoFEM.cpp:843
PetscErrorCode DMMoFEMTSSetI2Jacobian(DM dm, 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 TS Jacobian evaluation function
Definition DMMoFEM.cpp:1007
PetscErrorCode DMMoFEMTSSetI2Function(DM dm, 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 TS implicit function evaluation function
Definition DMMoFEM.cpp:965
PetscErrorCode DMMoFEMKSPSetComputeOperators(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
Set KSP operators and push mofem finite element methods.
Definition DMMoFEM.cpp:668
MoFEMErrorCode loopFiniteElementsEvaluation(SmartPetscObj< DM > dm=nullptr)
Iterate evaluation finite elements.
MoFEMErrorCode loopBoundaryPostProc(SmartPetscObj< DM > dm=nullptr)
Iterate boundary postprocessing finite elements only.
MoFEMErrorCode loopFiniteElements(SmartPetscObj< DM > dm=nullptr)
Iterate finite elements.
SmartPetscObj< SNES > createSNES(SmartPetscObj< DM > dm=nullptr)
Create SNES (nonlinear) solver.
SmartPetscObj< TS > createTSIM(SmartPetscObj< DM > dm=nullptr)
Create TS (time) implicit solver.
SmartPetscObj< TS > createTSIM2(SmartPetscObj< DM > dm=nullptr)
Create TS (time) solver for second order equation in time.
SmartPetscObj< KSP > createKSP(SmartPetscObj< DM > dm=nullptr)
Create KSP (linear) solver.
SmartPetscObj< TS > createTSIMEX(SmartPetscObj< DM > dm=nullptr)
Create TS (time) implicit-explicit solver.
SmartPetscObj< TS > createTSEX(SmartPetscObj< DM > dm=nullptr)
Create TS (time) explicit solver.
MoFEMErrorCode loopFiniteElementsPostProc(SmartPetscObj< DM > dm=nullptr)
Iterate postprocessing finite elements.
MoFEMErrorCode loopDomainPostProc(SmartPetscObj< DM > dm=nullptr)
Iterate domain postprocessing finite elements only.
#define MOFEM_LOG(channel, severity)
Log.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
auto createKSP(MPI_Comm comm)
auto getDMTsCtx(DM dm)
Get TS context data structure used by DM.
Definition DMMoFEM.hpp:1279
auto createSNES(MPI_Comm comm)
PetscErrorCode DMMoFEMTSSetRHSFunction(DM dm, 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 TS the right hand side function
Definition DMMoFEM.cpp:872
auto getDMKspCtx(DM dm)
Get KSP context data structure used by DM.
Definition DMMoFEM.hpp:1251
auto createTS(MPI_Comm comm)
PetscObject getPetscObject(T obj)
auto getDMSnesCtx(DM dm)
Get SNES context data structure used by DM.
Definition DMMoFEM.hpp:1265
auto createDM(MPI_Comm comm, const std::string dm_type_name)
Creates smart DM object.
PetscErrorCode DMMoFEMDuplicateDMCtx(DM dm, DM dm_duplicate)
Duplicate internal data structure.
Definition DMMoFEM.cpp:180
virtual MPI_Comm & get_comm() const =0
Core (interface) class.
Definition Core.hpp:83
Deprecated interface functions.
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
Shared pointer to finite element database structure.
structure to get information from mofem into EntitiesFieldData
ForcesAndSourcesCore(Interface &m_field)
MoFEMErrorCode loopOverOperators()
Iterate user data operators.
Section manager is used to create indexes and sections.
Definition ISManager.hpp:23
MoFEMErrorCode postProcess()
Post-processing function executed at loop completion.
MoFEMErrorCode operator()()
Main operator function executed for each loop iteration.
MoFEMErrorCode preProcess()
Pre-processing function executed at loop initialization.
PipelineManager interface.
TSType
Enumeration of time solver types.
@ IM
Implicit time integration.
@ IM2
Second-order implicit time integration.
@ IMEX
Implicit-explicit time integration.
@ EX
Explicit time integration.
boost::shared_ptr< FEMethod > feBoundaryRhs
Element to assemble RHS side by integrating boundary.
boost::ptr_deque< UserDataOperator > & getOpMeshsetRhsPipeline()
Get the Op Meshset Rhs Pipeline object.
boost::shared_ptr< FEMethod > feDomainExplicitRhs
Element to assemble explicit Rhs for IMEX solver.
boost::shared_ptr< FEMethod > feEvaluation
Element for evaluation by integrating domain.
boost::shared_ptr< FEMethod > feMeshsetLhs
boost::ptr_deque< UserDataOperator > & getOpMeshsetExplicitRhsPipeline()
Get the Op Meshset Explicit Rhs Pipeline object.
boost::shared_ptr< FEMethod > feBoundaryLhs
Element to assemble LHS side by integrating boundary.
boost::shared_ptr< FEMethod > feSkeletonExplicitRhs
boost::shared_ptr< FEMethod > feMeshsetExplicitRhs
SmartPetscObj< TS > createTS(const TSType type, SmartPetscObj< DM > dm=nullptr)
Create TS (time) solver with specified type.
boost::shared_ptr< FEMethod > feSkeletonLhs
Element to assemble LHS side by integrating skeleton.
boost::shared_ptr< FEMethod > feDomainLhs
Element to assemble LHS side by integrating domain.
boost::shared_ptr< FEMethod > feSkeletonRhs
Element to assemble RHS side by integrating skeleton.
boost::shared_ptr< FEMethod > feMeshsetRhs
boost::shared_ptr< FEMethod > feDomainPostProc
Element for postprocessing by integrating domain.
boost::shared_ptr< FEMethod > feBoundaryPostProc
Element for postprocessing by integrating boundary.
boost::shared_ptr< FEMethod > feDomainRhs
Element to assemble RHS side by integrating domain.
boost::ptr_deque< UserDataOperator > & getOpMeshsetLhsPipeline()
Get the Op Meshset Lhs Pipeline object.
boost::shared_ptr< FEMethod > & createMeshsetFEPipeline(boost::shared_ptr< FEMethod > &fe)
Create meshset finite element pipeline.
MoFEM::Core & cOre
Reference to MoFEM core instance.
boost::shared_ptr< FEMethod > feBoundaryExplicitRhs
PipelineManager(const MoFEM::Core &core)
Construct PipelineManager.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Query interface for type-safe casting.
keeps basic data about problem
Simple interface for fast problem set-up.
Definition Simple.hpp:27
intrusive_ptr for managing petsc objects
base class for all interface classes
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.