- Examples
- ExtractLand.cpp.
Definition at line 22 of file ExtractLand.cpp.
27 std::string pg2file, lndfile, outfile;
29 opts.
addOpt< std::string >(
"land,l",
"phys grid filename", &lndfile );
30 opts.
addOpt< std::string >(
"pg2file,p",
"pg2 mesh file", &pg2file );
31 opts.
addOpt< std::string >(
"output,o",
"output mesh filename", &outfile );
35 std::cout <<
" land file " << lndfile <<
"\n";
36 std::cout <<
"pg2 mesh file: " << pg2file <<
"\n";
37 std::cout <<
"output file: " << outfile <<
"\n";
39 if( lndfile.empty() || pg2file.empty() || outfile.empty() )
62 std::vector< int > globalIdsCells;
63 globalIdsCells.resize( cells.
size() );
66 std::vector< int > globalIdsVerts;
67 globalIdsVerts.resize( verts1.
size() );
72 std::map< int, EntityHandle > gidToCell;
76 gidToCell[globalIdsCells[i]] = *it;
85 for( i = 0; i < (int)verts1.
size(); i++ )
87 int gid = globalIdsVerts[i];
88 landCells.
insert( gidToCell[gid] );
References moab::Core::add_entities(), ProgOptions::addOpt(), moab::Range::begin(), moab::Core::create_meshset(), moab::Core::delete_entities(), moab::Range::end(), ErrorCode, moab::Core::get_entities_by_dimension(), moab::Core::globalId_tag(), moab::Range::insert(), moab::Core::load_file(), mb, MB_CHK_SET_ERR, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_DOUBLE, MESHSET_SET, ProgOptions::parseCommandLine(), ProgOptions::printHelp(), moab::Range::size(), moab::Core::tag_get_data(), moab::Core::tag_get_handle(), moab::Core::tag_set_data(), and moab::Core::write_file().