v0.13.0
Files | 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.
 

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>

Definition at line 62 of file PipelineManager.cpp.

62  {
63  Interface &m_field = cOre;
64  Simple *simple = m_field.getInterface<Simple>();
65 
66  auto copy_dm_struture = [&](auto simple_dm) {
67  MPI_Comm comm;
68  CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
69  DMType type;
70  CHKERR DMGetType(simple_dm, &type);
71  dm = createSmartDM(comm, type);
72  CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
73  return dm;
74  };
75 
76  if (!dm)
77  dm = copy_dm_struture(simple->getDM());
78  else
79  dm = copy_dm_struture(dm);
80 
81  const MoFEM::Problem *prb_ptr;
82  CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
83 
84  auto set_dm_section = [&](auto dm) {
86  auto section =
87  m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
88  CHKERR DMSetSection(dm, section);
90  };
91  CHKERR set_dm_section(dm);
92 
93  boost::shared_ptr<FEMethod> null;
94 
95  smartGetDMKspCtx(dm)->clearLoops();
96 
97  // Add element to calculate lhs of stiff part
98  if (feDomainLhs)
99  CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getDomainFEName(),
100  feDomainLhs, null, null);
101  if (feBoundaryLhs)
102  CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getBoundaryFEName(),
103  feBoundaryLhs, null, null);
104  if (feSkeletonLhs)
105  CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getSkeletonFEName(),
106  feSkeletonLhs, null, null);
107 
108  // Add element to calculate rhs of stiff part
109  if (feDomainRhs)
110  CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getDomainFEName(), feDomainRhs,
111  null, null);
112  if (feBoundaryRhs)
113  CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getBoundaryFEName(),
114  feBoundaryRhs, null, null);
115  if (feSkeletonRhs)
116  CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getSkeletonFEName(),
117  feSkeletonRhs, null, null);
118 
119  auto ksp = MoFEM::createKSP(m_field.get_comm());
120  CHKERR KSPSetDM(ksp, dm);
121  return ksp;
122 }
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:359
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
#define CHKERR
Inline error check.
Definition: definitions.h:548
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
Definition: DMMMoFEM.cpp:384
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:595
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:636
auto createSmartDM
Creates smart DM object.
auto createKSP
auto smartGetDMKspCtx
Get KSP context data structure used by DM.
Definition: DMMoFEM.hpp:967
PetscObject getPetscObject(T obj)
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1965
PetscErrorCode DMMoFEMDuplicateDMCtx(DM dm, DM dm_duplicate)
Duplicate internal data struture.
Definition: DMMMoFEM.cpp:196
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 124 of file PipelineManager.cpp.

124  {
125  Interface &m_field = cOre;
126  Simple *simple = m_field.getInterface<Simple>();
127 
128  auto copy_dm_struture = [&](auto simple_dm) {
129  MPI_Comm comm;
130  CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
131  DMType type;
132  CHKERR DMGetType(simple_dm, &type);
133  dm = createSmartDM(comm, type);
134  CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
135  return dm;
136  };
137 
138  if (!dm)
139  dm = copy_dm_struture(simple->getDM());
140  else
141  dm = copy_dm_struture(dm);
142 
143  const MoFEM::Problem *prb_ptr;
144  CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
145 
146  auto set_dm_section = [&](auto dm) {
148  auto section =
149  m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
150  CHKERR DMSetSection(dm, section);
152  };
153  CHKERR set_dm_section(dm);
154 
155  smartGetDMSnesCtx(dm)->clearLoops();
156 
157  boost::shared_ptr<FEMethod> null;
158 
159  // Add element to calculate lhs of stiff part
160  if (feDomainLhs)
161  CHKERR DMMoFEMSNESSetJacobian(dm, simple->getDomainFEName(), feDomainLhs,
162  null, null);
163  if (feBoundaryLhs)
164  CHKERR DMMoFEMSNESSetJacobian(dm, simple->getBoundaryFEName(),
165  feBoundaryLhs, null, null);
166  if (feSkeletonLhs)
167  CHKERR DMMoFEMSNESSetJacobian(dm, simple->getSkeletonFEName(),
168  feSkeletonLhs, null, null);
169 
170  // Add element to calculate rhs of stiff part
171  if (feDomainRhs)
172  CHKERR DMMoFEMSNESSetFunction(dm, simple->getDomainFEName(), feDomainRhs,
173  null, null);
174  if (feBoundaryRhs)
175  CHKERR DMMoFEMSNESSetFunction(dm, simple->getBoundaryFEName(),
176  feBoundaryRhs, null, null);
177  if (feSkeletonRhs)
178  CHKERR DMMoFEMSNESSetFunction(dm, simple->getSkeletonFEName(),
179  feSkeletonRhs, null, null);
180 
181  auto snes = MoFEM::createSNES(m_field.get_comm());
182  CHKERR SNESSetDM(snes, dm);
183  return snes;
184 }
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:676
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:717
auto createSNES
auto smartGetDMSnesCtx
Get SNES context data structure used by DM.
Definition: DMMoFEM.hpp:978

◆ createTSEX()

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

Create TS (time) explit solver.

Parameters
dm
Returns
SmartPetscObj<TS>

Definition at line 209 of file PipelineManager.cpp.

209  {
210  Interface &m_field = cOre;
211  Simple *simple = m_field.getInterface<Simple>();
212 
213  auto copy_dm_struture = [&](auto simple_dm) {
214  MPI_Comm comm;
215  CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
216  DMType type;
217  CHKERR DMGetType(simple_dm, &type);
218  dm = createSmartDM(comm, type);
219  CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
220  return dm;
221  };
222 
223  if (!dm)
224  dm = copy_dm_struture(simple->getDM());
225  else
226  dm = copy_dm_struture(dm);
227 
228  const MoFEM::Problem *prb_ptr;
229  CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
230 
231  auto set_dm_section = [&](auto dm) {
233  auto section =
234  m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
235  CHKERR DMSetSection(dm, section);
237  };
238  CHKERR set_dm_section(dm);
239 
240  boost::shared_ptr<FEMethod> null;
241 
242  smartGetDMTsCtx(dm)->clearLoops();
243 
244  // Add element to calculate rhs of stiff part
245  if (feDomainRhs)
246  CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getDomainFEName(),
247  feDomainExplicitRhs, null, null);
248  if (feBoundaryRhs)
249  CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getBoundaryFEName(),
250  feBoundaryExplicitRhs, null, null);
252  CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getSkeletonFEName(),
253  feSkeletonExplicitRhs, null, null);
254 
255  // Note: More cases for explit, and implicit time ingeration cases can be
256  // implemented here.
257 
258  auto ts = MoFEM::createTS(m_field.get_comm());
259  CHKERR TSSetDM(ts, dm);
260  return ts;
261 }
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:840
auto createTS
auto smartGetDMTsCtx
Get TS context data structure used by DM.
Definition: DMMoFEM.hpp:989
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 263 of file PipelineManager.cpp.

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

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

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

◆ createTSIMEX()

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

Create TS (time) implicit-explicit solver.

Parameters
dm
Returns
SmartPetscObj<TS>

Definition at line 389 of file PipelineManager.cpp.

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

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

819  {
820  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
821  createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs))
822  ->getOpPtrVector();
823 }

◆ 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>&

Definition at line 699 of file PipelineManager.hpp.

699  {
700  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
701  createBoundaryFEPipeline<DIM>(feBoundaryLhs))
702  ->getOpPtrVector();
703 }

◆ 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>&

Definition at line 723 of file PipelineManager.hpp.

723  {
724  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
725  createBoundaryFEPipeline<DIM>(feBoundaryRhs))
726  ->getOpPtrVector();
727 }

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

795  {
796  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
797  createDomainFEPipeline<DIM>(feDomainExplicitRhs))
798  ->getOpPtrVector();
799 }

◆ 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>&

Definition at line 651 of file PipelineManager.hpp.

651  {
652  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
653  createDomainFEPipeline<DIM>(feDomainLhs))
654  ->getOpPtrVector();
655 }

◆ 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>&

Definition at line 675 of file PipelineManager.hpp.

675  {
676  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
677  createDomainFEPipeline<DIM>(feDomainRhs))
678  ->getOpPtrVector();
679 }

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

843  {
844  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
845  createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs))
846  ->getOpPtrVector();
847 }

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

747  {
748  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
749  createBoundaryFEPipeline<DIM>(feSkeletonLhs))
750  ->getOpPtrVector();
751 }

◆ 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>&

Definition at line 771 of file PipelineManager.hpp.

771  {
772  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
773  createBoundaryFEPipeline<DIM>(feSkeletonRhs))
774  ->getOpPtrVector();
775 }

◆ loopFiniteElements()

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

Iterate finite elements.

Returns
MoFEMErrorCode

Definition at line 32 of file PipelineManager.cpp.

32  {
34  Interface &m_field = cOre;
35  Simple *simple = m_field.getInterface<Simple>();
36  if (!dm)
37  dm = simple->getDM();
38 
39  // Add element to calculate lhs of stiff part
40  if (feDomainLhs)
41  CHKERR DMoFEMLoopFiniteElements(dm, simple->getDomainFEName(), feDomainLhs);
42  if (feBoundaryLhs)
43  CHKERR DMoFEMLoopFiniteElements(dm, simple->getBoundaryFEName(),
45  if (feSkeletonLhs)
46  CHKERR DMoFEMLoopFiniteElements(dm, simple->getSkeletonFEName(),
48 
49  // Add element to calculate rhs of stiff part
50  if (feDomainRhs)
51  CHKERR DMoFEMLoopFiniteElements(dm, simple->getDomainFEName(), feDomainRhs);
52  if (feBoundaryRhs)
53  CHKERR DMoFEMLoopFiniteElements(dm, simple->getBoundaryFEName(),
55  if (feSkeletonRhs)
56  CHKERR DMoFEMLoopFiniteElements(dm, simple->getSkeletonFEName(),
58 
60 }
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:544