![Logo](MoFEMLogo.png) |
| v0.14.0
|
- Examples
- mixed_poisson.cpp.
Definition at line 31 of file mixed_poisson.cpp.
◆ MixedPoisson()
◆ analyticalFunction()
◆ analyticalFunctionGrad()
static VectorDouble MixedPoisson::analyticalFunctionGrad |
( |
const double |
x, |
|
|
const double |
y, |
|
|
const double |
z |
|
) |
| |
|
inlinestaticprivate |
[Analytical function]
[Analytical function gradient]
- Examples
- mixed_poisson.cpp.
Definition at line 56 of file mixed_poisson.cpp.
60 res[0] = -exp(-100. * (
sqr(x) +
sqr(y))) *
61 (200. * x * cos(M_PI * x) + M_PI * sin(M_PI * x)) * cos(M_PI * y);
62 res[1] = -exp(-100. * (
sqr(x) +
sqr(y))) *
63 (200. * y * cos(M_PI * y) + M_PI * sin(M_PI * y)) * cos(M_PI * x);
◆ assembleSystem()
[Create common data]
[Assemble system]
- Examples
- mixed_poisson.cpp.
Definition at line 239 of file mixed_poisson.cpp.
252 auto unity = []() {
return 1; };
254 new OpHdivU(
"Q",
"U", unity,
true));
255 auto source = [&](
const double x,
const double y,
const double z) {
◆ checkError()
[Solve and refine loop]
[Check error]
- Examples
- mixed_poisson.cpp.
Definition at line 371 of file mixed_poisson.cpp.
407 <<
"Global error indicator (max): " <<
commonDataPtr->maxErrorIndicator;
409 <<
"Global error indicator (total): "
412 <<
"Global error L2 norm: "
415 <<
"Global error H1 seminorm: "
421 std::vector<Tag> tag_handles;
422 tag_handles.resize(4);
430 ParallelComm *pcomm =
435 tag_handles.push_back(pcomm->part_tag());
436 std::ostringstream strm;
437 strm <<
"error_" << iter_num <<
".h5m";
439 "PARALLEL=WRITE_PART", 0, 0,
440 tag_handles.data(), tag_handles.size());
◆ createCommonData()
◆ getTagHandle()
[Source function]
- Examples
- mixed_poisson.cpp.
Definition at line 79 of file mixed_poisson.cpp.
84 double double_val = 0;
88 name, 1,
type, tag_handle, MB_TAG_CREAT | MB_TAG_SPARSE, &int_val);
92 name, 1,
type, tag_handle, MB_TAG_CREAT | MB_TAG_SPARSE, &double_val);
96 "Wrong data type %d for tag",
type);
◆ outputResults()
[Check error]
[Output results]
- Examples
- mixed_poisson.cpp.
Definition at line 446 of file mixed_poisson.cpp.
453 auto post_proc_fe = boost::make_shared<PostProcEle>(
mField);
457 auto u_ptr = boost::make_shared<VectorDouble>();
458 auto flux_ptr = boost::make_shared<MatrixDouble>();
459 post_proc_fe->getOpPtrVector().push_back(
461 post_proc_fe->getOpPtrVector().push_back(
466 post_proc_fe->getOpPtrVector().push_back(
468 new OpPPMap(post_proc_fe->getPostProcMesh(),
469 post_proc_fe->getMapGaussPts(),
486 std::ostringstream strm;
487 strm <<
"out_" << iter_num <<
".h5m";
488 CHKERR post_proc_fe->writeFile(strm.str().c_str());
◆ readMesh()
◆ refineOrder()
[Solve]
[Refine]
- Examples
- mixed_poisson.cpp.
Definition at line 286 of file mixed_poisson.cpp.
288 Tag th_error_ind, th_order;
292 std::vector<Range> refinement_levels;
293 refinement_levels.resize(iter_num + 1);
295 double err_indic = 0;
298 int order, new_order;
300 new_order =
order + 1;
303 refined_ents.insert(ent);
306 moab::Interface::UNION);
307 refined_ents.merge(adj);
308 refinement_levels[new_order -
initOrder].merge(refined_ents);
313 for (
int ll = 1; ll < refinement_levels.size(); ll++) {
315 refinement_levels[ll]);
319 <<
"setting approximation order higher than 8 is not currently "
◆ runProblem()
◆ setIntegrationRules()
◆ setupProblem()
◆ solveRefineLoop()
◆ solveSystem()
◆ sourceFunction()
[Analytical function gradient]
[Source function]
Definition at line 69 of file mixed_poisson.cpp.
70 return -exp(-100. * (
sqr(x) +
sqr(y))) *
72 (x * cos(M_PI * y) * sin(M_PI * x) +
73 y * cos(M_PI * x) * sin(M_PI * y)) +
74 2. * (20000. * (
sqr(x) +
sqr(y)) - 200. -
sqr(M_PI)) *
75 cos(M_PI * x) * cos(M_PI * y));
◆ commonDataPtr
boost::shared_ptr<CommonData> MixedPoisson::commonDataPtr |
|
private |
◆ domainEntities
Range MixedPoisson::domainEntities |
|
private |
◆ indicTolerance
double MixedPoisson::indicTolerance |
|
private |
◆ initOrder
int MixedPoisson::initOrder |
|
private |
◆ maxErrorIndicator
double MixedPoisson::maxErrorIndicator |
|
private |
◆ mField
◆ simpleInterface
Simple* MixedPoisson::simpleInterface |
|
private |
◆ thetaParam
double MixedPoisson::thetaParam |
|
private |
◆ totErrorIndicator
double MixedPoisson::totErrorIndicator |
|
private |
The documentation for this struct was generated from the following file:
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
boost::shared_ptr< FEMethod > & getDomainRhsFE()
#define MYPCOMM_INDEX
default communicator number PCOMM
Problem manager is used to build and partition problems.
std::map< std::string, boost::shared_ptr< VectorDouble > > DataMapVec
virtual MPI_Comm & get_comm() const =0
@ L2
field with C-1 continuity
MoFEMErrorCode loopFiniteElements(SmartPetscObj< DM > dm=nullptr)
Iterate finite elements.
boost::ptr_deque< UserDataOperator > & getOpDomainRhsPipeline()
Get the Op Domain Rhs Pipeline object.
virtual int get_comm_rank() const =0
MoFEMErrorCode loadFile(const std::string options, const std::string mesh_file_name, LoadFileFunc loadFunc=defaultLoadFileFunc)
Load mesh file.
PipelineManager interface.
PetscErrorCode DMSetUp_MoFEM(DM dm)
MoFEMErrorCode readMesh()
[Run programme]
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
MoFEMErrorCode outputResults(int iter_num=0)
[Check error]
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
MoFEMErrorCode getOptions()
get options
MoFEM::Interface & mField
boost::shared_ptr< CommonData > commonDataPtr
MoFEMErrorCode getDM(DM *dm)
Get DM.
#define CHKERR
Inline error check.
auto createDMVector(DM dm)
Get smart vector from DM.
auto createGhostVector(MPI_Comm comm, PetscInt n, PetscInt N, PetscInt nghost, const PetscInt ghosts[])
Create smart ghost vector.
virtual moab::Interface & get_moab()=0
static double sourceFunction(const double x, const double y, const double z)
[Analytical function gradient]
MoFEMErrorCode refineOrder(int iter_num=0)
[Solve]
MoFEMErrorCode setupProblem()
[Read mesh]
MoFEMErrorCode setIntegrationRules()
[Set up problem]
PetscErrorCode PetscOptionsGetReal(PetscOptions *, const char pre[], const char name[], PetscReal *dval, PetscBool *set)
virtual MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)=0
Build finite elements.
MoFEMErrorCode solveSystem()
[Assemble system]
Get vector field for H-div approximation.
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
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 setDomainRhsIntegrationRule(RuleHookFun rule)
@ MOFEM_OPERATION_UNSUCCESSFUL
boost::ptr_deque< UserDataOperator > & getOpDomainLhsPipeline()
Get the Op Domain Lhs Pipeline object.
std::map< std::string, boost::shared_ptr< MatrixDouble > > DataMapMat
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.
MoFEMErrorCode setDomainLhsIntegrationRule(RuleHookFun rule)
boost::shared_ptr< FEMethod > & getDomainLhsFE()
#define MOFEM_LOG(channel, severity)
Log.
SmartPetscObj< Vec > vectorDuplicate(Vec vec)
Create duplicate vector of smart vector.
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 3, 2 > OpHdivHdiv
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMixDivTimesScalar< 2 > OpHdivU
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
@ HCURL
field with continuous tangents
@ MOFEM_DATA_INCONSISTENCY
BitRefLevel & getBitRefLevel()
Get the BitRefLevel.
MoFEMErrorCode solveRefineLoop()
[Refine]
virtual MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)=0
MoFEMErrorCode checkError(int iter_num=0)
[Solve and refine loop]
UBlasVector< double > VectorDouble
const double D
diffusivity
virtual MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
build adjacencies
virtual MoFEMErrorCode set_field_order(const EntityHandle meshset, const EntityType type, const std::string &name, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)=0
Set order approximation of the entities in the field.
MoFEMErrorCode assembleSystem()
[Create common data]
MoFEMErrorCode setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
MoFEMErrorCode createCommonData()
[Set integration rule]
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, 1 > OpDomainSource
#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 ...
static MoFEMErrorCode getTagHandle(MoFEM::Interface &m_field, const char *name, DataType type, Tag &tag_handle)
[Source function]
Post post-proc data at points from hash maps.