11 unsigned int dimension)
15 unsigned int last_unknown_end = -1;
17 last_unknown_end =
unknowns_.back().GetMapEnd();
19 unsigned int new_unknown_index =
unknowns_.size();
41 <<
"UnknownManager: When adding unknown of type VECTOR_N, "
42 <<
"the dimension must not be 0.";
51 if (dimension == 0 or dimension == 1)
54 <<
"UnknownManager: When adding unknown of type TENSOR, "
55 <<
"the dimension must not be 0 or 1.";
59 throw std::invalid_argument(
"UnknownManager: TENSOR unknowns are not "
64 throw std::logic_error(
"UnknownManager: Invalid call to AddUnknown(). "
65 "Unknown type is probably not supported yet.");
68 return new_unknown_index;
74 MapUnknown(
unsigned int unknown_id,
unsigned int component)
const
78 if (unknown_id < 0 or unknown_id >= unknowns_.size())
81 <<
"UnknownManager failed call to MapUnknown " << unknown_id;
84 return unknowns_[unknown_id].GetMap(component);
91 if (unknowns_.empty())
94 return unknowns_.back().GetMapEnd() + 1;
106 if (unknown_id < 0 or unknown_id >= unknowns_.size())
109 <<
"UnknownManager failed call to SetUnknownNumOffBlockConnections,"
110 " illegal index. " << unknown_id;
114 for (
auto& val : unknowns_[unknown_id].num_off_block_connections_)
122 unsigned int component,
127 if (unknown_id < 0 or unknown_id >= unknowns_.size())
130 <<
"UnknownManager failed call to SetUnknownComponentTextName,"
131 " illegal unknown index. " << unknown_id;
135 if (component < 0 or component >= unknowns_[unknown_id].num_components_)
138 <<
"UnknownManager failed call to SetUnknownComponentTextName,"
139 " illegal component index. " << component;
143 unknowns_[unknown_id].num_off_block_connections_[component] = num_conn;
151 const std::string& in_text_name)
155 if (unknown_id < 0 or unknown_id >= unknowns_.size())
158 <<
"UnknownManager failed call to SetUnknownTextName,"
159 " illegal index. " << unknown_id;
163 unknowns_[unknown_id].text_name_ = in_text_name;
171 unsigned int component,
172 const std::string& in_text_name)
176 if (unknown_id < 0 or unknown_id >= unknowns_.size())
179 <<
"UnknownManager failed call to SetUnknownComponentTextName,"
180 " illegal unknown index. " << unknown_id;
184 if (component < 0 or component >= unknowns_[unknown_id].num_components_)
187 <<
"UnknownManager failed call to SetUnknownComponentTextName,"
188 " illegal component index. " << component;
192 unknowns_[unknown_id].component_text_names_[component] = in_text_name;
static void Exit(int error_code)
static ChiLog & GetInstance() noexcept
unsigned int AddUnknown(UnknownType unk_type, unsigned int dimension=0)
void SetUnknownComponentNumOffBlockConnections(unsigned int unknown_id, unsigned int component, int num_conn)
void SetUnknownNumOffBlockConnections(unsigned int unknown_id, int num_conn)
void SetUnknownComponentTextName(unsigned int unknown_id, unsigned int component, const std::string &in_text_name)
unsigned int MapUnknown(unsigned int unknown_id, unsigned int component=0) const
std::vector< Unknown > unknowns_
void SetUnknownTextName(unsigned int unknown_id, const std::string &in_text_name)
unsigned int GetTotalUnknownStructureSize() const