19#include <unordered_map>
34 using ErrorHandler = std::function<void(
const std::ostringstream &)>;
38 template <
typename EntityId>
49 {
"BLOCK_",
"SURFACE_",
"ASSEMBLY_"})
59 ErrorHandler errorHandler = [](
const std::ostringstream &errmsg) {
74 void parse(
const std::string &parseData)
78 for (
const auto &option : options) {
74 void parse(
const std::string &parseData) {
…}
84 void parse_option(std::string optionName,
const std::string &optionValue)
88 if (optionName ==
"name") {
91 else if (optionName ==
"data") {
95 std::ostringstream errmsg;
96 errmsg <<
"Unrecognized nodeset option: " << optionName;
84 void parse_option(std::string optionName,
const std::string &optionValue) {
…}
103 if (!option.empty()) {
106 if (optionTokens.size() != 2) {
107 std::ostringstream errmsg;
108 errmsg <<
"Unrecognized nodeset option: " << option;
122 for (
const std::string &nodeString : nodesetData) {
124 std::ostringstream errmsg;
125 errmsg <<
"Unrecognized nodeset node id: " << nodeString;
128 EntityId node = std::stoull(nodeString);
EntityGroup(const std::string &type, const std::string &namePrefix, const std::vector< std::string > &invalidNamePrefixes)
Definition Iotm_TextMeshEntityGroup.h:64
std::string m_name
Definition Iotm_TextMeshNodeset.h:134
const std::vector< EntityId > & get_nodeset_data()
Definition Iotm_TextMeshNodeset.h:69
std::string get_name()
Definition Iotm_TextMeshNodeset.h:67
void set_error_handler(ErrorHandler errorHandler)
Definition Iotm_TextMeshNodeset.h:65
void parse_name(const std::string &data)
Definition Iotm_TextMeshNodeset.h:116
void parse_option_group(const std::string &option)
Definition Iotm_TextMeshNodeset.h:101
NodesetParser()
Definition Iotm_TextMeshNodeset.h:57
void parse_node_data(const std::string &data)
Definition Iotm_TextMeshNodeset.h:118
void parse_option(std::string optionName, const std::string &optionValue)
Definition Iotm_TextMeshNodeset.h:84
void parse(const std::string &parseData)
Definition Iotm_TextMeshNodeset.h:74
ErrorHandler m_errorHandler
Definition Iotm_TextMeshNodeset.h:135
std::vector< EntityId > m_nodeList
Definition Iotm_TextMeshNodeset.h:133
Nodesets()
Definition Iotm_TextMeshNodeset.h:47
Definition Iotm_TextMeshAdjacencyGraph.h:39
bool is_positive_number(const std::string &str)
Definition Iotm_TextMeshFuncs.h:106
std::function< void(const std::ostringstream &)> ErrorHandler
Definition Iotm_TextMeshAdjacencyGraph.h:41
void convert_to_lowercase(std::string &str)
Definition Iotm_TextMeshFuncs.h:101
std::vector< std::string > get_tokens(const std::string &str, const std::string &separators)
Definition Iotm_TextMeshFuncs.h:76
void default_error_handler(const std::ostringstream &message)
Definition Iotm_TextMeshFuncs.h:40
EntityId NodesetDataType
Definition Iotm_TextMeshNodeset.h:36
A namespace for the textmesh database format.
Definition Iotm_DatabaseIO.C:95
int64_t EntityId
Definition Iotm_TextMesh.h:33
Definition Iotm_TextMeshEntityGroup.h:43
Definition Iotm_TextMeshNodeset.h:40
NodesetDataType< EntityId > DataType
Definition Iotm_TextMeshNodeset.h:41