41 auto set = [&](
auto &fe) {
48 auto unset = [&](
auto &fe) {
63 auto cache_ptr = boost::make_shared<CacheTuple>();
72 *(lit.second),
nullptr,
73 ksp_ctx->
bH, cache_ptr);
89 CHKERR VecGhostUpdateBegin(
f, ADD_VALUES, SCATTER_REVERSE);
90 CHKERR VecGhostUpdateEnd(
f, ADD_VALUES, SCATTER_REVERSE);
97 PetscErrorCode
KspMat(KSP ksp, Mat
A, Mat
B,
void *ctx) {
105 auto set = [&](
auto &fe) {
113 auto unset = [&](
auto &fe) {
118 auto ent_data_cache = boost::make_shared<std::vector<EntityCacheDofs>>();
120 boost::make_shared<std::vector<EntityCacheNumeredDofs>>();
122 boost::make_shared<std::vector<EntityCacheNumeredDofs>>();
134 auto cache_ptr = boost::make_shared<CacheTuple>();
143 *(lit.second),
nullptr,
144 ksp_ctx->
bH, cache_ptr);
160 CHKERR MatAssemblyBegin(
B, MAT_FINAL_ASSEMBLY);
161 CHKERR MatAssemblyEnd(
B, MAT_FINAL_ASSEMBLY);
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
virtual MoFEMErrorCode problem_basic_method_postProcess(const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY)=0
Set data for BasicMethod.
virtual MoFEMErrorCode loop_finite_elements(const std::string &problem_name, const std::string &fe_name, FEMethod &method, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)=0
Make a loop over finite elements.
const FTensor::Tensor2< T, Dim, Dim > Vec
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
PetscErrorCode KspRhs(KSP ksp, Vec f, void *ctx)
Run over elements in the lists.
PetscErrorCode KspMat(KSP ksp, Mat A, Mat B, void *ctx)
Run over elenents in the list.
virtual MoFEMErrorCode cache_problem_entities(const std::string prb_name, CacheTupleWeakPtr cache_ptr)=0
Cache variables.
virtual MoFEMErrorCode problem_basic_method_preProcess(const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY)=0
Set data for BasicMethod.
Interface for linear (KSP) solver.
FEMethodsSequence loops_to_do_Rhs
PetscLogEvent MOFEM_EVENT_KspRhs
BasicMethodsSequence preProcess_Rhs
BasicMethodsSequence postProcess_Rhs
BasicMethodsSequence postProcess_Mat
boost::movelib::unique_ptr< bool > matAssembleSwitch
PetscLogEvent MOFEM_EVENT_KspMat
MoFEMErrorCode clearLoops()
Clear loops.
BasicMethodsSequence preProcess_Mat
MoFEM::Interface & mField
MoFEMTypes bH
If set to MF_EXIST check if element exist.
std::string problemName
Problem name.
boost::movelib::unique_ptr< bool > vecAssembleSwitch
FEMethodsSequence loops_to_do_Mat
static constexpr Switches CtxSetA
static constexpr Switches CtxSetNone
static constexpr Switches CtxSetF
static constexpr Switches CtxSetB