Go to the documentation of this file. 1
7
8 #include "moab/Core.hpp"
9 #include "SphereDecomp.hpp"
10 #include <iostream>
11
12 const char* SPHERE_RADII_TAG_NAME = "SPHERE_RADII";
13
14 #define RR \
15 if( moab::MB_SUCCESS != result ) return result
16
17 int main( int argc, char* argv[] )
18 {
19 if( argc < 3 )
20 {
21 std::cout << "Usage: " << argv[0] << " <input_mesh> <output_mesh>" << std::endl;
22 return 0;
23 }
24
25
26 moab::Interface* mbImpl = new moab::Core();
27
28
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,
39 moab::MB_TAG_DENSE | moab::MB_TAG_CREAT, &dum_val );
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
52 result = mbImpl->write_mesh( argv[2], &this_set, 1 );RR;
53
54 return 0;
55 }