- Examples
- addPCdata.cpp.
Definition at line 28 of file addPCdata.cpp.
33 std::string inputfile, outfile(
"out.h5m" ), sourcefile, variable_name;
35 opts.
addOpt< std::string >(
"input,i",
"input mesh filename", &inputfile );
36 opts.
addOpt< std::string >(
"source,s",
"h5m file aligned with the mesh input file", &sourcefile );
37 opts.
addOpt< std::string >(
"output,o",
"output mesh filename", &outfile );
39 opts.
addOpt< std::string >(
"var,v",
"variable to extract and add to output file", &variable_name );
40 opts.
addOpt<
int >(
"pentagon,p",
"switch for dual mesh ", &dual_mesh );
44 std::cout <<
"input file: " << inputfile <<
"\n";
45 std::cout <<
"source file: " << sourcefile <<
"\n";
46 std::cout <<
"variable to copy: " << variable_name <<
"\n";
47 std::cout <<
"output file: " << outfile <<
"\n";
49 if( inputfile.empty() )
85 double defDouble = -1.e10;
88 defVal = (
void*)( &defInt );
92 defVal = (
void*)( &defDouble );
112 std::vector< int > gids;
113 gids.resize( iniVerts.
size() );
116 std::map< int, EntityHandle > fromGidToEh;
120 fromGidToEh[gids[i]] = *vit;
124 char* valTag =
new char[sizeInBytes];
126 std::cout <<
" size of tag in bytes:" << sizeInBytes <<
"\n";
137 rval = mb2->
tag_get_data( sourceTag, &sourceHandle, 1, (
void*)valTag );
MB_CHK_SET_ERR( rval,
"can't get value on source tag " );
References ProgOptions::addOpt(), moab::Range::begin(), moab::Range::end(), ErrorCode, moab::Core::get_entities_by_dimension(), moab::Core::load_file(), mb, MB_CHK_SET_ERR, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_DOUBLE, MB_TYPE_INTEGER, ProgOptions::parseCommandLine(), ProgOptions::printHelp(), moab::Range::size(), moab::Core::tag_get_bytes(), moab::Core::tag_get_data(), moab::Core::tag_get_data_type(), moab::Core::tag_get_handle(), moab::Core::tag_get_length(), moab::Core::tag_set_data(), and moab::Core::write_file().