Example demonstrating partial loading of mesh files based on tag values. More...
Include dependency graph for LoadPartial.cpp:Go to the source code of this file.
Macros | |
| #define | NTAGVALS 3 |
Functions | |
| ErrorCode | get_file_options (int argc, char **argv, string &filename, string &tagName, vector< int > &tagValues) |
| int | main (int argc, char **argv) |
Example demonstrating partial loading of mesh files based on tag values.
This example shows how to:
This is particularly useful for parallel applications where each processor needs to load only its assigned portion of a large mesh.
Load a part of a file
To run: LoadPartial [file] [tag_name] [val1] [val2] ...
In this example, it is shown how to load only a part of one file; the file must be organized in sets. (cherry-picking only the sets we want) The sets to load are identified by a tag name and the tag values for the sets of interest. This procedure is used when reading in parallel, as each processor will load only its part of the file, identified either by partition or by material/block sets by default, this example will load parallel partition sets with values 1, 2, and 5 from ../MeshFiles/unittest/64bricks_1khex.h5m The example will always write the output to a file name part.h5m
| argc | Number of command line arguments |
| argv | Command line arguments array |
Definition in file LoadPartial.cpp.
| #define NTAGVALS 3 |
Definition at line 42 of file LoadPartial.cpp.
| ErrorCode get_file_options | ( | int | argc, |
| char ** | argv, | ||
| string & | filename, | ||
| string & | tagName, | ||
| vector< int > & | tagValues | ||
| ) |
Definition at line 48 of file LoadPartial.cpp.
References MB_SUCCESS, and MESH_DIR.
Referenced by main().
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 79 of file LoadPartial.cpp.
References ErrorCode, moab::Core::get_entities_by_type(), get_file_options(), moab::Core::load_file(), mb, MB_CHK_ERR, MB_CHK_SET_ERR, MB_SUCCESS, MBVERTEX, NTAGVALS, PARALLEL_PARTITION_TAG_NAME, moab::Range::size(), moab::Core::tag_get_data(), moab::Core::tag_get_handle(), and moab::Core::write_file().