Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
sphere_decomp.cpp File Reference
#include "moab/Core.hpp"
#include "SphereDecomp.hpp"
#include <iostream>
+ Include dependency graph for sphere_decomp.cpp:

Go to the source code of this file.

Macros

#define RR    if( moab::MB_SUCCESS != result ) return result
 

Functions

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

Variables

const char * SPHERE_RADII_TAG_NAME = "SPHERE_RADII"
 

Macro Definition Documentation

◆ RR

#define RR    if( moab::MB_SUCCESS != result ) return result

Definition at line 14 of file sphere_decomp.cpp.

Function Documentation

◆ main()

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

Definition at line 17 of file sphere_decomp.cpp.

18 {
19  if( argc < 3 )
20  {
21  std::cout << "Usage: " << argv[0] << " <input_mesh> <output_mesh>" << std::endl;
22  return 0;
23  }
24 
25  // create MOAB
26  moab::Interface* mbImpl = new moab::Core();
27 
28  // read in mesh
29  moab::ErrorCode result = mbImpl->load_mesh( argv[1] );
30  if( moab::MB_SUCCESS != result )
31  {
32  std::cout << "Problems loading mesh." << std::endl;
33  return 1;
34  }
35 
36  moab::Tag sphere_radii_tag = 0;
37  double dum_val = 0.1;
38  result = mbImpl->tag_get_handle( SPHERE_RADII_TAG_NAME, 1, moab::MB_TYPE_DOUBLE, sphere_radii_tag,
40  if( moab::MB_SUCCESS != result )
41  {
42  std::cout << "Problem allocating SPHERE_RADII tag." << std::endl;
43  return 1;
44  }
45 
46  SphereDecomp sd( mbImpl );
47 
48  moab::EntityHandle this_set = 0;
49  result = sd.build_sphere_mesh( SPHERE_RADII_TAG_NAME, &this_set );RR;
50 
51  // write mesh
52  result = mbImpl->write_mesh( argv[2], &this_set, 1 );RR;
53 
54  return 0;
55 }

References SphereDecomp::build_sphere_mesh(), ErrorCode, moab::Interface::load_mesh(), MB_SUCCESS, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_DOUBLE, RR, SPHERE_RADII_TAG_NAME, moab::Interface::tag_get_handle(), and moab::Interface::write_mesh().

Variable Documentation

◆ SPHERE_RADII_TAG_NAME

const char* SPHERE_RADII_TAG_NAME = "SPHERE_RADII"

Definition at line 12 of file sphere_decomp.cpp.

Referenced by main().