#include <ReadRTT.hpp>
Classes | |
struct | boundary |
struct | cell |
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... | |
Public Member Functions inherited from moab::ReaderIface | |
virtual | ~ReaderIface () |
Static Public Member Functions | |
static ReaderIface * | factory (Interface *) |
Private Member Functions | |
ErrorCode | generate_topology (std::vector< side > side_data, std::vector< cell > cell_data, std::map< int, EntityHandle > &surface_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]) |
EntityHandle | create_group (std::string group_name, int id) |
ErrorCode | build_moab (std::vector< node > node_data, std::vector< facet > facet_data, std::vector< tet > tet_data, std::map< int, EntityHandle > surface_map) |
ErrorCode | read_header (const char *filename) |
ErrorCode | read_sides (const char *filename, std::vector< side > &side_data) |
ErrorCode | read_cells (const char *filename, std::vector< cell > &cell_data) |
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::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) |
Private Attributes | |
headerData | header_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.
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 79 of file ReadRTT.cpp.
References MBI, myGeomTool, readMeshIface, and moab::Interface::release_interface().
|
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 239 of file ReadRTT.cpp.
References moab::Interface::add_entities(), moab::ReadRTT::facet::connectivity, moab::ReadRTT::tet::connectivity, moab::Interface::create_element(), moab::Interface::create_meshset(), moab::Interface::create_vertex(), ErrorCode, moab::Range::insert(), moab::ReadRTT::tet::material_number, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_SPARSE, MB_TYPE_INTEGER, MBI, MBTET, MBTRI, MESHSET_SET, moab::ReadRTT::facet::side_id, moab::ReadRTT::facet::surface_number, moab::Interface::tag_get_handle(), moab::Interface::tag_set_data(), moab::ReadRTT::node::x, moab::ReadRTT::node::y, and moab::ReadRTT::node::z.
Referenced by load_file().
|
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 |
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 917 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().
|
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 813 of file ReadRTT.cpp.
References moab::Interface::add_parent_child(), ErrorCode, MB_SUCCESS, and MBI.
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 |
surface_map,reference | to the surface map of data |
Definition at line 166 of file ReadRTT.cpp.
References category_tag, CATEGORY_TAG_SIZE, 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(), 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 633 of file ReadRTT.cpp.
References moab::ReadRTT::cell::id, MB_SET_ERR_RET_VAL, moab::ReadRTT::cell::name, and split_string().
Referenced by read_cells().
|
private |
Reads a single atomic facet data string and populates a facet struct
facetdata,a | string of facet data and |
Definition at line 675 of file ReadRTT.cpp.
References moab::ReadRTT::facet::connectivity, header_data, moab::ReadRTT::facet::id, MB_SET_ERR_RET_VAL, 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 547 of file ReadRTT.cpp.
References 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 |
Reads a single atomic node data string and populates a node struct
sidedata,a | string of read data and |
Definition at line 654 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 594 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 read_sides().
|
private |
Reads a single atomic tet data string and populates a tet struct
tetdata,a | string of tet data and |
Definition at line 716 of file ReadRTT.cpp.
References moab::ReadRTT::tet::connectivity, header_data, moab::ReadRTT::tet::id, moab::ReadRTT::tet::material_number, MB_SET_ERR_RET_VAL, split_string(), and moab::ReadRTT::headerData::version.
Referenced by read_tets().
|
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 100 of file ReadRTT.cpp.
References build_moab(), ErrorCode, generate_topology(), MB_FILE_DOES_NOT_EXIST, MB_SUCCESS, MB_UNSUPPORTED_OPERATION, read_cells(), read_facets(), read_header(), read_nodes(), read_sides(), and read_tets().
Reads the full set of cell data from the file
filename,the | file to read all the side data from |
cell | data, a vector containing all the read cell data |
Definition at line 405 of file ReadRTT.cpp.
References get_cell_data(), input_file, and MB_SUCCESS.
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 476 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 340 of file ReadRTT.cpp.
References ErrorCode, get_header_data(), and input_file.
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 440 of file ReadRTT.cpp.
References get_node_data(), input_file, and MB_SUCCESS.
Referenced by load_file().
Reads the full set of side data from the file
filename,the | file to read all the side data from |
side | data, a vector containing all the read side data |
Definition at line 370 of file ReadRTT.cpp.
References get_side_data(), input_file, and MB_SUCCESS.
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 90 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 512 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 855 of file ReadRTT.cpp.
References ErrorCode, MB_SUCCESS, myGeomTool, SENSE_REVERSE, and moab::GeomTopoTool::set_sense().
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 |
Definition at line 902 of file ReadRTT.cpp.
References moab::Interface::add_entities(), create_group(), ErrorCode, and MBI.
Referenced by generate_topology().
|
private |
Splits an Attila cellname and populates a boundary structure
attila_cellname,string | containing the boundary information |
Definition at line 757 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 786 of file ReadRTT.cpp.
Referenced by get_cell_data(), get_facet_data(), get_header_data(), get_node_data(), get_side_data(), and get_tet_data().
|
private |
Definition at line 448 of file ReadRTT.hpp.
Referenced by create_group(), generate_topology(), and ReadRTT().
|
private |
Definition at line 448 of file ReadRTT.hpp.
Referenced by ReadRTT().
|
private |
Definition at line 448 of file ReadRTT.hpp.
Referenced by generate_topology(), and ReadRTT().
|
private |
Definition at line 440 of file ReadRTT.hpp.
Referenced by get_facet_data(), get_header_data(), and get_tet_data().
|
private |
Definition at line 448 of file ReadRTT.hpp.
Referenced by create_group(), generate_topology(), and ReadRTT().
|
private |
Definition at line 444 of file ReadRTT.hpp.
Referenced by build_moab(), create_group(), generate_parent_child_links(), generate_topology(), ReadRTT(), setup_group_data(), and ~ReadRTT().
|
private |
Definition at line 446 of file ReadRTT.hpp.
Referenced by ReadRTT(), set_surface_senses(), and ~ReadRTT().
|
private |
Definition at line 448 of file ReadRTT.hpp.
Referenced by create_group(), and ReadRTT().
|
private |
Definition at line 442 of file ReadRTT.hpp.
Referenced by ReadRTT(), and ~ReadRTT().