MOAB: Mesh Oriented datABase  (version 5.2.1)
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.

Defines

#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"

Define Documentation

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

Definition at line 14 of file sphere_decomp.cpp.

Referenced by main().


Function Documentation

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

Definition at line 17 of file sphere_decomp.cpp.

References SphereDecomp::build_sphere_mesh(), MB_SUCCESS, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_DOUBLE, RR, and SPHERE_RADII_TAG_NAME.

{
    if( argc < 3 )
    {
        std::cout << "Usage: " << argv[0] << " <input_mesh> <output_mesh>" << std::endl;
        return 0;
    }

    // create MOAB
    moab::Interface* mbImpl = new moab::Core();

    // read in mesh
    moab::ErrorCode result = mbImpl->load_mesh( argv[1] );
    if( moab::MB_SUCCESS != result )
    {
        std::cout << "Problems loading mesh." << std::endl;
        return 1;
    }

    moab::Tag sphere_radii_tag = 0;
    double dum_val             = 0.1;
    result = mbImpl->tag_get_handle( SPHERE_RADII_TAG_NAME, 1, moab::MB_TYPE_DOUBLE, sphere_radii_tag,
                                     moab::MB_TAG_DENSE | moab::MB_TAG_CREAT, &dum_val );
    if( moab::MB_SUCCESS != result )
    {
        std::cout << "Problem allocating SPHERE_RADII tag." << std::endl;
        return 1;
    }

    SphereDecomp sd( mbImpl );

    moab::EntityHandle this_set = 0;
    result                      = sd.build_sphere_mesh( SPHERE_RADII_TAG_NAME, &this_set );RR;

    // write mesh
    result = mbImpl->write_mesh( argv[2], &this_set, 1 );RR;

    return 0;
}

Variable Documentation

const char* SPHERE_RADII_TAG_NAME = "SPHERE_RADII"

Definition at line 12 of file sphere_decomp.cpp.

Referenced by main().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines