#include <iostream>
#include <vector>
#include "moab/Core.hpp"
#include "MBTagConventions.hpp"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
- Examples
- QuadTriConv.cpp.
Definition at line 20 of file QuadTriConv.cpp.
24 if( NULL ==
mb )
return 1;
26 std::string filename, outfile;
27 outfile = string(
"out.h5m" );
28 if( argc == 1 )
return 0;
29 if( argc > 1 ) filename = string( argv[1] );
30 if( argc > 2 ) outfile = string( argv[2] );
39 cout <<
" number of cells : " << cells.
size() <<
"\n";
53 vector< EntityHandle > newConnec;
54 newConnec.push_back( connec[0] );
57 while( index < num_verts - 2 )
59 int next_index = ( index + 1 );
60 if( connec[next_index] != newConnec[new_size - 1] )
62 newConnec.push_back( connec[next_index] );
68 if( ( connec[num_verts - 1] != connec[num_verts - 2] ) && ( connec[num_verts - 1] != connec[0] ) )
70 newConnec.push_back( connec[num_verts - 1] );
73 if( new_size < num_verts )
76 modifiedCells.
insert( cell );
78 EntityType type =
MBTRI;
81 else if( new_size == 4 )
83 else if( new_size > 4 )
104 gids.resize( verts.
size() );
109 for(
size_t i = 1; i <= verts.
size(); i++ )
110 gids[i - 1] = (
int)i;
115 cout <<
" wrote file " << outfile <<
" with " << modifiedCells.
size() <<
" modified cells\n";
References moab::Range::begin(), moab::Core::create_element(), moab::Core::delete_entities(), moab::Range::end(), ErrorCode, moab::Core::get_connectivity(), moab::Core::get_entities_by_dimension(), moab::Range::insert(), moab::Core::load_file(), mb, MB_CHK_SET_ERR, MBPOLYGON, MBQUAD, MBTRI, moab::Range::size(), moab::Core::tag_get_data(), moab::Core::tag_get_handle(), moab::Core::tag_set_data(), and moab::Core::write_file().