v0.13.2
Loading...
Searching...
No Matches
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, poisson_2d_homogeneous.cpp, and poisson_3d_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
66 const MoFEM::Problem *prb_ptr;
67 CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
68
69 auto set_dm_section = [&](auto dm) {
71 auto section =
72 m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
73 CHKERR DMSetSection(dm, section);
75 };
76 CHKERR set_dm_section(dm);
77
78 boost::shared_ptr<FEMethod> null;
79
80 smartGetDMKspCtx(dm)->clearLoops();
81
82 // Add element to calculate lhs of stiff part
83 if (feDomainLhs)
84 CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getDomainFEName(),
85 feDomainLhs, null, null);
86 if (feBoundaryLhs)
87 CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getBoundaryFEName(),
88 feBoundaryLhs, null, null);
89 if (feSkeletonLhs)
90 CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getSkeletonFEName(),
91 feSkeletonLhs, null, null);
92
93 // Add element to calculate rhs of stiff part
94 if (feDomainRhs)
95 CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getDomainFEName(), feDomainRhs,
96 null, null);
97 if (feBoundaryRhs)
98 CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getBoundaryFEName(),
99 feBoundaryRhs, null, null);
100 if (feSkeletonRhs)
101 CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getSkeletonFEName(),
102 feSkeletonRhs, null, null);
103
104 auto ksp = MoFEM::createKSP(m_field.get_comm());
105 CHKERR KSPSetDM(ksp, dm);
106 return ksp;
107}
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: DMMoFEM.cpp:394
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:605
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:646
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:989
PetscObject getPetscObject(T obj)
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1975
PetscErrorCode DMMoFEMDuplicateDMCtx(DM dm, DM dm_duplicate)
Duplicate internal data struture.
Definition: DMMoFEM.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 109 of file PipelineManager.cpp.

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

◆ createTSEX()

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

Create TS (time) explit solver.

Parameters
dm
Returns
SmartPetscObj<TS>

Definition at line 192 of file PipelineManager.cpp.

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

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

◆ 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 305 of file PipelineManager.cpp.

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

◆ createTSIMEX()

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

Create TS (time) implicit-explicit solver.

Parameters
dm
Returns
SmartPetscObj<TS>

Definition at line 366 of file PipelineManager.cpp.

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

◆ getOpBoundaryExplicitRhsPipeline()

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

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

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

Definition at line 812 of file PipelineManager.hpp.

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

◆ getOpBoundaryLhsPipeline()

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

Get the Op Boundary Lhs Pipeline object.

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

Definition at line 692 of file PipelineManager.hpp.

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

◆ getOpBoundaryRhsPipeline()

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

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 716 of file PipelineManager.hpp.

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

◆ getOpDomainExplicitRhsPipeline()

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

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

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

Definition at line 788 of file PipelineManager.hpp.

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

◆ getOpDomainLhsPipeline()

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

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, level_set.cpp, and mixed_poisson.cpp.

Definition at line 644 of file PipelineManager.hpp.

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

◆ getOpDomainRhsPipeline()

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

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 668 of file PipelineManager.hpp.

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

◆ getOpSkeletonExplicitRhsPipeline()

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

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

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

Definition at line 836 of file PipelineManager.hpp.

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

◆ getOpSkeletonLhsPipeline()

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

Get the Op Skeleton Lhs Pipeline object.

Returns
boost::ptr_vector<UserDataOperator>&
Examples
level_set.cpp.

Definition at line 740 of file PipelineManager.hpp.

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

◆ getOpSkeletonRhsPipeline()

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

Get the Op Skeleton Rhs Pipeline object.

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

Definition at line 764 of file PipelineManager.hpp.

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

◆ 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: DMMoFEM.cpp:554