v0.14.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_deque< UserDataOperator > & MoFEM::PipelineManager::getOpDomainLhsPipeline ()
 Get the Op Domain Lhs Pipeline object. More...
 
template<int DIM = -1>
boost::ptr_deque< UserDataOperator > & MoFEM::PipelineManager::getOpDomainRhsPipeline ()
 Get the Op Domain Rhs Pipeline object. More...
 
template<int DIM = -1>
boost::ptr_deque< UserDataOperator > & MoFEM::PipelineManager::getOpBoundaryLhsPipeline ()
 Get the Op Boundary Lhs Pipeline object. More...
 
template<int DIM = -1>
boost::ptr_deque< UserDataOperator > & MoFEM::PipelineManager::getOpBoundaryRhsPipeline ()
 Get the Op Boundary Rhs Pipeline object. More...
 
template<int DIM = -1>
boost::ptr_deque< UserDataOperator > & MoFEM::PipelineManager::getOpSkeletonLhsPipeline ()
 Get the Op Skeleton Lhs Pipeline object. More...
 
template<int DIM = -1>
boost::ptr_deque< UserDataOperator > & MoFEM::PipelineManager::getOpSkeletonRhsPipeline ()
 Get the Op Skeleton Rhs Pipeline object. More...
 
template<int DIM = -1>
boost::ptr_deque< UserDataOperator > & MoFEM::PipelineManager::getOpDomainExplicitRhsPipeline ()
 Get the Op Domain Rhs Pipeline object for implicit-explicit G term. More...
 
template<int DIM = -1>
boost::ptr_deque< UserDataOperator > & MoFEM::PipelineManager::getOpBoundaryExplicitRhsPipeline ()
 Get the Op Bondary Rhs Pipeline object for implicit-explicit G term. More...
 
template<int DIM = -1>
boost::ptr_deque< 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, dg_projection.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 99 of file PipelineManager.cpp.

99  {
100  Interface &m_field = cOre;
101  Simple *simple = m_field.getInterface<Simple>();
102 
103  auto copy_dm_struture = [&](auto simple_dm) {
104  MPI_Comm comm;
105  CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
106  DMType type;
107  CHKERR DMGetType(simple_dm, &type);
108  dm = createDM(comm, type);
109  CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
110  return dm;
111  };
112 
113  if (!dm)
114  dm = copy_dm_struture(simple->getDM());
115 
116  const MoFEM::Problem *prb_ptr;
117  CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
118 
119  auto set_dm_section = [&](auto dm) {
121  auto section =
122  m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
123  CHKERR DMSetSection(dm, section);
125  };
126  CHKERR set_dm_section(dm);
127 
128  boost::shared_ptr<FEMethod> null;
129 
130  getDMKspCtx(dm)->clearLoops();
131 
132  // Add element to calculate lhs of stiff part
133  if (feDomainLhs)
134  CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getDomainFEName(),
135  feDomainLhs, null, null);
136  if (feBoundaryLhs)
137  CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getBoundaryFEName(),
138  feBoundaryLhs, null, null);
139  if (feSkeletonLhs)
140  CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getSkeletonFEName(),
141  feSkeletonLhs, null, null);
142  if (feMeshsetLhs)
143  CHKERR DMMoFEMKSPSetComputeOperators(dm, simple->getMeshsetFEName(),
144  feMeshsetLhs, null, null);
145 
146  // Add element to calculate rhs of stiff part
147  if (feDomainRhs)
148  CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getDomainFEName(), feDomainRhs,
149  null, null);
150  if (feBoundaryRhs)
151  CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getBoundaryFEName(),
152  feBoundaryRhs, null, null);
153  if (feSkeletonRhs)
154  CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getSkeletonFEName(),
155  feSkeletonRhs, null, null);
156  if (feMeshsetRhs)
157  CHKERR DMMoFEMKSPSetComputeRHS(dm, simple->getMeshsetFEName(), feMeshsetRhs,
158  null, null);
159 
160  auto ksp = MoFEM::createKSP(m_field.get_comm());
161  CHKERR KSPSetDM(ksp, dm);
162  return ksp;
163 }

◆ createSNES()

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

Create SNES (nonlinear) solver.

Parameters
dm
Returns
SmartPetscObj<SNES>

Definition at line 165 of file PipelineManager.cpp.

165  {
166  Interface &m_field = cOre;
167  Simple *simple = m_field.getInterface<Simple>();
168 
169  auto copy_dm_struture = [&](auto simple_dm) {
170  MPI_Comm comm;
171  CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
172  DMType type;
173  CHKERR DMGetType(simple_dm, &type);
174  dm = createDM(comm, type);
175  CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
176  return dm;
177  };
178 
179  if (!dm)
180  dm = copy_dm_struture(simple->getDM());
181 
182  const MoFEM::Problem *prb_ptr;
183  CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
184 
185  auto set_dm_section = [&](auto dm) {
187  auto section =
188  m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
189  CHKERR DMSetSection(dm, section);
191  };
192  CHKERR set_dm_section(dm);
193 
194  getDMSnesCtx(dm)->clearLoops();
195 
196  boost::shared_ptr<FEMethod> null;
197 
198  // Add element to calculate lhs of stiff part
199  if (feDomainLhs)
200  CHKERR DMMoFEMSNESSetJacobian(dm, simple->getDomainFEName(), feDomainLhs,
201  null, null);
202  if (feBoundaryLhs)
203  CHKERR DMMoFEMSNESSetJacobian(dm, simple->getBoundaryFEName(),
204  feBoundaryLhs, null, null);
205  if (feSkeletonLhs)
206  CHKERR DMMoFEMSNESSetJacobian(dm, simple->getSkeletonFEName(),
207  feSkeletonLhs, null, null);
208  if (feMeshsetLhs)
209  CHKERR DMMoFEMSNESSetJacobian(dm, simple->getMeshsetFEName(), feMeshsetLhs,
210  null, null);
211 
212  // Add element to calculate rhs of stiff part
213  if (feDomainRhs)
214  CHKERR DMMoFEMSNESSetFunction(dm, simple->getDomainFEName(), feDomainRhs,
215  null, null);
216  if (feBoundaryRhs)
217  CHKERR DMMoFEMSNESSetFunction(dm, simple->getBoundaryFEName(),
218  feBoundaryRhs, null, null);
219  if (feSkeletonRhs)
220  CHKERR DMMoFEMSNESSetFunction(dm, simple->getSkeletonFEName(),
221  feSkeletonRhs, null, null);
222  if (feMeshsetRhs)
223  CHKERR DMMoFEMSNESSetFunction(dm, simple->getMeshsetFEName(), feMeshsetRhs,
224  null, null);
225 
226  auto snes = MoFEM::createSNES(m_field.get_comm());
227  CHKERR SNESSetDM(snes, dm);
228  return snes;
229 }

◆ createTSEX()

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

Create TS (time) explit solver.

Parameters
dm
Returns
SmartPetscObj<TS>

Definition at line 254 of file PipelineManager.cpp.

254  {
255  Interface &m_field = cOre;
256  Simple *simple = m_field.getInterface<Simple>();
257 
258  auto copy_dm_struture = [&](auto simple_dm) {
259  MPI_Comm comm;
260  CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
261  DMType type;
262  CHKERR DMGetType(simple_dm, &type);
263  dm = createDM(comm, type);
264  CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
265  return dm;
266  };
267 
268  if (!dm)
269  dm = copy_dm_struture(simple->getDM());
270 
271  const MoFEM::Problem *prb_ptr;
272  CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
273 
274  auto set_dm_section = [&](auto dm) {
276  auto section =
277  m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
278  CHKERR DMSetSection(dm, section);
280  };
281  CHKERR set_dm_section(dm);
282 
283  boost::shared_ptr<FEMethod> null;
284 
285  getDMTsCtx(dm)->clearLoops();
286 
287  // Add element to calculate rhs of slow part
289  CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getDomainFEName(),
290  feDomainExplicitRhs, null, null);
292  CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getBoundaryFEName(),
293  feBoundaryExplicitRhs, null, null);
295  CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getSkeletonFEName(),
296  feSkeletonExplicitRhs, null, null);
297  if (feMeshsetRhs)
298  CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getMeshsetFEName(),
299  feMeshsetExplicitRhs, null, null);
300 
301  // Note: More cases for explict, and implicit time interation cases can be
302  // implemented here.
303 
304  auto ts = MoFEM::createTS(m_field.get_comm());
305  CHKERR TSSetDM(ts, dm);
306  return ts;
307 }

◆ createTSIM()

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

Create TS (time) implicit solver.

Parameters
dm
Returns
SmartPetscObj<TS>

Definition at line 309 of file PipelineManager.cpp.

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

◆ 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 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 = createDM(comm, type);
386  CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
387  return dm;
388  };
389 
390  if (!dm)
391  dm = copy_dm_struture(simple->getDM());
392 
393  const MoFEM::Problem *prb_ptr;
394  CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
395 
396  auto set_dm_section = [&](auto dm) {
398  auto section =
399  m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
400  CHKERR DMSetSection(dm, section);
402  };
403  CHKERR set_dm_section(dm);
404 
405  boost::shared_ptr<FEMethod> null;
406 
407  // Add element to calculate lhs of stiff part
408  if (feDomainLhs)
409  CHKERR DMMoFEMTSSetI2Jacobian(dm, simple->getDomainFEName(), feDomainLhs,
410  null, null);
411  if (feBoundaryLhs)
412  CHKERR DMMoFEMTSSetI2Jacobian(dm, simple->getBoundaryFEName(),
413  feBoundaryLhs, null, null);
414  if (feSkeletonLhs)
415  CHKERR DMMoFEMTSSetI2Jacobian(dm, simple->getSkeletonFEName(),
416  feSkeletonLhs, null, null);
417  if (feMeshsetLhs)
418  CHKERR DMMoFEMTSSetI2Jacobian(dm, simple->getMeshsetFEName(), feMeshsetLhs,
419  null, null);
420 
421  // Add element to calculate rhs of stiff part
422  if (feDomainRhs)
423  CHKERR DMMoFEMTSSetI2Function(dm, simple->getDomainFEName(), feDomainRhs,
424  null, null);
425  if (feBoundaryRhs)
426  CHKERR DMMoFEMTSSetI2Function(dm, simple->getBoundaryFEName(),
427  feBoundaryRhs, null, null);
428  if (feSkeletonRhs)
429  CHKERR DMMoFEMTSSetI2Function(dm, simple->getSkeletonFEName(),
430  feSkeletonRhs, null, null);
431  if (feMeshsetRhs)
432  CHKERR DMMoFEMTSSetI2Function(dm, simple->getMeshsetFEName(), feMeshsetRhs,
433  null, null);
434 
435  // Note: More cases for explict, and implicit time interation cases can be
436  // implemented here.
437 
438  auto ts = MoFEM::createTS(m_field.get_comm());
439  CHKERR TSSetDM(ts, dm);
440  return ts;
441 }

◆ createTSIMEX()

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

Create TS (time) implicit-explicit solver.

Parameters
dm
Returns
SmartPetscObj<TS>

Definition at line 443 of file PipelineManager.cpp.

443  {
444  Interface &m_field = cOre;
445  Simple *simple = m_field.getInterface<Simple>();
446 
447  auto copy_dm_struture = [&](auto simple_dm) {
448  MPI_Comm comm;
449  CHKERR PetscObjectGetComm(getPetscObject(simple_dm.get()), &comm);
450  DMType type;
451  CHKERR DMGetType(simple_dm, &type);
452  dm = createDM(comm, type);
453  CHKERR DMMoFEMDuplicateDMCtx(simple_dm, dm);
454  return dm;
455  };
456 
457  if (!dm)
458  dm = copy_dm_struture(simple->getDM());
459 
460  const MoFEM::Problem *prb_ptr;
461  CHKERR DMMoFEMGetProblemPtr(dm, &prb_ptr);
462 
463  auto set_dm_section = [&](auto dm) {
465  auto section =
466  m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->getName());
467  CHKERR DMSetSection(dm, section);
469  };
470  CHKERR set_dm_section(dm);
471 
472  boost::shared_ptr<FEMethod> null;
473 
474  // Add element to calculate lhs of stiff part
475  if (feDomainLhs)
476  CHKERR DMMoFEMTSSetIJacobian(dm, simple->getDomainFEName(), feDomainLhs,
477  null, null);
478  if (feBoundaryLhs)
479  CHKERR DMMoFEMTSSetIJacobian(dm, simple->getBoundaryFEName(), feBoundaryLhs,
480  null, null);
481  if (feSkeletonLhs)
482  CHKERR DMMoFEMTSSetIJacobian(dm, simple->getSkeletonFEName(), feSkeletonLhs,
483  null, null);
484  if (feMeshsetLhs)
485  CHKERR DMMoFEMTSSetIJacobian(dm, simple->getMeshsetFEName(), feMeshsetLhs,
486  null, null);
487 
488  // Add element to calculate rhs of stiff part
489  if (feDomainRhs)
490  CHKERR DMMoFEMTSSetIFunction(dm, simple->getDomainFEName(), feDomainRhs,
491  null, null);
492  if (feBoundaryRhs)
493  CHKERR DMMoFEMTSSetIFunction(dm, simple->getBoundaryFEName(), feBoundaryRhs,
494  null, null);
495  if (feSkeletonRhs)
496  CHKERR DMMoFEMTSSetIFunction(dm, simple->getSkeletonFEName(), feSkeletonRhs,
497  null, null);
498  if (feMeshsetRhs)
499  CHKERR DMMoFEMTSSetIFunction(dm, simple->getMeshsetFEName(), feMeshsetRhs,
500  null, null);
501 
502  // Add element to calculate rhs of stiff part
504  CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getDomainFEName(),
505  feDomainExplicitRhs, null, null);
507  CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getBoundaryFEName(),
508  feBoundaryExplicitRhs, null, null);
510  CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getSkeletonFEName(),
511  feSkeletonExplicitRhs, null, null);
513  CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getMeshsetFEName(),
514  feMeshsetExplicitRhs, null, null);
515 
516  // Note: More cases for explict, and implicit time interation cases can be
517  // implemented here.
518 
519  auto ts = MoFEM::createTS(m_field.get_comm());
520  CHKERR TSSetDM(ts, dm);
521  return ts;
522 }

◆ getOpBoundaryExplicitRhsPipeline()

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

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

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

Definition at line 992 of file PipelineManager.hpp.

992  {
993  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
994  createBoundaryFEPipeline<DIM>(feBoundaryExplicitRhs))
995  ->getOpPtrVector();
996 }

◆ getOpBoundaryLhsPipeline()

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

Get the Op Boundary Lhs Pipeline object.

Template Parameters
-1
Returns
boost::ptr_deque<UserDataOperator>&
Examples
helmholtz.cpp.

Definition at line 872 of file PipelineManager.hpp.

872  {
873  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
874  createBoundaryFEPipeline<DIM>(feBoundaryLhs))
875  ->getOpPtrVector();
876 }

◆ getOpBoundaryRhsPipeline()

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

Get the Op Boundary Rhs Pipeline object.

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

Definition at line 896 of file PipelineManager.hpp.

896  {
897  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
898  createBoundaryFEPipeline<DIM>(feBoundaryRhs))
899  ->getOpPtrVector();
900 }

◆ getOpDomainExplicitRhsPipeline()

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

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

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

Definition at line 968 of file PipelineManager.hpp.

968  {
969  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
970  createDomainFEPipeline<DIM>(feDomainExplicitRhs))
971  ->getOpPtrVector();
972 }

◆ getOpDomainLhsPipeline()

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

Get the Op Domain Lhs Pipeline object.

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

Definition at line 824 of file PipelineManager.hpp.

824  {
825  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
826  createDomainFEPipeline<DIM>(feDomainLhs))
827  ->getOpPtrVector();
828 }

◆ getOpDomainRhsPipeline()

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

Get the Op Domain Rhs Pipeline object.

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

Definition at line 848 of file PipelineManager.hpp.

848  {
849  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
850  createDomainFEPipeline<DIM>(feDomainRhs))
851  ->getOpPtrVector();
852 }

◆ getOpSkeletonExplicitRhsPipeline()

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

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

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

Definition at line 1016 of file PipelineManager.hpp.

1016  {
1017  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
1018  createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs))
1019  ->getOpPtrVector();
1020 }

◆ getOpSkeletonLhsPipeline()

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

Get the Op Skeleton Lhs Pipeline object.

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

Definition at line 920 of file PipelineManager.hpp.

920  {
921  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
922  createBoundaryFEPipeline<DIM>(feSkeletonLhs))
923  ->getOpPtrVector();
924 }

◆ getOpSkeletonRhsPipeline()

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

Get the Op Skeleton Rhs Pipeline object.

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

Definition at line 944 of file PipelineManager.hpp.

944  {
945  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
946  createBoundaryFEPipeline<DIM>(feSkeletonRhs))
947  ->getOpPtrVector();
948 }

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

63  {
65  Interface &m_field = cOre;
66  Simple *simple = m_field.getInterface<Simple>();
67  if (!dm)
68  dm = simple->getDM();
69 
70  // Add element to calculate lhs of stiff part
71  if (feDomainLhs)
72  CHKERR DMoFEMLoopFiniteElements(dm, simple->getDomainFEName(), feDomainLhs);
73  if (feBoundaryLhs)
74  CHKERR DMoFEMLoopFiniteElements(dm, simple->getBoundaryFEName(),
76  if (feSkeletonLhs)
77  CHKERR DMoFEMLoopFiniteElements(dm, simple->getSkeletonFEName(),
79  if (feMeshsetLhs)
80  CHKERR DMoFEMLoopFiniteElements(dm, simple->getMeshsetFEName(),
81  feMeshsetLhs);
82 
83  // Add element to calculate rhs of stiff part
84  if (feDomainRhs)
85  CHKERR DMoFEMLoopFiniteElements(dm, simple->getDomainFEName(), feDomainRhs);
86  if (feBoundaryRhs)
87  CHKERR DMoFEMLoopFiniteElements(dm, simple->getBoundaryFEName(),
89  if (feSkeletonRhs)
90  CHKERR DMoFEMLoopFiniteElements(dm, simple->getSkeletonFEName(),
92  if (feMeshsetRhs)
93  CHKERR DMoFEMLoopFiniteElements(dm, simple->getMeshsetFEName(),
94  feMeshsetRhs);
95 
97 }
MoFEM::DMMoFEMKSPSetComputeRHS
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:637
MoFEM::createTS
auto createTS(MPI_Comm comm)
Definition: PetscSmartObj.hpp:249
MoFEM::createSNES
auto createSNES(MPI_Comm comm)
Definition: PetscSmartObj.hpp:255
MoFEM::getDMKspCtx
auto getDMKspCtx(DM dm)
Get KSP context data structure used by DM.
Definition: DMMoFEM.hpp:1113
MoFEM::getPetscObject
PetscObject getPetscObject(T obj)
Definition: PetscSmartObj.hpp:9
MoFEM::PipelineManager::feBoundaryRhs
boost::shared_ptr< FEMethod > feBoundaryRhs
Element to assemble RHS side by integrating boundary.
Definition: PipelineManager.hpp:332
MoFEM::PipelineManager::feDomainLhs
boost::shared_ptr< FEMethod > feDomainLhs
Element to assemble LHS side by integrating domain.
Definition: PipelineManager.hpp:330
MoFEM::createKSP
auto createKSP(MPI_Comm comm)
Definition: PetscSmartObj.hpp:261
MoFEM::DMMoFEMKSPSetComputeOperators
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:678
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
MoFEM::PipelineManager::feBoundaryLhs
boost::shared_ptr< FEMethod > feBoundaryLhs
Element to assemble LHS side by integrating boundary.
Definition: PipelineManager.hpp:334
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::PipelineManager::feMeshsetLhs
boost::shared_ptr< FEMethod > feMeshsetLhs
Definition: PipelineManager.hpp:351
MoFEM::DMMoFEMTSSetIJacobian
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:853
MoFEM::createDM
auto createDM(MPI_Comm comm, const std::string dm_type_name)
Creates smart DM object.
Definition: PetscSmartObj.hpp:141
MoFEM::DMMoFEMTSSetI2Jacobian
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:1017
MoFEM::PipelineManager::feDomainRhs
boost::shared_ptr< FEMethod > feDomainRhs
Element to assemble RHS side by integrating domain.
Definition: PipelineManager.hpp:328
MoFEM::PipelineManager::cOre
MoFEM::Core & cOre
Definition: PipelineManager.hpp:325
MoFEM::DMMoFEMTSSetI2Function
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:975
simple
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition: acoustic.cpp:69
convert.type
type
Definition: convert.py:64
MoFEM::PipelineManager::feBoundaryExplicitRhs
boost::shared_ptr< FEMethod > feBoundaryExplicitRhs
Definition: PipelineManager.hpp:343
MoFEM::DMMoFEMSNESSetJacobian
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:759
MoFEM::PipelineManager::feMeshsetExplicitRhs
boost::shared_ptr< FEMethod > feMeshsetExplicitRhs
Definition: PipelineManager.hpp:353
MoFEM::PipelineManager::feSkeletonLhs
boost::shared_ptr< FEMethod > feSkeletonLhs
Element to assemble LHS side by integrating skeleton.
Definition: PipelineManager.hpp:338
MoFEM::PipelineManager::feMeshsetRhs
boost::shared_ptr< FEMethod > feMeshsetRhs
Definition: PipelineManager.hpp:349
MoFEM::DMMoFEMTSSetRHSFunction
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:882
MoFEM::DMMoFEMTSSetIFunction
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:800
MoFEM::DMMoFEMGetProblemPtr
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
Definition: DMMoFEM.cpp:426
MoFEM::PipelineManager::feDomainExplicitRhs
boost::shared_ptr< FEMethod > feDomainExplicitRhs
Element to assemble explict Rhs for IMEX solver.
Definition: PipelineManager.hpp:341
MoFEM::getDMSnesCtx
auto getDMSnesCtx(DM dm)
Get SNES context data structure used by DM.
Definition: DMMoFEM.hpp:1127
MoFEM::Problem
keeps basic data about problem
Definition: ProblemsMultiIndices.hpp:54
MoFEM::DMMoFEMDuplicateDMCtx
PetscErrorCode DMMoFEMDuplicateDMCtx(DM dm, DM dm_duplicate)
Duplicate internal data struture.
Definition: DMMoFEM.cpp:180
MoFEM::Problem::getName
auto getName() const
Definition: ProblemsMultiIndices.hpp:372
MoFEM::PipelineManager::feSkeletonRhs
boost::shared_ptr< FEMethod > feSkeletonRhs
Element to assemble RHS side by integrating skeleton.
Definition: PipelineManager.hpp:336
MoFEM::DMoFEMLoopFiniteElements
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:586
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEM::getDMTsCtx
auto getDMTsCtx(DM dm)
Get TS context data structure used by DM.
Definition: DMMoFEM.hpp:1141
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
MoFEM::PipelineManager::feSkeletonExplicitRhs
boost::shared_ptr< FEMethod > feSkeletonExplicitRhs
Definition: PipelineManager.hpp:346
MoFEM::DMMoFEMSNESSetFunction
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:718