45 {
46
48
49 try {
50
51 enum bases { AINSWORTH, DEMKOWICZ,
LASTOP };
52
53 const char *list[] = {"ainsworth", "demkowicz"};
54
55 PetscBool flg;
56 PetscInt choise_value = AINSWORTH;
58 &choise_value, &flg);
59 if (flg != PETSC_TRUE) {
61 }
62
63 PetscBool ho_geometry = PETSC_FALSE;
65 PETSC_NULL);
66
67 DMType dm_name = "DMMOFEM";
69
70
71 moab::Core mb_instance;
72 moab::Interface &moab = mb_instance;
73
74
77
82
83
84 switch (choise_value) {
85 case AINSWORTH:
90 break;
91 case DEMKOWICZ:
96 break;
97 }
98
99 if (ho_geometry == PETSC_TRUE)
102
103 constexpr int order = 3;
105
106
107
108
109 if (ho_geometry == PETSC_TRUE)
112
116
119
120 auto material_grad_mat = boost::make_shared<MatrixDouble>();
121 auto material_det_vec = boost::make_shared<VectorDouble>();
122 auto material_inv_grad_mat = boost::make_shared<MatrixDouble>();
123 auto jac_ptr = boost::make_shared<MatrixDouble>();
124 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
125 auto det_ptr = boost::make_shared<VectorDouble>();
126
127 boost::dynamic_pointer_cast<VolumeElementForcesAndSourcesCore>(
128 pipeline_mng->getDomainRhsFE())
129 ->meshPositionsFieldName = "none";
130 boost::dynamic_pointer_cast<PipelineManager::FaceEle>(
131 pipeline_mng->getBoundaryRhsFE())
132 ->meshPositionsFieldName = "none";
133
134 pipeline_mng->getOpDomainRhsPipeline().push_back(
136 pipeline_mng->getOpDomainRhsPipeline().push_back(
138 pipeline_mng->getOpDomainRhsPipeline().push_back(
140 pipeline_mng->getOpDomainRhsPipeline().push_back(
142 pipeline_mng->getOpDomainRhsPipeline().push_back(
144
145 if (ho_geometry) {
146 pipeline_mng->getOpDomainRhsPipeline().push_back(
148 material_grad_mat));
150 material_grad_mat, material_det_vec, material_inv_grad_mat));
151 pipeline_mng->getOpDomainRhsPipeline().push_back(
153 pipeline_mng->getOpDomainRhsPipeline().push_back(
155 pipeline_mng->getOpDomainRhsPipeline().push_back(
157 }
158 pipeline_mng->getOpDomainRhsPipeline().push_back(
new OpVolCurl(t_curl_vol));
159
161 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
163 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
165 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
167
171
172
173 if (ho_geometry == PETSC_TRUE) {
176 }
177
178
179 CHKERR pipeline_mng->loopFiniteElements();
180
181 std::cout.precision(12);
182
183 t_curl_vol(
i) -= t_curl_skin(
i);
184 double nrm2 = sqrt(t_curl_vol(
i) * t_curl_vol(
i));
185
186 constexpr double eps = 1e-8;
187 if (fabs(nrm2) >
eps)
189 "Curl operator not passed test\n");
190 }
192
194}
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
@ HCURL
field with continuous tangents
@ 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
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.
FTensor::Index< 'i', SPACE_DIM > i
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)
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.
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
Calculate normals at Gauss points of triangle element.
transform local reference derivatives of shape function to global derivatives if higher order geometr...
Set inverse jacobian to base functions.
PipelineManager interface.
Projection of edge entities with one mid-node on hierarchical basis.
Simple interface for fast problem set-up.
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 field on domain.
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 getOptions()
get options
MoFEMErrorCode loadFile(const std::string options, const std::string mesh_file_name)
Load mesh file.
MoFEMErrorCode setFieldOrder(const std::string field_name, const int order, const Range *ents=NULL)
Set field order.
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 setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.