136 {
138 meshes.clear();
139 if (has_meshsets)
140 *has_meshsets = false;
141
142 const char *section_key = nullptr;
143 if (const auto *meshes_array =
145 meshes_array) {
146 meshes.reserve(meshes_array->size());
147 for (
size_t i = 0;
i != meshes_array->size(); ++
i) {
149 const auto &mesh_object =
150 requireObject((*meshes_array)[
i], file_name, context);
151
152 ParsedMeshEntry entry;
153 bool has_non_empty_meshsets = false;
154 for (const auto &item : mesh_object) {
156 file_name, context, entry,
157 has_non_empty_meshsets);
158 }
159
161 if (has_meshsets && has_non_empty_meshsets) {
162 *has_meshsets = true;
163 }
164 meshes.push_back(std::move(entry));
165 }
166 }
167
168 std::set<std::string> moab_mesh_keys;
169 std::set<std::string> python_script_keys;
170 for (const auto &entry : meshes) {
172 if (entry.key.empty()) {
173 continue;
174 }
175 const auto inserted = moab_mesh_keys.insert(entry.key);
176 if (!inserted.second) {
177 CHKERR failConfig(file_name, makeContext(
"root", section_key),
179 " key '" + entry.key + "'");
180 }
181 continue;
182 }
184 const auto inserted = python_script_keys.insert(entry.key);
185 if (!inserted.second) {
186 CHKERR failConfig(file_name, makeContext(
"root", section_key),
188 " key '" + entry.key + "'");
189 }
190 }
191 }
192
194}
std::string meshContext(const size_t mesh_index, const char *section_key=MESHES_KEY)
MoFEMErrorCode validateMeshEntry(const ParsedMeshEntry &entry, const std::string &file_name, const std::string &context, const size_t mesh_index)
bool isPythonScriptMeshType(const std::string &type)
MoFEMErrorCode parseMeshEntryField(const std::string &field_name, const JsonValue &value, const std::string &file_name, const std::string &context, ParsedMeshEntry &entry, bool &has_non_empty_meshsets)
const JsonArray * getMeshesArray(const JsonObject &root_object, const std::string &file_name, const char **section_key=nullptr)
constexpr auto MOAB_MESH_TYPE
constexpr auto PYTHON_SCRIPT_TYPE
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'i', SPACE_DIM > i