v0.14.0
plot_base.cpp
Go to the documentation of this file.
1 /**
2  * \file plot_base.cpp
3  * \example plot_base.cpp
4  *
5  * Utility for plotting base functions for different spaces, polynomial bases
6  */
7 
8 #include <MoFEM.hpp>
9 
10 using namespace MoFEM;
11 
12 static char help[] = "...\n\n";
13 
14 #include <BasicFiniteElements.hpp>
15 
16 template <int DIM> struct ElementsAndOps {};
17 
18 template <> struct ElementsAndOps<2> {
20 };
21 
22 template <> struct ElementsAndOps<3> {
24 };
25 
26 constexpr int SPACE_DIM =
27  EXECUTABLE_DIMENSION; //< Space dimension of problem, mesh
28 
33 
34 struct MyPostProc : public PostProcEle {
36 
37  MoFEMErrorCode generateReferenceElementMesh();
38  MoFEMErrorCode setGaussPts(int order);
39 
40  MoFEMErrorCode preProcess();
41  MoFEMErrorCode postProcess();
42 
43 protected:
44  ublas::matrix<int> refEleMap;
46 };
47 
48 struct Example {
49 
50  Example(MoFEM::Interface &m_field) : mField(m_field) {}
51 
52  MoFEMErrorCode runProblem();
53 
54 private:
55  MoFEM::Interface &mField;
56  Simple *simpleInterface;
57 
58  MoFEMErrorCode readMesh();
59  MoFEMErrorCode setupProblem();
60  MoFEMErrorCode setIntegrationRules();
61  MoFEMErrorCode createCommonData();
62  MoFEMErrorCode boundaryCondition();
63  MoFEMErrorCode assembleSystem();
64  MoFEMErrorCode solveSystem();
65  MoFEMErrorCode outputResults();
66  MoFEMErrorCode checkResults();
67 
70 };
71 
72 //! [Run programme]
75  CHKERR readMesh();
76  CHKERR setupProblem();
77  CHKERR setIntegrationRules();
78  CHKERR createCommonData();
79  CHKERR boundaryCondition();
80  CHKERR assembleSystem();
81  CHKERR solveSystem();
82  CHKERR outputResults();
83  CHKERR checkResults();
85 }
86 //! [Run programme]
87 
88 //! [Read mesh]
91 
92  PetscBool load_file = PETSC_FALSE;
93  CHKERR PetscOptionsGetBool(PETSC_NULL, "", "-load_file", &load_file,
94  PETSC_NULL);
95 
96  if (load_file == PETSC_FALSE) {
97 
98  auto &moab = mField.get_moab();
99 
100  if (SPACE_DIM == 3) {
101 
102  // create one tet
103  double tet_coords[] = {0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1};
104  EntityHandle nodes[4];
105  for (int nn = 0; nn < 4; nn++) {
106  CHKERR moab.create_vertex(&tet_coords[3 * nn], nodes[nn]);
107  }
108  EntityHandle tet;
109  CHKERR moab.create_element(MBTET, nodes, 4, tet);
110  Range adj;
111  for (auto d : {1, 2})
112  CHKERR moab.get_adjacencies(&tet, 1, d, true, adj);
113  }
114 
115  if (SPACE_DIM == 2) {
116 
117  // create one triangle
118  double tri_coords[] = {0, 0, 0, 1, 0, 0, 0, 1, 0};
119  EntityHandle nodes[3];
120  for (int nn = 0; nn < 3; nn++) {
121  CHKERR moab.create_vertex(&tri_coords[3 * nn], nodes[nn]);
122  }
123  EntityHandle tri;
124  CHKERR moab.create_element(MBTRI, nodes, 3, tri);
125  Range adj;
126  CHKERR moab.get_adjacencies(&tri, 1, 1, true, adj);
127  }
128 
129  CHKERR mField.rebuild_database();
130  CHKERR mField.getInterface(simpleInterface);
131  simpleInterface->setDim(SPACE_DIM);
132 
133  // Add all elements to database
134  CHKERR mField.getInterface<BitRefManager>()->setBitRefLevelByDim(
135  0, SPACE_DIM, simpleInterface->getBitRefLevel());
136 
137  } else {
138 
139  CHKERR mField.getInterface(simpleInterface);
140  CHKERR simpleInterface->getOptions();
141  CHKERR simpleInterface->loadFile();
142  }
143 
145 }
146 //! [Read mesh]
147 
148 //! [Set up problem]
151  // Add field
152 
153  // Declare elements
154  enum bases { AINSWORTH, AINSWORTH_LOBATTO, DEMKOWICZ, BERNSTEIN, LASBASETOP };
155  const char *list_bases[] = {"ainsworth", "ainsworth_lobatto", "demkowicz",
156  "bernstein"};
157 
158  PetscBool flg;
159  PetscInt choice_base_value = AINSWORTH;
160  CHKERR PetscOptionsGetEList(PETSC_NULL, NULL, "-base", list_bases, LASBASETOP,
161  &choice_base_value, &flg);
162  if (flg != PETSC_TRUE)
163  SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "base not set");
165  if (choice_base_value == AINSWORTH)
167  if (choice_base_value == AINSWORTH_LOBATTO)
168  base = AINSWORTH_LOBATTO_BASE;
169  else if (choice_base_value == DEMKOWICZ)
170  base = DEMKOWICZ_JACOBI_BASE;
171  else if (choice_base_value == BERNSTEIN)
173 
174  const char *list_continuity[] = {"continuous", "discontinuous"};
175  PetscInt choice_continuity_value = CONTINUOUS;
176  CHKERR PetscOptionsGetEList(PETSC_NULL, NULL, "-continuity", list_continuity,
177  LASTCONTINUITY, &choice_continuity_value, &flg);
178 
179  FieldContinuity continuity;
180  if (choice_continuity_value == CONTINUOUS)
181  continuity = CONTINUOUS;
182  else if (choice_continuity_value == DISCONTINUOUS)
183  continuity = DISCONTINUOUS;
184  else
185  SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "continuity not set");
186 
187  enum spaces { H1SPACE, L2SPACE, HCURLSPACE, HDIVSPACE, LASBASETSPACE };
188  const char *list_spaces[] = {"h1", "l2", "hcurl", "hdiv"};
189  PetscInt choice_space_value = H1SPACE;
190  CHKERR PetscOptionsGetEList(PETSC_NULL, NULL, "-space", list_spaces,
191  LASBASETSPACE, &choice_space_value, &flg);
192  if (flg != PETSC_TRUE)
193  SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "space not set");
194  space = H1;
195  if (choice_space_value == H1SPACE)
196  space = H1;
197  else if (choice_space_value == L2SPACE)
198  space = L2;
199  else if (choice_space_value == HCURLSPACE)
200  space = HCURL;
201  else if (choice_space_value == HDIVSPACE)
202  space = HDIV;
203 
204  if(continuity == CONTINUOUS)
205  CHKERR simpleInterface->addDomainField("U", space, base, 1);
206  else
207  CHKERR simpleInterface->addDomainBrokenField("U", space, base, 1);
208 
209  int order = 3;
210  CHKERR PetscOptionsGetInt(PETSC_NULL, "", "-order", &order, PETSC_NULL);
211  CHKERR simpleInterface->setFieldOrder("U", order);
212  CHKERR simpleInterface->setUp();
213 
214  auto bc_mng = mField.getInterface<BcManager>();
215  CHKERR bc_mng->removeSideDOFs(simpleInterface->getProblemName(), "ZERO_FLUX",
216  "U", SPACE_DIM, 0, 1, true);
217 
219 }
220 //! [Set up problem]
221 
222 //! [Set integration rule]
226 }
227 //! [Set integration rule]
228 
229 //! [Create common data]
231 //! [Create common data]
232 
233 //! [Boundary condition]
235 //! [Boundary condition]
236 
237 //! [Push operators to pipeline]
239 //! [Push operators to pipeline]
240 
241 //! [Solve]
242 MoFEMErrorCode Example::solveSystem() { return 0; }
243 
244 //! [Solve]
247 
248  PipelineManager *pipeline_mng = mField.getInterface<PipelineManager>();
249  pipeline_mng->getDomainLhsFE().reset();
250 
251  auto post_proc_fe = boost::make_shared<MyPostProc>(mField);
252  post_proc_fe->generateReferenceElementMesh();
253  pipeline_mng->getDomainRhsFE() = post_proc_fe;
254 
255  if (SPACE_DIM == 2) {
256  if (space == HCURL) {
257  auto jac_ptr = boost::make_shared<MatrixDouble>();
258  post_proc_fe->getOpPtrVector().push_back(
259  new OpCalculateHOJacForFace(jac_ptr));
260  post_proc_fe->getOpPtrVector().push_back(new OpMakeHdivFromHcurl());
261  post_proc_fe->getOpPtrVector().push_back(
263  }
264  }
265 
266  switch (space) {
267  case H1:
268  case L2:
269 
270  {
271 
273 
274  auto u_ptr = boost::make_shared<VectorDouble>();
275  post_proc_fe->getOpPtrVector().push_back(
276  new OpCalculateScalarFieldValues("U", u_ptr));
277  post_proc_fe->getOpPtrVector().push_back(
278 
279  new OpPPMap(
280 
281  post_proc_fe->getPostProcMesh(), post_proc_fe->getMapGaussPts(),
282 
283  {{"U", u_ptr}},
284 
285  {},
286 
287  {},
288 
289  {}
290 
291  )
292 
293  );
294  } break;
295  case HCURL:
296  case HDIV:
297 
298  {
300 
302  post_proc_fe->getOpPtrVector(), {space});
303  auto u_ptr = boost::make_shared<MatrixDouble>();
304  post_proc_fe->getOpPtrVector().push_back(
305  new OpCalculateHVecVectorField<3>("U", u_ptr));
306 
307  post_proc_fe->getOpPtrVector().push_back(
308 
309  new OpPPMap(
310 
311  post_proc_fe->getPostProcMesh(), post_proc_fe->getMapGaussPts(),
312 
313  {},
314 
315  {{"U", u_ptr}},
316 
317  {},
318 
319  {}
320 
321  )
322 
323  );
324  } break;
325  default:
326  break;
327  }
328 
329  auto scale_tag_val = [&]() {
331  auto &post_proc_mesh = post_proc_fe->getPostProcMesh();
332  Range nodes;
333  CHKERR post_proc_mesh.get_entities_by_type(0, MBVERTEX, nodes);
334  Tag th;
335  CHKERR post_proc_mesh.tag_get_handle("U", th);
336  int length;
337  CHKERR post_proc_mesh.tag_get_length(th, length);
338  std::vector<double> data(nodes.size() * length);
339  CHKERR post_proc_mesh.tag_get_data(th, nodes, &*data.begin());
340  double max_v = 0;
341  for (int i = 0; i != nodes.size(); ++i) {
342  double v = 0;
343  for (int d = 0; d != length; ++d)
344  v += pow(data[length * i + d], 2);
345  v = std::sqrt(v);
346  max_v = std::max(max_v, v);
347  }
348  for (auto &v : data)
349  v /= max_v;
350  CHKERR post_proc_mesh.tag_set_data(th, nodes, &*data.begin());
352  };
353 
354  auto prb_ptr = mField.get_problem(simpleInterface->getProblemName());
355 
356  size_t nb = 0;
357  auto dofs_ptr = prb_ptr->getNumeredRowDofsPtr();
358 
359  for (auto dof_ptr : (*dofs_ptr)) {
360  MOFEM_LOG("PLOTBASE", Sev::verbose) << *dof_ptr;
361  auto &val = const_cast<double &>(dof_ptr->getFieldData());
362  val = 1;
363  CHKERR pipeline_mng->loopFiniteElements();
364  CHKERR scale_tag_val();
365  CHKERR post_proc_fe->writeFile(
366  "out_base_dof_" + boost::lexical_cast<std::string>(nb) + ".h5m");
367  CHKERR post_proc_fe->getPostProcMesh().delete_mesh();
368  val = 0;
369  ++nb;
370  };
371 
373 }
374 //! [Postprocess results]
375 
376 //! [Check results]
378 //! [Check results]
379 
380 int main(int argc, char *argv[]) {
381 
382  // Initialisation of MoFEM/PETSc and MOAB data structures
383  MoFEM::Core::Initialize(&argc, &argv, (char *)0, help);
384 
385  try {
386 
387  //! [Register MoFEM discrete manager in PETSc]
388  DMType dm_name = "DMMOFEM";
389  CHKERR DMRegister_MoFEM(dm_name);
390  //! [Register MoFEM discrete manager in PETSc
391 
392  // Add logging channel for example
393  auto core_log = logging::core::get();
394  core_log->add_sink(
395  LogManager::createSink(LogManager::getStrmWorld(), "PLOTBASE"));
396  LogManager::setLog("PLOTBASE");
397  MOFEM_LOG_TAG("PLOTBASE", "plotbase");
398 
399  //! [Create MoAB]
400  moab::Core mb_instance; ///< mesh database
401  moab::Interface &moab = mb_instance; ///< mesh database interface
402  //! [Create MoAB]
403 
404  //! [Create MoFEM]
405  MoFEM::Core core(moab); ///< finite element database
406  MoFEM::Interface &m_field = core; ///< finite element database insterface
407  //! [Create MoFEM]
408 
409  //! [Example]
410  Example ex(m_field);
411  CHKERR ex.runProblem();
412  //! [Example]
413  }
414  CATCH_ERRORS;
415 
417 
418  return 0;
419 }
420 
423  moab::Core core_ref;
424  moab::Interface &moab_ref = core_ref;
425 
426  char ref_mesh_file_name[255];
427 
428  if (SPACE_DIM == 2)
429  strcpy(ref_mesh_file_name, "ref_mesh2d.h5m");
430  else if (SPACE_DIM == 3)
431  strcpy(ref_mesh_file_name, "ref_mesh3d.h5m");
432  else
433  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
434  "Dimension not implemented");
435 
436  CHKERR PetscOptionsGetString(PETSC_NULL, "", "-ref_file", ref_mesh_file_name,
437  255, PETSC_NULL);
438  CHKERR moab_ref.load_file(ref_mesh_file_name, 0, "");
439 
440  // Get elements
441  Range elems;
442  CHKERR moab_ref.get_entities_by_dimension(0, SPACE_DIM, elems);
443 
444  // Add mid-nodes on edges
445  EntityHandle meshset;
446  CHKERR moab_ref.create_meshset(MESHSET_SET, meshset);
447  CHKERR moab_ref.add_entities(meshset, elems);
448  CHKERR moab_ref.convert_entities(meshset, true, false, false);
449  CHKERR moab_ref.delete_entities(&meshset, 1);
450 
451  // Get nodes on the mesh
452  Range elem_nodes;
453  CHKERR moab_ref.get_connectivity(elems, elem_nodes, false);
454 
455  // Map node entity and Gauss pint number
456  std::map<EntityHandle, int> nodes_pts_map;
457 
458  // Set gauss points coordinates from the reference mesh
459  gaussPts.resize(SPACE_DIM + 1, elem_nodes.size(), false);
460  gaussPts.clear();
461  Range::iterator nit = elem_nodes.begin();
462  for (int gg = 0; nit != elem_nodes.end(); nit++, gg++) {
463  double coords[3];
464  CHKERR moab_ref.get_coords(&*nit, 1, coords);
465  for (auto d : {0, 1, 2})
466  gaussPts(d, gg) = coords[d];
467  nodes_pts_map[*nit] = gg;
468  }
469 
470  if (SPACE_DIM == 2) {
471  // Set size of adjacency matrix (note ho order nodes 3 nodes and 3 nodes on
472  // edges)
473  refEleMap.resize(elems.size(), 3 + 3);
474  } else if (SPACE_DIM == 3) {
475  refEleMap.resize(elems.size(), 4 + 6);
476  }
477 
478  // Set adjacency matrix
479  Range::iterator tit = elems.begin();
480  for (int tt = 0; tit != elems.end(); ++tit, ++tt) {
481  const EntityHandle *conn;
482  int num_nodes;
483  CHKERR moab_ref.get_connectivity(*tit, conn, num_nodes, false);
484  for (int nn = 0; nn != num_nodes; ++nn) {
485  refEleMap(tt, nn) = nodes_pts_map[conn[nn]];
486  }
487  }
488 
490 }
491 
494 
495  const int num_nodes = gaussPts.size2();
496 
497  // Calculate shape functions
498 
499  switch (numeredEntFiniteElementPtr->getEntType()) {
500  case MBTRI:
501  shapeFunctions.resize(num_nodes, 3);
502  CHKERR Tools::shapeFunMBTRI(&*shapeFunctions.data().begin(),
503  &gaussPts(0, 0), &gaussPts(1, 0), num_nodes);
504  break;
505  case MBQUAD: {
506  shapeFunctions.resize(num_nodes, 4);
507  for (int gg = 0; gg != num_nodes; gg++) {
508  double ksi = gaussPts(0, gg);
509  double eta = gaussPts(1, gg);
510  shapeFunctions(gg, 0) = N_MBQUAD0(ksi, eta);
511  shapeFunctions(gg, 1) = N_MBQUAD1(ksi, eta);
512  shapeFunctions(gg, 2) = N_MBQUAD2(ksi, eta);
513  shapeFunctions(gg, 3) = N_MBQUAD3(ksi, eta);
514  }
515  } break;
516  case MBTET: {
517  shapeFunctions.resize(num_nodes, 8);
518  CHKERR Tools::shapeFunMBTET(&*shapeFunctions.data().begin(),
519  &gaussPts(0, 0), &gaussPts(1, 0),
520  &gaussPts(2, 0), num_nodes);
521  } break;
522  case MBHEX: {
523  shapeFunctions.resize(num_nodes, 8);
524  for (int gg = 0; gg != num_nodes; gg++) {
525  double ksi = gaussPts(0, gg);
526  double eta = gaussPts(1, gg);
527  double zeta = gaussPts(2, gg);
528  shapeFunctions(gg, 0) = N_MBHEX0(ksi, eta, zeta);
529  shapeFunctions(gg, 1) = N_MBHEX1(ksi, eta, zeta);
530  shapeFunctions(gg, 2) = N_MBHEX2(ksi, eta, zeta);
531  shapeFunctions(gg, 3) = N_MBHEX3(ksi, eta, zeta);
532  shapeFunctions(gg, 4) = N_MBHEX4(ksi, eta, zeta);
533  shapeFunctions(gg, 5) = N_MBHEX5(ksi, eta, zeta);
534  shapeFunctions(gg, 6) = N_MBHEX6(ksi, eta, zeta);
535  shapeFunctions(gg, 7) = N_MBHEX7(ksi, eta, zeta);
536  }
537  } break;
538  default:
539  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
540  "Not implemented element type");
541  }
542 
543  // Create physical nodes
544 
545  // MoAB interface allowing for creating nodes and elements in the bulk
546  ReadUtilIface *iface;
547  CHKERR getPostProcMesh().query_interface(iface);
548 
549  std::vector<double *> arrays; /// pointers to memory allocated by MoAB for
550  /// storing X, Y, and Z coordinates
551  EntityHandle startv; // Starting handle for vertex
552  // Allocate memory for num_nodes, and return starting handle, and access to
553  // memort.
554  CHKERR iface->get_node_coords(3, num_nodes, 0, startv, arrays);
555 
556  mapGaussPts.resize(gaussPts.size2());
557  for (int gg = 0; gg != num_nodes; ++gg)
558  mapGaussPts[gg] = startv + gg;
559 
560  Tag th;
561  int def_in_the_loop = -1;
562  CHKERR getPostProcMesh().tag_get_handle("NB_IN_THE_LOOP", 1, MB_TYPE_INTEGER,
563  th, MB_TAG_CREAT | MB_TAG_SPARSE,
564  &def_in_the_loop);
565 
566  // Create physical elements
567 
568  const int num_el = refEleMap.size1();
569  const int num_nodes_on_ele = refEleMap.size2();
570 
571  EntityHandle starte; // Starting handle to first created element
572  EntityHandle *conn; // Access to MOAB memory with connectivity of elements
573 
574  // Create tris/tets in the bulk in MoAB database
575  if (SPACE_DIM == 2)
576  CHKERR iface->get_element_connect(num_el, num_nodes_on_ele, MBTRI, 0,
577  starte, conn);
578  else if (SPACE_DIM == 3)
579  CHKERR iface->get_element_connect(num_el, num_nodes_on_ele, MBTET, 0,
580  starte, conn);
581  else
582  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
583  "Dimension not implemented");
584 
585  // At this point elements (memory for elements) is allocated, at code bellow
586  // actual connectivity of elements is set.
587  for (unsigned int tt = 0; tt != refEleMap.size1(); ++tt) {
588  for (int nn = 0; nn != num_nodes_on_ele; ++nn)
589  conn[num_nodes_on_ele * tt + nn] = mapGaussPts[refEleMap(tt, nn)];
590  }
591 
592  // Finalise elements creation. At that point MOAB updates adjacency tables,
593  // and elements are ready to use.
594  CHKERR iface->update_adjacencies(starte, num_el, num_nodes_on_ele, conn);
595 
596  auto physical_elements = Range(starte, starte + num_el - 1);
597  CHKERR getPostProcMesh().tag_clear_data(th, physical_elements, &(nInTheLoop));
598 
599  EntityHandle fe_ent = numeredEntFiniteElementPtr->getEnt();
600  int fe_num_nodes;
601  {
602  const EntityHandle *conn;
603  mField.get_moab().get_connectivity(fe_ent, conn, fe_num_nodes, true);
604  coords.resize(3 * fe_num_nodes, false);
605  CHKERR mField.get_moab().get_coords(conn, fe_num_nodes, &coords[0]);
606  }
607 
608  // Set physical coordinates to physical nodes
611  &*shapeFunctions.data().begin());
612 
614  arrays[0], arrays[1], arrays[2]);
615  const double *t_coords_ele_x = &coords[0];
616  const double *t_coords_ele_y = &coords[1];
617  const double *t_coords_ele_z = &coords[2];
618  for (int gg = 0; gg != num_nodes; ++gg) {
620  t_coords_ele_x, t_coords_ele_y, t_coords_ele_z);
621  t_coords(i) = 0;
622  for (int nn = 0; nn != fe_num_nodes; ++nn) {
623  t_coords(i) += t_n * t_ele_coords(i);
624  for (auto ii : {0, 1, 2})
625  if (std::abs(t_coords(ii)) < std::numeric_limits<float>::epsilon())
626  t_coords(ii) = 0;
627  ++t_ele_coords;
628  ++t_n;
629  }
630  ++t_coords;
631  }
632 
634 }
635 
638  ParallelComm *pcomm_post_proc_mesh =
639  ParallelComm::get_pcomm(coreMeshPtr.get(), MYPCOMM_INDEX);
640  if (pcomm_post_proc_mesh != NULL)
641  delete pcomm_post_proc_mesh;
643 };
644 
647 
648  auto resolve_shared_ents = [&]() {
650 
651  ParallelComm *pcomm_post_proc_mesh =
652  ParallelComm::get_pcomm(&(getPostProcMesh()), MYPCOMM_INDEX);
653  if (pcomm_post_proc_mesh == NULL) {
654  // wrapRefMeshComm =
655  // boost::make_shared<WrapMPIComm>(T::mField.get_comm(), false);
656  pcomm_post_proc_mesh = new ParallelComm(
657  &(getPostProcMesh()),
658  PETSC_COMM_WORLD /*(T::wrapRefMeshComm)->get_comm()*/);
659  }
660 
661  CHKERR pcomm_post_proc_mesh->resolve_shared_ents(0);
662 
664  };
665 
666  CHKERR resolve_shared_ents();
667 
669 }
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
help
static char help[]
Definition: plot_base.cpp:12
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Definition: UnknownInterface.hpp:93
MoFEM::EntitiesFieldData::EntData
Data on single entity (This is passed as argument to DataOperator::doWork)
Definition: EntitiesFieldData.hpp:128
Example::checkResults
MoFEMErrorCode checkResults()
[Postprocess results]
Definition: dynamic_first_order_con_law.cpp:1205
EXECUTABLE_DIMENSION
#define EXECUTABLE_DIMENSION
Definition: plastic.cpp:13
MoFEM::PipelineManager::getDomainRhsFE
boost::shared_ptr< FEMethod > & getDomainRhsFE()
Definition: PipelineManager.hpp:405
MYPCOMM_INDEX
#define MYPCOMM_INDEX
default communicator number PCOMM
Definition: definitions.h:228
Example::assembleSystem
MoFEMErrorCode assembleSystem()
[Push operators to pipeline]
Definition: dynamic_first_order_con_law.cpp:647
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
H1
@ H1
continuous field
Definition: definitions.h:85
MyPostProc
Definition: plot_base.cpp:34
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
MyPostProc::setGaussPts
MoFEMErrorCode setGaussPts(int order)
Definition: plot_base.cpp:492
Example::Example
Example(MoFEM::Interface &m_field)
Definition: plot_base.cpp:50
EntityHandle
MoFEM::OpSetContravariantPiolaTransformOnFace2D
OpSetContravariantPiolaTransformOnFace2DImpl< 2 > OpSetContravariantPiolaTransformOnFace2D
Definition: UserDataOperators.hpp:3076
N_MBHEX5
#define N_MBHEX5(x, y, z)
Definition: fem_tools.h:76
L2
@ L2
field with C-1 continuity
Definition: definitions.h:88
MoFEM::PipelineManager::loopFiniteElements
MoFEMErrorCode loopFiniteElements(SmartPetscObj< DM > dm=nullptr)
Iterate finite elements.
Definition: PipelineManager.cpp:19
N_MBHEX0
#define N_MBHEX0(x, y, z)
Definition: fem_tools.h:71
main
int main(int argc, char *argv[])
[Check results]
Definition: plot_base.cpp:380
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
LASTCONTINUITY
@ LASTCONTINUITY
Definition: definitions.h:102
MoFEM::th
Tag th
Definition: Projection10NodeCoordsOnField.cpp:122
MoFEM::PipelineManager
PipelineManager interface.
Definition: PipelineManager.hpp:24
MoFEM.hpp
BasicFiniteElements.hpp
N_MBHEX7
#define N_MBHEX7(x, y, z)
Definition: fem_tools.h:78
MoFEM::CoreTmp< 0 >::Finalize
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
MoFEM::Simple
Simple interface for fast problem set-up.
Definition: Simple.hpp:27
N_MBQUAD2
#define N_MBQUAD2(x, y)
quad shape function
Definition: fem_tools.h:59
Example::base
FieldApproximationBase base
Definition: plot_base.cpp:68
MOFEM_IMPOSSIBLE_CASE
@ MOFEM_IMPOSSIBLE_CASE
Definition: definitions.h:35
zeta
double zeta
Viscous hardening.
Definition: plastic.cpp:126
order
constexpr int order
Definition: dg_projection.cpp:18
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
Example::readMesh
MoFEMErrorCode readMesh()
[Run problem]
Definition: dynamic_first_order_con_law.cpp:463
MoFEM::PostProcBrokenMeshInMoab
Definition: PostProcBrokenMeshInMoabBase.hpp:667
FieldSpace
FieldSpace
approximation spaces
Definition: definitions.h:82
N_MBHEX3
#define N_MBHEX3(x, y, z)
Definition: fem_tools.h:74
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
MoFEM::BcManager
Simple interface for fast problem set-up.
Definition: BcManager.hpp:25
FieldContinuity
FieldContinuity
Field continuity.
Definition: definitions.h:99
MoFEM::OpCalculateHVecVectorField
Get vector field for H-div approximation.
Definition: UserDataOperators.hpp:2115
Example
[Example]
Definition: plastic.cpp:177
OpPPMap
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
Definition: photon_diffusion.cpp:29
Example::solveSystem
MoFEMErrorCode solveSystem()
[Solve]
Definition: dynamic_first_order_con_law.cpp:893
MoFEM::OpCalculateScalarFieldValues
Get value at integration points for scalar field.
Definition: UserDataOperators.hpp:82
MoFEM::DMRegister_MoFEM
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:43
eta
double eta
Definition: free_surface.cpp:170
N_MBHEX1
#define N_MBHEX1(x, y, z)
Definition: fem_tools.h:72
N_MBQUAD1
#define N_MBQUAD1(x, y)
quad shape function
Definition: fem_tools.h:58
MoFEM::FaceElementForcesAndSourcesCore
Face finite element.
Definition: FaceElementForcesAndSourcesCore.hpp:23
AINSWORTH_LOBATTO_BASE
@ AINSWORTH_LOBATTO_BASE
Definition: definitions.h:62
Example::setIntegrationRules
MoFEMErrorCode setIntegrationRules()
[Set up problem]
Definition: plot_base.cpp:223
MOFEM_LOG_TAG
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
MyPostProc::generateReferenceElementMesh
MoFEMErrorCode generateReferenceElementMesh()
Definition: plot_base.cpp:421
MoFEM::VolumeElementForcesAndSourcesCore
Volume finite element base.
Definition: VolumeElementForcesAndSourcesCore.hpp:26
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
Example::space
FieldSpace space
Definition: plot_base.cpp:69
FTensor::Index< 'i', 3 >
AINSWORTH_BERNSTEIN_BEZIER_BASE
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
Definition: definitions.h:64
MoFEM::AddHOOps
Add operators pushing bases from local to physical configuration.
Definition: HODataOperators.hpp:503
SPACE_DIM
constexpr int SPACE_DIM
Definition: plot_base.cpp:26
v
const double v
phase velocity of light in medium (cm/ns)
Definition: initial_diffusion.cpp:40
ElementsAndOps
Definition: child_and_parent.cpp:18
Range
MoFEM::PipelineManager::getDomainLhsFE
boost::shared_ptr< FEMethod > & getDomainLhsFE()
Definition: PipelineManager.hpp:401
DomainEleOp
MoFEM::CoreTmp< 0 >::Initialize
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition: Core.cpp:72
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
MyPostProc::postProcess
MoFEMErrorCode postProcess()
Definition: plot_base.cpp:645
CATCH_ERRORS
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:385
DEMKOWICZ_JACOBI_BASE
@ DEMKOWICZ_JACOBI_BASE
Definition: definitions.h:66
FTensor::Tensor0
Definition: Tensor0.hpp:16
MyPostProc::refEleMap
ublas::matrix< int > refEleMap
Definition: plot_base.cpp:44
N_MBHEX2
#define N_MBHEX2(x, y, z)
Definition: fem_tools.h:73
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1148
EntData
EntitiesFieldData::EntData EntData
Definition: plot_base.cpp:29
Example::setupProblem
MoFEMErrorCode setupProblem()
[Run problem]
Definition: plastic.cpp:225
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
Example::boundaryCondition
MoFEMErrorCode boundaryCondition()
[Set up problem]
Definition: dynamic_first_order_con_law.cpp:536
N_MBHEX4
#define N_MBHEX4(x, y, z)
Definition: fem_tools.h:75
DISCONTINUOUS
@ DISCONTINUOUS
Broken continuity (No effect on L2 space)
Definition: definitions.h:101
PostProcEle
PostProcBrokenMeshInMoab< DomainEle > PostProcEle
Definition: plot_base.cpp:32
AINSWORTH_LEGENDRE_BASE
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:60
HCURL
@ HCURL
field with continuous tangents
Definition: definitions.h:86
N_MBQUAD0
#define N_MBQUAD0(x, y)
quad shape function
Definition: fem_tools.h:57
MoFEM::PetscOptionsGetString
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
Definition: DeprecatedPetsc.hpp:172
MoFEM::PetscOptionsGetEList
PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
Definition: DeprecatedPetsc.hpp:203
MoFEM::OpCalculateHOJacForFace
OpCalculateHOJacForFaceImpl< 2 > OpCalculateHOJacForFace
Definition: HODataOperators.hpp:264
sdf_hertz_2d_axisymm_plane.d
float d
Definition: sdf_hertz_2d_axisymm_plane.py:4
FieldApproximationBase
FieldApproximationBase
approximation base
Definition: definitions.h:58
Example::runProblem
MoFEMErrorCode runProblem()
[Run problem]
Definition: plastic.cpp:213
MyPostProc::preProcess
MoFEMErrorCode preProcess()
Definition: plot_base.cpp:636
N_MBQUAD3
#define N_MBQUAD3(x, y)
quad shape function
Definition: fem_tools.h:60
MoFEM::BitRefManager
Managing BitRefLevels.
Definition: BitRefManager.hpp:21
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
MoFEM::OpMakeHdivFromHcurl
Make Hdiv space from Hcurl space in 2d.
Definition: UserDataOperators.hpp:2985
Example::createCommonData
MoFEMErrorCode createCommonData()
[Set up problem]
Definition: plastic.cpp:396
N_MBHEX6
#define N_MBHEX6(x, y, z)
Definition: fem_tools.h:77
DomainEle
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
Definition: child_and_parent.cpp:34
CONTINUOUS
@ CONTINUOUS
Regular field.
Definition: definitions.h:100
Example::outputResults
MoFEMErrorCode outputResults()
[Solve]
Definition: dynamic_first_order_con_law.cpp:1183
MyPostProc::shapeFunctions
MatrixDouble shapeFunctions
Definition: plot_base.cpp:45
MoFEM::PetscOptionsGetInt
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
Definition: DeprecatedPetsc.hpp:142
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
HDIV
@ HDIV
field with continuous normal traction
Definition: definitions.h:87
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
MoFEM::OpPostProcMapInMoab
Post post-proc data at points from hash maps.
Definition: PostProcBrokenMeshInMoabBase.hpp:698
MoFEM::PetscOptionsGetBool
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
Definition: DeprecatedPetsc.hpp:182