Example demonstrating creation and query of structured meshes in MOAB. More...
#include "moab/Core.hpp"#include "moab/ScdInterface.hpp"#include "moab/ProgOptions.hpp"#include "moab/CN.hpp"#include <array>#include <cmath>#include <iostream>#include <memory>#include <stdexcept>#include <vector>
Include dependency graph for StructuredMeshSimple.cpp:Go to the source code of this file.
Namespaces | |
| anonymous_namespace{StructuredMeshSimple.cpp} | |
Functions | |
| int | main (int argc, char **argv) |
Variables | |
| constexpr int | anonymous_namespace{StructuredMeshSimple.cpp}::DEFAULT_DIMENSION = 3 |
| constexpr int | anonymous_namespace{StructuredMeshSimple.cpp}::DEFAULT_ELEMENTS_PER_SIDE = 10 |
Example demonstrating creation and query of structured meshes in MOAB.
This example shows how to:
In serial mode, a single N*N*N block of elements is created. In parallel mode, each processor gets an N*N*N block arranged in a 1D column, sharing vertices and faces at interfaces.
Show creation and query of structured mesh, serial or parallel, through MOAB's structured mesh interface. This is an example showing creation and query of a 3D structured mesh. In serial, a single N*N*N block of elements is created; in parallel, each proc gets an N*N*N block, with blocks arranged in a 1d column, sharing vertices and faces at their interfaces (proc 0 has no left neighbor and proc P-1 no right neighbor). Each square block of hex elements is then referenced by its ijk parameterization. 1D and 2D examples could be made simply by changing the dimension parameter passed into the MOAB functions.
This example :
To run: ./StructuredMeshSimple [d [N] ]
(default values so can run w/ no user interaction)
| argc | Number of command line arguments |
| argv | Command line arguments array |
Definition in file StructuredMeshSimple.cpp.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 81 of file StructuredMeshSimple.cpp.
References ProgOptions::addOpt(), moab::Range::begin(), moab::ScdInterface::construct_box(), anonymous_namespace{StructuredMeshSimple.cpp}::DEFAULT_DIMENSION, anonymous_namespace{StructuredMeshSimple.cpp}::DEFAULT_ELEMENTS_PER_SIDE, moab::CN::EntityTypeName(), moab::ScdBox::get_element(), MB_CHK_SET_ERR, ProgOptions::parseCommandLine(), and moab::Range::size().