#include <ReadTetGen.hpp>
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 a file More... | |
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... | |
ReadTetGen (Interface *impl=NULL) | |
Constructor. More... | |
virtual | ~ReadTetGen () |
Destructor. More... | |
Public Member Functions inherited from moab::ReaderIface | |
virtual | ~ReaderIface () |
Static Public Member Functions | |
static ReaderIface * | factory (Interface *) |
Private Member Functions | |
ErrorCode | open_file (const std::string &input_file_name, const std::string &input_name_base, const std::string &input_name_suffix, const char *file_type_suffix, const char *file_name_option, const FileOptions &opts, std::ifstream &file_stream, bool file_required=false) |
Try to open one of several input files. More... | |
ErrorCode | read_line (std::istream &file, std::string &line, int &lineno) |
Read a line from a file. More... | |
ErrorCode | read_line (std::istream &file, double *values_out, int num_values, int &lineno) |
Read a line of double values from a file. More... | |
ErrorCode | parse_attr_list (const std::string &option_str, std::vector< Tag > &tag_list, std::vector< int > &index_list, const char *group_designator=0) |
Parse option string specifying mapping from attributes to tags. More... | |
ErrorCode | read_node_file (std::istream &file, const Tag *attr_tag_list, const int *attr_tag_index, int attr_tag_list_len, std::vector< EntityHandle > &nodes) |
ErrorCode | read_elem_file (EntityType type, std::istream &file, const std::vector< EntityHandle > &nodes, Range &elems) |
Private Attributes | |
Interface * | mbIface |
ReadUtilIface * | readTool |
Definition at line 36 of file ReadTetGen.hpp.
moab::ReadTetGen::ReadTetGen | ( | Interface * | impl = NULL | ) |
|
virtual |
Destructor.
Definition at line 26 of file ReadTetGen.cpp.
References mbIface, readTool, and moab::Interface::release_interface().
|
static |
Definition at line 16 of file ReadTetGen.cpp.
References ReadTetGen().
Referenced by moab::ReaderWriterSet::ReaderWriterSet().
|
virtual |
load a file
Implements moab::ReaderIface.
Definition at line 75 of file ReadTetGen.cpp.
References moab::ReadUtilIface::assign_ids(), ErrorCode, moab::FileOptions::get_str_option(), MB_SET_ERR, MB_SUCCESS, MB_TYPE_OUT_OF_RANGE, MB_UNSUPPORTED_OPERATION, MBEDGE, MBTET, MBTRI, open_file(), parse_attr_list(), read_elem_file(), read_node_file(), readTool, and size.
|
private |
Try to open one of several input files.
input_file_name | The file name as passed in by the application |
input_name_base | If the input file name ends with a known suffix, the portition of the input file without the suffix. Otherwise equal to input_file_name. |
input_file_suffix | If the input file name ends with a known suffix, the suffix. Otherwise empty. |
file_type_suffix | The suffix for the file type that is to be opened. |
file_name_option | The FileOptions option name specifying the file name to open. |
opts | Input options list. |
file_stream | The stream to open for the file. |
Definition at line 31 of file ReadTetGen.cpp.
References ErrorCode, moab::FileOptions::get_option(), MB_ENTITY_NOT_FOUND, MB_FILE_DOES_NOT_EXIST, MB_SET_ERR, and MB_SUCCESS.
Referenced by load_file().
|
private |
Parse option string specifying mapping from attributes to tags.
Given a file option string describing the mapping from tetgen attributes to MOAB tags, parse it and populate the passed vectors.
option_str | Input: The option string to parse. |
tag_list | Output: A list tag handles, one for each attribute. Tag handle value will be zero if the attribute is to be interpreted as a group id. |
index_list | Output: Which array index to store the attribute value at for a multi-valued tag. Zero for single- valued tags. -1 if the corresponding attribute value is to be interpreted as a group ID. |
group_designator | Input: special tag name used to designate an attribute as the group (surface or volume) ID. |
Definition at line 151 of file ReadTetGen.cpp.
References ErrorCode, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_DOUBLE, mbIface, and moab::Interface::tag_get_handle().
Referenced by load_file().
|
private |
Definition at line 345 of file ReadTetGen.cpp.
References moab::Interface::add_entities(), moab::Interface::create_meshset(), dim, ErrorCode, GEOM_DIMENSION_TAG_NAME, moab::ReadUtilIface::get_element_connect(), moab::Interface::globalId_tag(), moab::Range::insert(), MB_SET_ERR, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_SPARSE, MB_TYPE_INTEGER, MBEDGE, mbIface, MBTET, MBTRI, MESHSET_SET, read_line(), readTool, moab::Interface::tag_get_handle(), and moab::Interface::tag_set_data().
Referenced by load_file().
|
private |
Read a line of double values from a file.
Definition at line 217 of file ReadTetGen.cpp.
References ErrorCode, MB_SET_ERR, MB_SUCCESS, and read_line().
|
private |
Read a line from a file.
Read the next non-empty line. Strips comments.
file | The stream to read from |
line | Output: the line read from the stream |
lineno | Incremented for each real line read from the stream (including disgarded empty and comment lines.) |
Definition at line 193 of file ReadTetGen.cpp.
References MB_FILE_WRITE_ERROR, and MB_SUCCESS.
Referenced by read_elem_file(), read_line(), and read_node_file().
|
private |
Definition at line 246 of file ReadTetGen.cpp.
References dim, ErrorCode, moab::ReadUtilIface::get_node_coords(), moab::Interface::globalId_tag(), moab::Range::insert(), MB_SET_ERR, MB_SUCCESS, mbIface, read_line(), readTool, and moab::Interface::tag_set_data().
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 66 of file ReadTetGen.cpp.
References MB_NOT_IMPLEMENTED.
|
private |
Definition at line 62 of file ReadTetGen.hpp.
Referenced by parse_attr_list(), read_elem_file(), read_node_file(), and ~ReadTetGen().
|
private |
Definition at line 63 of file ReadTetGen.hpp.
Referenced by load_file(), read_elem_file(), read_node_file(), ReadTetGen(), and ~ReadTetGen().