v0.10.0
Functions | Variables
error_norm_obsolete.cpp File Reference
#include <MoFEM.hpp>
#include <PotsProcOnRefMesh.hpp>
#include <NormElement.hpp>
#include <Projection10NodeCoordsOnField.hpp>
#include <boost/numeric/ublas/vector_proxy.hpp>
#include <petsctime.h>
#include <boost/iostreams/tee.hpp>
#include <boost/iostreams/stream.hpp>
#include <fstream>
#include <iostream>
#include <stdexcept>

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Variables

static char help [] = "...\n\n"
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 48 of file error_norm_obsolete.cpp.

48  {
49 
50  ErrorCode rval;
51  PetscErrorCode ierr;
52 
53  PetscInitialize(&argc,&argv,(char *)0,help);
54 
55  moab::Core mb_instance;
56  Interface& moab = mb_instance;
57  int rank;
58  MPI_Comm_rank(PETSC_COMM_WORLD,&rank);
59 
60  //read h5m solution file into moab
61  bool usel2; //norm type
62  PetscBool flg = PETSC_TRUE;
63 
64  char mesh_file_name[255];
65  ierr = PetscOptionsGetString(PETSC_NULL,"-my_file",mesh_file_name,255,&flg); CHKERRQ(ierr);
66  if(flg != PETSC_TRUE) {
67  SETERRQ(PETSC_COMM_SELF,1,"*** ERROR -my_file (MESH FILE NEEDED)");
68  }
69 
70 
71  PetscBool userela = PETSC_FALSE;
72  ierr = PetscOptionsGetBool(NULL,"-relative_error",&userela,NULL); CHKERRQ(ierr);
73 
74  /* FIX ME, change to enum for better performance */
75  char type_error_norm[255];
76  ierr = PetscOptionsGetString(PETSC_NULL,"-norm_type",type_error_norm,255,&flg); CHKERRQ(ierr);
77  if(flg != PETSC_TRUE) {
78  SETERRQ(PETSC_COMM_SELF,1,"*** ERROR -type_error_norm (L2 or H1 type needed)");
79  }
80 
81  if (strcmp ("l2",type_error_norm ) == 0) {usel2 = true;}
82  else if(strcmp ("h1",type_error_norm ) == 0) {usel2 = false;}
83 
84  ParallelComm* pcomm = ParallelComm::get_pcomm(&moab,MYPCOMM_INDEX);
85  if(pcomm == NULL) pcomm = new ParallelComm(&moab,PETSC_COMM_WORLD);
86 
87  const char *option;
88  option = "";//"PARALLEL=BCAST;";//;DEBUG_IO";
89  BARRIER_RANK_START(pcomm)
90  /* load the mesh files */
91  rval = moab.load_file(mesh_file_name, 0, option); CHKERR_PETSC(rval);
92  //rval = moab.load_file(mesh_file_name2, 0, option); CHKERR_PETSC(rval);
93  BARRIER_RANK_END(pcomm)
94 
95  //Create MoFEM (Joseph) database
96  MoFEM::Core core(moab);
97  MoFEM::Interface& m_field = core;
98 
99  //count the comsumption of time by single run
100  PetscLogDouble t1,t2;
101  PetscLogDouble v1,v2;
102  ierr = PetscTime(&v1); CHKERRQ(ierr);
103  ierr = PetscGetCPUTime(&t1); CHKERRQ(ierr);
104 
105  //set entitities bit level
106  BitRefLevel bit_level0;
107  bit_level0.set(0);
108  EntityHandle meshset_level0;
109  rval = moab.create_meshset(MESHSET_SET,meshset_level0); CHKERR_PETSC(rval);
110  ierr = m_field.seed_ref_level_3D(0,bit_level0); CHKERRQ(ierr);
111 
112  //Fields
113  ierr = m_field.add_field("erorNORM_re",H1,1); CHKERRQ(ierr);
114  ierr = m_field.add_field("erorNORM_im",H1,1); CHKERRQ(ierr);
115 
116 
117  //Problem
118  ierr = m_field.add_problem("NORM_PROBLEM1"); CHKERRQ(ierr);
119  ierr = m_field.add_problem("NORM_PROBLEM2"); CHKERRQ(ierr);
120 
121 
122  //set refinment level for problem
123  ierr = m_field.modify_problem_ref_level_add_bit("NORM_PROBLEM1",bit_level0); CHKERRQ(ierr);
124  ierr = m_field.modify_problem_ref_level_add_bit("NORM_PROBLEM2",bit_level0); CHKERRQ(ierr);
125 
126 
127 
128  //meshset consisting all entities in mesh
129  EntityHandle root_set = moab.get_root_set();
130  //add entities to field
131  ierr = m_field.add_ents_to_field_by_TETs(root_set,"erorNORM_re"); CHKERRQ(ierr);
132  ierr = m_field.add_ents_to_field_by_TETs(root_set,"erorNORM_im"); CHKERRQ(ierr);
133 
134 
135  //set app. order , approximation error of norm should be as least 1 order higher than numerical spaces.
136  //see Hierarchic Finite Element Bases on Unstructured Tetrahedral Meshes (Mark Ainsworth & Joe Coyle)
137  PetscInt order;
138  ierr = PetscOptionsGetInt(PETSC_NULL,"-my_order",&order,&flg); CHKERRQ(ierr);
139  if(flg != PETSC_TRUE) {
140  order = 2;
141  }
142 
143  ierr = m_field.set_field_order(root_set,MBTET,"erorNORM_re",order); CHKERRQ(ierr);
144  ierr = m_field.set_field_order(root_set,MBTRI,"erorNORM_re",order); CHKERRQ(ierr);
145  ierr = m_field.set_field_order(root_set,MBEDGE,"erorNORM_re",order); CHKERRQ(ierr);
146  ierr = m_field.set_field_order(root_set,MBVERTEX,"erorNORM_re",1); CHKERRQ(ierr);
147  ierr = m_field.set_field_order(root_set,MBTET,"erorNORM_im",order); CHKERRQ(ierr);
148  ierr = m_field.set_field_order(root_set,MBTRI,"erorNORM_im",order); CHKERRQ(ierr);
149  ierr = m_field.set_field_order(root_set,MBEDGE,"erorNORM_im",order); CHKERRQ(ierr);
150  ierr = m_field.set_field_order(root_set,MBVERTEX,"erorNORM_im",1); CHKERRQ(ierr);
151 
152  if(!m_field.check_field("MESH_NODE_POSITIONS")) {
153  ierr = m_field.add_field("MESH_NODE_POSITIONS",H1,3); CHKERRQ(ierr);
154  ierr = m_field.add_ents_to_field_by_TETs(root_set,"MESH_NODE_POSITIONS"); CHKERRQ(ierr);
155  ierr = m_field.set_field_order(0,MBTET,"MESH_NODE_POSITIONS",2); CHKERRQ(ierr);
156  ierr = m_field.set_field_order(0,MBTRI,"MESH_NODE_POSITIONS",2); CHKERRQ(ierr);
157  ierr = m_field.set_field_order(0,MBEDGE,"MESH_NODE_POSITIONS",2); CHKERRQ(ierr);
158  ierr = m_field.set_field_order(0,MBVERTEX,"MESH_NODE_POSITIONS",1); CHKERRQ(ierr);
159  }
160 
161  double real_error;
162  double imag_error;
163  double real_analy;
164  double imag_analy;
165 
166  NormElement norm_elements_re(m_field,real_error,real_analy);
167  NormElement norm_elements_im(m_field,imag_error,imag_analy);
168 
169  if(m_field.check_field("reEX") && m_field.check_field("rePRES")) {
170  //&& m_field.check_field("imPRES") && m_field.check_field("imEX") ) {
171  norm_elements_re.addNormElements("NORM_PROBLEM1","NORM_FE1","erorNORM_re","reEX","rePRES");
172  norm_elements_im.addNormElements("NORM_PROBLEM2","NORM_FE2","erorNORM_im","imEX","imPRES");
173  ierr = m_field.modify_finite_element_add_field_data("NORM_FE1","erorNORM_im"); CHKERRQ(ierr);
174  }
175 
176 
177  /****/
178  //build database
179 
180  //build field
181  ierr = m_field.build_fields(); CHKERRQ(ierr);
182  //build finite elemnts
183  ierr = m_field.build_finite_elements(); CHKERRQ(ierr);
184  //build adjacencies
185  ierr = m_field.build_adjacencies(bit_level0); CHKERRQ(ierr);
186  //build problem
187  ierr = m_field.build_problems(); CHKERRQ(ierr);
188 
189  Projection10NodeCoordsOnField ent_method_material(m_field,"MESH_NODE_POSITIONS");
190  ierr = m_field.loop_dofs("MESH_NODE_POSITIONS",ent_method_material); CHKERRQ(ierr);
191 
192 
193  /****/
194  //mesh partitioning
195  //partition
196  ierr = m_field.partition_problem("NORM_PROBLEM1"); CHKERRQ(ierr);
197  ierr = m_field.partition_finite_elements("NORM_PROBLEM1"); CHKERRQ(ierr);
198  //what are ghost nodes, see Petsc Manual
199  ierr = m_field.partition_ghost_dofs("NORM_PROBLEM1"); CHKERRQ(ierr);
200 
201  ierr = m_field.partition_problem("NORM_PROBLEM2"); CHKERRQ(ierr);
202  ierr = m_field.partition_finite_elements("NORM_PROBLEM2"); CHKERRQ(ierr);
203  ierr = m_field.partition_ghost_dofs("NORM_PROBLEM2"); CHKERRQ(ierr);
204 
205  if(m_field.check_field("reEX") && m_field.check_field("imEX")) {
206 
207  ierr = m_field.build_problem("EX1_PROBLEM"); CHKERRQ(ierr);
208  ierr = m_field.partition_problem("EX1_PROBLEM"); CHKERRQ(ierr);
209  ierr = m_field.partition_finite_elements("EX1_PROBLEM"); CHKERRQ(ierr);
210  ierr = m_field.partition_ghost_dofs("EX1_PROBLEM"); CHKERRQ(ierr);
211 
212  }
213 
214  //print block sets with materials
215  //ierr = m_field.print_cubit_materials_set(); CHKERRQ(ierr);
216 
217  Vec F;
218  ierr = m_field.VecCreateGhost("NORM_PROBLEM1",ROW,&F); CHKERRQ(ierr);
219  Vec T;
220  ierr = VecDuplicate(F,&T); CHKERRQ(ierr);
221  Mat A;
222  ierr = m_field.MatCreateMPIAIJWithArrays("NORM_PROBLEM1",&A); CHKERRQ(ierr);
223 
224  Vec G;
225  ierr = m_field.VecCreateGhost("NORM_PROBLEM2",ROW,&G); CHKERRQ(ierr);
226  Vec D;
227  ierr = VecDuplicate(G,&D); CHKERRQ(ierr);
228 
229 
230  /* Set operators */
231  ierr = norm_elements_re.setNormFiniteElementRhsOperator("erorNORM_re","reEX","rePRES",F,usel2,userela); CHKERRQ(ierr);
232  ierr = norm_elements_re.setNormFiniteElementLhsOperator("erorNORM_re","reEX","rePRES",A); CHKERRQ(ierr);
233  ierr = norm_elements_im.setNormFiniteElementRhsOperator("erorNORM_im","imEX","imPRES",G,usel2,userela); CHKERRQ(ierr);
234 
235 
236 
237  /* create matrix and vectors */
238  ierr = VecZeroEntries(T); CHKERRQ(ierr);
239  ierr = VecGhostUpdateBegin(T,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(ierr);
240  ierr = VecGhostUpdateEnd(T,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(ierr);
241  ierr = VecZeroEntries(F); CHKERRQ(ierr);
242  ierr = VecGhostUpdateBegin(F,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(ierr);
243  ierr = VecGhostUpdateEnd(F,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(ierr);
244  ierr = MatZeroEntries(A); CHKERRQ(ierr);
245  ierr = m_field.set_global_ghost_vector("NORM_PROBLEM1",ROW,T,INSERT_VALUES,SCATTER_REVERSE); CHKERRQ(ierr);
246 
247  ierr = VecZeroEntries(D); CHKERRQ(ierr);
248  ierr = VecGhostUpdateBegin(D,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(ierr);
249  ierr = VecGhostUpdateEnd(D,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(ierr);
250  ierr = VecZeroEntries(G); CHKERRQ(ierr);
251  ierr = VecGhostUpdateBegin(G,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(ierr);
252  ierr = VecGhostUpdateEnd(G,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(ierr);
253 
254  ierr = m_field.set_global_ghost_vector("NORM_PROBLEM2",ROW,D,INSERT_VALUES,SCATTER_REVERSE); CHKERRQ(ierr);
255 
256  /* looop over finite elements */
257  ierr = m_field.loop_finite_elements("NORM_PROBLEM1","NORM_FE1",norm_elements_re.getLoopFe()); CHKERRQ(ierr);
258  ierr = m_field.loop_finite_elements("NORM_PROBLEM2","NORM_FE2",norm_elements_im.getLoopFe()); CHKERRQ(ierr);
259 
260 
261  /* create ghost points */
262  ierr = VecGhostUpdateBegin(F,ADD_VALUES,SCATTER_REVERSE); CHKERRQ(ierr);
263  ierr = VecGhostUpdateEnd(F,ADD_VALUES,SCATTER_REVERSE); CHKERRQ(ierr);
264  ierr = VecAssemblyBegin(F); CHKERRQ(ierr);
265  ierr = VecAssemblyEnd(F); CHKERRQ(ierr);
266  ierr = MatAssemblyBegin(A,MAT_FINAL_ASSEMBLY); CHKERRQ(ierr);
267  ierr = MatAssemblyEnd(A,MAT_FINAL_ASSEMBLY); CHKERRQ(ierr);
268 
269  ierr = VecGhostUpdateBegin(G,ADD_VALUES,SCATTER_REVERSE); CHKERRQ(ierr);
270  ierr = VecGhostUpdateEnd(G,ADD_VALUES,SCATTER_REVERSE); CHKERRQ(ierr);
271  ierr = VecAssemblyBegin(G); CHKERRQ(ierr);
272  ierr = VecAssemblyEnd(G); CHKERRQ(ierr);
273 
274 
275  //Solver
276  KSP solver1;
277  ierr = KSPCreate(PETSC_COMM_WORLD,&solver1); CHKERRQ(ierr);
278  ierr = KSPSetOperators(solver1,A,A); CHKERRQ(ierr);
279  ierr = KSPSetFromOptions(solver1); CHKERRQ(ierr);
280  ierr = KSPSetUp(solver1); CHKERRQ(ierr);
281 
282  ierr = KSPSolve(solver1,F,T); CHKERRQ(ierr);
283  ierr = VecGhostUpdateBegin(T,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(ierr);
284  ierr = VecGhostUpdateEnd(T,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(ierr);
285  ierr = m_field.set_global_ghost_vector("NORM_PROBLEM1",ROW,T,INSERT_VALUES,SCATTER_REVERSE); CHKERRQ(ierr);
286 
287 
288 
289  ierr = KSPSolve(solver1,G,D); CHKERRQ(ierr);
290  ierr = VecGhostUpdateBegin(D,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(ierr);
291  ierr = VecGhostUpdateEnd(D,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(ierr);
292  ierr = m_field.set_global_ghost_vector("NORM_PROBLEM2",ROW,D,INSERT_VALUES,SCATTER_REVERSE); CHKERRQ(ierr);
293 
294 
295 
296  /* Global error calculation */
297  //PetscScalar sum_T,sum_D;
298  PetscReal nrm2_T,nrm2_D,nrm2_P,nrm2_M;
299  /* FIXME sum and sqrt of Vector T and D */
300  //ierr = VecSum(T,&sum_T);
301  //ierr = VecSum(D,&sum_D);
302  //nrm2_T = sqrt(abs(sum_T));
303  //nrm2_D = sqrt(abs(sum_D));
304  ierr = VecNorm(T,NORM_2,&nrm2_T);;
305  ierr = VecNorm(D,NORM_2,&nrm2_D); CHKERRQ(ierr);
306 
307  Vec P,M;
308  ierr = m_field.VecCreateGhost("EX1_PROBLEM",ROW,&M); CHKERRQ(ierr);
309  ierr = VecDuplicate(M,&P); CHKERRQ(ierr);
310 
311  ierr = m_field.set_local_ghost_vector("EX1_PROBLEM",ROW,M,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(ierr);
312  ierr = m_field.set_other_global_ghost_vector("EX1_PROBLEM","reEX","imEX",ROW,P,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(ierr);
313 
314  //PetscPrintf(PETSC_COMM_WORLD,"\n real part of l2 norm of analytical solution is: %f \n",real_analy);
315  //PetscPrintf(PETSC_COMM_WORLD,"\n imag part of l2 norm of analytical solution is: %f \n",imag_analy);
316 
317  if(usel2) {
318  double a = sqrt(real_error)/sqrt(real_analy);
319  double b = sqrt(imag_error)/sqrt(imag_analy);
320  PetscPrintf(PETSC_COMM_WORLD,"\n real part of global relative l2 error is: %f \n",a);
321  PetscPrintf(PETSC_COMM_WORLD,"\n imag part of global relative l2 error is: %f \n",b);
322  PetscPrintf(PETSC_COMM_WORLD,"\n total global l2 realtive error is: %f \n",sqrt(a*a+b*b));
323  } else {
324 
325  double a = sqrt(real_error)/sqrt(real_analy);
326  double b = sqrt(imag_error)/sqrt(imag_analy);
327  PetscPrintf(PETSC_COMM_WORLD,"\n real part of global H1 error is: %f \n",a);
328  PetscPrintf(PETSC_COMM_WORLD,"\n imag part of global H1 error is: %f \n",b);
329  PetscPrintf(PETSC_COMM_WORLD,"\n total global H1 realtive error is: %f \n",sqrt(a*a+b*b));
330 
331  }
332 
333  /* Projection of global error */
334 
335  //ierr = VecNorm(M,NORM_FROBENIUS,&nrm2_M);
336  //ierr = VecNorm(P,NORM_2,&nrm2_P); CHKERRQ(ierr);
337  ////ierr = VecNorm(M,NORM_INFINITY,&nrm2_M);
338 
339 
340  ////out stream the global error
341  //if(usel2 && !userela) {
342  // //PetscPrintf(PETSC_COMM_WORLD,"\n The Global L2 error of real field is : %f \n",nrm2_T);
343  // //PetscPrintf(PETSC_COMM_WORLD,"\n The Global L2 error of imag field is : %f \n",nrm2_D);
344 
345  // PetscPrintf(PETSC_COMM_WORLD,"\n The Global L2 relative error of real field is : %f \n",nrm2_T/nrm2_M);
346  // PetscPrintf(PETSC_COMM_WORLD,"\n The Global L2 relative error of imag field is : %f \n",nrm2_D/nrm2_P);
347  // PetscPrintf(PETSC_COMM_WORLD,"\n Global error of total potential in l2 norm is : %f \n",sqrt((nrm2_T/nrm2_M)*(nrm2_T/nrm2_M) + (nrm2_D/nrm2_P)*(nrm2_D/nrm2_P)));
348  // //std::cout << "\n The Global L2 relative error of real field is : --\n" << nrm2_T/nrm2_M << std::endl;
349  // //std::cout << "\n The Global L2 relative error of imag field is : --\n" << nrm2_D/nrm2_P << std::endl;
350  // //cout << "\n Global error of total potential in l2 norm \n" << sqrt((nrm2_T/nrm2_M)*(nrm2_T/nrm2_M) + (nrm2_D/nrm2_P)*(nrm2_D/nrm2_P)) << endl;
351  //}
352  //else if(!usel2 && !userela) {
353 
354  // std::cout << "\n The Global H1 relative error of real field is : --\n" << nrm2_T/nrm2_M << std::endl;
355  // std::cout << "\n The Global H1 relative error of imag field is : --\n" << nrm2_D/nrm2_P << std::endl;
356  // cout << "\n Global error of total potential in l2 norm \n" << sqrt((nrm2_T/nrm2_M)*(nrm2_T/nrm2_M) + (nrm2_D/nrm2_P)*(nrm2_D/nrm2_P)) << endl;
357  //}
358  //else if(userela) {
359  // //NEED TO BE FIXED
360  // //we need two vector, one is exact solution, one is error in the norm, then find the maximum of
361  // //two vectors, and devide second one by first one. it is the global pointwise relative error.
362  // std::cout << "\n The Global least square of H1 Norm of error real field is : --\n" << nrm2_T << std::endl;
363  // //std::cout << "\n The Global Pointwise of H1 Norm of error for real field is : --\n" << pointwisenorm << std::endl;
364  //}
365 
366 
367  /* destroy objects */
368  ierr = MatDestroy(&A); CHKERRQ(ierr);
369  ierr = VecDestroy(&F); CHKERRQ(ierr);
370  ierr = VecDestroy(&T); CHKERRQ(ierr);
371  ierr = KSPDestroy(&solver1); CHKERRQ(ierr);
372 
373  ierr = VecDestroy(&G); CHKERRQ(ierr);
374  ierr = VecDestroy(&D); CHKERRQ(ierr);
375 
376  ierr = VecDestroy(&M); CHKERRQ(ierr);
377  ierr = VecDestroy(&P); CHKERRQ(ierr);
378 
379 
380  PetscBool save_postproc_mesh = PETSC_TRUE;
381  ierr = PetscOptionsGetBool(NULL,"-save_postproc_mesh",&save_postproc_mesh,NULL); CHKERRQ(ierr);
382  if(save_postproc_mesh) {
383 
384  PostProcVolumeOnRefinedMesh post_proc1(m_field);
385  ierr = post_proc1.generateRefereneElemenMesh(); CHKERRQ(ierr);
386  ierr = post_proc1.addFieldValuesPostProc("erorNORM_re"); CHKERRQ(ierr);
387  ierr = post_proc1.addFieldValuesPostProc("erorNORM_im"); CHKERRQ(ierr);
388  ierr = post_proc1.addFieldValuesPostProc("MESH_NODE_POSITIONS"); CHKERRQ(ierr);
389  ierr = m_field.loop_finite_elements("NORM_PROBLEM1","NORM_FE1",post_proc1); CHKERRQ(ierr);
390  rval = post_proc1.postProcMesh.write_file("norm_error.h5m","MOAB","PARALLEL=WRITE_PART"); CHKERR_PETSC(rval);
391 
392  }
393 
394  ierr = PetscTime(&v2);CHKERRQ(ierr);
395  ierr = PetscGetCPUTime(&t2);CHKERRQ(ierr);
396  PetscSynchronizedPrintf(PETSC_COMM_WORLD,"Total Rank %d Time = %f S CPU Time = %f S \n",pcomm->rank(),v2-v1,t2-t1);
397 
398  //output the results from Docker
399  //char command1[] = "mbconvert norm_error.h5m ./norm_error.vtk";
400  //int todo1 = system( command1 );
401 
402  ierr = PetscFinalize(); CHKERRQ(ierr);
403 
404  return 0;
405 
406 }
const double T
finite element to appeximate analytical solution on surface
Deprecated interface functions.
virtual MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
build adjacencies
DEPRECATED MoFEMErrorCode set_global_ghost_vector(const Problem *problem_ptr, RowColData rc, Vec V, InsertMode mode, ScatterMode scatter_mode) const
set values of vector from/to mesh database (collective)collective - need tu be run on all processors ...
CoreTmp< 0 > Core
Definition: Core.hpp:1129
const double D
diffusivity
#define BARRIER_RANK_END(PCMB)
Definition: definitions.h:351
virtual DEPRECATED MoFEMErrorCode build_problems(int verb=-1)=0
build problem data structures
DEPRECATED MoFEMErrorCode set_local_ghost_vector(const Problem *problem_ptr, RowColData rc, Vec V, InsertMode mode, ScatterMode scatter_mode) const
set values of vector from/to meshdatabase
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.
char mesh_file_name[255]
Projection of edge entities with one mid-node on hierarchical basis.
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:85
DEPRECATED MoFEMErrorCode set_other_global_ghost_vector(const Problem *problem_ptr, const std::string &field_name, const std::string &cpy_field_name, RowColData rc, Vec V, InsertMode mode, ScatterMode scatter_mode, int verb=-1)
Copy vector to field which is not part of the problem (collective)collective - need tu be run on all ...
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
#define BARRIER_RANK_START(PCMB)
Definition: definitions.h:328
CHKERRQ(ierr)
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)
DEPRECATED MoFEMErrorCode VecCreateGhost(const std::string &name, RowColData rc, Vec *V) const
create ghost vector for problem (collective)collective - need to be run on all processors in communic...
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
#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
static char help[]
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
Core (interface) class.
Definition: Core.hpp:77
continuous field
Definition: definitions.h:177
DEPRECATED MoFEMErrorCode MatCreateMPIAIJWithArrays(const std::string &name, Mat *Aij, int verb=DEFAULT_VERBOSITY)
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...
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)
FTensor::Index< 'M', 3 > M
Definition: PlasticOps.hpp:72

Variable Documentation

◆ help

char help[] = "...\n\n"
static

Definition at line 46 of file error_norm_obsolete.cpp.