v0.13.1
Files | Classes | Functions
PipelineManager interface

Implementation of basic interface for rapid problem implementation. More...

Collaboration diagram for PipelineManager interface:

Files

file  PipelineManager.cpp
 Implementation of basic interface.
 
file  PipelineManager.hpp
 Header file for basic interface.
 

Classes

struct  MoFEM::PipelineManager
 PipelineManager interface. More...
 

Functions

template<int DIM = -1>
boost::ptr_vector< UserDataOperator > & MoFEM::PipelineManager::getOpDomainLhsPipeline ()
 Get the Op Domain Lhs Pipeline object. More...
 
template<int DIM = -1>
boost::ptr_vector< UserDataOperator > & MoFEM::PipelineManager::getOpDomainRhsPipeline ()
 Get the Op Domain Rhs Pipeline object. More...
 
template<int DIM = -1>
boost::ptr_vector< UserDataOperator > & MoFEM::PipelineManager::getOpBoundaryLhsPipeline ()
 Get the Op Boundary Lhs Pipeline object. More...
 
template<int DIM = -1>
boost::ptr_vector< UserDataOperator > & MoFEM::PipelineManager::getOpBoundaryRhsPipeline ()
 Get the Op Boundary Rhs Pipeline object. More...
 
template<int DIM = -1>
boost::ptr_vector< UserDataOperator > & MoFEM::PipelineManager::getOpSkeletonLhsPipeline ()
 Get the Op Skeleton Lhs Pipeline object. More...
 
template<int DIM = -1>
boost::ptr_vector< UserDataOperator > & MoFEM::PipelineManager::getOpSkeletonRhsPipeline ()
 Get the Op Skeleton Rhs Pipeline object. More...
 
template<int DIM = -1>
boost::ptr_vector< UserDataOperator > & MoFEM::PipelineManager::getOpDomainExplicitRhsPipeline ()
 Get the Op Domain Rhs Pipeline object for implicit-explicit G term. More...
 
template<int DIM = -1>
boost::ptr_vector< UserDataOperator > & MoFEM::PipelineManager::getOpBoundaryExplicitRhsPipeline ()
 Get the Op Bondary Rhs Pipeline object for implicit-explicit G term. More...
 
template<int DIM = -1>
boost::ptr_vector< UserDataOperator > & MoFEM::PipelineManager::getOpSkeletonExplicitRhsPipeline ()
 Get the Op Skeleton Rhs Pipeline object for implicit-explicit G term. More...
 
MoFEMErrorCode MoFEM::PipelineManager::loopFiniteElements (SmartPetscObj< DM > dm=nullptr)
 Iterate finite elements. More...
 
SmartPetscObj< KSP > MoFEM::PipelineManager::createKSP (SmartPetscObj< DM > dm=nullptr)
 Create KSP (linear) solver. More...
 
SmartPetscObj< SNES > MoFEM::PipelineManager::createSNES (SmartPetscObj< DM > dm=nullptr)
 Create SNES (nonlinear) solver. More...
 
SmartPetscObj< TS > MoFEM::PipelineManager::createTSEX (SmartPetscObj< DM > dm=nullptr)
 Create TS (time) explit solver. More...
 
SmartPetscObj< TS > MoFEM::PipelineManager::createTSIM (SmartPetscObj< DM > dm=nullptr)
 Create TS (time) implicit solver. More...
 
SmartPetscObj< TS > MoFEM::PipelineManager::createTSIM2 (SmartPetscObj< DM > dm=nullptr)
 Create TS (time) solver for second order equation in time. More...
 
SmartPetscObj< TS > MoFEM::PipelineManager::createTSIMEX (SmartPetscObj< DM > dm=nullptr)
 Create TS (time) implicit-explicit solver. More...
 

Detailed Description

Implementation of basic interface for rapid problem implementation.

Function Documentation

◆ createKSP()

SmartPetscObj< KSP > MoFEM::PipelineManager::createKSP ( SmartPetscObj< DM >  dm = nullptr)

Create KSP (linear) solver.

Parameters
dm
Returns
SmartPetscObj<KSP>
Examples
child_and_parent.cpp, hanging_node_approx.cpp, helmholtz.cpp, higher_derivatives.cpp, mixed_poisson.cpp, phase.cpp, poisson_2d_dis_galerkin.cpp, and poisson_2d_homogeneous.cpp.

Definition at line 49 of file PipelineManager.cpp.

49 {
50 Interface &m_field = cOre;
51 Simple *simple = m_field.getInterface<Simple>();
52
53 auto copy_dm_struture = [&](auto simple_dm) {
54 MPI_Comm comm;
55 CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
56 DMType type;
57 CHKERR DMGetType(simple_dm, &type);
58 dm = createSmartDM(comm, type);
59 CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
60 return dm;
61 };
62
63 if (!dm)
64 dm = copy_dm_struture(simple->getDM());
65 else
66 dm = copy_dm_struture(dm);
67
68 const MoFEM::Problem *prb_ptr;
69 CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
70
71 auto set_dm_section = [&](auto dm) {
73 auto section =
74 m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
75 CHKERR DMSetSection(dm, section);
77 };
78 CHKERR set_dm_section(dm);
79
80 boost::shared_ptr<FEMethod> null;
81
82 smartGetDMKspCtx(dm)->clearLoops();
83
84 // Add element to calculate lhs of stiff part
85 if (feDomainLhs)
86 CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getDomainFEName(),
87 feDomainLhs, null, null);
88 if (feBoundaryLhs)
89 CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getBoundaryFEName(),
90 feBoundaryLhs, null, null);
91 if (feSkeletonLhs)
92 CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getSkeletonFEName(),
93 feSkeletonLhs, null, null);
94
95 // Add element to calculate rhs of stiff part
96 if (feDomainRhs)
97 CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getDomainFEName(), feDomainRhs,
98 null, null);
99 if (feBoundaryRhs)
100 CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getBoundaryFEName(),
101 feBoundaryRhs, null, null);
102 if (feSkeletonRhs)
103 CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getSkeletonFEName(),
104 feSkeletonRhs, null, null);
105
106 auto ksp = MoFEM::createKSP(m_field.get_comm());
107 CHKERR KSPSetDM(ksp, dm);
108 return ksp;
109}
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition: acoustic.cpp:69
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
Definition: DMMMoFEM.cpp:373
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: DMMMoFEM.cpp:584
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: DMMMoFEM.cpp:625
auto createKSP(MPI_Comm comm)
auto createSmartDM(MPI_Comm comm, const std::string dm_type_name)
Creates smart DM object.
auto smartGetDMKspCtx(DM dm)
Get KSP context data structure used by DM.
Definition: DMMoFEM.hpp:976
PetscObject getPetscObject(T obj)
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1955
PetscErrorCode DMMoFEMDuplicateDMCtx(DM dm, DM dm_duplicate)
Duplicate internal data struture.
Definition: DMMMoFEM.cpp:184
boost::shared_ptr< FEMethod > feBoundaryRhs
Element to assemble RHS side by integrating boundary.
boost::shared_ptr< FEMethod > feBoundaryLhs
Element to assemble LHS side by integrating boundary.
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 > feDomainRhs
Element to assemble RHS side by integrating domain.
keeps basic data about problem

◆ createSNES()

SmartPetscObj< SNES > MoFEM::PipelineManager::createSNES ( SmartPetscObj< DM >  dm = nullptr)

Create SNES (nonlinear) solver.

Parameters
dm
Returns
SmartPetscObj<SNES>

Definition at line 111 of file PipelineManager.cpp.

111 {
112 Interface &m_field = cOre;
113 Simple *simple = m_field.getInterface<Simple>();
114
115 auto copy_dm_struture = [&](auto simple_dm) {
116 MPI_Comm comm;
117 CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
118 DMType type;
119 CHKERR DMGetType(simple_dm, &type);
120 dm = createSmartDM(comm, type);
121 CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
122 return dm;
123 };
124
125 if (!dm)
126 dm = copy_dm_struture(simple->getDM());
127 else
128 dm = copy_dm_struture(dm);
129
130 const MoFEM::Problem *prb_ptr;
131 CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
132
133 auto set_dm_section = [&](auto dm) {
135 auto section =
136 m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
137 CHKERR DMSetSection(dm, section);
139 };
140 CHKERR set_dm_section(dm);
141
142 smartGetDMSnesCtx(dm)->clearLoops();
143
144 boost::shared_ptr<FEMethod> null;
145
146 // Add element to calculate lhs of stiff part
147 if (feDomainLhs)
148 CHKERR DMMoFEMSNESSetJacobian(dm, simple->getDomainFEName(), feDomainLhs,
149 null, null);
150 if (feBoundaryLhs)
151 CHKERR DMMoFEMSNESSetJacobian(dm, simple->getBoundaryFEName(),
152 feBoundaryLhs, null, null);
153 if (feSkeletonLhs)
154 CHKERR DMMoFEMSNESSetJacobian(dm, simple->getSkeletonFEName(),
155 feSkeletonLhs, null, null);
156
157 // Add element to calculate rhs of stiff part
158 if (feDomainRhs)
159 CHKERR DMMoFEMSNESSetFunction(dm, simple->getDomainFEName(), feDomainRhs,
160 null, null);
161 if (feBoundaryRhs)
162 CHKERR DMMoFEMSNESSetFunction(dm, simple->getBoundaryFEName(),
163 feBoundaryRhs, null, null);
164 if (feSkeletonRhs)
165 CHKERR DMMoFEMSNESSetFunction(dm, simple->getSkeletonFEName(),
166 feSkeletonRhs, null, null);
167
168 auto snes = MoFEM::createSNES(m_field.get_comm());
169 CHKERR SNESSetDM(snes, dm);
170 return snes;
171}
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: DMMMoFEM.cpp:665
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: DMMMoFEM.cpp:706
auto createSNES(MPI_Comm comm)
auto smartGetDMSnesCtx(DM dm)
Get SNES context data structure used by DM.
Definition: DMMoFEM.hpp:987

◆ createTSEX()

SmartPetscObj< TS > MoFEM::PipelineManager::createTSEX ( SmartPetscObj< DM >  dm = nullptr)

Create TS (time) explit solver.

Parameters
dm
Returns
SmartPetscObj<TS>

Definition at line 196 of file PipelineManager.cpp.

196 {
197 Interface &m_field = cOre;
198 Simple *simple = m_field.getInterface<Simple>();
199
200 auto copy_dm_struture = [&](auto simple_dm) {
201 MPI_Comm comm;
202 CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
203 DMType type;
204 CHKERR DMGetType(simple_dm, &type);
205 dm = createSmartDM(comm, type);
206 CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
207 return dm;
208 };
209
210 if (!dm)
211 dm = copy_dm_struture(simple->getDM());
212 else
213 dm = copy_dm_struture(dm);
214
215 const MoFEM::Problem *prb_ptr;
216 CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
217
218 auto set_dm_section = [&](auto dm) {
220 auto section =
221 m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
222 CHKERR DMSetSection(dm, section);
224 };
225 CHKERR set_dm_section(dm);
226
227 boost::shared_ptr<FEMethod> null;
228
229 smartGetDMTsCtx(dm)->clearLoops();
230
231 // Add element to calculate rhs of stiff part
232 if (feDomainRhs)
233 CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getDomainFEName(),
234 feDomainExplicitRhs, null, null);
235 if (feBoundaryRhs)
236 CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getBoundaryFEName(),
237 feBoundaryExplicitRhs, null, null);
239 CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getSkeletonFEName(),
240 feSkeletonExplicitRhs, null, null);
241
242 // Note: More cases for explit, and implicit time ingeration cases can be
243 // implemented here.
244
245 auto ts = MoFEM::createTS(m_field.get_comm());
246 CHKERR TSSetDM(ts, dm);
247 return ts;
248}
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: DMMMoFEM.cpp:829
auto smartGetDMTsCtx(DM dm)
Get TS context data structure used by DM.
Definition: DMMoFEM.hpp:998
auto createTS(MPI_Comm comm)
boost::shared_ptr< FEMethod > feDomainExplicitRhs
Element to assemble explict Rhs for IMEX solver.
boost::shared_ptr< FEMethod > feSkeletonExplicitRhs
boost::shared_ptr< FEMethod > feBoundaryExplicitRhs

◆ createTSIM()

SmartPetscObj< TS > MoFEM::PipelineManager::createTSIM ( SmartPetscObj< DM >  dm = nullptr)

Create TS (time) implicit solver.

Parameters
dm
Returns
SmartPetscObj<TS>

Definition at line 250 of file PipelineManager.cpp.

250 {
251 Interface &m_field = cOre;
252 Simple *simple = m_field.getInterface<Simple>();
253
254 auto copy_dm_struture = [&](auto simple_dm) {
255 MPI_Comm comm;
256 CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
257 DMType type;
258 CHKERR DMGetType(simple_dm, &type);
259 dm = createSmartDM(comm, type);
260 CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
261 return dm;
262 };
263
264 if (!dm)
265 dm = copy_dm_struture(simple->getDM());
266 else
267 dm = copy_dm_struture(dm);
268
269 const MoFEM::Problem *prb_ptr;
270 CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
271
272 auto set_dm_section = [&](auto dm) {
274 auto section =
275 m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
276 CHKERR DMSetSection(dm, section);
278 };
279 CHKERR set_dm_section(dm);
280
281 boost::shared_ptr<FEMethod> null;
282
283 // Add element to calculate lhs of stiff part
284 if (feDomainLhs)
285 CHKERR DMMoFEMTSSetIJacobian(dm, simple->getDomainFEName(), feDomainLhs,
286 null, null);
287 if (feBoundaryLhs)
288 CHKERR DMMoFEMTSSetIJacobian(dm, simple->getBoundaryFEName(), feBoundaryLhs,
289 null, null);
290 if (feSkeletonLhs)
291 CHKERR DMMoFEMTSSetIJacobian(dm, simple->getSkeletonFEName(), feSkeletonLhs,
292 null, null);
293
294 // Add element to calculate rhs of stiff part
295 if (feDomainRhs)
296 CHKERR DMMoFEMTSSetIFunction(dm, simple->getDomainFEName(), feDomainRhs,
297 null, null);
298 if (feBoundaryRhs)
299 CHKERR DMMoFEMTSSetIFunction(dm, simple->getBoundaryFEName(), feBoundaryRhs,
300 null, null);
301 if (feSkeletonRhs)
302 CHKERR DMMoFEMTSSetIFunction(dm, simple->getSkeletonFEName(), feSkeletonRhs,
303 null, null);
304
305 // Note: More cases for explit, and implicit time ingeration cases can be
306 // implemented here.
307
308 auto ts = MoFEM::createTS(m_field.get_comm());
309 CHKERR TSSetDM(ts, dm);
310 return ts;
311}
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: DMMMoFEM.cpp:747
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: DMMMoFEM.cpp:800

◆ createTSIM2()

SmartPetscObj< TS > MoFEM::PipelineManager::createTSIM2 ( SmartPetscObj< DM >  dm = nullptr)

Create TS (time) solver for second order equation in time.

Parameters
dm
Returns
SmartPetscObj<TS>

Definition at line 313 of file PipelineManager.cpp.

313 {
314 Interface &m_field = cOre;
315 Simple *simple = m_field.getInterface<Simple>();
316
317 auto copy_dm_struture = [&](auto simple_dm) {
318 MPI_Comm comm;
319 CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
320 DMType type;
321 CHKERR DMGetType(simple_dm, &type);
322 dm = createSmartDM(comm, type);
323 CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
324 return dm;
325 };
326
327 if (!dm)
328 dm = copy_dm_struture(simple->getDM());
329 else
330 dm = copy_dm_struture(dm);
331
332 const MoFEM::Problem *prb_ptr;
333 CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
334
335 auto set_dm_section = [&](auto dm) {
337 auto section =
338 m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
339 CHKERR DMSetSection(dm, section);
341 };
342 CHKERR set_dm_section(dm);
343
344 boost::shared_ptr<FEMethod> null;
345
346 // Add element to calculate lhs of stiff part
347 if (feDomainLhs)
348 CHKERR DMMoFEMTSSetI2Jacobian(dm, simple->getDomainFEName(), feDomainLhs,
349 null, null);
350 if (feBoundaryLhs)
351 CHKERR DMMoFEMTSSetI2Jacobian(dm, simple->getBoundaryFEName(),
352 feBoundaryLhs, null, null);
353 if (feSkeletonLhs)
354 CHKERR DMMoFEMTSSetI2Jacobian(dm, simple->getSkeletonFEName(),
355 feSkeletonLhs, null, null);
356
357 // Add element to calculate rhs of stiff part
358 if (feDomainRhs)
359 CHKERR DMMoFEMTSSetI2Function(dm, simple->getDomainFEName(), feDomainRhs,
360 null, null);
361 if (feBoundaryRhs)
362 CHKERR DMMoFEMTSSetI2Function(dm, simple->getBoundaryFEName(),
363 feBoundaryRhs, null, null);
364 if (feSkeletonRhs)
365 CHKERR DMMoFEMTSSetI2Function(dm, simple->getSkeletonFEName(),
366 feSkeletonRhs, null, null);
367
368 // Note: More cases for explit, and implicit time ingeration cases can be
369 // implemented here.
370
371 auto ts = MoFEM::createTS(m_field.get_comm());
372 CHKERR TSSetDM(ts, dm);
373 return ts;
374}
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: DMMMoFEM.cpp:964
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: DMMMoFEM.cpp:922

◆ createTSIMEX()

SmartPetscObj< TS > MoFEM::PipelineManager::createTSIMEX ( SmartPetscObj< DM >  dm = nullptr)

Create TS (time) implicit-explicit solver.

Parameters
dm
Returns
SmartPetscObj<TS>

Definition at line 376 of file PipelineManager.cpp.

376 {
377 Interface &m_field = cOre;
378 Simple *simple = m_field.getInterface<Simple>();
379
380 auto copy_dm_struture = [&](auto simple_dm) {
381 MPI_Comm comm;
382 CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
383 DMType type;
384 CHKERR DMGetType(simple_dm, &type);
385 dm = createSmartDM(comm, type);
386 CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
387 return dm;
388 };
389
390 if (!dm)
391 dm = copy_dm_struture(simple->getDM());
392 else
393 dm = copy_dm_struture(dm);
394
395 const MoFEM::Problem *prb_ptr;
396 CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
397
398 auto set_dm_section = [&](auto dm) {
400 auto section =
401 m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
402 CHKERR DMSetSection(dm, section);
404 };
405 CHKERR set_dm_section(dm);
406
407 boost::shared_ptr<FEMethod> null;
408
409 // Add element to calculate lhs of stiff part
410 if (feDomainLhs)
411 CHKERR DMMoFEMTSSetIJacobian(dm, simple->getDomainFEName(), feDomainLhs,
412 null, null);
413 if (feBoundaryLhs)
414 CHKERR DMMoFEMTSSetIJacobian(dm, simple->getBoundaryFEName(), feBoundaryLhs,
415 null, null);
416 if (feSkeletonLhs)
417 CHKERR DMMoFEMTSSetIJacobian(dm, simple->getSkeletonFEName(), feSkeletonLhs,
418 null, null);
419
420 // Add element to calculate rhs of stiff part
421 if (feDomainRhs)
422 CHKERR DMMoFEMTSSetIFunction(dm, simple->getDomainFEName(), feDomainRhs,
423 null, null);
424 if (feBoundaryRhs)
425 CHKERR DMMoFEMTSSetIFunction(dm, simple->getBoundaryFEName(), feBoundaryRhs,
426 null, null);
427 if (feSkeletonRhs)
428 CHKERR DMMoFEMTSSetIFunction(dm, simple->getSkeletonFEName(), feSkeletonRhs,
429 null, null);
430
431 // Add element to calculate rhs of stiff part
433 CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getDomainFEName(),
434 feDomainExplicitRhs, null, null);
436 CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getBoundaryFEName(),
437 feBoundaryExplicitRhs, null, null);
439 CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getSkeletonFEName(),
440 feSkeletonExplicitRhs, null, null);
441
442 // Note: More cases for explit, and implicit time ingeration cases can be
443 // implemented here.
444
445 auto ts = MoFEM::createTS(m_field.get_comm());
446 CHKERR TSSetDM(ts, dm);
447 return ts;
448}

◆ getOpBoundaryExplicitRhsPipeline()

template<int DIM>
boost::ptr_vector< PipelineManager::UserDataOperator > & MoFEM::PipelineManager::getOpBoundaryExplicitRhsPipeline

Get the Op Bondary Rhs Pipeline object for implicit-explicit G term.

Template Parameters
-1
Returns
boost::ptr_vector<UserDataOperator>&

Definition at line 810 of file PipelineManager.hpp.

810 {
811 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
812 createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs))
813 ->getOpPtrVector();
814}

◆ getOpBoundaryLhsPipeline()

template<int DIM>
boost::ptr_vector< PipelineManager::UserDataOperator > & MoFEM::PipelineManager::getOpBoundaryLhsPipeline

Get the Op Boundary Lhs Pipeline object.

Template Parameters
-1
Returns
boost::ptr_vector<UserDataOperator>&
Examples
contact.cpp, and helmholtz.cpp.

Definition at line 690 of file PipelineManager.hpp.

690 {
691 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
692 createBoundaryFEPipeline<DIM>(feBoundaryLhs))
693 ->getOpPtrVector();
694}

◆ getOpBoundaryRhsPipeline()

template<int DIM>
boost::ptr_vector< PipelineManager::UserDataOperator > & MoFEM::PipelineManager::getOpBoundaryRhsPipeline

Get the Op Boundary Rhs Pipeline object.

Template Parameters
-1
Returns
boost::ptr_vector<UserDataOperator>&
Examples
child_and_parent.cpp, contact.cpp, hanging_node_approx.cpp, helmholtz.cpp, and simple_l2_only.cpp.

Definition at line 714 of file PipelineManager.hpp.

714 {
715 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
716 createBoundaryFEPipeline<DIM>(feBoundaryRhs))
717 ->getOpPtrVector();
718}

◆ getOpDomainExplicitRhsPipeline()

template<int DIM>
boost::ptr_vector< PipelineManager::UserDataOperator > & MoFEM::PipelineManager::getOpDomainExplicitRhsPipeline

Get the Op Domain Rhs Pipeline object for implicit-explicit G term.

Template Parameters
-1
Returns
boost::ptr_vector<UserDataOperator>&

Definition at line 786 of file PipelineManager.hpp.

786 {
787 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
788 createDomainFEPipeline<DIM>(feDomainExplicitRhs))
789 ->getOpPtrVector();
790}

◆ getOpDomainLhsPipeline()

template<int DIM>
boost::ptr_vector< PipelineManager::UserDataOperator > & MoFEM::PipelineManager::getOpDomainLhsPipeline

Get the Op Domain Lhs Pipeline object.

Template Parameters
-1
Returns
boost::ptr_vector<UserDataOperator>&
Examples
approx_sphere.cpp, child_and_parent.cpp, contact.cpp, hanging_node_approx.cpp, heat_method.cpp, helmholtz.cpp, higher_derivatives.cpp, and mixed_poisson.cpp.

Definition at line 642 of file PipelineManager.hpp.

642 {
643 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
644 createDomainFEPipeline<DIM>(feDomainLhs))
645 ->getOpPtrVector();
646}

◆ getOpDomainRhsPipeline()

template<int DIM>
boost::ptr_vector< PipelineManager::UserDataOperator > & MoFEM::PipelineManager::getOpDomainRhsPipeline

Get the Op Domain Rhs Pipeline object.

Template Parameters
-1
Returns
boost::ptr_vector<UserDataOperator>&
Examples
approx_sphere.cpp, child_and_parent.cpp, contact.cpp, hanging_node_approx.cpp, heat_method.cpp, hello_world.cpp, higher_derivatives.cpp, and mixed_poisson.cpp.

Definition at line 666 of file PipelineManager.hpp.

666 {
667 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
668 createDomainFEPipeline<DIM>(feDomainRhs))
669 ->getOpPtrVector();
670}

◆ getOpSkeletonExplicitRhsPipeline()

template<int DIM>
boost::ptr_vector< PipelineManager::UserDataOperator > & MoFEM::PipelineManager::getOpSkeletonExplicitRhsPipeline

Get the Op Skeleton Rhs Pipeline object for implicit-explicit G term.

Template Parameters
-1
Returns
boost::ptr_vector<UserDataOperator>&

Definition at line 834 of file PipelineManager.hpp.

834 {
835 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
836 createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs))
837 ->getOpPtrVector();
838}

◆ getOpSkeletonLhsPipeline()

template<int DIM>
boost::ptr_vector< PipelineManager::UserDataOperator > & MoFEM::PipelineManager::getOpSkeletonLhsPipeline

Get the Op Skeleton Lhs Pipeline object.

Returns
boost::ptr_vector<UserDataOperator>&

Definition at line 738 of file PipelineManager.hpp.

738 {
739 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
740 createBoundaryFEPipeline<DIM>(feSkeletonLhs))
741 ->getOpPtrVector();
742}

◆ getOpSkeletonRhsPipeline()

template<int DIM>
boost::ptr_vector< PipelineManager::UserDataOperator > & MoFEM::PipelineManager::getOpSkeletonRhsPipeline

Get the Op Skeleton Rhs Pipeline object.

Template Parameters
-1
Returns
boost::ptr_vector<UserDataOperator>&
Examples
simple_l2_only.cpp.

Definition at line 762 of file PipelineManager.hpp.

762 {
763 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
764 createBoundaryFEPipeline<DIM>(feSkeletonRhs))
765 ->getOpPtrVector();
766}

◆ loopFiniteElements()

MoFEMErrorCode MoFEM::PipelineManager::loopFiniteElements ( SmartPetscObj< DM >  dm = nullptr)

Iterate finite elements.

Returns
MoFEMErrorCode
Examples
child_and_parent.cpp, hanging_node_approx.cpp, heat_method.cpp, helmholtz.cpp, higher_derivatives.cpp, mixed_poisson.cpp, phase.cpp, plot_base.cpp, and simple_l2_only.cpp.

Definition at line 19 of file PipelineManager.cpp.

19 {
21 Interface &m_field = cOre;
22 Simple *simple = m_field.getInterface<Simple>();
23 if (!dm)
24 dm = simple->getDM();
25
26 // Add element to calculate lhs of stiff part
27 if (feDomainLhs)
28 CHKERR DMoFEMLoopFiniteElements(dm, simple->getDomainFEName(), feDomainLhs);
29 if (feBoundaryLhs)
30 CHKERR DMoFEMLoopFiniteElements(dm, simple->getBoundaryFEName(),
32 if (feSkeletonLhs)
33 CHKERR DMoFEMLoopFiniteElements(dm, simple->getSkeletonFEName(),
35
36 // Add element to calculate rhs of stiff part
37 if (feDomainRhs)
38 CHKERR DMoFEMLoopFiniteElements(dm, simple->getDomainFEName(), feDomainRhs);
39 if (feBoundaryRhs)
40 CHKERR DMoFEMLoopFiniteElements(dm, simple->getBoundaryFEName(),
42 if (feSkeletonRhs)
43 CHKERR DMoFEMLoopFiniteElements(dm, simple->getSkeletonFEName(),
45
47}
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
Definition: DMMMoFEM.cpp:533