44 int main(
int argc,
char* argv[] )
49 std::string inputfile, outfile(
"out.h5m" ), sourcefile;
51 opts.
addOpt< std::string >(
"input,i",
"input mesh filename", &inputfile );
52 opts.
addOpt< std::string >(
"source,s",
"h5m file aligned with the mesh input file", &sourcefile );
53 opts.
addOpt< std::string >(
"output,o",
"output mesh filename", &outfile );
57 std::cout <<
"input mesh file: " << inputfile <<
"\n";
58 std::cout <<
"source file: " << sourcefile <<
"\n";
59 std::cout <<
"output file: " << outfile <<
"\n";
61 if( inputfile.empty() )
85 std::vector< int > gids;
86 gids.resize( iniVerts.
size() );
89 std::map< int, EntityHandle > fromGidToEh;
93 fromGidToEh[gids[i]] = *vit;
99 std::vector< int > gids2;
100 gids2.resize( sourceVerts.
size() );
102 std::map< int, EntityHandle > fromGid2ToEh;
106 fromGid2ToEh[gids2[i]] = *vit;
110 for(
size_t i = 0; i < gids2.size(); i++ )
112 int globalId = gids2[i];
114 usedVerts.
insert( usedVert );
127 std::vector< EntityHandle > nconn( nnodes );
128 bool goodCell =
true;
129 for(
int i = 0; i < nnodes; i++ )
133 if(
index < 0 ) goodCell =
false;
134 int id = gids[
index];
135 if( fromGid2ToEh.find(
id ) == fromGid2ToEh.end() )
138 nconn[i] = fromGid2ToEh[id];
140 if( !goodCell )
continue;
141 EntityType type =
MBTRI;
144 else if( nnodes == 4 )
146 else if( nnodes > 4 )