#include <ReadRTT.hpp>
Classes | |
struct | boundary |
struct | cell |
struct | cell_def |
struct | dimData |
struct | facet |
struct | headerData |
struct | node |
struct | side |
struct | tet |
Public Member Functions | |
ErrorCode | load_file (const char *file_name, const EntityHandle *file_set, const FileOptions &opts, const SubsetList *subset_list=0, const Tag *file_id_tag=0) |
Load mesh from a file. More... | |
ReadRTT (Interface *impl=NULL) | |
virtual | ~ReadRTT () |
ErrorCode | read_tag_values (const char *file_name, const char *tag_name, const FileOptions &opts, std::vector< int > &tag_values_out, const SubsetList *subset_list=0) |
Read tag values from a file. More... | |
![]() | |
virtual | ~ReaderIface () |
Static Public Member Functions | |
static ReaderIface * | factory (Interface *) |
Private Types | |
typedef std::map< std::string, std::vector< std::string > > | rtt_flags |
typedef std::map< std::string, std::vector< cell > > | rtt_flags_data |
Private Member Functions | |
ErrorCode | generate_topology (std::vector< side > side_data, std::vector< cell > cell_data, std::vector< tet > tet_data, std::map< int, EntityHandle > &surface_map, std::map< int, EntityHandle > &volume_map) |
void | generate_parent_child_links (int num_ents[4], std::vector< EntityHandle > entity_map[4], std::vector< side > side_data, std::vector< cell > cell_data) |
void | set_surface_senses (int num_ents[4], std::vector< EntityHandle > entity_map[4], std::vector< side > side_data, std::vector< cell > cell_data) |
ErrorCode | setup_group_data (std::vector< EntityHandle > entity_map[4], std::vector< tet > tet_data, std::map< int, EntityHandle > &volume_map) |
EntityHandle | create_group (std::string group_name, int id) |
ErrorCode | parse_dims (std::ifstream &input_file) |
ErrorCode | read_cell_defs (std::ifstream &input_file) |
ErrorCode | build_moab (std::vector< node > node_data, std::vector< facet > facet_data, std::vector< tet > tet_data, std::map< int, EntityHandle > surface_map, std::map< int, EntityHandle > volume_map) |
ErrorCode | add_metadata (EntityHandle file_set) |
ErrorCode | read_header (const char *filename) |
ErrorCode | read_all_flags (const char *filename, std::vector< int > n_flags, std::string flag_id, rtt_flags &flags, std::map< std::string, int > &flag_idx) |
ErrorCode | read_side_flags (const char *filename) |
ErrorCode | side_process_faces (rtt_flags side_flags, std::vector< side > &side_data) |
ErrorCode | read_cell_flags (const char *filename) |
ErrorCode | cell_process_flag (rtt_flags cell_flags, std::string key) |
ErrorCode | read_nodes (const char *filename, std::vector< node > &node_data) |
ErrorCode | read_facets (const char *filename, std::vector< facet > &facet_data) |
ErrorCode | read_tets (const char *filename, std::vector< tet > &tet_data) |
ErrorCode | get_header_data (std::ifstream &input_file) |
cell | get_cell_data (std::string celldata) |
side | get_side_data (std::string sidedata) |
node | get_node_data (std::string nodedata) |
facet | get_facet_data (std::string facetdata) |
tet | get_tet_data (std::string tetdata) |
std::string | get_material_ref_flag () |
Get the material ref flag object. More... | |
std::string | get_volume_ref_flag () |
Get the volume ref flag object. More... | |
int | get_max_name_size (std::vector< cell > cell_data) |
Get the max name size object. More... | |
std::vector< std::string > | split_string (std::string string_to_split, char split_char) |
boundary | split_name (std::string atilla_cellname) |
int | count_sides (std::vector< side > side_data, std::vector< int > &surface_numbers) |
void | create_facets (const std::vector< facet > &facet_data, const std::map< int, EntityHandle > &surface_map, Range &mb_coords, EntityHandle file_set) |
ErrorCode | create_material_group (const std::string &material_name, int material_id, EntityHandle &handle) |
Private Attributes | |
headerData | header_data |
dimData | dim_data |
rtt_flags_data | cell_flag_datas |
std::map< std::string, std::map< int, int > > | cell_flag_indexes |
std::map< std::string, int > | cell_flag_idx |
rtt_flags_data | side_flag_datas |
std::map< std::string, std::map< int, int > > | side_flag_indexes |
std::map< std::string, int > | side_flag_idx |
std::map< int, cell_def > | cell_def_data |
std::vector< cell > | cell_data |
std::map< int, int > | cell_data_idx |
std::vector< side > | side_data |
ReadUtilIface * | readMeshIface |
Interface * | MBI |
GeomTopoTool * | myGeomTool |
Tag | geom_tag |
Tag | id_tag |
Tag | name_tag |
Tag | category_tag |
Tag | faceting_tol_tag |
Definition at line 112 of file ReadRTT.hpp.
|
private |
Definition at line 333 of file ReadRTT.hpp.
|
private |
Definition at line 334 of file ReadRTT.hpp.
ReadRTT::ReadRTT | ( | Interface * | impl = NULL | ) |
Definition at line 56 of file ReadRTT.cpp.
References category_tag, CATEGORY_TAG_NAME, CATEGORY_TAG_SIZE, ErrorCode, faceting_tol_tag, GEOM_DIMENSION_TAG_NAME, geom_tag, moab::Interface::globalId_tag(), id_tag, MB_CHK_ERR_CONT, MB_TAG_CREAT, MB_TAG_SPARSE, MB_TYPE_DOUBLE, MB_TYPE_INTEGER, MB_TYPE_OPAQUE, MBI, myGeomTool, name_tag, NAME_TAG_NAME, NAME_TAG_SIZE, moab::Interface::query_interface(), readMeshIface, and moab::Interface::tag_get_handle().
Referenced by factory().
|
virtual |
Definition at line 83 of file ReadRTT.cpp.
References MBI, myGeomTool, readMeshIface, and moab::Interface::release_interface().
|
private |
Add Metadata to the meshset, this includes the version number and contiguity value
Definition at line 366 of file ReadRTT.cpp.
References moab::ReadRTT::headerData::contiguity, ErrorCode, header_data, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_SPARSE, MB_TYPE_OPAQUE, MBI, moab::Interface::tag_get_handle(), and moab::Interface::tag_set_data().
|
private |
Builds the full MOAB representation of the data, making vertices from coordinates, triangles from vertices and tets from the same vertices. Tags appropriate to each dataset collection are applied, triangles are tagged with the surface id and side id they belong to, as well as tagging the surface with the same data. Tets are similarly tagged only with the Material number
node_data | the node data |
facet_data,the | triangles in the problem |
tet_data,the | tets in the problem |
surface_map,the | map of surface meshset and id numbers |
Definition at line 247 of file ReadRTT.cpp.
References moab::Interface::add_entities(), cell_flag_idx, moab::Interface::create_element(), create_facets(), moab::Interface::create_meshset(), moab::Interface::create_vertex(), ErrorCode, get_material_ref_flag(), get_volume_ref_flag(), moab::Range::insert(), MB_CHK_ERR, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_SPARSE, MB_TYPE_INTEGER, MBI, MBTET, MESHSET_SET, moab::Interface::tag_get_handle(), and moab::Interface::tag_set_data().
Referenced by load_file().
Process the standard flag from the cell_flags section
cell_flags,a | vector containing all the read side_flag section |
key,the | key to read |
cell_data,a | vector containing all the read cell data |
Definition at line 562 of file ReadRTT.cpp.
References cell_data, cell_data_idx, cell_flag_datas, cell_flag_indexes, get_cell_data(), moab::ReadRTT::cell::id, and MB_SUCCESS.
Referenced by read_cell_flags().
|
private |
Count the number of unique surface numbers in the dataset, also get list of surface numbers
side_data,collection | of all the side data in the mesh |
surface_numbers,collection | of surface numbers |
returns the number of surface numbers
|
private |
Definition at line 327 of file ReadRTT.cpp.
References moab::Interface::add_entities(), moab::Interface::create_element(), ErrorCode, moab::Range::insert(), MB_TAG_CREAT, MB_TAG_SPARSE, MB_TYPE_INTEGER, MBI, MBTRI, moab::Interface::tag_get_handle(), and moab::Interface::tag_set_data().
Referenced by build_moab().
|
private |
create a group of a given name, mustkeep track of id
group_name,name | of the group |
id,integer | id number |
returns the entity handle of the group
Definition at line 1365 of file ReadRTT.cpp.
References category_tag, CATEGORY_TAG_SIZE, moab::Interface::create_meshset(), ErrorCode, id_tag, MB_SUCCESS, MBI, MESHSET_SET, name_tag, and moab::Interface::tag_set_data().
Referenced by setup_group_data().
|
private |
Definition at line 302 of file ReadRTT.cpp.
References category_tag, CATEGORY_TAG_SIZE, moab::Interface::create_meshset(), ErrorCode, geom_tag, id_tag, MB_CHK_ERR, MB_SUCCESS, MBI, MESHSET_SET, name_tag, NAME_TAG_SIZE, and moab::Interface::tag_set_data().
Referenced by setup_group_data().
|
static |
Definition at line 50 of file ReadRTT.cpp.
References iface, and ReadRTT().
Referenced by moab::ReaderWriterSet::ReaderWriterSet().
|
private |
Generate parent child links to create DAGMC like structure of surface meshsets being children of parent cell meshsets. By looping over the surfaces (1->N), look in the description of the cells that are shared by that surface, and then make the surface the child of the parent volume. The appropriate sense data will be set later
num_ents[4],array | containing the number of surfaces, cells, groups etc |
entity_map[4],vector | of maps containing data by dimension |
side_data,vector | of all the side data in the problem |
cell_data,vector | of the cell data in the problem |
Definition at line 1200 of file ReadRTT.cpp.
References moab::Interface::add_parent_child(), cell_data, ErrorCode, MB_SUCCESS, MBI, and side_data.
Referenced by generate_topology().
|
private |
generates the topology of the problem from the already read input data, loops over the 2 and 3 dimension macrodata that exist from the rtt file, sides = dagmc surfaces, cells = dagmc cells, creates a meshset for each surface and tags with the id number, and similarly makes a meshset for dagmc cells and tags with the id number. The surfaces are added to the s surface map, where the key is the surface ID number (1->N) and (cells and surfaces are added to an dimesional entity map stored in the class
side_data,vector | of side data |
cell_data,vector | of vector of cell data |
tet_data,vector | of tet data |
surface_map,reference | to the surface map of data |
volume_map,reference | to the volume map of data |
Definition at line 170 of file ReadRTT.cpp.
References category_tag, CATEGORY_TAG_SIZE, cell_data, moab::Interface::create_meshset(), dim, ErrorCode, generate_parent_child_links(), geom_tag, id_tag, MB_SUCCESS, MBI, MESHSET_SET, set_surface_senses(), setup_group_data(), side_data, and moab::Interface::tag_set_data().
Referenced by load_file().
|
private |
Reads a single atomic cell data string and populates a cell struct
celldata,a | string of read data and |
Definition at line 978 of file ReadRTT.cpp.
References moab::ReadRTT::cell::id, MB_SET_ERR_RET_VAL, moab::ReadRTT::cell::name, and split_string().
Referenced by cell_process_flag().
|
private |
Reads a single atomic facet data string and populates a facet struct
facetdata,a | string of facet data and |
Definition at line 1020 of file ReadRTT.cpp.
References moab::ReadRTT::facet::connectivity, dim_data, header_data, moab::ReadRTT::facet::id, MB_SET_ERR_RET_VAL, moab::ReadRTT::dimData::nside_flag_types, moab::ReadRTT::facet::side_id, split_string(), moab::ReadRTT::facet::surface_number, and moab::ReadRTT::headerData::version.
Referenced by read_facets().
|
private |
Reads the header data into a class member structure
input_file,an | open filestream |
Definition at line 699 of file ReadRTT.cpp.
References moab::ReadRTT::headerData::contiguity, moab::ReadRTT::headerData::date, header_data, input_file, MB_SUCCESS, split_string(), moab::ReadRTT::headerData::title, and moab::ReadRTT::headerData::version.
Referenced by read_header().
|
private |
Get the material ref flag object.
Definition at line 511 of file ReadRTT.cpp.
References cell_flag_datas.
Referenced by build_moab(), and setup_group_data().
|
private |
Get the max name size object.
cell_data,vector | of cell data |
Definition at line 1130 of file ReadRTT.cpp.
References cell_data.
|
private |
Reads a single atomic node data string and populates a node struct
sidedata,a | string of read data and |
Definition at line 999 of file ReadRTT.cpp.
References moab::ReadRTT::node::id, MB_SET_ERR_RET_VAL, split_string(), moab::ReadRTT::node::x, moab::ReadRTT::node::y, and moab::ReadRTT::node::z.
Referenced by read_nodes().
|
private |
Reads a single atomic side data string and populates a side struct
sidedata,a | string of read data and |
Definition at line 939 of file ReadRTT.cpp.
References moab::ReadRTT::side::id, MB_SET_ERR_RET_VAL, moab::ReadRTT::boundary::name, moab::ReadRTT::side::names, moab::ReadRTT::boundary::sense, moab::ReadRTT::side::senses, split_name(), and split_string().
Referenced by side_process_faces().
|
private |
Reads a single atomic tet data string and populates a tet struct
tetdata,a | string of tet data and |
Definition at line 1068 of file ReadRTT.cpp.
References cell_def_data, moab::ReadRTT::tet::connectivity, dim_data, moab::ReadRTT::tet::flag_values, header_data, moab::ReadRTT::tet::id, MB_SET_ERR_RET_VAL, moab::ReadRTT::dimData::ncell_flag_types, split_string(), moab::ReadRTT::tet::type_id, and moab::ReadRTT::headerData::version.
Referenced by read_tets().
|
private |
Get the volume ref flag object.
Definition at line 521 of file ReadRTT.cpp.
References cell_flag_datas.
Referenced by build_moab(), read_cell_flags(), and setup_group_data().
|
virtual |
Load mesh from a file.
Method all readers must provide to import a mesh.
file_name | The file to read. |
file_set | Optional pointer to entity set representing file. If this is not NULL, reader may optionally tag the pointed-to set with format-specific meta-data. |
subset_list | An optional struct pointer specifying the tags identifying entity sets to be read. |
file_id_tag | If specified, reader should store for each entity it reads, a unique integer ID for this tag. |
Implements moab::ReaderIface.
Definition at line 104 of file ReadRTT.cpp.
References build_moab(), cell_data, ErrorCode, generate_topology(), MB_FILE_DOES_NOT_EXIST, MB_SUCCESS, MB_UNSUPPORTED_OPERATION, read_cell_flags(), read_facets(), read_header(), read_nodes(), read_side_flags(), read_tets(), and side_data.
|
private |
parse the dimensions of the problem from the file header
input_file,an | open filestream |
Definition at line 745 of file ReadRTT.cpp.
References moab::ReadRTT::dimData::cell_types, moab::ReadRTT::dimData::coor_units, dim_data, input_file, MB_SUCCESS, moab::ReadRTT::dimData::n_dim_topo, moab::ReadRTT::dimData::ncell_data, moab::ReadRTT::dimData::ncell_defs, moab::ReadRTT::dimData::ncell_flag_types, moab::ReadRTT::dimData::ncell_flags, moab::ReadRTT::dimData::ncell_types, moab::ReadRTT::dimData::ncells, moab::ReadRTT::dimData::ndim, moab::ReadRTT::dimData::nnode_data, moab::ReadRTT::dimData::nnode_flag_types, moab::ReadRTT::dimData::nnode_flags, moab::ReadRTT::dimData::nnodes, moab::ReadRTT::dimData::nnodes_max, moab::ReadRTT::dimData::nnodes_sides_max, moab::ReadRTT::dimData::nside_data, moab::ReadRTT::dimData::nside_flag_types, moab::ReadRTT::dimData::nside_flags, moab::ReadRTT::dimData::nside_types, moab::ReadRTT::dimData::nsides, moab::ReadRTT::dimData::nsides_max, moab::ReadRTT::dimData::prob_time_units, moab::ReadRTT::dimData::side_types, split_string(), and moab::ReadRTT::dimData::validate().
Referenced by read_header().
|
private |
Reads the full set of data from the file
filename,the | file to read all the data from |
n_flags,a | vector containing the number of flags |
flag_id,the | flag id to read |
flags,a | map for all the flags from the XX_flags section |
flag_idx,a | map for the index of the flags |
Definition at line 420 of file ReadRTT.cpp.
References input_file, MB_SUCCESS, and split_string().
Referenced by read_cell_flags(), and read_side_flags().
|
private |
parse the cell definition car
input_file,an | open filestream |
Definition at line 876 of file ReadRTT.cpp.
References cell_def_data, moab::ReadRTT::cell_def::id, input_file, MB_SUCCESS, moab::ReadRTT::cell_def::name, moab::ReadRTT::cell_def::nnodes, moab::ReadRTT::cell_def::nsides, moab::ReadRTT::cell_def::side_type, moab::ReadRTT::cell_def::sides_nodes, and split_string().
Referenced by read_header().
|
private |
Reads the full set of cell data from the file
filename,the | file to read all the side data from |
Definition at line 538 of file ReadRTT.cpp.
References cell_data, cell_data_idx, cell_flag_datas, cell_flag_idx, cell_flag_indexes, cell_process_flag(), dim_data, ErrorCode, get_volume_ref_flag(), MB_SUCCESS, moab::ReadRTT::dimData::ncell_flags, and read_all_flags().
Referenced by load_file().
Reads the full set of facet data from the file
filename,the | file to read all the side data from |
facet | data, a vector containing all the read facet data |
Definition at line 628 of file ReadRTT.cpp.
References get_facet_data(), input_file, and MB_SUCCESS.
Referenced by load_file().
|
private |
reads the full set of header data
filename,the | file to read the data from |
Definition at line 384 of file ReadRTT.cpp.
References ErrorCode, get_header_data(), input_file, parse_dims(), and read_cell_defs().
Referenced by load_file().
Reads the full set of node data from the file
filename,the | file to read all the side data from |
node | data, a vector containing all the read node data |
Definition at line 592 of file ReadRTT.cpp.
References get_node_data(), input_file, and MB_SUCCESS.
Referenced by load_file().
|
private |
Reads the full set of side data from the file
filename,the | file to read all the side data from |
Definition at line 479 of file ReadRTT.cpp.
References dim_data, ErrorCode, MB_SUCCESS, moab::ReadRTT::dimData::nside_flags, read_all_flags(), side_data, side_flag_idx, and side_process_faces().
Referenced by load_file().
|
virtual |
Read tag values from a file.
Read the list if all integer tag values from the file for a tag that is a single integer value per entity.
file_name | The file to read. |
tag_name | The tag for which to read values |
tag_values_out | Output: The list of tag values. |
subset_list | An array of tag name and value sets specifying the subset of the file to read. If multiple tags are specified, the sets that match all tags (intersection) should be read. |
subset_list_length | The length of the 'subset_list' array. |
Implements moab::ReaderIface.
Definition at line 94 of file ReadRTT.cpp.
References MB_NOT_IMPLEMENTED.
Reads the full set of tet data from the file
filename,the | file to read all the side data from |
tet | data, a vector containing all the read tet data |
Definition at line 664 of file ReadRTT.cpp.
References get_tet_data(), input_file, and MB_SUCCESS.
Referenced by load_file().
|
private |
Sets the appropriate surface senses for each surface in the problem. By looping through all the surfaces, we determine from the side_data vector, the volume id's that are shared, then using 1 to mean +ve sense and -1 to mean -ve sense wrt the volume.
num_ents[4],array | containing the number of surfaces, cells, groups etc |
entity_map[4],vector | of maps containing data by dimension |
side_data,vector | of all the side data in the problem |
cell_data,vector | of the cell data in the problem |
Definition at line 1242 of file ReadRTT.cpp.
References cell_data, ErrorCode, MB_SUCCESS, myGeomTool, SENSE_REVERSE, moab::GeomTopoTool::set_sense(), and side_data.
Referenced by generate_topology().
|
private |
creates the group data requried for dagmc, reflecting planes, material assignments etc
entity_map,vector | of vector of entitiy handles for each dimension |
tet_data,vector | of tet data |
Definition at line 1289 of file ReadRTT.cpp.
References moab::Interface::add_entities(), cell_flag_datas, cell_flag_idx, cell_flag_indexes, create_group(), create_material_group(), ErrorCode, get_material_ref_flag(), get_volume_ref_flag(), MB_CHK_ERR, and MBI.
Referenced by generate_topology().
|
private |
Process the FACES flag from the side_flags section
side_flags,a | vector containing all the read side data |
side_data,a | vector containing all the read side data |
Definition at line 497 of file ReadRTT.cpp.
References get_side_data(), MB_SUCCESS, and side_data.
Referenced by read_side_flags().
|
private |
Splits an Attila cellname and populates a boundary structure
attila_cellname,string | containing the boundary information |
Definition at line 1144 of file ReadRTT.cpp.
References moab::ReadRTT::boundary::name, and moab::ReadRTT::boundary::sense.
Referenced by get_side_data().
|
private |
Splits a string into a vector of substrings delimited by split_char
string_to_split,the | string that needs splitting into chunks |
split_char,the | character to split the string with |
Definition at line 1173 of file ReadRTT.cpp.
Referenced by get_cell_data(), get_facet_data(), get_header_data(), get_node_data(), get_side_data(), get_tet_data(), parse_dims(), read_all_flags(), and read_cell_defs().
|
private |
Definition at line 678 of file ReadRTT.hpp.
Referenced by create_group(), create_material_group(), generate_topology(), and ReadRTT().
|
private |
Definition at line 667 of file ReadRTT.hpp.
Referenced by cell_process_flag(), generate_parent_child_links(), generate_topology(), get_max_name_size(), load_file(), read_cell_flags(), and set_surface_senses().
|
private |
Definition at line 668 of file ReadRTT.hpp.
Referenced by cell_process_flag(), and read_cell_flags().
|
private |
Definition at line 666 of file ReadRTT.hpp.
Referenced by get_tet_data(), and read_cell_defs().
|
private |
Definition at line 655 of file ReadRTT.hpp.
Referenced by cell_process_flag(), get_material_ref_flag(), get_volume_ref_flag(), read_cell_flags(), and setup_group_data().
|
private |
Definition at line 658 of file ReadRTT.hpp.
Referenced by build_moab(), read_cell_flags(), and setup_group_data().
|
private |
Definition at line 657 of file ReadRTT.hpp.
Referenced by cell_process_flag(), read_cell_flags(), and setup_group_data().
|
private |
Definition at line 652 of file ReadRTT.hpp.
Referenced by get_facet_data(), get_tet_data(), parse_dims(), read_cell_flags(), and read_side_flags().
|
private |
Definition at line 678 of file ReadRTT.hpp.
Referenced by ReadRTT().
|
private |
Definition at line 678 of file ReadRTT.hpp.
Referenced by create_material_group(), generate_topology(), and ReadRTT().
|
private |
Definition at line 651 of file ReadRTT.hpp.
Referenced by add_metadata(), get_facet_data(), get_header_data(), and get_tet_data().
|
private |
Definition at line 678 of file ReadRTT.hpp.
Referenced by create_group(), create_material_group(), generate_topology(), and ReadRTT().
|
private |
Definition at line 674 of file ReadRTT.hpp.
Referenced by add_metadata(), build_moab(), create_facets(), create_group(), create_material_group(), generate_parent_child_links(), generate_topology(), ReadRTT(), setup_group_data(), and ~ReadRTT().
|
private |
Definition at line 676 of file ReadRTT.hpp.
Referenced by ReadRTT(), set_surface_senses(), and ~ReadRTT().
|
private |
Definition at line 678 of file ReadRTT.hpp.
Referenced by create_group(), create_material_group(), and ReadRTT().
|
private |
Definition at line 672 of file ReadRTT.hpp.
Referenced by ReadRTT(), and ~ReadRTT().
|
private |
Definition at line 670 of file ReadRTT.hpp.
Referenced by generate_parent_child_links(), generate_topology(), load_file(), read_side_flags(), set_surface_senses(), and side_process_faces().
|
private |
Definition at line 661 of file ReadRTT.hpp.
|
private |
Definition at line 663 of file ReadRTT.hpp.
Referenced by read_side_flags().
|
private |
Definition at line 662 of file ReadRTT.hpp.