32 int main(
int argc,
char* argv[] )
37 std::string inputfile1(
"fTargetIntx.h5m" ), inputfile2(
"ocn_proj.h5m" ), outfile(
"out.h5m" );
39 std::string tag_name(
"a2oTAG_proj" );
41 opts.
addOpt< std::string >(
"input1,i",
"input mesh filename 1", &inputfile1 );
42 opts.
addOpt< std::string >(
"input2,j",
"input mesh filename 2", &inputfile2 );
43 opts.
addOpt< std::string >(
"tagname,n",
"tag to compare", &tag_name );
44 opts.
addOpt< std::string >(
"outfile,o",
"output file", &outfile );
56 std::cout <<
" opened " << inputfile1 <<
" and " << inputfile2 <<
" with initial h5m data.\n";
68 std::cout << inputfile1 <<
" has " << nodes.
size() <<
" vertices " << edges.
size() <<
" edges " << cells.
size()
72 std::map< int, EntityHandle > vGidHandle;
73 std::map< int, EntityHandle > eGidHandle;
74 std::map< int, EntityHandle > cGidHandle;
75 std::vector< int > gids;
78 gids.resize( nodes.
size() );
83 vGidHandle[gids[i++]] = *vit;
86 gids.resize( edges.
size() );
91 eGidHandle[gids[i++]] = *vit;
94 gids.resize( cells.
size() );
99 cGidHandle[gids[i++]] = *vit;
111 std::cout << inputfile2 <<
" has " << nodes2.
size() <<
" vertices " << edges2.
size() <<
" edges " << cells2.
size()
115 std::map< int, EntityHandle > vGidHandle2;
116 std::map< int, EntityHandle > eGidHandle2;
117 std::map< int, EntityHandle > cGidHandle2;
121 gids.resize( nodes2.
size() );
127 vGidHandle2[gids[i++]] = *vit;
130 gids.resize( edges2.
size() );
135 eGidHandle2[gids[i++]] = *vit;
138 gids.resize( cells2.
size() );
143 cGidHandle2[gids[i++]] = *vit;
151 std::cout <<
"length tag : " << len_tag <<
"\n";
155 std::cout <<
" meshes are different between 2 files, cells.size do not agree \n";
158 std::vector< double > vals;
159 vals.resize( len_tag * cells.
size() );
164 std::vector< double > vals2;
165 vals2.resize( len_tag * cells2.
size() );
170 std::string new_tag_name = tag_name +
"_2";
171 Tag newTag, newTagDiff;
172 double def_val = -1000;
175 std::string tag_name_diff = tag_name +
"_diff";
181 double val2 = vals2[i];
187 int indx = cells.
index( c1 );
188 double diff = vals[indx] - val2;
193 std::cout <<
" wrote file " << outfile <<
"\n";