19#include <unordered_map>
35 using ErrorHandler = std::function<void(
const std::ostringstream &)>;
39 template <
typename EntityId>
50 {
"BLOCK_",
"SURFACE_",
"ASSEMBLY_"})
60 ErrorHandler errorHandler = [](
const std::ostringstream &errmsg) {
75 void parse(
const std::string &parseData)
79 for (
const auto &option : options) {
85 void parse_option(std::string optionName,
const std::string &optionValue)
89 if (optionName ==
"name") {
92 else if (optionName ==
"data") {
96 std::ostringstream errmsg;
97 errmsg <<
"Unrecognized nodeset option: " << optionName;
104 if (!option.empty()) {
107 if (optionTokens.size() != 2) {
108 std::ostringstream errmsg;
109 errmsg <<
"Unrecognized nodeset option: " << option;
123 for (
const std::string &nodeString : nodesetData) {
125 std::ostringstream errmsg;
126 errmsg <<
"Unrecognized nodeset node id: " << nodeString;
129 EntityId node = std::stoull(nodeString);
Definition Iotm_TextMeshEntityGroup.h:53
Definition Iotm_TextMeshNodeset.h:56
std::string m_name
Definition Iotm_TextMeshNodeset.h:135
const std::vector< EntityId > & get_nodeset_data()
Definition Iotm_TextMeshNodeset.h:70
std::string get_name()
Definition Iotm_TextMeshNodeset.h:68
void set_error_handler(ErrorHandler errorHandler)
Definition Iotm_TextMeshNodeset.h:66
void parse_name(const std::string &data)
Definition Iotm_TextMeshNodeset.h:117
void parse_option_group(const std::string &option)
Definition Iotm_TextMeshNodeset.h:102
NodesetParser()
Definition Iotm_TextMeshNodeset.h:58
void parse_node_data(const std::string &data)
Definition Iotm_TextMeshNodeset.h:119
void parse_option(std::string optionName, const std::string &optionValue)
Definition Iotm_TextMeshNodeset.h:85
void parse(const std::string &parseData)
Definition Iotm_TextMeshNodeset.h:75
ErrorHandler m_errorHandler
Definition Iotm_TextMeshNodeset.h:136
std::vector< EntityId > m_nodeList
Definition Iotm_TextMeshNodeset.h:134
Definition Iotm_TextMeshNodeset.h:46
Nodesets()
Definition Iotm_TextMeshNodeset.h:48
bool is_positive_number(const std::string &str)
Definition Iotm_TextMeshFuncs.h:98
std::function< void(const std::ostringstream &)> ErrorHandler
Definition Iotm_TextMeshAdjacencyGraph.h:35
std::vector< std::string > get_tokens(const std::string &str, const std::string &separators)
Definition Iotm_TextMeshFuncs.h:68
void default_error_handler(const std::ostringstream &message)
Definition Iotm_TextMeshFuncs.h:32
void convert_to_lower_case(std::string &str)
Definition Iotm_TextMeshFuncs.h:93
EntityId NodesetDataType
Definition Iotm_TextMeshNodeset.h:37
A namespace for the textmesh database format.
Definition Iotm_DatabaseIO.C:95
int64_t EntityId
Definition Iotm_TextMesh.h:33
Definition Iotm_TextMeshEntityGroup.h:37
Definition Iotm_TextMeshNodeset.h:41
NodesetDataType< EntityId > DataType
Definition Iotm_TextMeshNodeset.h:42