|
| v0.14.0
|
◆ Poisson2DNonhomogeneous()
◆ assembleSystem()
[Boundary condition]
[Assemble system]
Definition at line 108 of file poisson_2d_nonhomogeneous.cpp.
116 pipeline_mng->getOpDomainLhsPipeline(), {H1});
117 pipeline_mng->getOpDomainLhsPipeline().push_back(
119 pipeline_mng->getOpDomainLhsPipeline().push_back(
121 pipeline_mng->getOpDomainLhsPipeline().push_back(
127 pipeline_mng->getOpDomainRhsPipeline().push_back(
129 pipeline_mng->getOpDomainRhsPipeline().push_back(
131 pipeline_mng->getOpDomainRhsPipeline().push_back(
137 pipeline_mng->getOpBoundaryLhsPipeline().push_back(
139 pipeline_mng->getOpBoundaryLhsPipeline().push_back(
141 pipeline_mng->getOpBoundaryLhsPipeline().push_back(
147 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
149 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
151 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
◆ boundaryCondition()
[Setup problem]
[Boundary condition]
Definition at line 90 of file poisson_2d_nonhomogeneous.cpp.
98 boundaryMarker = bc_mng->getMergedBlocksMarker({
"BOUNDARY_CONDITION"});
101 bc_mng->getMergedBlocksRange({
"BOUNDARY_CONDITION"});
◆ boundaryFunction()
◆ outputResults()
[Solve system]
[Output results]
Definition at line 231 of file poisson_2d_nonhomogeneous.cpp.
236 pipeline_mng->getBoundaryLhsFE().reset();
237 pipeline_mng->getDomainRhsFE().reset();
238 pipeline_mng->getBoundaryRhsFE().reset();
240 auto d_ptr = boost::make_shared<VectorDouble>();
241 auto l_ptr = boost::make_shared<VectorDouble>();
245 auto post_proc_fe = boost::make_shared<PostProcFaceEle>(
mField);
247 post_proc_fe->getOpPtrVector().push_back(
249 post_proc_fe->getOpPtrVector().push_back(
new OpPPMap(
250 post_proc_fe->getPostProcMesh(), post_proc_fe->getMapGaussPts(),
251 {{domainField, d_ptr}}, {}, {}, {}));
252 pipeline_mng->getDomainRhsFE() = post_proc_fe;
254 CHKERR pipeline_mng->loopFiniteElements();
255 CHKERR post_proc_fe->writeFile(
"out_result.h5m");
◆ readMesh()
◆ runProgram()
◆ setIntegrationRules()
[Assemble system]
[Set integration rules]
Definition at line 160 of file poisson_2d_nonhomogeneous.cpp.
165 auto domain_rule_lhs = [](
int,
int,
int p) ->
int {
return 2 * (p - 1); };
166 auto domain_rule_rhs = [](
int,
int,
int p) ->
int {
return 2 * (p - 1); };
167 CHKERR pipeline_mng->setDomainLhsIntegrationRule(domain_rule_lhs);
168 CHKERR pipeline_mng->setDomainRhsIntegrationRule(domain_rule_rhs);
170 auto boundary_rule_lhs = [](
int,
int,
int p) ->
int {
return 2 * p; };
171 auto boundary_rule_rhs = [](
int,
int,
int p) ->
int {
return 2 * p; };
172 CHKERR pipeline_mng->setBoundaryLhsIntegrationRule(boundary_rule_lhs);
173 CHKERR pipeline_mng->setBoundaryLhsIntegrationRule(boundary_rule_rhs);
◆ setupProblem()
◆ solveSystem()
[Set integration rules]
[Solve system]
Definition at line 180 of file poisson_2d_nonhomogeneous.cpp.
185 auto ksp_solver = pipeline_mng->
createKSP();
186 CHKERR KSPSetFromOptions(ksp_solver);
196 CHKERR KSPGetPC(ksp_solver, &pc);
197 PetscBool is_pcfs = PETSC_FALSE;
198 PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
203 if (is_pcfs == PETSC_TRUE) {
204 IS is_domain, is_boundary;
211 CHKERR PCFieldSplitSetIS(pc, NULL, is_boundary);
212 CHKERR ISDestroy(&is_boundary);
216 CHKERR KSPSetUp(ksp_solver);
222 CHKERR VecGhostUpdateBegin(
D, INSERT_VALUES, SCATTER_FORWARD);
223 CHKERR VecGhostUpdateEnd(
D, INSERT_VALUES, SCATTER_FORWARD);
◆ sourceTermFunction()
◆ boundaryEntitiesForFieldsplit
Range Poisson2DNonhomogeneous::boundaryEntitiesForFieldsplit |
|
private |
◆ boundaryMarker
boost::shared_ptr<std::vector<unsigned char> > Poisson2DNonhomogeneous::boundaryMarker |
|
private |
◆ domainField
std::string Poisson2DNonhomogeneous::domainField |
|
private |
◆ mField
◆ oRder
int Poisson2DNonhomogeneous::oRder |
|
private |
◆ simpleInterface
Simple* Poisson2DNonhomogeneous::simpleInterface |
|
private |
The documentation for this struct was generated from the following file:
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
MoFEMErrorCode assembleSystem()
[Boundary condition]
MoFEM::Interface & mField
MoFEMErrorCode loadFile(const std::string options, const std::string mesh_file_name, LoadFileFunc loadFunc=defaultLoadFileFunc)
Load mesh file.
PipelineManager interface.
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
MoFEMErrorCode outputResults()
[Solve system]
MoFEMErrorCode getOptions()
get options
MoFEMErrorCode getDM(DM *dm)
Get DM.
#define CHKERR
Inline error check.
auto createDMVector(DM dm)
Get smart vector from DM.
MoFEMErrorCode readMesh()
[Read mesh]
Section manager is used to create indexes and sections.
Simple interface for fast problem set-up.
static double boundaryFunction(const double x, const double y, const double z)
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
static double sourceTermFunction(const double x, const double y, const double z)
Get value at integration points for scalar field.
MoFEMErrorCode addDomainField(const std::string &name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_ZERO, int verb=-1)
Add field on domain.
SmartPetscObj< KSP > createKSP(SmartPetscObj< DM > dm=nullptr)
Create KSP (linear) solver.
MoFEMErrorCode solveSystem()
[Set integration rules]
MoFEMErrorCode setIntegrationRules()
[Assemble system]
Range boundaryEntitiesForFieldsplit
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
MoFEMErrorCode setFieldOrder(const std::string field_name, const int order, const Range *ents=NULL)
Set field order.
Add operators pushing bases from local to physical configuration.
boost::shared_ptr< FEMethod > & getDomainLhsFE()
SmartPetscObj< Vec > vectorDuplicate(Vec vec)
Create duplicate vector of smart vector.
MoFEMErrorCode boundaryCondition()
[Setup problem]
MoFEMErrorCode setupProblem()
[Read mesh]
Set indices on entities on finite element.
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
MoFEMErrorCode addBoundaryField(const std::string &name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_ZERO, int verb=-1)
Add field on boundary.
boost::shared_ptr< std::vector< unsigned char > > boundaryMarker
const double D
diffusivity
keeps basic data about problem
MoFEMErrorCode setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
const std::string getProblemName() const
Get the Problem Name.
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Post post-proc data at points from hash maps.