Definition at line 24 of file standard_poisson.cpp.
◆ StandardPoisson()
◆ analyticalFunction()
[Analytical function]
Definition at line 44 of file standard_poisson.cpp.
45 {
46 return exp(-100. * (
sqr(x) +
sqr(y))) * cos(M_PI * x) * cos(M_PI * y);
47 }
◆ analyticalFunctionGrad()
[Analytical function]
[Analytical function gradient]
Definition at line 51 of file standard_poisson.cpp.
52 {
54 res.resize(2);
55 res[0] = -exp(-100. * (
sqr(x) +
sqr(y))) *
56 (200. * x * cos(M_PI * x) + M_PI * sin(M_PI * x)) * cos(M_PI * y);
57 res[1] = -exp(-100. * (
sqr(x) +
sqr(y))) *
58 (200. * y * cos(M_PI * y) + M_PI * sin(M_PI * y)) * cos(M_PI * x);
59 return res;
60 }
◆ assembleSystem()
[Create common data]
Definition at line 175 of file standard_poisson.cpp.
175 {
177
179
180 {
181
184 pipeline_mng->getOpDomainLhsPipeline().push_back(
186 }
187
188 {
189
190 pipeline_mng->getOpDomainRhsPipeline().push_back(
192 }
193
195}
#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.
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGrad< 1, 1, SPACE_DIM > OpDomainGradGrad
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, 1 > OpDomainSource
Add operators pushing bases from local to physical configuration.
PipelineManager interface.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
static double sourceFunction(const double x, const double y, const double z)
[Analytical function gradient]
◆ boundaryCondition()
Definition at line 144 of file standard_poisson.cpp.
144 {
146
148
149
150
153 true);
154
156}
MoFEMErrorCode removeBlockDOFsOnEntities(const std::string problem_name, const std::string block_name, const std::string field_name, int lo, int hi, bool get_low_dim_ents=true, bool is_distributed_mesh=true)
Remove DOFs from problem based on block entities.
Boundary condition manager for finite element problem setup.
Template specialization for scalar field boundary conditions.
const std::string getProblemName() const
Get the Problem Name.
◆ checkError()
[Check error]
Definition at line 242 of file standard_poisson.cpp.
242 {
245
247 {H1});
248
256
258
260
263 const double *array;
266 << "Global error L2 norm: " << std::sqrt(array[0]);
268 << "Global error H1 seminorm: " << std::sqrt(array[1]);
270
272}
boost::ptr_deque< UserDataOperator > & getOpDomainPostProcPipeline()
Get the Op Domain PostProc Pipeline object.
MoFEMErrorCode loopFiniteElementsPostProc(SmartPetscObj< DM > dm=nullptr)
Iterate postprocessing finite elements.
#define MOFEM_LOG(channel, severity)
Log.
Get field gradients at integration pts for scalar field rank 0, i.e. vector field.
Specialization for double precision scalar field values calculation.
boost::shared_ptr< CommonData > commonDataPtr
◆ createCommonData()
[Create common data]
Definition at line 159 of file standard_poisson.cpp.
159 {
162 PetscInt ghosts[2] = {0, 1};
166 else
169 commonDataPtr->approxVals = boost::make_shared<VectorDouble>();
170 commonDataPtr->approxValsGrad = boost::make_shared<MatrixDouble>();
172}
auto createGhostVector(MPI_Comm comm, PetscInt n, PetscInt N, PetscInt nghost, const PetscInt ghosts[])
Create smart ghost vector.
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
◆ outputResults()
[Check error]
Definition at line 275 of file standard_poisson.cpp.
275 {
277
279
281
282 auto post_proc_fe = boost::make_shared<PostProcFaceEle>(
mField);
283
285
286 post_proc_fe->getOpPtrVector().push_back(
288 post_proc_fe->getOpPtrVector().push_back(
291
292 post_proc_fe->getOpPtrVector().push_back(
new OpPPMap(
293 post_proc_fe->getPostProcMesh(), post_proc_fe->getMapGaussPts(),
294 {{domainField, commonDataPtr->approxVals}},
296 pipeline_mng->getDomainPostProcFE() = post_proc_fe;
297
298 CHKERR pipeline_mng->loopFiniteElementsPostProc();
299 CHKERR post_proc_fe->writeFile(
"out_result.h5m");
300
302}
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
Post post-proc data at points from hash maps.
◆ readMesh()
Definition at line 117 of file standard_poisson.cpp.
117 {
119
123
125}
MoFEMErrorCode loadFile(const std::string options, const std::string mesh_file_name, LoadFileFunc loadFunc=defaultLoadFileFunc)
Load mesh file.
MoFEMErrorCode getOptions()
get options
◆ runProgram()
Definition at line 304 of file standard_poisson.cpp.
304 {
306
316
318}
MoFEMErrorCode outputResults()
[Check error]
MoFEMErrorCode setIntegrationRules()
MoFEMErrorCode createCommonData()
[Create common data]
MoFEMErrorCode checkError()
[Check error]
MoFEMErrorCode solveSystem()
MoFEMErrorCode assembleSystem()
[Create common data]
MoFEMErrorCode setupProblem()
MoFEMErrorCode boundaryCondition()
MoFEMErrorCode readMesh()
◆ setIntegrationRules()
Definition at line 197 of file standard_poisson.cpp.
197 {
199
201
202 auto domain_rule_lhs = [](
int,
int,
int p) ->
int {
return 2 * (p - 1); };
203 auto domain_rule_rhs = [](
int,
int,
int p) ->
int {
return 2 * (p - 1); };
205 CHKERR pipeline_mng->setDomainRhsIntegrationRule(domain_rule_rhs);
206
207 auto boundary_rule_lhs = [](
int,
int,
int p) ->
int {
return 2 * p; };
208 auto boundary_rule_rhs = [](
int,
int,
int p) ->
int {
return 2 * p; };
209 CHKERR pipeline_mng->setBoundaryLhsIntegrationRule(boundary_rule_lhs);
210 CHKERR pipeline_mng->setBoundaryLhsIntegrationRule(boundary_rule_rhs);
211
213}
MoFEMErrorCode setDomainLhsIntegrationRule(RuleHookFun rule)
Set integration rule for domain left-hand side finite element.
◆ setupProblem()
Definition at line 127 of file standard_poisson.cpp.
127 {
129
134
138
140
142}
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
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.
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.
MoFEMErrorCode setFieldOrder(const std::string field_name, const int order, const Range *ents=NULL)
Set field order.
MoFEMErrorCode setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
◆ solveSystem()
Definition at line 215 of file standard_poisson.cpp.
215 {
217
219
220 auto ksp_solver = pipeline_mng->
createKSP();
221 CHKERR KSPSetFromOptions(ksp_solver);
222
223
227
228 CHKERR KSPSetUp(ksp_solver);
229
230
232
233
234 CHKERR VecGhostUpdateBegin(
D, INSERT_VALUES, SCATTER_FORWARD);
235 CHKERR VecGhostUpdateEnd(
D, INSERT_VALUES, SCATTER_FORWARD);
237
239}
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode, RowColData rc=RowColData::COL)
set local (or ghosted) vector values on mesh for partition only
auto createDMVector(DM dm, RowColData rc=RowColData::COL)
Get smart vector from DM.
SmartPetscObj< KSP > createKSP(SmartPetscObj< DM > dm=nullptr)
Create KSP (linear) solver.
SmartPetscObj< Vec > vectorDuplicate(Vec vec)
Create duplicate vector of smart vector.
MoFEMErrorCode getDM(DM *dm)
Get DM.
◆ sourceFunction()
[Analytical function gradient]
[Source function]
Definition at line 64 of file standard_poisson.cpp.
64 {
65 return -exp(-100. * (
sqr(x) +
sqr(y))) *
66 (400. * M_PI *
67 (x * cos(M_PI * y) * sin(M_PI * x) +
68 y * cos(M_PI * x) * sin(M_PI * y)) +
69 2. * (20000. * (
sqr(x) +
sqr(y)) - 200. -
sqr(M_PI)) *
70 cos(M_PI * x) * cos(M_PI * y));
71 }
◆ boundaryEntitiesForFieldsplit
| Range StandardPoisson::boundaryEntitiesForFieldsplit |
|
private |
◆ boundaryMarker
| boost::shared_ptr<std::vector<unsigned char> > StandardPoisson::boundaryMarker |
|
private |
◆ commonDataPtr
| boost::shared_ptr<CommonData> StandardPoisson::commonDataPtr |
|
private |
◆ domainField
| std::string StandardPoisson::domainField |
|
private |
◆ mField
◆ oRder
| int StandardPoisson::oRder |
|
private |
◆ simpleInterface
| Simple* StandardPoisson::simpleInterface |
|
private |
The documentation for this struct was generated from the following file: