14 if (type != MBENTITYSET) {
16 "Expected entity set as a finite element");
25boost::shared_ptr<FEMethod> &
28 fe = boost::make_shared<MeshsetFE>(
cOre);
32boost::ptr_deque<PipelineManager::UserDataOperator> &
34 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
39boost::ptr_deque<PipelineManager::UserDataOperator> &
41 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
46boost::ptr_deque<PipelineManager::UserDataOperator> &
48 return boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
61 : cOre(const_cast<
Core &>(core)) {}
103 auto copy_dm_struture = [&](
auto simple_dm) {
107 CHKERR DMGetType(simple_dm, &type);
114 dm = copy_dm_struture(
simple->getDM());
119 auto set_dm_section = [&](
auto dm) {
123 CHKERR DMSetSection(dm, section);
126 CHKERR set_dm_section(dm);
128 boost::shared_ptr<FEMethod> null;
169 auto copy_dm_struture = [&](
auto simple_dm) {
173 CHKERR DMGetType(simple_dm, &type);
180 dm = copy_dm_struture(
simple->getDM());
185 auto set_dm_section = [&](
auto dm) {
189 CHKERR DMSetSection(dm, section);
192 CHKERR set_dm_section(dm);
196 boost::shared_ptr<FEMethod> null;
227 CHKERR SNESSetDM(snes, dm);
248 "TS solver handling not implemented");
258 auto copy_dm_struture = [&](
auto simple_dm) {
262 CHKERR DMGetType(simple_dm, &type);
269 dm = copy_dm_struture(
simple->getDM());
274 auto set_dm_section = [&](
auto dm) {
278 CHKERR DMSetSection(dm, section);
281 CHKERR set_dm_section(dm);
283 boost::shared_ptr<FEMethod> null;
313 auto copy_dm_struture = [&](
auto simple_dm) {
317 CHKERR DMGetType(simple_dm, &type);
324 dm = copy_dm_struture(
simple->getDM());
329 auto set_dm_section = [&](
auto dm) {
333 CHKERR DMSetSection(dm, section);
336 CHKERR set_dm_section(dm);
338 boost::shared_ptr<FEMethod> null;
380 auto copy_dm_struture = [&](
auto simple_dm) {
384 CHKERR DMGetType(simple_dm, &type);
391 dm = copy_dm_struture(
simple->getDM());
396 auto set_dm_section = [&](
auto dm) {
400 CHKERR DMSetSection(dm, section);
403 CHKERR set_dm_section(dm);
405 boost::shared_ptr<FEMethod> null;
447 auto copy_dm_struture = [&](
auto simple_dm) {
451 CHKERR DMGetType(simple_dm, &type);
458 dm = copy_dm_struture(
simple->getDM());
463 auto set_dm_section = [&](
auto dm) {
467 CHKERR DMSetSection(dm, section);
470 CHKERR set_dm_section(dm);
472 boost::shared_ptr<FEMethod> null;
void simple(double P1[], double P2[], double P3[], double c[], const int N)
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
PetscErrorCode DMMoFEMSNESSetFunction(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set SNES residual evaluation function
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
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
PetscErrorCode DMMoFEMSNESSetJacobian(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set SNES Jacobian evaluation function
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
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
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
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
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
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.
MoFEMErrorCode loopFiniteElements(SmartPetscObj< DM > dm=nullptr)
Iterate finite elements.
SmartPetscObj< SNES > createSNES(SmartPetscObj< DM > dm=nullptr)
Create SNES (nonlinear) solver.
SmartPetscObj< TS > createTSIM(SmartPetscObj< DM > dm=nullptr)
Create TS (time) implicit solver.
SmartPetscObj< TS > createTSIM2(SmartPetscObj< DM > dm=nullptr)
Create TS (time) solver for second order equation in time.
SmartPetscObj< KSP > createKSP(SmartPetscObj< DM > dm=nullptr)
Create KSP (linear) solver.
SmartPetscObj< TS > createTSIMEX(SmartPetscObj< DM > dm=nullptr)
Create TS (time) implicit-explicit solver.
SmartPetscObj< TS > createTSEX(SmartPetscObj< DM > dm=nullptr)
Create TS (time) explicit solver.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
auto createKSP(MPI_Comm comm)
auto getDMTsCtx(DM dm)
Get TS context data structure used by DM.
auto createSNES(MPI_Comm comm)
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
auto getDMKspCtx(DM dm)
Get KSP context data structure used by DM.
auto createTS(MPI_Comm comm)
PetscObject getPetscObject(T obj)
auto getDMSnesCtx(DM dm)
Get SNES context data structure used by DM.
auto createDM(MPI_Comm comm, const std::string dm_type_name)
Creates smart DM object.
PetscErrorCode DMMoFEMDuplicateDMCtx(DM dm, DM dm_duplicate)
Duplicate internal data structure.
virtual MPI_Comm & get_comm() const =0
Deprecated interface functions.
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
Shared pointer to finite element database structure.
structure to get information from mofem into EntitiesFieldData
MoFEMErrorCode loopOverOperators()
Iterate user data operators.
ForcesAndSourcesCore(Interface &m_field)
Section manager is used to create indexes and sections.
MoFEMErrorCode postProcess()
Post-processing function executed at loop completion.
MoFEMErrorCode operator()()
Main operator function executed for each loop iteration.
MoFEMErrorCode preProcess()
Pre-processing function executed at loop initialization.
PipelineManager interface.
TSType
Enumeration of time solver types.
@ IM
Implicit time integration.
@ IM2
Second-order implicit time integration.
@ IMEX
Implicit-explicit time integration.
@ EX
Explicit time integration.
boost::shared_ptr< FEMethod > feBoundaryRhs
Element to assemble RHS side by integrating boundary.
boost::ptr_deque< UserDataOperator > & getOpMeshsetRhsPipeline()
Get the Op Meshset Rhs Pipeline object.
boost::shared_ptr< FEMethod > feDomainExplicitRhs
Element to assemble explicit Rhs for IMEX solver.
boost::shared_ptr< FEMethod > feMeshsetLhs
boost::ptr_deque< UserDataOperator > & getOpMeshsetExplicitRhsPipeline()
Get the Op Meshset Explicit Rhs Pipeline object.
boost::shared_ptr< FEMethod > feBoundaryLhs
Element to assemble LHS side by integrating boundary.
boost::shared_ptr< FEMethod > feSkeletonExplicitRhs
boost::shared_ptr< FEMethod > feMeshsetExplicitRhs
SmartPetscObj< TS > createTS(const TSType type, SmartPetscObj< DM > dm=nullptr)
Create TS (time) solver with specified type.
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 > feMeshsetRhs
boost::shared_ptr< FEMethod > feDomainRhs
Element to assemble RHS side by integrating domain.
boost::ptr_deque< UserDataOperator > & getOpMeshsetLhsPipeline()
Get the Op Meshset Lhs Pipeline object.
boost::shared_ptr< FEMethod > & createMeshsetFEPipeline(boost::shared_ptr< FEMethod > &fe)
Create meshset finite element pipeline.
MoFEM::Core & cOre
Reference to MoFEM core instance.
boost::shared_ptr< FEMethod > feBoundaryExplicitRhs
PipelineManager(const MoFEM::Core &core)
Construct PipelineManager.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Query interface for type-safe casting.
keeps basic data about problem
Simple interface for fast problem set-up.
intrusive_ptr for managing petsc objects
base class for all interface classes
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.