![]() |
v0.16.3 |
#include "src/interfaces/JsonConfigManager.hpp"
Public Member Functions | |
| MoFEMErrorCode | query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const |
| JsonConfigManager (const MoFEM::Core &core) | |
| virtual | ~JsonConfigManager ()=default |
| MoFEMErrorCode | getSubInterfaceOptions () |
| MoFEMErrorCode | loadFromFile (const std::string &file_name) |
| MoFEMErrorCode | applyMeshsets () |
| std::string | getPythonScriptByKey (const std::string &key) const |
| std::string | getMoabMeshByKey (const std::string &key) const |
| std::map< std::string, double > | getParamsFromBlockset (const std::string &type_name, int meshset_id) const |
| std::map< std::string, double > | getParamsFromBlocksetByTypePrefix (const std::string &type_prefix, int meshset_id) const |
| Numeric attributes of the entry with this id whose type starts with type_prefix. | |
| std::map< std::string, std::string > | getStringParamsFromBlockset (const std::string &type_name, int meshset_id) const |
| bool | hasMeshsetsSection () const |
Public Member Functions inherited from MoFEM::UnknownInterface | |
| template<class IFACE > | |
| MoFEMErrorCode | registerInterface (bool error_if_registration_failed=true) |
| Register interface. | |
| template<class IFACE > | |
| MoFEMErrorCode | getInterface (IFACE *&iface) const |
| Get interface reference to pointer of interface. | |
| template<class IFACE > | |
| MoFEMErrorCode | getInterface (IFACE **const iface) const |
| Get interface pointer to pointer of interface. | |
| template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0> | |
| IFACE | getInterface () const |
| Get interface pointer to pointer of interface. | |
| template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0> | |
| IFACE | getInterface () const |
| Get reference to interface. | |
| template<class IFACE > | |
| IFACE * | getInterface () const |
| Function returning pointer to interface. | |
| virtual | ~UnknownInterface ()=default |
Static Public Member Functions | |
| static const std::string & | supportedVersion () |
| static MoFEMErrorCode | addCanonicalAttributeNames (const std::vector< std::string > &names) |
| static MoFEMErrorCode | setMeshFileFromJson () |
| Set -file_name from JSON before Core is available. | |
| static MoFEMErrorCode | getMofemBoolFromJson (const std::string &key, PetscBool &value, PetscBool &found) |
| Read a boolean of the JSON "mofem" section before Core is available. | |
Static Public Member Functions inherited from MoFEM::UnknownInterface | |
| static MoFEMErrorCode | getLibVersion (Version &version) |
| Get library version. | |
| static MoFEMErrorCode | getFileVersion (moab::Interface &moab, Version &version) |
| Get database major version. | |
| static MoFEMErrorCode | setFileVersion (moab::Interface &moab, Version version=Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD)) |
| Get database major version. | |
| static MoFEMErrorCode | getInterfaceVersion (Version &version) |
| Get database major version. | |
Static Public Attributes | |
| static std::vector< std::string > | canonical_attributes_ordering |
Private Types | |
| using | MeshsetKey = std::pair< std::string, int > |
| using | MeshsetParams = std::map< std::string, double > |
| using | MeshsetStringParams = std::map< std::string, std::string > |
Private Member Functions | |
| MoFEMErrorCode | loadFromCommandLine () |
| MoFEMErrorCode | applyPetscOptions () |
Private Attributes | |
| MoFEM::Core & | cOre |
| boost::json::value | configRoot |
| std::string | configFileName |
| bool | configLoaded = false |
| bool | hasMeshsets = false |
| bool | meshsetsApplied = false |
| std::map< std::string, std::string > | moabMeshesByKey |
| std::map< std::string, std::string > | pythonScriptsByKey |
| std::map< MeshsetKey, MeshsetParams > | primaryMeshsetParamsByKey |
| std::map< MeshsetKey, MeshsetStringParams > | primaryMeshsetStringParamsByKey |
Definition at line 12 of file JsonConfigManager.hpp.
|
private |
Definition at line 81 of file JsonConfigManager.hpp.
|
private |
Definition at line 82 of file JsonConfigManager.hpp.
|
private |
Definition at line 83 of file JsonConfigManager.hpp.
| MoFEM::JsonConfigManager::JsonConfigManager | ( | const MoFEM::Core & | core | ) |
Definition at line 448 of file JsonConfigManager.cpp.
|
virtualdefault |
|
static |
Register additional numeric JSON attribute names.
Definition at line 419 of file JsonConfigManager.cpp.
| MoFEMErrorCode MoFEM::JsonConfigManager::applyMeshsets | ( | ) |
Definition at line 650 of file JsonConfigManager.cpp.
|
private |
Definition at line 616 of file JsonConfigManager.cpp.
| std::string MoFEM::JsonConfigManager::getMoabMeshByKey | ( | const std::string & | key | ) | const |
Definition at line 710 of file JsonConfigManager.cpp.
|
static |
Read a boolean of the JSON "mofem" section before Core is available.
Use only in programs that must branch before MoFEM::Core and the JsonConfigManager interface are initialised, as the choice of mesh loader does. The command line is not consulted; callers that honour it read the option themselves and fall back to this.
| key | name of the entry in the "mofem" section, without the leading - |
| value | set only when the entry is present |
| found | whether the entry was present |
Definition at line 486 of file JsonConfigManager.cpp.
| std::map< std::string, double > MoFEM::JsonConfigManager::getParamsFromBlockset | ( | const std::string & | type_name, |
| int | meshset_id | ||
| ) | const |
Definition at line 718 of file JsonConfigManager.cpp.
| std::map< std::string, double > MoFEM::JsonConfigManager::getParamsFromBlocksetByTypePrefix | ( | const std::string & | type_prefix, |
| int | meshset_id | ||
| ) | const |
Numeric attributes of the entry with this id whose type starts with type_prefix.
Generated BLOCKSET names embed the type, so a consumer finding blocks by a regex such as CRACK(.*) knows the prefix and the id, but not whether the JSON type was CRACK, CRACK_1 or CRACK_2. Returns an empty map when nothing matches.
Definition at line 729 of file JsonConfigManager.cpp.
| std::string MoFEM::JsonConfigManager::getPythonScriptByKey | ( | const std::string & | key | ) | const |
Definition at line 702 of file JsonConfigManager.cpp.
| std::map< std::string, std::string > MoFEM::JsonConfigManager::getStringParamsFromBlockset | ( | const std::string & | type_name, |
| int | meshset_id | ||
| ) | const |
Definition at line 745 of file JsonConfigManager.cpp.
| MoFEMErrorCode MoFEM::JsonConfigManager::getSubInterfaceOptions | ( | ) |
Definition at line 529 of file JsonConfigManager.cpp.
|
inline |
Definition at line 78 of file JsonConfigManager.hpp.
|
private |
Definition at line 755 of file JsonConfigManager.cpp.
| MoFEMErrorCode MoFEM::JsonConfigManager::loadFromFile | ( | const std::string & | file_name | ) |
Definition at line 533 of file JsonConfigManager.cpp.
|
virtual |
Implements MoFEM::UnknownInterface.
Definition at line 442 of file JsonConfigManager.cpp.
|
static |
Set -file_name from JSON before Core is available.
Use only in programs that must read the mesh before MoFEM::Core and the JsonConfigManager interface are initialised.
Definition at line 451 of file JsonConfigManager.cpp.
|
static |
Definition at line 13 of file JsonConfigManager.cpp.
|
inlinestatic |
Definition at line 14 of file JsonConfigManager.hpp.
|
private |
Definition at line 87 of file JsonConfigManager.hpp.
|
private |
Definition at line 88 of file JsonConfigManager.hpp.
|
private |
Definition at line 86 of file JsonConfigManager.hpp.
|
private |
Definition at line 85 of file JsonConfigManager.hpp.
|
private |
Definition at line 89 of file JsonConfigManager.hpp.
|
private |
Definition at line 90 of file JsonConfigManager.hpp.
|
private |
Definition at line 91 of file JsonConfigManager.hpp.
|
private |
Definition at line 93 of file JsonConfigManager.hpp.
|
private |
Definition at line 94 of file JsonConfigManager.hpp.
|
private |
Definition at line 92 of file JsonConfigManager.hpp.