v0.10.0
best_approximation.cpp
Go to the documentation of this file.
1 /** \file best_approximation.cpp
2  \ingroup mofem_helmholtz_elem
3 
4  Calculates best approximation for incident wave problem.
5 
6  */
7 
8 /* This file is part of MoFEM.
9  * MoFEM is free software: you can redistribute it and/or modify it under
10  * the terms of the GNU Lesser General Public License as published by the
11  * Free Software Foundation, either version 3 of the License, or (at your
12  * option) any later version.
13 
14  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17  * License for more details.
18 
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #include <MoFEM.hpp>
24 using namespace MoFEM;
26 
27 #include <boost/numeric/ublas/vector_proxy.hpp>
28 #include <FieldApproximation.hpp>
29 #include <PostProcOnRefMesh.hpp>
30 #include <petsctime.h>
31 #include <fstream>
32 #include <iostream>
33 
34 #include <stdexcept>
35 #include <cmath>
36 #include <boost/math/special_functions.hpp>
37 #include <complex>
38 
39 using namespace std;
40 using namespace boost::math;
41 
42 #include <AnalyticalSolutions.hpp>
43 
44 static char help[] = "...\n\n";
45 
46 // argc = argument counts, argv = argument vectors
47 int main(int argc, char *argv[]) {
48 
49  ErrorCode rval;
50  PetscErrorCode ierr;
51 
52  PetscInitialize(&argc,&argv,(char *)0,help);
53 
54  moab::Core mb_instance;
55  moab::Interface& moab = mb_instance;
56  int rank;
57  MPI_Comm_rank(PETSC_COMM_WORLD,&rank);
58 
59  PetscBool flg = PETSC_TRUE;
60  char mesh_file_name[255];
61  ierr = PetscOptionsGetString(PETSC_NULL,PETSC_NULL,"-my_file",mesh_file_name,255,&flg); CHKERRQ(ierr);
62  if(flg != PETSC_TRUE) {
63  SETERRQ(PETSC_COMM_SELF,MOFEM_INVALID_DATA,"*** ERROR -my_file (MESH FILE NEEDED)");
64  }
65 
66  ParallelComm* pcomm = ParallelComm::get_pcomm(&moab,MYPCOMM_INDEX);
67  if(pcomm == NULL) pcomm = new ParallelComm(&moab,PETSC_COMM_WORLD);
68 
69  PetscBool is_partitioned = PETSC_FALSE;
70  ierr = PetscOptionsGetBool(PETSC_NULL,PETSC_NULL,"-my_is_partitioned",&is_partitioned,&flg); CHKERRQ(ierr);
71  if(is_partitioned == PETSC_TRUE) {
72  //Read mesh to MOAB
73  const char *option;
74  option = "PARALLEL=BCAST_DELETE;PARALLEL_RESOLVE_SHARED_ENTS;PARTITION=PARALLEL_PARTITION;";
75  rval = moab.load_file(mesh_file_name, 0, option); CHKERRQ_MOAB(rval);
76  } else {
77  const char *option;
78  option = "";
79  rval = moab.load_file(mesh_file_name, 0, option); CHKERRQ_MOAB(rval);
80  }
81 
82  PetscBool is_lobatto = PETSC_TRUE;
83  // enum approxBase {AINSWORTH_LEGENDRE_BASE, AINSWORTH_LOBATTO_BASE};
84  // approxBase approx_base = AINSWORTH_LOBATTO_BASE;
85  // int approx_base = AINSWORTH_LOBATTO_BASE;
86  ierr = PetscOptionsGetBool(PETSC_NULL,PETSC_NULL,"-lobatto",&is_lobatto,NULL); CHKERRQ(ierr);
87  // if(is_lobatto != PETSC_TRUE) {
88  // approx_base = "AINSWORTH_LEGENDRE_BASE";
89  // }
90 
91  // create MoFEM database
92  MoFEM::Core core(moab);
93  MoFEM::Interface& m_field = core;
94 
95  // count the comsumption of time by single run
96  PetscLogDouble t1,t2;
97  PetscLogDouble v1,v2;
98  ierr = PetscTime(&v1); CHKERRQ(ierr);
99  ierr = PetscGetCPUTime(&t1); CHKERRQ(ierr);
100 
101  // set entitities bit level
102  BitRefLevel bit_level0;
103  bit_level0.set(0);
104  EntityHandle meshset_level0;
105  rval = moab.create_meshset(MESHSET_SET,meshset_level0); CHKERRQ_MOAB(rval);
106  ierr = m_field.seed_ref_level_3D(0,bit_level0); CHKERRQ(ierr);
107 
108  // define fields
109  if(is_lobatto) {
110  ierr = m_field.add_field("reEX",H1,AINSWORTH_LOBATTO_BASE,1,MB_TAG_SPARSE,MF_ZERO); CHKERRQ(ierr);
111  ierr = m_field.add_field("imEX",H1,AINSWORTH_LOBATTO_BASE,1,MB_TAG_SPARSE,MF_ZERO); CHKERRQ(ierr);
112  } else {
113  ierr = m_field.add_field("reEX",H1,AINSWORTH_LEGENDRE_BASE,1,MB_TAG_SPARSE,MF_ZERO); CHKERRQ(ierr);
114  ierr = m_field.add_field("imEX",H1,AINSWORTH_LEGENDRE_BASE,1,MB_TAG_SPARSE,MF_ZERO); CHKERRQ(ierr);
115  }
116  ierr = m_field.add_field("MESH_NODE_POSITIONS",H1,AINSWORTH_LEGENDRE_BASE,3,MB_TAG_SPARSE,MF_ZERO); CHKERRQ(ierr);
117 
118  // define finite element
119  ierr = m_field.add_finite_element("FE1"); CHKERRQ(ierr);
120 
121  // Define rows/cols and element data
122  ierr = m_field.modify_finite_element_add_field_row("FE1","reEX"); CHKERRQ(ierr);
123  ierr = m_field.modify_finite_element_add_field_col("FE1","reEX"); CHKERRQ(ierr);
124  ierr = m_field.modify_finite_element_add_field_data("FE1","reEX"); CHKERRQ(ierr);
125  ierr = m_field.modify_finite_element_add_field_data("FE1","imEX"); CHKERRQ(ierr);
126  ierr = m_field.modify_finite_element_add_field_data("FE1","MESH_NODE_POSITIONS"); CHKERRQ(ierr);
127 
128  if(m_field.check_field("rePRES") && m_field.check_field("imPRES")) {
129 
130  ierr = m_field.modify_finite_element_add_field_data("FE1","rePRES"); CHKERRQ(ierr);
131  ierr = m_field.modify_finite_element_add_field_data("FE1","imPRES"); CHKERRQ(ierr);
132 
133  }
134 
135  // meshset consisting all entities in mesh
136  EntityHandle root_set = moab.get_root_set();
137  // add entities to field
138  ierr = m_field.add_ents_to_field_by_TETs(root_set,"reEX"); CHKERRQ(ierr);
139  ierr = m_field.add_ents_to_field_by_TETs(root_set,"imEX"); CHKERRQ(ierr);
140  ierr = m_field.add_ents_to_field_by_TETs(root_set,"MESH_NODE_POSITIONS",2); CHKERRQ(ierr);
141  // add entities to finite element
142  ierr = m_field.add_ents_to_finite_element_by_type(root_set,MBTET,"FE1"); CHKERRQ(ierr);
143 
144  // set app. order
145  // see Hierarchic Finite Element Bases on Unstructured Tetrahedral Meshes (Mark Ainsworth & Joe Coyle)
146  int order = 3;
147  ierr = PetscOptionsGetInt(PETSC_NULL,PETSC_NULL,"-my_order",&order,&flg); CHKERRQ(ierr);
148  if(flg != PETSC_TRUE) {
149  order = 3;
150  }
151  ierr = m_field.set_field_order(root_set,MBTET,"reEX",order); CHKERRQ(ierr);
152  ierr = m_field.set_field_order(root_set,MBTRI,"reEX",order); CHKERRQ(ierr);
153  ierr = m_field.set_field_order(root_set,MBEDGE,"reEX",order); CHKERRQ(ierr);
154  ierr = m_field.set_field_order(root_set,MBVERTEX,"reEX",1); CHKERRQ(ierr);
155 
156  ierr = m_field.set_field_order(root_set,MBTET,"imEX",order); CHKERRQ(ierr);
157  ierr = m_field.set_field_order(root_set,MBTRI,"imEX",order); CHKERRQ(ierr);
158  ierr = m_field.set_field_order(root_set,MBEDGE,"imEX",order); CHKERRQ(ierr);
159  ierr = m_field.set_field_order(root_set,MBVERTEX,"imEX",1); CHKERRQ(ierr);
160 
161  ierr = m_field.set_field_order(root_set,MBTET,"MESH_NODE_POSITIONS",2); CHKERRQ(ierr);
162  ierr = m_field.set_field_order(root_set,MBTRI,"MESH_NODE_POSITIONS",2); CHKERRQ(ierr);
163  ierr = m_field.set_field_order(root_set,MBEDGE,"MESH_NODE_POSITIONS",2); CHKERRQ(ierr);
164  ierr = m_field.set_field_order(root_set,MBVERTEX,"MESH_NODE_POSITIONS",1); CHKERRQ(ierr);
165 
166  // build field
167  ierr = m_field.build_fields(); CHKERRQ(ierr);
168  Projection10NodeCoordsOnField ent_method_material(m_field,"MESH_NODE_POSITIONS");
169  ierr = m_field.loop_dofs("MESH_NODE_POSITIONS",ent_method_material); CHKERRQ(ierr);
170  // build finite elemnts
171  ierr = m_field.build_finite_elements(); CHKERRQ(ierr);
172  // build adjacencies
173  ierr = m_field.build_adjacencies(bit_level0); CHKERRQ(ierr);
174 
175  // define problem
176  ierr = m_field.add_problem("EX1_PROBLEM"); CHKERRQ(ierr);
177  // set finite elements for problem
178  ierr = m_field.modify_problem_add_finite_element("EX1_PROBLEM","FE1"); CHKERRQ(ierr);
179  // set refinment level for problem
180  ierr = m_field.modify_problem_ref_level_add_bit("EX1_PROBLEM",bit_level0); CHKERRQ(ierr);
181 
182  // build porblems
183  if(is_partitioned) {
184  // if mesh is partitioned
185  ierr = m_field.build_problem_on_distributed_mesh("EX1_PROBLEM",true); CHKERRQ(ierr);
186  ierr = m_field.partition_finite_elements("EX1_PROBLEM",true); CHKERRQ(ierr);
187  } else {
188  // if not partitioned mesh is load to all processes
189  ierr = m_field.build_problem("EX1_PROBLEM",true); CHKERRQ(ierr);
190  ierr = m_field.partition_problem("EX1_PROBLEM"); CHKERRQ(ierr);
191  ierr = m_field.partition_finite_elements("EX1_PROBLEM"); CHKERRQ(ierr);
192  }
193  ierr = m_field.partition_ghost_dofs("EX1_PROBLEM"); CHKERRQ(ierr);
194 
195  PetscBool wavenumber_flg;
196  double wavenumber;
197  // set wave number from line command, that overwrite numbre form block set
198  ierr = PetscOptionsGetScalar(NULL,"-wave_number",&wavenumber,&wavenumber_flg); CHKERRQ(ierr);
199  if(!wavenumber_flg) {
200 
201  SETERRQ(PETSC_COMM_SELF,MOFEM_INVALID_DATA,"wave number not given, set in line command -wave_number to fix problem");
202 
203  }
204 
205  double power_of_incident_wave = 1;
206  ierr = PetscOptionsGetScalar(NULL,"-amplitude_of_incident_wave",&power_of_incident_wave,NULL); CHKERRQ(ierr);
207 
208  //wave direction unit vector=[x,y,z]^T
209  VectorDouble wave_direction;
210  wave_direction.resize(3);
211  wave_direction.clear();
212  wave_direction[2] = 1; // default:X direction [0,0,1]
213 
214  int nmax = 3;
215  ierr = PetscOptionsGetRealArray(PETSC_NULL,"-wave_direction",&wave_direction[0],&nmax,NULL); CHKERRQ(ierr);
216  if(nmax > 0 && nmax != 3) {
217  SETERRQ(PETSC_COMM_SELF,MOFEM_INVALID_DATA,"*** ERROR -wave_direction [3*1 vector] default:X direction [0,0,1]");
218  }
219 
220  PetscInt choise_value = 0;
221 
222  // set type of analytical solution
223  ierr = PetscOptionsGetEList(NULL,"-analytical_solution_type",analytical_solution_types,7,&choise_value,&flg); CHKERRQ(ierr);
224 
225  if(flg != PETSC_TRUE) {
226  SETERRQ(PETSC_COMM_SELF,1,"*** ERROR -analytical_solution_type needed, WARNING!!!!!!.");
227  }
228 
229  switch((AnalyticalSolutionTypes)choise_value) {
230 
232 
233  {
234 
235  double scattering_sphere_radius = 0.5;
236  ierr = PetscOptionsGetScalar(NULL,"-scattering_sphere_radius",&scattering_sphere_radius,NULL); CHKERRQ(ierr);
237 
238  HardSphereScatterWave function_evaluator(wavenumber,scattering_sphere_radius);
239  ierr = solve_problem(m_field,"EX1_PROBLEM","FE1","reEX","imEX",INSERT_VALUES,function_evaluator,is_partitioned); CHKERRQ(ierr);
240  }
241 
242  break;
243 
244 
246 
247  {
248  double scattering_sphere_radius = 0.5;
249  ierr = PetscOptionsGetScalar(NULL,"-scattering_sphere_radius",&scattering_sphere_radius,NULL); CHKERRQ(ierr);
250 
251  SoftSphereScatterWave function_evaluator(wavenumber,scattering_sphere_radius);
252  ierr = solve_problem(m_field,"EX1_PROBLEM","FE1","reEX","imEX",INSERT_VALUES,function_evaluator,is_partitioned); CHKERRQ(ierr);
253  }
254 
255  break;
256 
257  case PLANE_WAVE:
258 
259  {
260 
261  double angle = 0.25;
262  // set wave number from line command, that overwrite numbre form block set
263  ierr = PetscOptionsGetScalar(NULL,"-wave_guide_angle",&angle,NULL); CHKERRQ(ierr);
264 
265  PlaneWave function_evaluator(wavenumber,angle*M_PI);
266  ierr = solve_problem(m_field,"EX1_PROBLEM","FE1","reEX","imEX",INSERT_VALUES,function_evaluator,is_partitioned); CHKERRQ(ierr);
267  }
268 
269  break;
270 
272 
273  {
274  HardCylinderScatterWave function_evaluator(wavenumber);
275  ierr = solve_problem(m_field,"EX1_PROBLEM","FE1","reEX","imEX",INSERT_VALUES,function_evaluator,is_partitioned); CHKERRQ(ierr);
276  }
277 
278  break;
279 
281 
282  {
283  SoftCylinderScatterWave function_evaluator(wavenumber);
284  ierr = solve_problem(m_field,"EX1_PROBLEM","FE1","reEX","imEX",INSERT_VALUES,function_evaluator,is_partitioned); CHKERRQ(ierr);
285  }
286 
287  break;
288 
290 
291  {
292  SingularScatterWave function_evaluator(wavenumber);
293  ierr = solve_problem(m_field,"EX1_PROBLEM","FE1","reEX","imEX",INSERT_VALUES,function_evaluator,is_partitioned); CHKERRQ(ierr);
294  }
295 
296  break;
297 
298  case INCIDENT_WAVE:
299 
300  {
301  IncidentWave function_evaluator(wavenumber,wave_direction);
302  ierr = solve_problem(m_field,"EX1_PROBLEM","FE1","reEX","imEX",INSERT_VALUES,function_evaluator,is_partitioned); CHKERRQ(ierr);
303  }
304 
305  break;
306 
307  default:
308 
309  SETERRQ(PETSC_COMM_SELF,MOFEM_INVALID_DATA,"No analytical solution has been defined");
310 
311  }
312 
313  PetscBool add_incident_wave = PETSC_FALSE;
314  ierr = PetscOptionsGetBool(PETSC_NULL,NULL,"-add_incident_wave",&add_incident_wave,NULL); CHKERRQ(ierr);
315  if(add_incident_wave) {
316 
317  IncidentWave function_evaluator(wavenumber,wave_direction);
318  ierr = solve_problem(m_field,"EX1_PROBLEM","FE1","reEX","imEX",ADD_VALUES,function_evaluator,is_partitioned); CHKERRQ(ierr);
319 
320  }
321 
322  if(is_partitioned) {
323  rval = moab.write_file("best_solution.h5m","MOAB","PARALLEL=WRITE_PART"); CHKERRQ_MOAB(rval);
324  } else {
325  if(!pcomm->rank()) {
326  rval = moab.write_file("analytical_solution.h5m"); CHKERRQ_MOAB(rval);
327  }
328  }
329 
330  PetscBool save_postproc_mesh = PETSC_FALSE;
331  ierr = PetscOptionsGetBool(PETSC_NULL,NULL,"-save_postproc_mesh",&save_postproc_mesh,NULL); CHKERRQ(ierr);
332  if(save_postproc_mesh) {
333 
335  ierr = post_proc.generateReferenceElementMesh(); CHKERRQ(ierr);
336  ierr = post_proc.addFieldValuesPostProc("reEX"); CHKERRQ(ierr);
337  ierr = post_proc.addFieldValuesPostProc("imEX"); CHKERRQ(ierr);
338 
339  if(m_field.check_field("rePRES") && m_field.check_field("imPRES")) {
340  ierr = post_proc.addFieldValuesPostProc("rePRES"); CHKERRQ(ierr);
341  ierr = post_proc.addFieldValuesPostProc("imPRES"); CHKERRQ(ierr);
342  }
343 
344  ierr = post_proc.addFieldValuesPostProc("MESH_NODE_POSITIONS"); CHKERRQ(ierr);
345  ierr = m_field.loop_finite_elements("EX1_PROBLEM","FE1",post_proc); CHKERRQ(ierr);
346  ierr = post_proc.writeFile("best_solution_mesh_post_proc.h5m"); CHKERRQ(ierr);
347 
348  }
349 
350  // calculate total time
351  ierr = PetscTime(&v2);CHKERRQ(ierr);
352  ierr = PetscGetCPUTime(&t2);CHKERRQ(ierr);
353  PetscSynchronizedPrintf(PETSC_COMM_WORLD,"Total Rank %d Time = %f S CPU Time = %f S \n",pcomm->rank(),v2-v1,t2-t1);
354 
355  ierr = PetscFinalize(); CHKERRQ(ierr);
356 
357  return 0;
358 
359 }
#define CHKERRQ_MOAB(a)
check error code of MoAB function
Definition: definitions.h:523
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string &name_row)=0
set field col which finite element use
PetscErrorCode PetscOptionsGetRealArray(PetscOptions *, const char pre[], const char name[], PetscReal dval[], PetscInt *nmax, PetscBool *set)
virtual MoFEMErrorCode add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string &name, const bool recursive=true)=0
add entities to finite element
Deprecated interface functions.
virtual MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
build adjacencies
CoreTmp< 0 > Core
Definition: Core.hpp:1129
Calculate the analytical solution of impinging wave on cylinder.
Post-process fields on refined mesh.
auto post_proc
virtual MoFEMErrorCode modify_problem_add_finite_element(const std::string &name_problem, const std::string &fe_name)=0
add finite element to problem, this add entities assigned to finite element to a particular problem
virtual MoFEMErrorCode add_field(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_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add field.
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.
Calculate the analytical solution of impinging wave on cylinder.
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
char mesh_file_name[255]
Projection of edge entities with one mid-node on hierarchical basis.
int main(int argc, char *argv[])
DEPRECATED MoFEMErrorCode build_problem_on_distributed_mesh(const std::string &name, const bool square_matrix=true, int verb=-1)
build problem data structures, assuming that mesh is distributed (collective)
Calculate the analytical solution of plane wave guide propagating in direction theta.
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:85
PetscErrorCode solve_problem(MoFEM::Interface &m_field, const string &problem_name, const string &fe_name, const string &re_field, const string &im_field, InsertMode mode, FUNEVAL &fun_evaluator, PetscBool is_partitioned)
const char * analytical_solution_types[]
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
DEPRECATED MoFEMErrorCode partition_finite_elements(const std::string &name, bool part_from_moab=false, int low_proc=-1, int hi_proc=-1, int verb=-1)
partition finite elements
constexpr int order
PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
CHKERRQ(ierr)
static char help[]
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:152
DEPRECATED MoFEMErrorCode build_problem(const std::string &name, const bool square_matrix, int verb=-1)
build problem data structures
Post processing.
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.
virtual MoFEMErrorCode modify_problem_ref_level_add_bit(const std::string &name_problem, const BitRefLevel &bit)=0
add ref level to problem
DEPRECATED MoFEMErrorCode partition_problem(const std::string &name, int verb=-1)
partition problem dofs (collective)
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string &name_filed)=0
set finite element field data
AnalyticalSolutionTypes
#define MYPCOMM_INDEX
default communicator number PCOMM
Definition: definitions.h:292
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
DEPRECATED MoFEMErrorCode partition_ghost_dofs(const std::string &name, int verb=-1)
determine ghost nodes
virtual MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)=0
virtual MoFEMErrorCode add_problem(const std::string &name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add problem.
virtual bool check_field(const std::string &name) const =0
check if field is in database
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1943
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string &name_row)=0
set field row which finite element use
Core (interface) class.
Definition: Core.hpp:77
continuous field
Definition: definitions.h:177
ublas::vector< double, DoubleAllocator > VectorDouble
Definition: Types.hpp:74
DEPRECATED MoFEMErrorCode seed_ref_level_3D(const EntityHandle meshset, const BitRefLevel &bit, int verb=-1)
seed 2D entities in the meshset and their adjacencies (only TETs adjacencies) in a particular BitRefL...
DEPRECATED MoFEMErrorCode add_ents_to_field_by_TETs(const EntityHandle meshset, const std::string &name, int verb=-1)
set field entities from adjacencies of tetrahedronThe lower dimension entities are added depending on...
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
virtual MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)=0
Build finite elementsBuild finite element data structures. Have to be run before problem and adjacenc...
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)
DEPRECATED MoFEMErrorCode loop_finite_elements(const Problem *problem_ptr, const std::string &fe_name, FEMethod &method, int lower_rank, int upper_rank, MoFEMTypes bh, int verb=DEFAULT_VERBOSITY)