MOAB: Mesh Oriented datABase  (version 5.2.1)
DeleteEdges.cpp File Reference
#include "moab/Core.hpp"
#include "moab/Range.hpp"
#include "moab/CN.hpp"
#include <iostream>
+ Include dependency graph for DeleteEdges.cpp:

Go to the source code of this file.

Defines

#define MESH_DIR   "."

Functions

int main (int argc, char **argv)

Variables

string test_file_name = string( MESH_DIR ) + string( "/hex01.vtk" )
string out_file = string( "outFile.h5m" )

Define Documentation

#define MESH_DIR   "."

Definition at line 16 of file DeleteEdges.cpp.


Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 22 of file DeleteEdges.cpp.

References moab::Core::delete_entities(), edges, moab::Core::get_entities_by_dimension(), moab::Core::load_mesh(), mb, MB_CHK_ERR, out_file, test_file_name, and moab::Core::write_file().

{
    if( argc > 1 )
    {
        // User has input a mesh file
        test_file_name = argv[1];
    }
    if( argc > 2 )
    {
        // User has specified an output file
        out_file = argv[2];
    }

    // Instantiate & load a mesh from a file
    Core* mb = new( std::nothrow ) Core;
    if( NULL == mb ) return 1;
    ErrorCode rval = mb->load_mesh( test_file_name.c_str() );MB_CHK_ERR( rval );

    Range edges;
    rval = mb->get_entities_by_dimension( 0, 1, edges );MB_CHK_ERR( rval );
    rval = mb->delete_entities( edges );MB_CHK_ERR( rval );

    rval = mb->write_file( out_file.c_str() );MB_CHK_ERR( rval );
    delete mb;

    return 0;
}

Variable Documentation

string out_file = string( "outFile.h5m" )

Definition at line 20 of file DeleteEdges.cpp.

Referenced by main().

string test_file_name = string( MESH_DIR ) + string( "/hex01.vtk" )

Definition at line 19 of file DeleteEdges.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines