v0.16.0
Loading...
Searching...
No Matches
JsonConfigManager.hpp
Go to the documentation of this file.
1/** \file JsonConfigManager.hpp
2 * \brief JSON configuration loader for PETSc options and meshsets
3 */
4
5#ifndef __JSONCONFIGMANAGER_HPP__
6#define __JSONCONFIGMANAGER_HPP__
7
8namespace MoFEM {
9
11
12 static const std::string &supportedVersion();
13
14 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
15 UnknownInterface **iface) const;
16
17 JsonConfigManager(const MoFEM::Core &core);
18 virtual ~JsonConfigManager() = default;
19
21
22 MoFEMErrorCode loadFromFile(const std::string &file_name);
24 std::string getPythonScriptByKey(const std::string &key) const;
25 std::string getMoabMeshByKey(const std::string &key) const;
26 std::map<std::string, double>
27 getParamsFromBlockset(const std::string &type_name, int meshset_id) const;
28
29 inline bool hasMeshsetsSection() const { return hasMeshsets; }
30
31private:
32 using MeshsetKey = std::pair<std::string, int>;
33 using MeshsetParams = std::map<std::string, double>;
34
36 boost::json::value configRoot;
37 std::string configFileName;
38 bool configLoaded = false;
39 bool hasMeshsets = false;
40 bool meshsetsApplied = false;
41 std::map<std::string, std::string> moabMeshesByKey;
42 std::map<std::string, std::string> pythonScriptsByKey;
43 std::map<MeshsetKey, MeshsetParams> primaryMeshsetParamsByKey;
44
47};
48
49} // namespace MoFEM
50
51#endif // __JSONCONFIGMANAGER_HPP__
std::string key
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
Core (interface) class.
Definition Core.hpp:83
static const std::string & supportedVersion()
std::string getPythonScriptByKey(const std::string &key) const
std::map< std::string, std::string > moabMeshesByKey
std::map< std::string, double > MeshsetParams
virtual ~JsonConfigManager()=default
std::string getMoabMeshByKey(const std::string &key) const
std::map< std::string, double > getParamsFromBlockset(const std::string &type_name, int meshset_id) const
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
std::map< std::string, std::string > pythonScriptsByKey
MoFEMErrorCode loadFromFile(const std::string &file_name)
MoFEMErrorCode getSubInterfaceOptions()
std::map< MeshsetKey, MeshsetParams > primaryMeshsetParamsByKey
boost::json::value configRoot
std::pair< std::string, int > MeshsetKey
MoFEMErrorCode loadFromCommandLine()
base class for all interface classes