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 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 = createDM(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  getDMKspCtx(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 }

◆ 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 = createDM(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  getDMSnesCtx(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 }

◆ 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 = createDM(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  getDMTsCtx(dm)->clearLoops();
224 
225  // Add element to calculate rhs of slow part
227  CHKERR DMMoFEMTSSetRHSFunction(dm, simple->getDomainFEName(),
228  feDomainExplicitRhs, null, null);
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 }

◆ 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 = createDM(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 }

◆ 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 = createDM(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 }

◆ 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 = createDM(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_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 917 of file PipelineManager.hpp.

917  {
918  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
919  createBoundaryFEPipeline<DIM>(feBoundaryExplicitRhs))
920  ->getOpPtrVector();
921 }

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

797  {
798  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
799  createBoundaryFEPipeline<DIM>(feBoundaryLhs))
800  ->getOpPtrVector();
801 }

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

821  {
822  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
823  createBoundaryFEPipeline<DIM>(feBoundaryRhs))
824  ->getOpPtrVector();
825 }

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

893  {
894  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
895  createDomainFEPipeline<DIM>(feDomainExplicitRhs))
896  ->getOpPtrVector();
897 }

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

749  {
750  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
751  createDomainFEPipeline<DIM>(feDomainLhs))
752  ->getOpPtrVector();
753 }

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

773  {
774  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
775  createDomainFEPipeline<DIM>(feDomainRhs))
776  ->getOpPtrVector();
777 }

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

941  {
942  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
943  createBoundaryFEPipeline<DIM>(feSkeletonExplicitRhs))
944  ->getOpPtrVector();
945 }

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

845  {
846  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
847  createBoundaryFEPipeline<DIM>(feSkeletonLhs))
848  ->getOpPtrVector();
849 }

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

869  {
870  return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
871  createBoundaryFEPipeline<DIM>(feSkeletonRhs))
872  ->getOpPtrVector();
873 }

◆ 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 }
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:296
MoFEM::PipelineManager::feDomainLhs
boost::shared_ptr< FEMethod > feDomainLhs
Element to assemble LHS side by integrating domain.
Definition: PipelineManager.hpp:294
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:298
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
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:292
MoFEM::PipelineManager::cOre
MoFEM::Core & cOre
Definition: PipelineManager.hpp:289
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:307
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::feSkeletonLhs
boost::shared_ptr< FEMethod > feSkeletonLhs
Element to assemble LHS side by integrating skeleton.
Definition: PipelineManager.hpp:302
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:305
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:300
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:310
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