Create KSP (linear) solver.
99 {
102
103 auto copy_dm_struture = [&](auto simple_dm) {
104 MPI_Comm comm;
107 CHKERR DMGetType(simple_dm, &type);
110 return dm;
111 };
112
113 if (!dm)
114 dm = copy_dm_struture(
simple->getDM());
115
118
119 auto set_dm_section = [&](auto dm) {
121 auto section =
122 m_field.getInterface<ISManager>()->sectionCreate(prb_ptr->
getName());
123 CHKERR DMSetSection(dm, section);
125 };
126 CHKERR set_dm_section(dm);
127
128 boost::shared_ptr<FEMethod> null;
129
131
132
145
146
149 null, null);
158 null, null);
159
162 return ksp;
163}
void simple(double P1[], double P2[], double P3[], double c[], const int N)
#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.
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
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 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.
auto createKSP(MPI_Comm comm)
auto getDMKspCtx(DM dm)
Get KSP context data structure used by DM.
PetscObject getPetscObject(T obj)
DeprecatedCoreInterface Interface
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 struture.
boost::shared_ptr< FEMethod > feBoundaryRhs
Element to assemble RHS side by integrating boundary.
boost::shared_ptr< FEMethod > feMeshsetLhs
boost::shared_ptr< FEMethod > feBoundaryLhs
Element to assemble LHS side by integrating boundary.
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.
keeps basic data about problem
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.