44 {
45
47
48 try {
49
50 enum bases { AINSWORTH, DEMKOWICZ, LASTOP };
51
52 const char *list[] = {"ainsworth", "demkowicz"};
53
54 PetscBool flg;
55 PetscInt choice_value = AINSWORTH;
57 &choice_value, &flg);
58 if (flg != PETSC_TRUE) {
60 }
61
62 PetscBool ho_geometry = PETSC_FALSE;
64 PETSC_NULLPTR);
65
66 PetscInt ho_choice_value = AINSWORTH;
68 &ho_choice_value, &flg);
69
70 DMType dm_name = "DMMOFEM";
72
73
74 moab::Core mb_instance;
75 moab::Interface &moab = mb_instance;
76
77
80
85
86
87 switch (choice_value) {
88 case AINSWORTH:
93 break;
94 case DEMKOWICZ:
99 break;
100 }
101
102 if (ho_geometry == PETSC_TRUE) {
103 switch (ho_choice_value) {
104 case AINSWORTH:
107 case DEMKOWICZ:
110 }
111 }
112
113 constexpr int order = 3;
115 if (ho_geometry == PETSC_TRUE)
118
122
123 double divergence_vol = 0;
124 double divergence_skin = 0;
125
128 {HDIV}, "MESH_NODE_POSITIONS");
130 {HDIV}, "MESH_NODE_POSITIONS");
131 } else {
133 {HDIV});
135 {HDIV});
136 }
137
138
139 pipeline_mng->getOpDomainRhsPipeline().push_back(
141
142 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
144
145
146 if (ho_geometry == PETSC_TRUE) {
149 }
150 CHKERR pipeline_mng->loopFiniteElements();
151
153 << "divergence_vol " << std::setprecision(12) << divergence_vol;
155 << "divergence_skin " << std::setprecision(12) << divergence_skin;
156
157 constexpr double eps = 1e-8;
158 const double error = divergence_skin - divergence_vol;
159 if (fabs(error) >
eps)
161 "invalid surface flux or divergence or both error = %3.4e",
162 error);
163 }
165
167}
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
@ HDIV
field with continuous normal traction
@ MOFEM_ATOM_TEST_INVALID
#define CHKERR
Inline error check.
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
virtual bool check_field(const std::string &name) const =0
check if field is in database
#define MOFEM_LOG(channel, severity)
Log.
virtual MoFEMErrorCode loop_dofs(const Problem *problem_ptr, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)=0
Make a loop over dofs.
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
Add operators pushing bases from local to physical configuration.
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Deprecated interface functions.
PipelineManager interface.
Projection of edge entities with one mid-node on hierarchical basis.
Simple interface for fast problem set-up.
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 loadFile(const std::string options, const std::string mesh_file_name, LoadFileFunc loadFunc=defaultLoadFileFunc)
Load mesh file.
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 getOptions()
get options
MoFEMErrorCode setFieldOrder(const std::string field_name, const int order, const Range *ents=NULL)
Set field order.
MoFEMErrorCode addDataField(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 data field.
MoFEMErrorCode setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.