50#define DM_NO_ELEMENT "DMNONEFE"
180 IS *old_row_indices = PETSC_NULLPTR,
181 IS *new_row_indices = PETSC_NULLPTR);
245 PetscLayout *layout);
315 ScatterMode scatter_mode,
333 ScatterMode scatter_mode,
381 DM dm,
const std::string fe_name, boost::shared_ptr<MoFEM::FEMethod> method,
382 int low_rank,
int up_rank,
407 boost::shared_ptr<MoFEM::FEMethod> method,
442 boost::shared_ptr<MoFEM::FEMethod> method,
443 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
444 boost::shared_ptr<MoFEM::BasicMethod> post_only);
479 boost::shared_ptr<MoFEM::FEMethod> method,
480 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
481 boost::shared_ptr<MoFEM::BasicMethod> post_only);
498 boost::shared_ptr<MoFEM::FEMethod> method,
499 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
500 boost::shared_ptr<MoFEM::BasicMethod> post_only);
517 boost::shared_ptr<MoFEM::FEMethod> method,
518 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
519 boost::shared_ptr<MoFEM::BasicMethod> post_only);
536 boost::shared_ptr<MoFEM::FEMethod> method,
537 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
538 boost::shared_ptr<MoFEM::BasicMethod> post_only);
546 boost::shared_ptr<MoFEM::FEMethod> method,
547 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
548 boost::shared_ptr<MoFEM::BasicMethod> post_only);
575 boost::shared_ptr<MoFEM::FEMethod> method,
576 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
577 boost::shared_ptr<MoFEM::BasicMethod> post_only);
600 boost::shared_ptr<MoFEM::FEMethod> method,
601 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
602 boost::shared_ptr<MoFEM::BasicMethod> post_only);
615 boost::shared_ptr<MoFEM::FEMethod> method,
616 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
617 boost::shared_ptr<MoFEM::BasicMethod> post_only);
633 boost::shared_ptr<MoFEM::FEMethod> method,
634 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
635 boost::shared_ptr<MoFEM::BasicMethod> post_only);
663 boost::shared_ptr<MoFEM::FEMethod> method,
664 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
665 boost::shared_ptr<MoFEM::BasicMethod> post_only);
717 boost::shared_ptr<MoFEM::KspCtx> ksp_ctx);
746 boost::shared_ptr<MoFEM::SnesCtx> snes_ctx);
759 const boost::shared_ptr<MoFEM::TsCtx> &
ts_ctx);
867#if PETSC_VERSION_GE(3, 17, 0)
869 PetscOptionItems *PetscOptionsObject);
870#elif PETSC_VERSION_GE(3, 7, 0)
873#elif PETSC_VERSION_GE(3, 5, 3)
917 boost::shared_ptr<Range> r_ptr);
921 boost::shared_ptr<Range> r_ptr);
941 boost::shared_ptr<Range> r_ptr);
946 boost::shared_ptr<Range> r_ptr);
1081 char ***fieldNames, IS **fields);
1111struct BlockStructure;
1119 boost::shared_ptr<BlockStructure>);
1158template <
typename T>
1216 "Can not get interface ptr from DM");
1227 "Get cot get problem ptr from DM");
1294 boost::shared_ptr<MoFEM::KspCtx> ksp_ctx;
1308 boost::shared_ptr<MoFEM::SnesCtx> snes_ctx;
1322 boost::shared_ptr<MoFEM::TsCtx>
ts_ctx;
1339 return prb_ptr->getSubData();
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
PetscErrorCode DMGlobalToLocalBegin_MoFEM(DM dm, Vec, InsertMode, Vec)
PetscErrorCode DMoFEMMeshToGlobalVector(DM dm, Vec g, InsertMode mode, ScatterMode scatter_mode, RowColData rc=RowColData::COL)
set ghosted vector values on all existing mesh entities
PetscErrorCode DMGlobalToLocalEnd_MoFEM(DM dm, Vec, InsertMode, Vec)
PetscErrorCode DMMoFEMSetIsPartitioned(DM dm, PetscBool is_partitioned)
PetscErrorCode DMMoFEMCreateSubDM(DM subdm, DM dm, const char problem_name[])
Must be called by user to set Sub DM MoFEM data structures.
PetscErrorCode DMMoFEMGetIsPartitioned(DM dm, PetscBool *is_partitioned)
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
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 DMMoFEMGetProblemFiniteElementLayout(DM dm, std::string fe_name, PetscLayout *layout)
Get finite elements layout in the problem.
PetscErrorCode DMMoFEMRebuildProblem(DM dm, const MoFEM::BitRefLevel target_bit, const MoFEM::BitRefLevel target_mask, IS *old_row_indices=PETSC_NULLPTR, IS *new_row_indices=PETSC_NULLPTR)
Rebuild the DM's parent problem in place on a new bit ref level.
PetscErrorCode DMCreateLocalVector_MoFEM(DM dm, Vec *l)
DMShellSetCreateLocalVector.
PetscErrorCode DMMoFEMSetSquareProblem(DM dm, PetscBool square_problem)
set squared problem
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 DMDestroy_MoFEM(DM dm)
Destroys dm with MoFEM data structure.
PetscErrorCode DMMoFEMCreateMoFEM(DM dm, MoFEM::Interface *m_field_ptr, const char problem_name[], const MoFEM::BitRefLevel bit_level, const MoFEM::BitRefLevel bit_mask=MoFEM::BitRefLevel().set())
Must be called by user to set MoFEM data structures.
PetscErrorCode DMoFEMPostProcessFiniteElements(DM dm, MoFEM::FEMethod *method)
execute finite element method for each element in dm (problem)
PetscErrorCode DMMoFEMAddColCompositeProblem(DM dm, const char prb_name[])
Add problem to composite DM on col.
PetscErrorCode DMLocalToGlobalBegin_MoFEM(DM, Vec, InsertMode, Vec)
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
PetscErrorCode DMCreate_MoFEM(DM dm)
Create dm data structure with MoFEM data structure.
PetscErrorCode DMMoFEMSetSnesCtx(DM dm, boost::shared_ptr< MoFEM::SnesCtx > snes_ctx)
Set MoFEM::SnesCtx data structure.
PetscErrorCode DMMoFEMSetKspCtx(DM dm, boost::shared_ptr< MoFEM::KspCtx > ksp_ctx)
set MoFEM::KspCtx data structure
PetscErrorCode DMMoFEMAddSubFieldRow(DM dm, const char field_name[])
PetscErrorCode DMMoFEMGetIsSubDM(DM dm, PetscBool *is_sub_dm)
PetscErrorCode DMMoFEMAddRowCompositeProblem(DM dm, const char prb_name[])
Add problem to composite DM on row.
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 DMCreateMatrix_MoFEM(DM dm, Mat *M)
PetscErrorCode DMSetFromOptions_MoFEM(DM dm)
PetscErrorCode DMMoFEMGetTsCtx(DM dm, MoFEM::TsCtx **ts_ctx)
get MoFEM::TsCtx data structure
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode, RowColData rc=RowColData::COL)
set local (or ghosted) vector values on mesh for partition only
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
PetscErrorCode DMMoFEMGetKspCtx(DM dm, MoFEM::KspCtx **ksp_ctx)
get MoFEM::KspCtx data structure
PetscErrorCode DMMoFEMGetSquareProblem(DM dm, PetscBool *square_problem)
get squared problem
PetscErrorCode DMoFEMLoopDofs(DM dm, const char field_name[], MoFEM::DofMethod *method)
execute method for dofs on field in problem
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 DMMoFEMResolveSharedFiniteElements(DM dm, std::string fe_name)
Resolve shared entities.
PetscErrorCode DMMoFEMSetTsCtx(DM dm, boost::shared_ptr< MoFEM::TsCtx > ts_ctx)
Set MoFEM::TsCtx data structure.
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
PetscErrorCode DMMoFEMGetFieldIS(DM dm, RowColData rc, const char field_name[], IS *is)
get field is in the problem
auto createDMVector(DM dm, RowColData rc=RowColData::COL)
Get smart vector from 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
MoFEMErrorCode DMMoFEMCreateBlockMat(DM dm, Mat *mat)
Create block matrix.
PetscErrorCode DMoFEMGetInterfacePtr(DM dm, MoFEM::Interface **m_field_ptr)
Get pointer to MoFEM::Interface.
PetscErrorCode DMMoFEMAddSubFieldCol(DM dm, const char field_name[])
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
auto createDMMatrix(DM dm)
Get smart matrix from DM.
PetscErrorCode DMCreateGlobalVector_MoFEM(DM dm, Vec *g)
DMShellSetCreateGlobalVector.
PetscErrorCode DMMoFEMGetSnesCtx(DM dm, MoFEM::SnesCtx **snes_ctx)
get MoFEM::SnesCtx data structure
PetscErrorCode DMMoFEMGetIsCompDM(DM dm, PetscBool *is_comp_dm)
Get if this DM is composite DM.
PetscErrorCode DMSubDMSetUp_MoFEM(DM subdm)
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.
PetscErrorCode DMCreateFieldIS_MoFEM(DM dm, PetscInt *numFields, char ***fieldNames, IS **fields)
PetscErrorCode DMMoFEMUnSetElement(DM dm, std::string fe_name)
unset element from dm
PetscErrorCode DMSetUp_MoFEM(DM dm)
PetscErrorCode DMLocalToGlobalEnd_MoFEM(DM, Vec, InsertMode, Vec)
PetscErrorCode DMoFEMLoopFiniteElementsUpAndLowRank(DM dm, const char fe_name[], MoFEM::FEMethod *method, int low_rank, int up_rank, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
PetscErrorCode DMoFEMPreProcessFiniteElements(DM dm, MoFEM::FEMethod *method)
execute finite element method for each element in dm (problem)
PetscErrorCode DMSetOperators_MoFEM(DM dm)
Set operators for MoFEM dm.
const double v
phase velocity of light in medium (cm/ns)
FTensor::Index< 'l', 3 > l
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
implementation of Data Operators for Forces and Sources
DEPRECATED auto smartCreateDMMatrix(DM dm)
MPI_Comm getCommFromPetscObject(PetscObject obj)
Get the Comm From Petsc Object object.
PetscErrorCode DMMoFEMTSSetMonitor(DM dm, TS ts, 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 Monitor To TS solver.
auto getDMTsCtx(DM dm)
Get TS context data structure used by DM.
DEPRECATED auto smartGetDMKspCtx(DM dm)
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
PetscErrorCode DMMoFEMSetDestroyProblem(DM dm, PetscBool destroy_problem)
MoFEMErrorCode DMMoFEMCreateHybridL2Mat(DM dm, SmartPetscObj< Mat > &mat)
Create matrix for hybridised system.
PetscErrorCode DMMoFEMGetDestroyProblem(DM dm, PetscBool *destroy_problem)
MoFEMErrorCode DMMoFEMGetBlocMatData(DM dm, boost::shared_ptr< BlockStructure > &)
Get data for block mat.
PetscErrorCode DMMoFEMGetSubRowIS(DM dm, IS *is)
get sub problem is
PetscErrorCode DMMoFEMClearDMCtx(DM dm)
Clear solver and Schur data owned by a MoFEM DM context.
DEPRECATED auto smartCreateDMVector(DM dm)
MoFEMErrorCode DMMoFEMCreateNestSchurMat(DM dm, Mat *mat)
Create nest schur matrix.
PetscErrorCode DMMoFEMGetSubColIS(DM dm, IS *is)
get sub problem is
auto getDMKspCtx(DM dm)
Get KSP context data structure used by DM.
auto createDMHybridisedL2Matrix(DM dm)
Get smart hybridised L2 matrix from DM.
auto getDMSubData(DM dm)
Get sub problem data structure.
MoFEMErrorCode DMMoFEMSetBlocMatData(DM dm, boost::shared_ptr< BlockStructure >)
Set data for block mat.
DEPRECATED auto smartGetDMTsCtx(DM dm)
auto getInterfacePtr(DM dm)
Get the Interface Ptr object.
MoFEMErrorCode DMMoFEMSetNestSchurData(DM dm, boost::shared_ptr< NestSchurData >)
DEPRECATED auto smartGetDMSnesCtx(DM dm)
auto getDMSnesCtx(DM dm)
Get SNES context data structure used by DM.
PetscErrorCode DMMoFEMTSSetRHSJacobian(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 jacobian
PetscErrorCode DMMoFEMSetVerbosity(DM dm, const int verb)
Set verbosity level.
auto createDMNestSchurMat(DM dm)
PetscErrorCode DMMoFEMSwapDMCtx(DM dm, DM dm_swap)
Swap internal data structure.
boost::shared_ptr< CacheTuple > CacheTupleSharedPtr
auto getProblemPtr(DM dm)
get problem pointer from DM
PetscErrorCode DMMoFEMDuplicateDMCtx(DM dm, DM dm_duplicate)
Duplicate internal data structure.
boost::weak_ptr< CacheTuple > CacheTupleWeakPtr
auto createDMBlockMat(DM dm)
constexpr auto field_name
Data structure to exchange data between MoFEM and User Loop Methods.
PETSc Discrete Manager data structure.
boost::shared_ptr< SnesCtx > snesCtx
data structure SNES
boost::shared_ptr< TsCtx > tsCtx
data structure for TS solver
boost::shared_ptr< KspCtx > kspCtx
data structure KSP
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Deprecated interface functions.
Data structure for user loop methods on degrees of freedom (DOFs)
Structure for user loop methods on finite elements.
Interface for linear (KSP) solver.
keeps basic data about problem
intrusive_ptr for managing petsc objects
Interface for nonlinear (SNES) solver.
Interface for Time Stepping (TS) solver.
base class for all interface classes