22#define DM_NO_ELEMENT "DMNONEFE"
137 const char fe_name[]);
155 PetscLayout *layout);
188 ScatterMode scatter_mode);
205 ScatterMode scatter_mode);
244 DM dm,
const std::string fe_name, boost::shared_ptr<MoFEM::FEMethod> method,
245 int low_rank,
int up_rank,
270 boost::shared_ptr<MoFEM::FEMethod> method,
305 boost::shared_ptr<MoFEM::FEMethod> method,
306 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
307 boost::shared_ptr<MoFEM::BasicMethod> post_only);
342 boost::shared_ptr<MoFEM::FEMethod> method,
343 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
344 boost::shared_ptr<MoFEM::BasicMethod> post_only);
361 boost::shared_ptr<MoFEM::FEMethod> method,
362 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
363 boost::shared_ptr<MoFEM::BasicMethod> post_only);
380 boost::shared_ptr<MoFEM::FEMethod> method,
381 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
382 boost::shared_ptr<MoFEM::BasicMethod> post_only);
399 boost::shared_ptr<MoFEM::FEMethod> method,
400 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
401 boost::shared_ptr<MoFEM::BasicMethod> post_only);
409 boost::shared_ptr<MoFEM::FEMethod> method,
410 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
411 boost::shared_ptr<MoFEM::BasicMethod> post_only);
438 boost::shared_ptr<MoFEM::FEMethod> method,
439 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
440 boost::shared_ptr<MoFEM::BasicMethod> post_only);
463 boost::shared_ptr<MoFEM::FEMethod> method,
464 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
465 boost::shared_ptr<MoFEM::BasicMethod> post_only);
478 boost::shared_ptr<MoFEM::FEMethod> method,
479 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
480 boost::shared_ptr<MoFEM::BasicMethod> post_only);
496 boost::shared_ptr<MoFEM::FEMethod> method,
497 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
498 boost::shared_ptr<MoFEM::BasicMethod> post_only);
526 boost::shared_ptr<MoFEM::FEMethod> method,
527 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
528 boost::shared_ptr<MoFEM::BasicMethod> post_only);
568 boost::shared_ptr<MoFEM::KspCtx> ksp_ctx);
589 boost::shared_ptr<MoFEM::SnesCtx> snes_ctx);
602 const boost::shared_ptr<MoFEM::TsCtx> &ts_ctx);
612PetscErrorCode
DMMoFEMSetTsCtx(DM dm, boost::shared_ptr<MoFEM::TsCtx> ts_ctx);
691#if PETSC_VERSION_GE(3, 7, 0)
694#elif PETSC_VERSION_GE(3, 5, 3)
861 char ***fieldNames, IS **fields);
931 boost::shared_ptr<std::map<std::string, std::pair<EntityType, EntityType>>>
933 boost::shared_ptr<std::map<std::string, std::pair<EntityType, EntityType>>>
956 "Get cot get problem ptr from DM");
989 boost::shared_ptr<MoFEM::KspCtx> ksp_ctx;
1000 boost::shared_ptr<MoFEM::SnesCtx> snes_ctx;
1011 boost::shared_ptr<MoFEM::TsCtx> ts_ctx;
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
PetscErrorCode DMGlobalToLocalBegin_MoFEM(DM dm, Vec, InsertMode, Vec)
auto smartCreateDMMatrix(DM dm)
Get smart matrix from DM.
PetscErrorCode DMGlobalToLocalEnd_MoFEM(DM dm, Vec, InsertMode, Vec)
PetscErrorCode DMMoFEMResolveSharedFiniteElements(DM dm, const char fe_name[])
Resolve shared entities.
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 DMMoFEMGetProblemFiniteElementLayout(DM dm, const char fe_name[], PetscLayout *layout)
Get finite elements layout in the problem.
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 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 DMMoFEMAddSubFieldRow(DM dm, const char field_name[], EntityType lo_type=MBVERTEX, EntityType hi_type=MBMAXTYPE)
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 DMMoFEMAddElement(DM dm, const char fe_name[])
add element to dm
PetscErrorCode DMoFEMPostProcessFiniteElements(DM dm, MoFEM::FEMethod *method)
execute finite element method for each element in dm (problem)
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
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 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 DMMoFEMAddSubFieldCol(DM dm, const char field_name[], EntityType lo_type=MBVERTEX, EntityType hi_type=MBMAXTYPE)
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
PetscErrorCode DMMoFEMUnSetElement(DM dm, const char fe_name[])
unset element from dm
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 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
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 DMoFEMGetInterfacePtr(DM dm, MoFEM::Interface **m_field_ptr)
Get pointer to MoFEM::Interface.
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 DMCreateGlobalVector_MoFEM(DM dm, Vec *g)
DMShellSetCreateGlobalVector.
PetscErrorCode DMMoFEMGetSnesCtx(DM dm, MoFEM::SnesCtx **snes_ctx)
get MoFEM::SnesCtx data structure
PetscErrorCode DMoFEMMeshToGlobalVector(DM dm, Vec g, InsertMode mode, ScatterMode scatter_mode)
set ghosted vector values on all existing mesh entities
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 DMSetUp_MoFEM(DM dm)
PetscErrorCode DMLocalToGlobalEnd_MoFEM(DM, Vec, InsertMode, Vec)
auto smartCreateDMVector(DM dm)
Get smart vector from DM.
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.
double v
phase velocity of light in medium (cm/ns)
FTensor::Index< 'l', 3 > l
const FTensor::Tensor2< T, Dim, Dim > Vec
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
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.
DEPRECATED auto smartCreateDMDVector(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)
PetscErrorCode DMMoFEMGetDestroyProblem(DM dm, PetscBool *destroy_problem)
PetscErrorCode DMMoFEMGetSubRowIS(DM dm, IS *is)
get sub problem is
PetscErrorCode DMMoFEMGetSubColIS(DM dm, IS *is)
get sub problem is
auto smartGetDMTsCtx(DM dm)
Get TS context data structure used by DM.
auto smartGetDMKspCtx(DM dm)
Get KSP 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.
boost::shared_ptr< CacheTuple > CacheTupleSharedPtr
auto getProblemPtr(DM dm)
get problem pointer from DM
PetscErrorCode DMMoFEMDuplicateDMCtx(DM dm, DM dm_duplicate)
Duplicate internal data struture.
DEPRECATED PetscErrorCode DMMoFEMResolveSharedEntities(DM dm, const char fe_name[])
boost::weak_ptr< CacheTuple > CacheTupleWeakPtr
auto smartGetDMSnesCtx(DM dm)
Get SNES context data structure used by DM.
constexpr auto field_name
Data structure to exchange data between mofem and User Loop Methods.
PETSc Discrete Manager data structure.
std::string problemName
Problem name.
const Problem * problemPtr
pinter to problem data structure
std::vector< std::string > rowCompPrb
boost::shared_ptr< SnesCtx > snesCtx
data structure SNES
boost::shared_ptr< TsCtx > tsCtx
data structure for TS solver
PetscBool isSquareMatrix
true if rows equals to cols
PetscBool isPartitioned
true if read mesh is on parts
PetscBool isProblemBuild
True if problem is build.
Interface * mField_ptr
MoFEM interface.
boost::shared_ptr< KspCtx > kspCtx
data structure KSP
boost::shared_ptr< std::map< std::string, std::pair< EntityType, EntityType > > > mapTypeRow
std::vector< std::string > colCompPrb
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
std::vector< std::string > colFields
PetscBool destroyProblem
If true destroy problem with DM.
std::vector< std::string > rowFields
const Problem * problemMainOfSubPtr
pinter to main problem to sub-problem
boost::shared_ptr< std::map< std::string, std::pair< EntityType, EntityType > > > mapTypeCol
Deprecated interface functions.
Data structure to exchange data between mofem and User Loop Methods on entities.
structure for User Loop Methods on finite elements
Interface for linear (KSP) solver.
keeps basic data about problem
Interface for nonlinear (SNES) solver.
Interface for Time Stepping (TS) solver.
base class for all interface classes