50 int main(
int argc,
char* argv[] )
55 std::string inputfile, outfile(
"out.h5m" ), sourcefile, variable_name;
57 opts.
addOpt< std::string >(
"input,i",
"input mesh filename", &inputfile );
58 opts.
addOpt< std::string >(
"source,s",
"h5m file aligned with the mesh input file", &sourcefile );
59 opts.
addOpt< std::string >(
"output,o",
"output mesh filename", &outfile );
61 opts.
addOpt< std::string >(
"var,v",
"variable to extract and add to output file", &variable_name );
62 opts.
addOpt<
int >(
"pentagon,p",
"switch for dual mesh ", &dual_mesh );
66 std::cout <<
"input file: " << inputfile <<
"\n";
67 std::cout <<
"source file: " << sourcefile <<
"\n";
68 std::cout <<
"variable to copy: " << variable_name <<
"\n";
69 std::cout <<
"output file: " << outfile <<
"\n";
71 if( inputfile.empty() )
106 int defInt = -100000;
107 double defDouble = -1.e10;
110 defVal = (
void*)( &defInt );
114 defVal = (
void*)( &defDouble );
119 "can't create new tag " );
136 std::vector< int > gids;
137 gids.resize( iniVerts.
size() );
140 std::map< int, EntityHandle > fromGidToEh;
144 fromGidToEh[gids[i]] = *vit;
148 char* valTag =
new char[sizeInBytes];
150 std::cout <<
" size of tag in bytes:" << sizeInBytes <<
"\n";
162 "can't get value on source tag " );
165 "can't set value on initial mesh, new tag " );