|
| v0.14.0
|
◆ Poisson2DLagrangeMultiplier()
Poisson2DLagrangeMultiplier::Poisson2DLagrangeMultiplier |
( |
MoFEM::Interface & |
m_field | ) |
|
◆ assembleSystem()
Definition at line 134 of file poisson_2d_lagrange_multiplier.cpp.
138 auto det_ptr = boost::make_shared<VectorDouble>();
139 auto jac_ptr = boost::make_shared<MatrixDouble>();
140 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
144 pipeline_mng->getOpDomainLhsPipeline().push_back(
146 pipeline_mng->getOpDomainLhsPipeline().push_back(
148 pipeline_mng->getOpDomainLhsPipeline().push_back(
150 pipeline_mng->getOpDomainLhsPipeline().push_back(
152 pipeline_mng->getOpDomainLhsPipeline().push_back(
158 pipeline_mng->getOpDomainRhsPipeline().push_back(
164 pipeline_mng->getOpBoundaryLhsPipeline().push_back(
166 pipeline_mng->getOpBoundaryLhsPipeline().push_back(
172 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
◆ boundaryCondition()
Definition at line 93 of file poisson_2d_lagrange_multiplier.cpp.
97 auto get_ents_on_mesh = [&]() {
98 Range boundary_entities;
100 std::string entity_name = it->getName();
101 if (entity_name.compare(0, 18,
"BOUNDARY_CONDITION") == 0) {
103 boundary_entities,
true);
107 Range boundary_vertices;
109 boundary_vertices,
true);
110 boundary_entities.merge(boundary_vertices);
115 return boundary_entities;
118 auto mark_boundary_dofs = [&](
Range &&skin_edges) {
120 auto marker_ptr = boost::make_shared<std::vector<unsigned char>>();
122 skin_edges, *marker_ptr);
◆ boundaryFunction()
◆ outputResults()
Definition at line 249 of file poisson_2d_lagrange_multiplier.cpp.
254 pipeline_mng->getBoundaryLhsFE().reset();
256 auto d_ptr = boost::make_shared<VectorDouble>();
257 auto l_ptr = boost::make_shared<VectorDouble>();
261 auto post_proc_domain_fe = boost::make_shared<PostProcFaceEle>(
mField);
262 post_proc_domain_fe->getOpPtrVector().push_back(
264 post_proc_domain_fe->getOpPtrVector().push_back(
265 new OpPPMap(post_proc_domain_fe->getPostProcMesh(),
266 post_proc_domain_fe->getMapGaussPts(), {{domainField, d_ptr}},
268 pipeline_mng->getDomainRhsFE() = post_proc_domain_fe;
270 auto post_proc_boundary_fe = boost::make_shared<PostProcEdgeEle>(
mField);
271 post_proc_boundary_fe->getOpPtrVector().push_back(
273 post_proc_boundary_fe->getOpPtrVector().push_back(
274 new OpPPMap(post_proc_boundary_fe->getPostProcMesh(),
275 post_proc_boundary_fe->getMapGaussPts(),
276 {{boundaryField, l_ptr}}, {}, {}, {}));
277 pipeline_mng->getBoundaryRhsFE() = post_proc_boundary_fe;
279 CHKERR pipeline_mng->loopFiniteElements();
280 CHKERR post_proc_domain_fe->writeFile(
"out_result_domain.h5m");
281 CHKERR post_proc_boundary_fe->writeFile(
"out_result_boundary.h5m");
◆ readMesh()
◆ runProgram()
◆ setIntegrationRules()
Definition at line 179 of file poisson_2d_lagrange_multiplier.cpp.
184 auto domain_rule_lhs = [](
int,
int,
int p) ->
int {
return 2 * (p - 1); };
185 auto domain_rule_rhs = [](
int,
int,
int p) ->
int {
return 2 * (p - 1); };
186 CHKERR pipeline_mng->setDomainLhsIntegrationRule(domain_rule_lhs);
187 CHKERR pipeline_mng->setDomainRhsIntegrationRule(domain_rule_rhs);
189 auto boundary_rule_lhs = [](
int,
int,
int p) ->
int {
return 2 * p; };
190 auto boundary_rule_rhs = [](
int,
int,
int p) ->
int {
return 2 * p; };
191 CHKERR pipeline_mng->setBoundaryLhsIntegrationRule(boundary_rule_lhs);
192 CHKERR pipeline_mng->setBoundaryLhsIntegrationRule(boundary_rule_rhs);
◆ setupProblem()
◆ solveSystem()
Definition at line 197 of file poisson_2d_lagrange_multiplier.cpp.
202 auto ksp_solver = pipeline_mng->
createKSP();
203 CHKERR KSPSetFromOptions(ksp_solver);
213 CHKERR KSPGetPC(ksp_solver, &pc);
214 PetscBool is_pcfs = PETSC_FALSE;
215 PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
220 if (is_pcfs == PETSC_TRUE) {
221 IS is_domain, is_boundary;
222 cerr <<
"Running FIELDSPLIT..." << endl;
230 CHKERR PCFieldSplitSetIS(pc, NULL, is_boundary);
232 CHKERR ISDestroy(&is_boundary);
236 CHKERR KSPSetUp(ksp_solver);
242 CHKERR VecGhostUpdateBegin(
D, INSERT_VALUES, SCATTER_FORWARD);
243 CHKERR VecGhostUpdateEnd(
D, INSERT_VALUES, SCATTER_FORWARD);
◆ sourceTermFunction()
◆ boundaryEntitiesForFieldsplit
Range Poisson2DLagrangeMultiplier::boundaryEntitiesForFieldsplit |
|
private |
◆ boundaryField
std::string Poisson2DLagrangeMultiplier::boundaryField |
|
private |
◆ boundaryMarker
boost::shared_ptr<std::vector<unsigned char> > Poisson2DLagrangeMultiplier::boundaryMarker |
|
private |
◆ domainField
std::string Poisson2DLagrangeMultiplier::domainField |
|
private |
◆ mField
◆ oRder
int Poisson2DLagrangeMultiplier::oRder |
|
private |
◆ simpleInterface
Simple* Poisson2DLagrangeMultiplier::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.
static double sourceTermFunction(const double x, const double y, const double z)
Problem manager is used to build and partition problems.
MoFEMErrorCode assembleSystem()
std::string boundaryField
MoFEMErrorCode solveSystem()
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 getOptions()
get options
MoFEMErrorCode getDM(DM *dm)
Get DM.
#define CHKERR
Inline error check.
auto createDMVector(DM dm)
Get smart vector from DM.
virtual moab::Interface & get_moab()=0
MoFEMErrorCode readMesh()
MoFEMErrorCode outputResults()
MoFEMErrorCode setIntegrationRules()
Section manager is used to create indexes and sections.
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
Range boundaryEntitiesForFieldsplit
static double boundaryFunction(const double x, const double y, const double z)
MoFEMErrorCode boundaryCondition()
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.
Modify integration weights on face to take in account higher-order geometry.
MoFEMErrorCode markDofs(const std::string problem_name, RowColData rc, const enum MarkOP op, const Range ents, std::vector< unsigned char > &marker) const
Create vector with marked indices.
MoFEMErrorCode setupProblem()
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
MoFEMErrorCode setFieldOrder(const std::string field_name, const int order, const Range *ents=NULL)
Set field order.
boost::shared_ptr< FEMethod > & getDomainLhsFE()
SmartPetscObj< Vec > vectorDuplicate(Vec vec)
Create duplicate vector of smart vector.
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
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.
const double D
diffusivity
keeps basic data about problem
MoFEMErrorCode setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
MoFEM::Interface & mField
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 ...
boost::shared_ptr< std::vector< unsigned char > > boundaryMarker
Post post-proc data at points from hash maps.