31 int main(
int argc,
char* argv[] )
35 std::string inputfile(
"penta3d.h5m" ), outfile(
"penta3d_ch.h5m" ), chunkfile_name, gsmapfile;
36 opts.
addOpt< std::string >(
"input,i",
"input mesh filename", &inputfile );
37 opts.
addOpt< std::string >(
"chunkFile,n",
"chunk file from cam run", &chunkfile_name );
38 opts.
addOpt< std::string >(
"gsMAPfile,g",
"gsmap file", &gsmapfile );
39 opts.
addOpt< std::string >(
"output,o",
"output mesh filename", &outfile );
47 std::cout <<
" opened " << inputfile <<
" with initial h5m data.\n";
58 std::cout <<
" it has " << nodes.
size() <<
" vertices " << edges.
size() <<
" edges " << cells.
size() <<
" cells\n";
61 std::map< int, EntityHandle > vGidHandle;
62 std::map< int, EntityHandle > eGidHandle;
63 std::map< int, EntityHandle > cGidHandle;
64 std::vector< int > gids;
67 gids.resize( nodes.
size() );
72 vGidHandle[gids[i++]] = *vit;
75 gids.resize( edges.
size() );
80 eGidHandle[gids[i++]] = *vit;
83 gids.resize( cells.
size() );
88 cGidHandle[gids[i++]] = *vit;
91 if( chunkfile_name.length() > 0 )
95 inFile.open( chunkfile_name.c_str() );
98 cout <<
"Unable to open chunk file";
105 "can't define processor tag" );
108 "can't define chunk tag" );
110 int proc, lcid, ncols;
111 while( inFile >> proc )
113 inFile >> lcid >> ncols;
115 for( i = 0; i < ncols; i++ )
127 if( gsmapfile.length() > 0 )
132 inFile.open( gsmapfile.c_str() );
135 cout <<
"Unable to open gsmap file";
141 std::string procTagName = gsmapfile +
"_proc";
144 "can't define processor tag" );
145 std::string segTagName = gsmapfile +
"_seg";
148 "can't define segment tag" );
150 int compid, ngseg, gsize;
151 inFile >> compid >> ngseg >> gsize;
152 for( i = 1; i <= ngseg; i++ )
155 inFile >> start >> len >> pe;
157 for(
int j = 0; j < len; j++ )
170 std::cout <<
" wrote file " << outfile <<
"\n";