From fbdddce85d595549ca04c77087ddcf738855d21d Mon Sep 17 00:00:00 2001 From: kdrienCG Date: Wed, 22 Jul 2026 16:00:39 +0200 Subject: [PATCH 01/13] add GlobalViewKeys --- .../dataRepository/CMakeLists.txt | 1 + .../dataRepository/GlobalViewKeys.hpp | 69 +++++++++++++++++++ .../dataRepository/KeyNames.hpp | 4 +- src/coreComponents/mesh/DomainPartition.hpp | 8 ++- 4 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 src/coreComponents/dataRepository/GlobalViewKeys.hpp diff --git a/src/coreComponents/dataRepository/CMakeLists.txt b/src/coreComponents/dataRepository/CMakeLists.txt index 8d0fc0e09ce..436fef8339f 100644 --- a/src/coreComponents/dataRepository/CMakeLists.txt +++ b/src/coreComponents/dataRepository/CMakeLists.txt @@ -28,6 +28,7 @@ set( dataRepository_headers ConduitRestart.hpp DefaultValue.hpp ExecutableGroup.hpp + GlobalViewKeys.hpp Group.hpp HistoryDataSpec.hpp InputFlags.hpp diff --git a/src/coreComponents/dataRepository/GlobalViewKeys.hpp b/src/coreComponents/dataRepository/GlobalViewKeys.hpp new file mode 100644 index 00000000000..4b0c7a53278 --- /dev/null +++ b/src/coreComponents/dataRepository/GlobalViewKeys.hpp @@ -0,0 +1,69 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file GlobalViewKeys.hpp + */ + +#ifndef GEOS_DATAREPOSITORY_GLOBALVIEWKEYS_HPP_ +#define GEOS_DATAREPOSITORY_GLOBALVIEWKEYS_HPP_ + + +namespace geos +{ +namespace dataRepository +{ + + +/** + * @struct GlobalViewKeys + */ +struct GlobalViewKeys +{ + /// @return Root problem group name + static constexpr char const * problem() { return "Problem"; } + /// @return Command-line group name + static constexpr char const * commandLine() { return "commandLine"; } + /// @return Domain partition group name + static constexpr char const * domain() { return "domain"; } + /// @return Constitutive manager group name + static constexpr char const * constitutiveManager() { return "Constitutive"; } + /// @return Event manager group name + static constexpr char const * eventManager() { return "Events"; } + /// @return External data source manager group name + static constexpr char const * externalDataSourceManager() { return "ExternalDataSource"; } + /// @return FieldSpecification manager group name + static constexpr char const * fieldSpecificationManager() { return "FieldSpecifications"; } + /// @return Function manager group name + static constexpr char const * functionManager() { return "Functions"; } + /// @return Geometric object manager group name + static constexpr char const * geometricObjectManager() { return "Geometry"; } + /// @return Mesh manager group name + static constexpr char const * meshManager() { return "Mesh"; } + /// @return Numerical methods manager group name + static constexpr char const * numericalMethodsManager() { return "NumericalMethods"; } + /// @return Outputs manager group name + static constexpr char const * outputManager() { return "Outputs"; } + /// @return Physics solvers manager group name + static constexpr char const * physicsSolverManager() { return "Solvers"; } + /// @return Tasks manager group name + static constexpr char const * tasksManager() { return "Tasks"; } +}; + +} /* namespace dataRepository */ +} /* namespace geos */ + + +#endif /* GEOS_DATAREPOSITORY_GLOBALVIEWKEYS_HPP_ */ diff --git a/src/coreComponents/dataRepository/KeyNames.hpp b/src/coreComponents/dataRepository/KeyNames.hpp index 4c46b69a266..d6482837051 100644 --- a/src/coreComponents/dataRepository/KeyNames.hpp +++ b/src/coreComponents/dataRepository/KeyNames.hpp @@ -20,6 +20,8 @@ #ifndef GEOS_DATAREPOSITORY__KEYNAMES_HPP_ #define GEOS_DATAREPOSITORY__KEYNAMES_HPP_ +#include "GlobalViewKeys.hpp" + #include namespace geos @@ -31,7 +33,7 @@ namespace keys /// @cond DO_NOT_DOCUMENT -static constexpr auto ProblemManager = "Problem"; +static constexpr auto ProblemManager = GlobalViewKeys::problem(); static constexpr auto cellManager = "cellManager"; static constexpr auto particleManager = "particleManager"; diff --git a/src/coreComponents/mesh/DomainPartition.hpp b/src/coreComponents/mesh/DomainPartition.hpp index 870ad00bec2..1b30fc47ddd 100644 --- a/src/coreComponents/mesh/DomainPartition.hpp +++ b/src/coreComponents/mesh/DomainPartition.hpp @@ -22,6 +22,7 @@ #include "common/MpiWrapper.hpp" #include "constitutive/ConstitutiveManager.hpp" +#include "dataRepository/GlobalViewKeys.hpp" #include "dataRepository/Group.hpp" #include "discretizationMethods/NumericalMethodsManager.hpp" #include "mesh/MeshBody.hpp" @@ -134,7 +135,8 @@ class DomainPartition : public dataRepository::Group /// @return String key to the Group holding the MeshBodies static constexpr char const * meshBodiesString() { return "MeshBodies"; } /// @return String key to the Group holding the ConstitutiveManager - static constexpr char const * constitutiveManagerString() { return "Constitutive"; } + static constexpr char const * constitutiveManagerString() + { return dataRepository::GlobalViewKeys::constitutiveManager(); } /// View key to the Group holding the MeshBodies dataRepository::GroupKey meshBodies = { meshBodiesString() }; @@ -164,13 +166,13 @@ class DomainPartition : public dataRepository::Group * @brief @return Return a reference to const NumericalMethodsManager from ProblemManager */ NumericalMethodsManager const & getNumericalMethodManager() const - { return this->getParent().getGroup< NumericalMethodsManager >( "NumericalMethods" ); } + { return this->getParent().getGroup< NumericalMethodsManager >( dataRepository::GlobalViewKeys::numericalMethodsManager()); } /** * @brief @return Return a reference to NumericalMethodsManager from ProblemManager */ NumericalMethodsManager & getNumericalMethodManager() - { return this->getParent().getGroup< NumericalMethodsManager >( "NumericalMethods" ); } + { return this->getParent().getGroup< NumericalMethodsManager >( dataRepository::GlobalViewKeys::numericalMethodsManager()); } /** * @brief Get the mesh bodies, const version. From 7772fab068130868e2bce0ff9dde1c5367e87b57 Mon Sep 17 00:00:00 2001 From: kdrienCG Date: Wed, 22 Jul 2026 18:36:05 +0200 Subject: [PATCH 02/13] add ProblemManagerBase --- .../dataRepository/CMakeLists.txt | 1 + .../dataRepository/ProblemManagerBase.hpp | 135 ++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 src/coreComponents/dataRepository/ProblemManagerBase.hpp diff --git a/src/coreComponents/dataRepository/CMakeLists.txt b/src/coreComponents/dataRepository/CMakeLists.txt index 436fef8339f..22f4575df6b 100644 --- a/src/coreComponents/dataRepository/CMakeLists.txt +++ b/src/coreComponents/dataRepository/CMakeLists.txt @@ -38,6 +38,7 @@ set( dataRepository_headers LogLevelsRegistry.hpp MappedVector.hpp ObjectCatalog.hpp + ProblemManagerBase.hpp ReferenceWrapper.hpp RestartFlags.hpp Utilities.hpp diff --git a/src/coreComponents/dataRepository/ProblemManagerBase.hpp b/src/coreComponents/dataRepository/ProblemManagerBase.hpp new file mode 100644 index 00000000000..70e6eaf4da4 --- /dev/null +++ b/src/coreComponents/dataRepository/ProblemManagerBase.hpp @@ -0,0 +1,135 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file ProblemManagerBase.hpp + */ + +#ifndef GEOS_DATAREPOSITORY_PROBLEMMANAGERBASE_HPP_ +#define GEOS_DATAREPOSITORY_PROBLEMMANAGERBASE_HPP_ + +#include "dataRepository/Group.hpp" + +namespace geos +{ + +class DomainPartition; +class EventManager; +class ExternalDataSourceManager; +class FieldSpecificationManager; +class FunctionManager; +class GeometricObjectManager; +class MeshManager; +class NumericalMethodsManager; +class OutputManager; +class PhysicsSolverManager; +class TasksManager; +namespace constitutive +{ +class ConstitutiveManager; +} + +namespace dataRepository +{ + + +/** + * @class ProblemManagerBase + */ +class ProblemManagerBase : public Group +{ +public: + + using Group::Group; + + virtual DomainPartition & getDomainPartition() = 0; + virtual DomainPartition const & getDomainPartition() const = 0; + + virtual constitutive::ConstitutiveManager & getConstitutiveManager() = 0; + virtual constitutive::ConstitutiveManager const & getConstitutiveManager() const = 0; + + virtual EventManager & getEventManager() = 0; + virtual EventManager const & getEventManager() const = 0; + + virtual ExternalDataSourceManager & getExternalDataSourceManager() = 0; + virtual ExternalDataSourceManager const & getExternalDataSourceManager() const = 0; + + virtual FieldSpecificationManager & getFieldSpecificationManager() = 0; + virtual FieldSpecificationManager const & getFieldSpecificationManager() const = 0; + + virtual FunctionManager & getFunctionManager() = 0; + virtual FunctionManager const & getFunctionManager() const = 0; + + virtual GeometricObjectManager & getGeometricObjectManager() = 0; + virtual GeometricObjectManager const & getGeometricObjectManager() const = 0; + + virtual MeshManager & getMeshManager() = 0; + virtual MeshManager const & getMeshManager() const = 0; + + virtual NumericalMethodsManager & getNumericalMethodsManager() = 0; + virtual NumericalMethodsManager const & getNumericalMethodsManager() const = 0; + + virtual OutputManager & getOutputManager() = 0; + virtual OutputManager const & getOutputManager() const = 0; + + virtual PhysicsSolverManager & getPhysicsSolverManager() = 0; + virtual PhysicsSolverManager const & getPhysicsSolverManager() const = 0; + + virtual TasksManager & getTasksManager() = 0; + virtual TasksManager const & getTasksManager() const = 0; + + + virtual string const & getProblemName() const = 0; + virtual string const & getInputFileName() const = 0; + virtual string const & getRestartFileName() const = 0; + virtual string const & getSchemaFileName() const = 0; + +}; + +/** + * @brief Gives the ProblemManagerBase from the given Group + * @param group The current Group in the Problem tree + * @return A reference to the ProblemManagerBase + */ +inline ProblemManagerBase & getProblemManagerBase( Group & group ) +{ + Group * current = &group; + while( current->hasParent() ) + { + current = ¤t->getParent(); + } + ProblemManagerBase * const root = dynamic_cast< ProblemManagerBase * >( current ); + return *root; +} + +/** + * @copydoc getProblemManagerBase( Group & ) + */ +inline ProblemManagerBase const & getProblemManagerBase( Group const & group ) +{ + Group const * current = &group; + while( current->hasParent() ) + { + current = ¤t->getParent(); + } + ProblemManagerBase const * const root = dynamic_cast< ProblemManagerBase const * >( current ); + return *root; +} + +} /* namespace dataRepository */ +} /* namespace geos */ + + +#endif /* GEOS_DATAREPOSITORY_PROBLEMMANAGERBASE_HPP_ */ From 7b3a0b0a5e1a29e15accd441b8af679f187b4712 Mon Sep 17 00:00:00 2001 From: kdrienCG Date: Wed, 22 Jul 2026 18:36:28 +0200 Subject: [PATCH 03/13] derive ProblemManager from ProblemManagerBase --- .../mainInterface/GeosxState.cpp | 8 + .../mainInterface/GeosxState.hpp | 14 ++ .../mainInterface/ProblemManager.cpp | 62 ++++++- .../mainInterface/ProblemManager.hpp | 162 ++++++++++++++---- 4 files changed, 213 insertions(+), 33 deletions(-) diff --git a/src/coreComponents/mainInterface/GeosxState.cpp b/src/coreComponents/mainInterface/GeosxState.cpp index 1fcb001bc18..38a0cd12c9c 100644 --- a/src/coreComponents/mainInterface/GeosxState.cpp +++ b/src/coreComponents/mainInterface/GeosxState.cpp @@ -192,6 +192,14 @@ void GeosxState::run() dataRepository::Group & GeosxState::getProblemManagerAsGroup() { return getProblemManager(); } +////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +dataRepository::ProblemManagerBase & GeosxState::getProblemManagerBase() +{ return getProblemManager(); } + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +dataRepository::ProblemManagerBase const & GeosxState::getProblemManagerBase() const +{ return *m_problemManager; } + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// FieldSpecificationManager & GeosxState::getFieldSpecificationManager() { return getProblemManager().getFieldSpecificationManager(); } diff --git a/src/coreComponents/mainInterface/GeosxState.hpp b/src/coreComponents/mainInterface/GeosxState.hpp index 43d44de6674..3f57d2d32bc 100644 --- a/src/coreComponents/mainInterface/GeosxState.hpp +++ b/src/coreComponents/mainInterface/GeosxState.hpp @@ -50,6 +50,7 @@ namespace geos namespace dataRepository { class Group; +class ProblemManagerBase; } class ProblemManager; @@ -183,6 +184,19 @@ class GeosxState */ dataRepository::Group & getProblemManagerAsGroup(); + /** + * @brief Return the @c ProblemManager as a @c ProblemManagerBase. + * @return The @c ProblemManagerBase interface. + * @note Prefer this when you only need accessors to common objects and don't want to + * include @c ProblemManager.hpp. + */ + dataRepository::ProblemManagerBase & getProblemManagerBase(); + + /** + * @copydoc getProblemManagerBase() + */ + dataRepository::ProblemManagerBase const & getProblemManagerBase() const; + /** * @brief Return the FieldSpecificationManager. * @return The FieldSpecificationManager. diff --git a/src/coreComponents/mainInterface/ProblemManager.cpp b/src/coreComponents/mainInterface/ProblemManager.cpp index bdf792ea36d..ba0a2bf69bc 100644 --- a/src/coreComponents/mainInterface/ProblemManager.cpp +++ b/src/coreComponents/mainInterface/ProblemManager.cpp @@ -159,7 +159,7 @@ void logHypredriveInputs( PhysicsSolverManager & physicsSolverManager, #endif ProblemManager::ProblemManager( conduit::Node & root ): - Group( keys::ProblemManager, root ), + ProblemManagerBase( keys::ProblemManager, root ), m_physicsSolverManager( nullptr ), m_eventManager( nullptr ), m_functionManager( nullptr ), @@ -1270,6 +1270,16 @@ bool ProblemManager::runSimulation() return m_eventManager->run( getDomainPartition() ); } +ConstitutiveManager & ProblemManager::getConstitutiveManager() +{ + return getDomainPartition().getConstitutiveManager(); +} + +ConstitutiveManager const & ProblemManager::getConstitutiveManager() const +{ + return getDomainPartition().getConstitutiveManager(); +} + DomainPartition & ProblemManager::getDomainPartition() { return getGroup< DomainPartition >( groupKeys.domain ); @@ -1280,6 +1290,56 @@ DomainPartition const & ProblemManager::getDomainPartition() const return getGroup< DomainPartition >( groupKeys.domain ); } +ExternalDataSourceManager & ProblemManager::getExternalDataSourceManager() +{ + return getGroup< ExternalDataSourceManager >( groupKeys.externalDataSourceManager );; +} + +ExternalDataSourceManager const & ProblemManager::getExternalDataSourceManager() const +{ + return getGroup< ExternalDataSourceManager >( groupKeys.externalDataSourceManager );; +} + +GeometricObjectManager & ProblemManager::getGeometricObjectManager() +{ + return getGroup< GeometricObjectManager >( groupKeys.geometricObjectManager ); +} + +GeometricObjectManager const & ProblemManager::getGeometricObjectManager() const +{ + return getGroup< GeometricObjectManager >( groupKeys.geometricObjectManager ); +} + +MeshManager & ProblemManager::getMeshManager() +{ + return getGroup< MeshManager >( groupKeys.meshManager ); +} + +MeshManager const & ProblemManager::getMeshManager() const +{ + return getGroup< MeshManager >( groupKeys.meshManager ); +} + +NumericalMethodsManager & ProblemManager::getNumericalMethodsManager() +{ + return getGroup< NumericalMethodsManager >( groupKeys.numericalMethodsManager ); +} + +NumericalMethodsManager const & ProblemManager::getNumericalMethodsManager() const +{ + return getGroup< NumericalMethodsManager >( groupKeys.numericalMethodsManager ); +} + +OutputManager & ProblemManager::getOutputManager() +{ + return getGroup< OutputManager >( groupKeys.outputManager ); +} + +OutputManager const & ProblemManager::getOutputManager() const +{ + return getGroup< OutputManager >( groupKeys.outputManager ); +} + void ProblemManager::applyInitialConditions() { diff --git a/src/coreComponents/mainInterface/ProblemManager.hpp b/src/coreComponents/mainInterface/ProblemManager.hpp index 447ac419885..0d7676d859b 100644 --- a/src/coreComponents/mainInterface/ProblemManager.hpp +++ b/src/coreComponents/mainInterface/ProblemManager.hpp @@ -21,7 +21,8 @@ #ifndef GEOS_MAININTERFACE_PROBLEMMANAGER_HPP_ #define GEOS_MAININTERFACE_PROBLEMMANAGER_HPP_ -#include "dataRepository/Group.hpp" +#include "dataRepository/GlobalViewKeys.hpp" +#include "dataRepository/ProblemManagerBase.hpp" namespace geos { @@ -31,6 +32,10 @@ class DomainPartition; class GeometricObjectManager; class FiniteElementDiscretization; class MeshLevel; +class MeshManager; +class NumericalMethodsManager; +class OutputManager; +class ExternalDataSourceManager; namespace constitutive { class ConstitutiveManager; @@ -47,7 +52,7 @@ class ParticleBlockManagerABC; * @class ProblemManager * @brief This is the class handling the operation flow of the problem being ran in GEOS */ -class ProblemManager : public dataRepository::Group +class ProblemManager : public dataRepository::ProblemManagerBase { public: @@ -176,40 +181,40 @@ class ProblemManager : public dataRepository::Group * @brief Returns a pointer to the DomainPartition * @return Pointer to the DomainPartition */ - DomainPartition & getDomainPartition(); + DomainPartition & getDomainPartition() override; /** * @brief Returns a pointer to the DomainPartition * @return Const pointer to the DomainPartition */ - DomainPartition const & getDomainPartition() const; + DomainPartition const & getDomainPartition() const override; /** * @brief Returns the problem name * @return The problem name */ - string const & getProblemName() const + string const & getProblemName() const override { return getGroup< Group >( groupKeys.commandLine ).getReference< string >( viewKeys.problemName ); } /** * @brief Returns the input file name * @return The input file name */ - string const & getInputFileName() const + string const & getInputFileName() const override { return getGroup< Group >( groupKeys.commandLine ).getReference< string >( viewKeys.inputFileName ); } /** * @brief Returns the restart file name * @return The restart file name */ - string const & getRestartFileName() const + string const & getRestartFileName() const override { return getGroup< Group >( groupKeys.commandLine ).getReference< string >( viewKeys.restartFileName ); } /** * @brief Returns the schema file name * @return The schema file name */ - string const & getSchemaFileName() const + string const & getSchemaFileName() const override { return getGroup< Group >( groupKeys.commandLine ).getReference< string >( viewKeys.schemaFileName ); } /// Command line input viewKeys @@ -238,27 +243,34 @@ class ProblemManager : public dataRepository::Group struct groupKeysStruct { /// @return Numerical methods string - static constexpr char const * numericalMethodsManagerString() { return "NumericalMethods"; } - dataRepository::GroupKey commandLine = { "commandLine" }; ///< Command line key - dataRepository::GroupKey constitutiveManager = { "Constitutive" }; ///< Constitutive key - dataRepository::GroupKey domain = { "domain" }; ///< Domain key - dataRepository::GroupKey eventManager = { "Events" }; ///< Events key - dataRepository::GroupKey externalDataSourceManager = { "ExternalDataSource" }; ///< External Data Source key - dataRepository::GroupKey fieldSpecificationManager = { "FieldSpecifications" }; ///< Field specification key - dataRepository::GroupKey functionManager = { "Functions" }; ///< Functions key - dataRepository::GroupKey geometricObjectManager = { "Geometry" }; ///< Geometry key - dataRepository::GroupKey meshManager = { "Mesh" }; ///< Mesh key - dataRepository::GroupKey numericalMethodsManager = { numericalMethodsManagerString() }; ///< Numerical methods key - dataRepository::GroupKey outputManager = { "Outputs" }; ///< Outputs key - dataRepository::GroupKey physicsSolverManager = { "Solvers" }; ///< Solvers key - dataRepository::GroupKey tasksManager = { "Tasks" }; ///< Tasks key + // static constexpr char const * numericalMethodsManagerString() + // { return dataRepository::GlobalViewKeys::numericalMethodsManager(); } + dataRepository::GroupKey commandLine = { dataRepository::GlobalViewKeys::commandLine() }; ///< Command line + ///< key + dataRepository::GroupKey constitutiveManager = { dataRepository::GlobalViewKeys::constitutiveManager() }; ///< Constitutive + ///< key + dataRepository::GroupKey domain = { dataRepository::GlobalViewKeys::domain() }; ///< Domain key + dataRepository::GroupKey eventManager = { dataRepository::GlobalViewKeys::eventManager() }; ///< Events key + dataRepository::GroupKey externalDataSourceManager = { dataRepository::GlobalViewKeys::externalDataSourceManager() }; ///< External Data + ///< Source key + dataRepository::GroupKey fieldSpecificationManager = { dataRepository::GlobalViewKeys::fieldSpecificationManager() }; ///< Field + ///< specification + ///< key + dataRepository::GroupKey functionManager = { dataRepository::GlobalViewKeys::functionManager() }; ///< Functions key + dataRepository::GroupKey geometricObjectManager = { dataRepository::GlobalViewKeys::geometricObjectManager() }; ///< Geometry key + dataRepository::GroupKey meshManager = { dataRepository::GlobalViewKeys::meshManager() }; ///< Mesh key + dataRepository::GroupKey numericalMethodsManager = { dataRepository::GlobalViewKeys::numericalMethodsManager() }; ///< Numerical + ///< methods key + dataRepository::GroupKey outputManager = { dataRepository::GlobalViewKeys::outputManager() }; ///< Outputs key + dataRepository::GroupKey physicsSolverManager = { dataRepository::GlobalViewKeys::physicsSolverManager() }; ///< Solvers key + dataRepository::GroupKey tasksManager = { dataRepository::GlobalViewKeys::tasksManager() }; ///< Tasks key } groupKeys; ///< Child group viewKeys /** * @brief Returns the PhysicsSolverManager * @return Reference to the PhysicsSolverManager */ - PhysicsSolverManager & getPhysicsSolverManager() + PhysicsSolverManager & getPhysicsSolverManager() override { return *m_physicsSolverManager; } @@ -267,7 +279,7 @@ class ProblemManager : public dataRepository::Group * @brief Returns the PhysicsSolverManager * @return Const reference to the PhysicsSolverManager */ - PhysicsSolverManager const & getPhysicsSolverManager() const + PhysicsSolverManager const & getPhysicsSolverManager() const override { return *m_physicsSolverManager; } @@ -276,7 +288,7 @@ class ProblemManager : public dataRepository::Group * @brief Returns the FunctionManager. * @return The FunctionManager. */ - FunctionManager & getFunctionManager() + FunctionManager & getFunctionManager() override { GEOS_ERROR_IF( m_functionManager == nullptr, "Not initialized." ); return *m_functionManager; @@ -286,7 +298,7 @@ class ProblemManager : public dataRepository::Group * @brief Returns the const FunctionManager. * @return The const FunctionManager. */ - FunctionManager const & getFunctionManager() const + FunctionManager const & getFunctionManager() const override { GEOS_ERROR_IF( m_functionManager == nullptr, "Not initialized." ); return *m_functionManager; @@ -296,7 +308,7 @@ class ProblemManager : public dataRepository::Group * @brief Returns the FieldSpecificationManager. * @return The FieldSpecificationManager. */ - FieldSpecificationManager & getFieldSpecificationManager() + FieldSpecificationManager & getFieldSpecificationManager() override { GEOS_ERROR_IF( m_fieldSpecificationManager == nullptr, "Not initialized." ); return *m_fieldSpecificationManager; @@ -306,7 +318,7 @@ class ProblemManager : public dataRepository::Group * @brief Returns the const FunctionManager. * @return The const FunctionManager. */ - FieldSpecificationManager const & getFieldSpecificationManager() const + FieldSpecificationManager const & getFieldSpecificationManager() const override { GEOS_ERROR_IF( m_fieldSpecificationManager == nullptr, "Not initialized." ); return *m_fieldSpecificationManager; @@ -316,15 +328,101 @@ class ProblemManager : public dataRepository::Group * @brief Returns the EventManager. * @return The EventManager. */ - EventManager & getEventManager() - {return *m_eventManager;} + EventManager & getEventManager() override + { return *m_eventManager; } + + /** + * @brief Returns the const EventManager. + * @return The const EventManager. + */ + EventManager const & getEventManager() const override + { return *m_eventManager; } + + /** + * @brief Returns the ExternalDataSourceManager. + * @return The ExternalDataSourceManager. + */ + ExternalDataSourceManager & getExternalDataSourceManager() override; + + /** + * @brief Returns the const ExternalDataSourceManager. + * @return The const ExternalDataSourceManager. + */ + ExternalDataSourceManager const & getExternalDataSourceManager() const override; /** * @brief Returns the TasksManager. * @return The TasksManager. */ - TasksManager & getTasksManager() - {return *m_tasksManager;} + TasksManager & getTasksManager() override + { return *m_tasksManager; } + + /** + * @brief Returns the const TasksManager. + * @return The const TasksManager. + */ + TasksManager const & getTasksManager() const override + { return *m_tasksManager; } + + /** + * @brief Returns the NumericalMethodsManager. + * @return The NumericalMethodsManager. + */ + NumericalMethodsManager & getNumericalMethodsManager() override; + + /** + * @brief Returns the const NumericalMethodsManager. + * @return The const NumericalMethodsManager. + */ + NumericalMethodsManager const & getNumericalMethodsManager() const override; + + /** + * @brief Returns the MeshManager. + * @return The MeshManager. + */ + MeshManager & getMeshManager() override; + + /** + * @brief Returns the const MeshManager. + * @return The const MeshManager. + */ + MeshManager const & getMeshManager() const override; + + /** + * @brief Returns the OutputManager. + * @return The OutputManager. + */ + OutputManager & getOutputManager() override; + + /** + * @brief Returns the const OutputManager. + * @return The const OutputManager. + */ + OutputManager const & getOutputManager() const override; + + /** + * @brief Returns the GeometricObjectManager. + * @return The GeometricObjectManager. + */ + GeometricObjectManager & getGeometricObjectManager() override; + + /** + * @brief Returns the const GeometricObjectManager. + * @return The const GeometricObjectManager. + */ + GeometricObjectManager const & getGeometricObjectManager() const override; + + /** + * @brief Returns the ConstitutiveManager. + * @return The ConstitutiveManager. + */ + constitutive::ConstitutiveManager & getConstitutiveManager() override; + + /** + * @brief Returns the const ConstitutiveManager. + * @return The const ConstitutiveManager. + */ + constitutive::ConstitutiveManager const & getConstitutiveManager() const override; protected: /** From e6b58eda9d47ba7effa047f8e45206db0a3d9c4f Mon Sep 17 00:00:00 2001 From: kdrienCG Date: Wed, 22 Jul 2026 18:37:16 +0200 Subject: [PATCH 04/13] replace paths --- .../constitutiveDrivers/ConstitutiveDriver.cpp | 5 +++-- .../multiFluid/reactive/ReactiveFluidDriver.cpp | 4 ++-- .../FieldSpecificationManager.cpp | 3 ++- .../fileIO/Outputs/RestartOutput.cpp | 3 ++- .../fileIO/Outputs/TimeHistoryOutput.cpp | 3 ++- .../fileIO/Outputs/unitTests/testMemoryStats.cpp | 5 +++-- .../fileIO/python/PyHistoryCollection.cpp | 2 +- .../fileIO/python/PyHistoryOutput.cpp | 2 +- src/coreComponents/fileIO/python/PyVTKOutput.cpp | 2 +- .../fileIO/timeHistory/PackCollection.cpp | 3 ++- .../finiteVolume/FluxApproximationBase.cpp | 5 +++-- .../mesh/generators/VTKMeshGenerator.cpp | 3 ++- .../SimpleGeometricObjectBase.cpp | 3 ++- .../physicsSolvers/FieldStatisticsBase.hpp | 5 +++-- .../physicsSolvers/PhysicsSolverBase.cpp | 13 ++++++++++++- .../physicsSolvers/PhysicsSolverBase.hpp | 11 +++++++++++ .../fluidFlow/CompositionalMultiphaseBase.cpp | 8 ++++---- .../fluidFlow/CompositionalMultiphaseFVM.cpp | 4 ++-- .../fluidFlow/CompositionalMultiphaseHybridFVM.cpp | 4 ++-- .../CompositionalMultiphaseStatisticsTask.cpp | 2 +- .../physicsSolvers/fluidFlow/FlowSolverBase.cpp | 8 ++++---- .../fluidFlow/ImmiscibleMultiphaseFlow.cpp | 4 ++-- .../ReactiveCompositionalMultiphaseOBL.cpp | 2 +- .../physicsSolvers/fluidFlow/SinglePhaseBase.cpp | 4 ++-- .../fluidFlow/SinglePhaseHybridFVM.cpp | 4 ++-- .../fluidFlow/SinglePhaseReactiveTransport.cpp | 4 ++-- .../proppantTransport/ProppantTransport.cpp | 4 ++-- .../wells/CompositionalMultiphaseWell.cpp | 8 ++++---- .../fluidFlow/wells/WellSolverBase.cpp | 4 ++-- .../multiphysics/FieldApplicator.cpp | 6 ++++-- .../SinglePhasePoromechanicsEmbeddedFractures.cpp | 3 ++- .../physicsSolvers/python/PySolver.cpp | 4 ++-- .../SolidMechanicsInitialization.cpp | 6 +++--- .../solidMechanics/SolidMechanicsLagrangianFEM.cpp | 7 ++++--- .../solidMechanics/SolidMechanicsMPM.cpp | 2 +- .../solidMechanics/SolidMechanicsStateReset.cpp | 4 ++-- .../SolidMechanicsAugmentedLagrangianContact.cpp | 7 ++++--- .../contact/SolidMechanicsEmbeddedFractures.cpp | 2 +- .../contact/SolidMechanicsLagrangeContact.cpp | 2 +- .../SolidMechanicsLagrangeContactBubbleStab.cpp | 6 +++--- .../surfaceGeneration/EmbeddedSurfaceGenerator.cpp | 2 +- .../surfaceGeneration/SurfaceGenerator.cpp | 8 ++++---- .../isotropic/AcousticWaveEquationDG.cpp | 2 +- .../AcousticFirstOrderWaveEquationSEM.cpp | 2 +- .../anisotropic/AcousticVTIWaveEquationSEM.cpp | 2 +- .../isotropic/AcousticWaveEquationSEM.cpp | 14 +++++++------- .../isotropic/AcousticElasticWaveEquationSEM.cpp | 2 +- .../isotropic/ElasticFirstOrderWaveEquationSEM.cpp | 2 +- .../isotropic/ElasticWaveEquationSEM.cpp | 6 +++--- .../wavePropagation/shared/WaveSolverBase.cpp | 4 ++-- 50 files changed, 131 insertions(+), 94 deletions(-) diff --git a/src/coreComponents/constitutiveDrivers/ConstitutiveDriver.cpp b/src/coreComponents/constitutiveDrivers/ConstitutiveDriver.cpp index 2126e23da78..304f305fb0f 100644 --- a/src/coreComponents/constitutiveDrivers/ConstitutiveDriver.cpp +++ b/src/coreComponents/constitutiveDrivers/ConstitutiveDriver.cpp @@ -21,6 +21,7 @@ #include "LogLevelsInfo.hpp" #include "constitutive/ConstitutiveManager.hpp" +#include "dataRepository/ProblemManagerBase.hpp" #include "common/format/table/TableFormatter.hpp" #include "common/format/StringUtilities.hpp" @@ -246,12 +247,12 @@ void ConstitutiveDriver::allocateTable( integer const numColumns, ConstitutiveManager & ConstitutiveDriver::getConstitutiveManager() { - return this->getGroupByPath< ConstitutiveManager >( "/Problem/domain/Constitutive" ); + return getProblemManagerBase( *this ).getConstitutiveManager(); } ConstitutiveManager const & ConstitutiveDriver::getConstitutiveManager() const { - return this->getGroupByPath< ConstitutiveManager >( "/Problem/domain/Constitutive" ); + return getProblemManagerBase( *this ).getConstitutiveManager(); } } /* namespace geos */ diff --git a/src/coreComponents/constitutiveDrivers/fluid/multiFluid/reactive/ReactiveFluidDriver.cpp b/src/coreComponents/constitutiveDrivers/fluid/multiFluid/reactive/ReactiveFluidDriver.cpp index 0999865a168..3ea4fcf69e3 100644 --- a/src/coreComponents/constitutiveDrivers/fluid/multiFluid/reactive/ReactiveFluidDriver.cpp +++ b/src/coreComponents/constitutiveDrivers/fluid/multiFluid/reactive/ReactiveFluidDriver.cpp @@ -78,7 +78,7 @@ void ReactiveFluidDriver::postInputInitialization() { // get number of phases and components - ConstitutiveManager & constitutiveManager = this->getGroupByPath< ConstitutiveManager >( "/Problem/domain/Constitutive" ); + ConstitutiveManager & constitutiveManager = getProblemManagerBase( *this ).getConstitutiveManager(); ReactiveMultiFluid & fluid = constitutiveManager.getGroup< ReactiveMultiFluid >( m_fluidName ); m_numPhases = fluid.numFluidPhases(); @@ -132,7 +132,7 @@ bool ReactiveFluidDriver::execute( real64 const GEOS_UNUSED_PARAM( time_n ), // get the fluid out of the constitutive manager. // for the moment it is of type MultiFluidBase. - ConstitutiveManager & constitutiveManager = this->getGroupByPath< ConstitutiveManager >( "/Problem/domain/Constitutive" ); + ConstitutiveManager & constitutiveManager = getProblemManagerBase( *this ).getConstitutiveManager(); ReactiveMultiFluid & baseFluid = constitutiveManager.getGroup< ReactiveMultiFluid >( m_fluidName ); // depending on logLevel, print some useful info diff --git a/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp b/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp index f5fe8126991..c7b49b13a91 100644 --- a/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp +++ b/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp @@ -14,6 +14,7 @@ */ #include "FieldSpecificationManager.hpp" +#include "dataRepository/ProblemManagerBase.hpp" #include "mesh/DomainPartition.hpp" #include "mesh/MeshBody.hpp" #include "mesh/MeshObjectPath.hpp" @@ -70,7 +71,7 @@ void FieldSpecificationManager::expandObjectCatalogs() void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) const { - DomainPartition const & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition const & domain = getProblemManagerBase( *this ).getDomainPartition(); Group const & meshBodies = domain.getMeshBodies(); // loop over all the FieldSpecification of the XML file this->forSubGroups< FieldSpecification >( [&] ( FieldSpecification const & fs ) diff --git a/src/coreComponents/fileIO/Outputs/RestartOutput.cpp b/src/coreComponents/fileIO/Outputs/RestartOutput.cpp index ee9038f3f2a..80a22b8090e 100644 --- a/src/coreComponents/fileIO/Outputs/RestartOutput.cpp +++ b/src/coreComponents/fileIO/Outputs/RestartOutput.cpp @@ -18,6 +18,7 @@ */ #include "RestartOutput.hpp" +#include "dataRepository/ProblemManagerBase.hpp" namespace geos { @@ -44,7 +45,7 @@ bool RestartOutput::execute( real64 const GEOS_UNUSED_PARAM( time_n ), { Timer timer( m_outputTimer ); - Group & rootGroup = this->getGroupByPath( "/Problem" ); + Group & rootGroup = getProblemManagerBase( *this ); string const fileName = GEOS_FMT( "{}_restart_{:09}", getFileNameRoot(), cycleNumber ); rootGroup.prepareToWrite(); writeTree( joinPath( getOutputDirectory(), fileName ), *(rootGroup.getConduitNode().parent()) ); diff --git a/src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp b/src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp index fd885431dcd..e0126e9b772 100644 --- a/src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp +++ b/src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp @@ -15,6 +15,7 @@ #include "TimeHistoryOutput.hpp" +#include "dataRepository/ProblemManagerBase.hpp" #include "fileIO/timeHistory/HDFFile.hpp" #include "fileIO/LogLevelsInfo.hpp" @@ -130,7 +131,7 @@ void TimeHistoryOutput::initializePostInitialConditionsPostSubGroups() HDFFile( outputFile, (m_recordCount == 0), true, MPI_COMM_GEOS ); } - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getProblemManagerBase( *this ).getDomainPartition(); GEOS_LOG_LEVEL_BY_RANK( logInfo::DataCollectorInitialization, GEOS_FMT( "TimeHistory: '{}' initializing data collectors.", this->getName() ) ); for( auto collectorPath : m_collectorPaths ) diff --git a/src/coreComponents/fileIO/Outputs/unitTests/testMemoryStats.cpp b/src/coreComponents/fileIO/Outputs/unitTests/testMemoryStats.cpp index 84cd000bc60..119274e650b 100644 --- a/src/coreComponents/fileIO/Outputs/unitTests/testMemoryStats.cpp +++ b/src/coreComponents/fileIO/Outputs/unitTests/testMemoryStats.cpp @@ -17,6 +17,7 @@ #include "mainInterface/initialization.hpp" #include "mainInterface/GeosxState.hpp" #include "fileIO/Outputs/MemoryStatsOutput.hpp" +#include "fileIO/Outputs/OutputManager.hpp" #include "codingUtilities/Parsing.hpp" #include "common/format/table/TableFormatter.hpp" @@ -147,7 +148,7 @@ static const string basicSimXml = )xml"; -static const string memOutputPath = "/Outputs/memoryOutput"; +static const string memOutputName = "memoryOutput"; static const string memOutputFileName = "MemoryStats_umpireStats.csv"; CommandLineOptions g_commandLineOptions; @@ -166,7 +167,7 @@ TEST( testXML, testMemoryCSVOutput ) // do a MemoryStats test output with a dummy entry integer const dummyCycle = 123456; string const dummyCycleStr = std::to_string( dummyCycle ); - MemoryStatsOutput & memOutput = problem.getGroupByPath< MemoryStatsOutput >( memOutputPath ); + MemoryStatsOutput & memOutput = problem.getOutputManager().getGroup< MemoryStatsOutput >( memOutputName ); memOutput.execute( 0.0, 0.0, dummyCycle, 0, 0.0, problem.getDomainPartition() ); // read the CSV output (parseFile() will throw if no CSV is generated) diff --git a/src/coreComponents/fileIO/python/PyHistoryCollection.cpp b/src/coreComponents/fileIO/python/PyHistoryCollection.cpp index 7bd2a08ea4d..b971aefeacd 100644 --- a/src/coreComponents/fileIO/python/PyHistoryCollection.cpp +++ b/src/coreComponents/fileIO/python/PyHistoryCollection.cpp @@ -97,7 +97,7 @@ static PyObject * collect( PyHistoryCollection * self, PyObject * args ) return nullptr; } - geos::DomainPartition & domain = self->group->getGroupByPath< DomainPartition >( "/Problem/domain" ); + geos::DomainPartition & domain = geos::dataRepository::getProblemManagerBase( *self->group ).getDomainPartition(); try { diff --git a/src/coreComponents/fileIO/python/PyHistoryOutput.cpp b/src/coreComponents/fileIO/python/PyHistoryOutput.cpp index e7fff852ef5..2207597690e 100644 --- a/src/coreComponents/fileIO/python/PyHistoryOutput.cpp +++ b/src/coreComponents/fileIO/python/PyHistoryOutput.cpp @@ -95,7 +95,7 @@ static PyObject * output( PyHistoryOutput * self, PyObject * args ) return nullptr; } - geos::DomainPartition & domain = self->group->getGroupByPath< DomainPartition >( "/Problem/domain" ); + geos::DomainPartition & domain = geos::dataRepository::getProblemManagerBase( *self->group ).getDomainPartition(); try { diff --git a/src/coreComponents/fileIO/python/PyVTKOutput.cpp b/src/coreComponents/fileIO/python/PyVTKOutput.cpp index 89cc2c4026f..6294c0dad91 100644 --- a/src/coreComponents/fileIO/python/PyVTKOutput.cpp +++ b/src/coreComponents/fileIO/python/PyVTKOutput.cpp @@ -93,7 +93,7 @@ static PyObject * output( PyVTKOutput * self, PyObject * args ) return nullptr; } - geos::DomainPartition & domain = self->group->getGroupByPath< DomainPartition >( "/Problem/domain" ); + geos::DomainPartition & domain = geos::dataRepository::getProblemManagerBase( *self->group ).getDomainPartition(); try { diff --git a/src/coreComponents/fileIO/timeHistory/PackCollection.cpp b/src/coreComponents/fileIO/timeHistory/PackCollection.cpp index ee18e7e1e48..9baf7a2ce87 100644 --- a/src/coreComponents/fileIO/timeHistory/PackCollection.cpp +++ b/src/coreComponents/fileIO/timeHistory/PackCollection.cpp @@ -14,6 +14,7 @@ */ #include "PackCollection.hpp" +#include "dataRepository/ProblemManagerBase.hpp" namespace geos { @@ -60,7 +61,7 @@ void PackCollection::initializePostSubGroups( ) { if( !m_initialized ) { - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getProblemManagerBase( *this ).getDomainPartition(); m_collectionCount = collectAll() ? 1 : m_setNames.size(); // determine whether we're collecting from a mesh object manager Group const * const targetObject = this->getTargetObject( domain, m_objectPath ); diff --git a/src/coreComponents/finiteVolume/FluxApproximationBase.cpp b/src/coreComponents/finiteVolume/FluxApproximationBase.cpp index 4104ab292b9..fdc182ed828 100644 --- a/src/coreComponents/finiteVolume/FluxApproximationBase.cpp +++ b/src/coreComponents/finiteVolume/FluxApproximationBase.cpp @@ -20,6 +20,7 @@ #include "FluxApproximationBase.hpp" +#include "dataRepository/ProblemManagerBase.hpp" #include "fieldSpecification/FieldSpecificationManager.hpp" #include "fieldSpecification/AquiferBoundaryCondition.hpp" @@ -72,7 +73,7 @@ void FluxApproximationBase::initializePreSubGroups() { GEOS_MARK_FUNCTION; - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getProblemManagerBase( *this ).getDomainPartition(); domain.forMeshBodies( [&]( MeshBody & meshBody ) { @@ -113,7 +114,7 @@ void FluxApproximationBase::initializePostInitialConditionsPreSubGroups() { GEOS_MARK_FUNCTION; - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getProblemManagerBase( *this ).getDomainPartition(); FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance(); for( auto const & [meshBodyName, meshBodyRegions] : m_targetRegions ) diff --git a/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp b/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp index 4a881414782..154a4b38e7e 100644 --- a/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp +++ b/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp @@ -20,6 +20,7 @@ #include "VTKMeshGenerator.hpp" #include "common/DataTypes.hpp" +#include "dataRepository/ProblemManagerBase.hpp" #include "mesh/ExternalDataSourceManager.hpp" #include "mesh/LogLevelsInfo.hpp" #include "mesh/generators/VTKFaceBlockUtilities.hpp" @@ -118,7 +119,7 @@ void VTKMeshGenerator::postInputInitialization() if( !m_dataSourceName.empty()) { - ExternalDataSourceManager & externalDataManager = getGroupByPath< ExternalDataSourceManager >( "/Problem/ExternalDataSource" ); + ExternalDataSourceManager & externalDataManager = getProblemManagerBase( *this ).getExternalDataSourceManager(); m_dataSource = externalDataManager.getGroupPointer< VTKHierarchicalDataSource >( m_dataSourceName ); diff --git a/src/coreComponents/mesh/simpleGeometricObjects/SimpleGeometricObjectBase.cpp b/src/coreComponents/mesh/simpleGeometricObjects/SimpleGeometricObjectBase.cpp index 12097ec516d..6c9d69aeec6 100644 --- a/src/coreComponents/mesh/simpleGeometricObjects/SimpleGeometricObjectBase.cpp +++ b/src/coreComponents/mesh/simpleGeometricObjects/SimpleGeometricObjectBase.cpp @@ -19,6 +19,7 @@ #include "SimpleGeometricObjectBase.hpp" #include "dataRepository/InputFlags.hpp" +#include "dataRepository/ProblemManagerBase.hpp" #include "mesh/DomainPartition.hpp" namespace geos @@ -49,7 +50,7 @@ void SimpleGeometricObjectBase::postInputInitialization() { // determine m_epsilon m_epsilon = std::numeric_limits< real64 >::max(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getProblemManagerBase( *this ).getDomainPartition(); domain.forMeshBodies( [&]( MeshBody const & meshBody ) { m_epsilon = std::min( m_epsilon, 1e-6 * meshBody.getGlobalLengthScale() ); diff --git a/src/coreComponents/physicsSolvers/FieldStatisticsBase.hpp b/src/coreComponents/physicsSolvers/FieldStatisticsBase.hpp index 1548ed4b6e6..74da5dfee3d 100644 --- a/src/coreComponents/physicsSolvers/FieldStatisticsBase.hpp +++ b/src/coreComponents/physicsSolvers/FieldStatisticsBase.hpp @@ -20,6 +20,7 @@ #ifndef SRC_CORECOMPONENTS_PHYSICSSOLVERS_FIELDSTATISTICSBASE_HPP_ #define SRC_CORECOMPONENTS_PHYSICSSOLVERS_FIELDSTATISTICSBASE_HPP_ +#include "dataRepository/ProblemManagerBase.hpp" #include "events/tasks/TaskBase.hpp" #include "physicsSolvers/PhysicsSolverManager.hpp" #include "mesh/MeshLevel.hpp" @@ -95,8 +96,8 @@ class FieldStatisticsBase : public TaskBase void postInputInitialization() override { - Group & problemManager = this->getGroupByPath( "/Problem" ); - Group & physicsSolverManager = problemManager.getGroup( "Solvers" ); + PhysicsSolverManager & physicsSolverManager = + dataRepository::getProblemManagerBase( *this ).getPhysicsSolverManager(); m_solver = physicsSolverManager.getGroupPointer< SOLVER >( m_solverName ); GEOS_THROW_IF( m_solver == nullptr, diff --git a/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp b/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp index 8d05dfd6958..0e04649306e 100644 --- a/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp @@ -20,6 +20,7 @@ #include "codingUtilities/RTTypes.hpp" #include "common/format/EnumStrings.hpp" #include "dataRepository/Group.hpp" +#include "dataRepository/ProblemManagerBase.hpp" #include "physicsSolvers/LogLevelsInfo.hpp" #include "common/format/LogPart.hpp" #include "common/TimingMacros.hpp" @@ -158,10 +159,20 @@ void PhysicsSolverBase::postInputInitialization() PhysicsSolverBase::~PhysicsSolverBase() = default; +DomainPartition & PhysicsSolverBase::getDomainPartition() +{ + return getProblemManagerBase( *this ).getDomainPartition(); +} + +DomainPartition const & PhysicsSolverBase::getDomainPartition() const +{ + return getProblemManagerBase( *this ).getDomainPartition(); +} + void PhysicsSolverBase::initialize_postMeshGeneration() { ExecutableGroup::initialize_postMeshGeneration(); - DomainPartition const & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition const & domain = getDomainPartition(); generateMeshTargetsFromTargetRegions( domain.getMeshBodies()); } diff --git a/src/coreComponents/physicsSolvers/PhysicsSolverBase.hpp b/src/coreComponents/physicsSolvers/PhysicsSolverBase.hpp index a174b485e67..923e55abfdf 100644 --- a/src/coreComponents/physicsSolvers/PhysicsSolverBase.hpp +++ b/src/coreComponents/physicsSolvers/PhysicsSolverBase.hpp @@ -1014,6 +1014,17 @@ class PhysicsSolverBase : public ExecutableGroup protected: + /** + * @brief Get the DomainPartition from the Problem + * @return A reference to the DomainPartition + */ + DomainPartition & getDomainPartition(); + + /** + * @copydoc getDomainPartition() + */ + DomainPartition const & getDomainPartition() const; + virtual void postInputInitialization() override; /** diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp index 93c17c765ec..6e4550419c6 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp @@ -276,7 +276,7 @@ void CompositionalMultiphaseBase::registerDataOnMesh( Group & meshBodies ) { FlowSolverBase::registerDataOnMesh( meshBodies ); - DomainPartition const & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition const & domain = getDomainPartition(); ConstitutiveManager const & cm = domain.getConstitutiveManager(); // 0. Find a "reference" fluid model name (at this point, models are already attached to subregions) @@ -568,7 +568,7 @@ void CompositionalMultiphaseBase::initializePreSubGroups() { FlowSolverBase::initializePreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); ConstitutiveManager const & cm = domain.getConstitutiveManager(); // 1. Validate various models against each other (must have same phases and components) @@ -980,7 +980,7 @@ void CompositionalMultiphaseBase::initializeFluidState( MeshLevel & mesh, // check if comp fractions need to be corrected to avoid zero diags etc if( m_formulationType == CompositionalMultiphaseFormulationType::OverallComposition && m_allowCompDensChopping ) { - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); chopNegativeCompFractions( domain ); } @@ -1618,7 +1618,7 @@ void CompositionalMultiphaseBase::initializePostInitialConditionsPreSubGroups() FlowSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &, MeshLevel & mesh, diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp index 9e40db7e20c..432ba1bac6e 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp @@ -139,7 +139,7 @@ void CompositionalMultiphaseFVM::postInputInitialization() getWrapperDataContext( viewKeyStruct::useDBCString() ) ); } - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); NumericalMethodsManager const & numericalMethodManager = domain.getNumericalMethodManager(); FiniteVolumeManager const & fvManager = numericalMethodManager.getFiniteVolumeManager(); FluxApproximationBase const & fluxApprox = fvManager.getFluxApproximation( m_discretizationName ); @@ -201,7 +201,7 @@ void CompositionalMultiphaseFVM::initializePreSubGroups() checkDiscretizationName(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); NumericalMethodsManager const & numericalMethodManager = domain.getNumericalMethodManager(); FiniteVolumeManager const & fvManager = numericalMethodManager.getFiniteVolumeManager(); FluxApproximationBase const & fluxApprox = fvManager.getFluxApproximation( m_discretizationName ); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.cpp index 6fd5cba3a5c..c2cd8e2cdf2 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.cpp @@ -120,7 +120,7 @@ void CompositionalMultiphaseHybridFVM::initializePreSubGroups() { CompositionalMultiphaseBase::initializePreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); NumericalMethodsManager const & numericalMethodManager = domain.getNumericalMethodManager(); FiniteVolumeManager const & fvManager = numericalMethodManager.getFiniteVolumeManager(); @@ -137,7 +137,7 @@ void CompositionalMultiphaseHybridFVM::initializePostInitialConditionsPreSubGrou { GEOS_MARK_FUNCTION; - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); NumericalMethodsManager const & numericalMethodManager = domain.getNumericalMethodManager(); FiniteVolumeManager const & fvManager = numericalMethodManager.getFiniteVolumeManager(); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsTask.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsTask.cpp index d80db9040c1..281dd658161 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsTask.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsTask.cpp @@ -119,7 +119,7 @@ void StatsTask::prepareFluidMetaData() { using namespace constitutive; - ConstitutiveManager const & constitutiveManager = this->getGroupByPath< ConstitutiveManager >( "/Problem/domain/Constitutive" ); + ConstitutiveManager const & constitutiveManager = getProblemManagerBase( *this ).getConstitutiveManager(); MultiFluidBase const & fluid = constitutiveManager.getGroup< MultiFluidBase >( m_solver->referenceFluidModelName() ); m_fluid.m_numPhases = fluid.numFluidPhases(); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp index 3a948b6fee9..3cf1b560de6 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp @@ -252,7 +252,7 @@ void FlowSolverBase::registerDataOnMesh( Group & meshBodies ) } ); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); // fill stencil targetRegions NumericalMethodsManager & numericalMethodManager = domain.getNumericalMethodManager(); @@ -365,7 +365,7 @@ void FlowSolverBase::initializePreSubGroups() { PhysicsSolverBase::initializePreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); // fill stencil targetRegions NumericalMethodsManager & numericalMethodManager = domain.getNumericalMethodManager(); @@ -393,7 +393,7 @@ void FlowSolverBase::initializePreSubGroups() void FlowSolverBase::checkDiscretizationName() const { - DomainPartition const & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition const & domain = getDomainPartition(); NumericalMethodsManager const & numericalMethodManager = domain.getNumericalMethodManager(); FiniteVolumeManager const & finiteVolumeManager = numericalMethodManager.getFiniteVolumeManager(); @@ -493,7 +493,7 @@ void FlowSolverBase::initializePostInitialConditionsPreSubGroups() { PhysicsSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &, MeshLevel & mesh, diff --git a/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.cpp b/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.cpp index 1531799faeb..b90af0e2eba 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.cpp @@ -191,7 +191,7 @@ void ImmiscibleMultiphaseFlow::initializePreSubGroups() FlowSolverBase::initializePreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &, MeshLevel & mesh, @@ -461,7 +461,7 @@ void ImmiscibleMultiphaseFlow::initializePostInitialConditionsPreSubGroups() FlowSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &, MeshLevel & mesh, diff --git a/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp b/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp index 6ba70a82cf5..c9e031513cf 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp @@ -540,7 +540,7 @@ void ReactiveCompositionalMultiphaseOBL::initializePostInitialConditionsPreSubGr FlowSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &, MeshLevel & mesh, diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp index 562cfae6df4..b7d954eedd8 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp @@ -181,7 +181,7 @@ void SinglePhaseBase::initializePreSubGroups() { FlowSolverBase::initializePreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); // 1. Validate various models against each other (must have same phases and components) validateConstitutiveModels( domain ); @@ -392,7 +392,7 @@ void SinglePhaseBase::initializePostInitialConditionsPreSubGroups() FlowSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); initializeState( domain ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp index fdaf8496edb..e1d565fb17c 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp @@ -99,7 +99,7 @@ void SinglePhaseHybridFVM::initializePreSubGroups() "The thermal option is not supported by SinglePhaseHybridFVM", InputError, getDataContext() ); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); NumericalMethodsManager const & numericalMethodManager = domain.getNumericalMethodManager(); FiniteVolumeManager const & fvManager = numericalMethodManager.getFiniteVolumeManager(); @@ -113,7 +113,7 @@ void SinglePhaseHybridFVM::initializePostInitialConditionsPreSubGroups() GEOS_MARK_FUNCTION; SinglePhaseBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &, MeshLevel & mesh, string_array const & regionNames ) diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseReactiveTransport.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseReactiveTransport.cpp index b5c850662d3..5daeff72a86 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseReactiveTransport.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseReactiveTransport.cpp @@ -115,7 +115,7 @@ void SinglePhaseReactiveTransport::registerDataOnMesh( Group & meshBodies ) SinglePhaseBase::registerDataOnMesh( meshBodies ); - DomainPartition const & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition const & domain = getDomainPartition(); ConstitutiveManager const & cm = domain.getConstitutiveManager(); // 0. Find a reactive fluid model name (at this point, models are already attached to subregions) @@ -828,7 +828,7 @@ void SinglePhaseReactiveTransport::initializePostInitialConditionsPreSubGroups() FlowSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &, MeshLevel & mesh, diff --git a/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp b/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp index 3087c47b322..0369e2519bf 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp @@ -137,7 +137,7 @@ void ProppantTransport::initializePreSubGroups() { FlowSolverBase::initializePreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); ConstitutiveManager & cm = domain.getConstitutiveManager(); // Validate proppant models in regions @@ -289,7 +289,7 @@ void ProppantTransport::initializePostInitialConditionsPreSubGroups() FlowSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); integer const numComponents = m_numComponents; diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp index 6a72af7a90c..5d3b9ca7e6b 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp @@ -159,7 +159,7 @@ void CompositionalMultiphaseWell::registerDataOnMesh( Group & meshBodies ) { WellSolverBase::registerDataOnMesh( meshBodies ); - DomainPartition const & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition const & domain = getDomainPartition(); ConstitutiveManager const & cm = domain.getConstitutiveManager(); forDiscretizationOnMeshTargets( meshBodies, [&]( string const &, @@ -518,7 +518,7 @@ void CompositionalMultiphaseWell::initializePostSubGroups() { WellSolverBase::initializePostSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); validateConstitutiveModels( domain ); @@ -542,7 +542,7 @@ void CompositionalMultiphaseWell::initializePostInitialConditionsPreSubGroups() void CompositionalMultiphaseWell::postRestartInitialization() { - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &, MeshLevel & mesh, string_array const & regionNames ) @@ -562,7 +562,7 @@ void CompositionalMultiphaseWell::postRestartInitialization() void CompositionalMultiphaseWell::createSeparator() { - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &, MeshLevel & mesh, string_array const & regionNames ) diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp index 61b9398d0e6..4a89569e3f1 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp @@ -151,7 +151,7 @@ void WellSolverBase::registerDataOnMesh( Group & meshBodies ) void WellSolverBase::initializePostSubGroups() { - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); FunctionManager & functionManager = FunctionManager::getInstance(); Group & meshBodies = domain.getMeshBodies(); forDiscretizationOnMeshTargets( meshBodies, [&] ( string const &, @@ -344,7 +344,7 @@ void WellSolverBase::initializePostInitialConditionsPreSubGroups() { PhysicsSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); // make sure that nextWellElementIndex is up-to-date (will be used in well initialization and assembly) forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &, diff --git a/src/coreComponents/physicsSolvers/multiphysics/FieldApplicator.cpp b/src/coreComponents/physicsSolvers/multiphysics/FieldApplicator.cpp index 98595748809..7212cf946cd 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/FieldApplicator.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/FieldApplicator.cpp @@ -14,6 +14,7 @@ */ #include "FieldApplicator.hpp" +#include "dataRepository/ProblemManagerBase.hpp" #include "events/tasks/TasksManager.hpp" #include "fieldSpecification/FieldSpecification.hpp" #include "fieldSpecification/FieldSpecificationImpl.hpp" @@ -25,6 +26,7 @@ #include "mesh/CellElementSubRegion.hpp" #include "mesh/SurfaceElementSubRegion.hpp" #include "functions/TableFunction.hpp" +#include "physicsSolvers/PhysicsSolverManager.hpp" #include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp" #include "physicsSolvers/fluidFlow/CompositionalMultiphaseBaseFields.hpp" #include "constitutive/fluid/multifluid/MultiFluidBase.hpp" @@ -105,7 +107,7 @@ FieldApplicator:: // Find the flow solver to delegate initialization to. // Use m_solverName if provided, otherwise find the first FlowSolverBase. FlowSolverBase * flowSolver = nullptr; - Group & solversGroup = this->getGroupByPath< Group >( "/Problem/Solvers" ); + PhysicsSolverManager & solversGroup = getProblemManagerBase( *this ).getPhysicsSolverManager(); if( !m_solverName.empty() ) { @@ -239,7 +241,7 @@ void FieldApplicator::initializeSubRegionFluidState( DomainPartition & domain, E // Use m_solverName if provided, otherwise search all solvers. CompositionalMultiphaseBase * flowSolver = nullptr; - Group & solversGroup = this->getGroupByPath< Group >( "/Problem/Solvers" ); + PhysicsSolverManager & solversGroup = getProblemManagerBase( *this ).getPhysicsSolverManager(); if( !m_solverName.empty() ) { diff --git a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsEmbeddedFractures.cpp b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsEmbeddedFractures.cpp index 9ac8d570c7f..9c47d05b142 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsEmbeddedFractures.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsEmbeddedFractures.cpp @@ -92,7 +92,8 @@ void SinglePhasePoromechanicsEmbeddedFractures::initializePostInitialConditionsP { Base::initializePostInitialConditionsPreSubGroups(); - updateState( this->getGroupByPath< DomainPartition >( "/Problem/domain" ) ); + updateState( getDomainPartition() ); + } void SinglePhasePoromechanicsEmbeddedFractures::setupCoupling( DomainPartition const & domain, diff --git a/src/coreComponents/physicsSolvers/python/PySolver.cpp b/src/coreComponents/physicsSolvers/python/PySolver.cpp index d8c7ada2ae2..5a07765fbac 100644 --- a/src/coreComponents/physicsSolvers/python/PySolver.cpp +++ b/src/coreComponents/physicsSolvers/python/PySolver.cpp @@ -92,7 +92,7 @@ static PyObject * execute( PySolver * self, PyObject * args ) return nullptr; } - geos::DomainPartition & domain = self->group->getGroupByPath< DomainPartition >( "/Problem/domain" ); + geos::DomainPartition & domain = self->group->getDomainPartition(); self->group->execute( time, dt, cycleNumber, 0, 0, domain ); @@ -123,7 +123,7 @@ static PyObject * cleanup( PySolver * self, PyObject *args ) return nullptr; } - geos::DomainPartition & domain = self->group->getGroupByPath< DomainPartition >( "/Problem/domain" ); + geos::DomainPartition & domain = self->group->getDomainPartition(); self->group->cleanup( time, 0, 0, 0.0, domain ); Py_RETURN_NONE; diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsInitialization.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsInitialization.cpp index 19fca8f4c4f..5c8aa7d237e 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsInitialization.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsInitialization.cpp @@ -67,8 +67,8 @@ SolidMechanicsInitialization< SOLID_SOLVER >::~SolidMechanicsInitialization() = template< typename SOLID_SOLVER > void SolidMechanicsInitialization< SOLID_SOLVER >::postInputInitialization() { - Group & problemManager = this->getGroupByPath( "/Problem" ); - Group & physicsSolverManager = problemManager.getGroup( "Solvers" ); + ProblemManagerBase & problemManager = getProblemManagerBase( *this ); + PhysicsSolverManager & physicsSolverManager = problemManager.getPhysicsSolverManager(); GEOS_THROW_IF( !physicsSolverManager.hasGroup( m_solidSolverName ), GEOS_FMT( "{}: {} solver named {} not found", @@ -81,7 +81,7 @@ void SolidMechanicsInitialization< SOLID_SOLVER >::postInputInitialization() if( !m_solidMechanicsStatisticsName.empty() ) { - TasksManager & tasksManager = problemManager.getGroup< TasksManager >( "Tasks" ); + TasksManager & tasksManager = problemManager.getTasksManager(); GEOS_THROW_IF( !tasksManager.hasGroup( m_solidMechanicsStatisticsName ), GEOS_FMT( "{}: {} task named {} not found", diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp index 2e2ab2d365d..80e3cc349a7 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp @@ -45,6 +45,7 @@ #include "mesh/CellElementSubRegion.hpp" #include "mesh/mpiCommunications/NeighborCommunicator.hpp" #include "fileIO/Outputs/ChomboIO.hpp" +#include "fileIO/Outputs/OutputManager.hpp" #include "physicsSolvers/LogLevelsInfo.hpp" #include "physicsSolvers/solidMechanics/kernels/SolidMechanicsKernelsDispatchTypeList.hpp" @@ -199,7 +200,7 @@ void SolidMechanicsLagrangianFEM::registerDataOnMesh( Group & meshBodies ) nodes.registerField< solidMechanics::incrementalDisplacement >( getName() ). reference().resizeDimension< 1 >( 3 ); - Group const & outputs = Group::getGroupByPath( GEOS_FMT( "/{}", ProblemManager::groupKeysStruct().outputManager.key() ) ); + OutputManager const & outputs = getProblemManagerBase( *this ).getOutputManager(); if( m_timeIntegrationOption != TimeIntegrationOption::QuasiStatic || outputs.hasSubGroupOfType< ChomboIO >() ) { nodes.registerField< solidMechanics::velocity >( getName() ). @@ -269,7 +270,7 @@ void SolidMechanicsLagrangianFEM::initializePreSubGroups() { PhysicsSolverBase::initializePreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); NumericalMethodsManager const & numericalMethodManager = domain.getNumericalMethodManager(); FiniteElementDiscretizationManager const & feDiscretizationManager = numericalMethodManager.getFiniteElementDiscretizationManager(); @@ -379,7 +380,7 @@ void SolidMechanicsLagrangianFEM::initializeMass( MeshLevel & mesh, CellElementS void SolidMechanicsLagrangianFEM::initializePostInitialConditionsPreSubGroups() { - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &, diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp index bf1814610e5..52ed0af0e34 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp @@ -469,7 +469,7 @@ void SolidMechanicsMPM::initializePreSubGroups() { PhysicsSolverBase::initializePreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getProblemManagerBase( *this ).getDomainPartition(); Group & meshBodies = domain.getMeshBodies(); diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp index a67fabbf24b..c7bfb3264cc 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp @@ -19,6 +19,7 @@ #include "SolidMechanicsStateReset.hpp" +#include "dataRepository/ProblemManagerBase.hpp" #include "physicsSolvers/PhysicsSolverManager.hpp" #include "physicsSolvers/solidMechanics/contact/ContactFields.hpp" #include "physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.hpp" @@ -62,8 +63,7 @@ SolidMechanicsStateReset::~SolidMechanicsStateReset() void SolidMechanicsStateReset::postInputInitialization() { - Group & problemManager = this->getGroupByPath( "/Problem" ); - Group & physicsSolverManager = problemManager.getGroup( "Solvers" ); + PhysicsSolverManager & physicsSolverManager = getProblemManagerBase( *this ).getPhysicsSolverManager(); GEOS_THROW_IF( !physicsSolverManager.hasGroup( m_solidSolverName ), GEOS_FMT( "physics solver named {} not found", m_solidSolverName ), diff --git a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.cpp b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.cpp index c4145ee9318..94e199d2f62 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.cpp @@ -40,6 +40,7 @@ #include "physicsSolvers/solidMechanics/contact/kernels/SolidMechanicsALMContactPorousKernelsDispatchTypeList.hpp" #include "finiteElement/FiniteElementDiscretization.hpp" #include "mesh/DomainPartition.hpp" +#include "dataRepository/ProblemManagerBase.hpp" #include @@ -193,7 +194,7 @@ void SolidMechanicsAugmentedLagrangianContact::initializePostInitialConditionsPr { ContactSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getProblemManagerBase( *this ).getDomainPartition(); validateTetrahedralQuadrature( domain.getMeshBodies() ); } @@ -202,7 +203,7 @@ void SolidMechanicsAugmentedLagrangianContact::validateTetrahedralQuadrature( Gr string const discretizationName = getDiscretizationName(); NumericalMethodsManager const & numericalMethodManager = - this->getGroupByPath< DomainPartition >( "/Problem/domain" ).getNumericalMethodManager(); + getProblemManagerBase( *this ).getDomainPartition().getNumericalMethodManager(); FiniteElementDiscretizationManager const & feDiscretizationManager = numericalMethodManager.getFiniteElementDiscretizationManager(); FiniteElementDiscretization const & feDiscretization = @@ -328,7 +329,7 @@ void SolidMechanicsAugmentedLagrangianContact::postInputInitialization() { ContactSolverBase::postInputInitialization(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getProblemManagerBase( *this ).getDomainPartition(); NumericalMethodsManager const & numericalMethodManager = domain.getNumericalMethodManager(); FiniteElementDiscretizationManager const & feDiscretizationManager = numericalMethodManager.getFiniteElementDiscretizationManager(); diff --git a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsEmbeddedFractures.cpp b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsEmbeddedFractures.cpp index d2f9af55b01..cbdbe208579 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsEmbeddedFractures.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsEmbeddedFractures.cpp @@ -110,7 +110,7 @@ void SolidMechanicsEmbeddedFractures::registerDataOnMesh( dataRepository::Group void SolidMechanicsEmbeddedFractures::initializePostInitialConditionsPreSubGroups() { ContactSolverBase::initializePostInitialConditionsPreSubGroups(); - updateState( getGroupByPath< DomainPartition >( "/Problem/domain" ) ); + updateState( getDomainPartition() ); } void SolidMechanicsEmbeddedFractures::resetStateToBeginningOfStep( DomainPartition & domain ) diff --git a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContact.cpp b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContact.cpp index b12a67de3ca..45c31284894 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContact.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContact.cpp @@ -180,7 +180,7 @@ void SolidMechanicsLagrangeContact::initializePreSubGroups() { ContactSolverBase::initializePreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); // fill stencil targetRegions NumericalMethodsManager & numericalMethodManager = domain.getNumericalMethodManager(); diff --git a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContactBubbleStab.cpp b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContactBubbleStab.cpp index 34417df75db..ddb6b2402c8 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContactBubbleStab.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContactBubbleStab.cpp @@ -119,7 +119,7 @@ void SolidMechanicsLagrangeContactBubbleStab::initializePostInitialConditionsPre { ContactSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); validateTetrahedralQuadrature( domain.getMeshBodies() ); } @@ -128,7 +128,7 @@ void SolidMechanicsLagrangeContactBubbleStab::validateTetrahedralQuadrature( Gro string const discretizationName = getDiscretizationName(); NumericalMethodsManager const & numericalMethodManager = - this->getGroupByPath< DomainPartition >( "/Problem/domain" ).getNumericalMethodManager(); + getDomainPartition().getNumericalMethodManager(); FiniteElementDiscretizationManager const & feDiscretizationManager = numericalMethodManager.getFiniteElementDiscretizationManager(); FiniteElementDiscretization const & feDiscretization = @@ -225,7 +225,7 @@ void SolidMechanicsLagrangeContactBubbleStab::postInputInitialization() { ContactSolverBase::postInputInitialization(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); NumericalMethodsManager const & numericalMethodManager = domain.getNumericalMethodManager(); FiniteElementDiscretizationManager const & feDiscretizationManager = numericalMethodManager.getFiniteElementDiscretizationManager(); diff --git a/src/coreComponents/physicsSolvers/surfaceGeneration/EmbeddedSurfaceGenerator.cpp b/src/coreComponents/physicsSolvers/surfaceGeneration/EmbeddedSurfaceGenerator.cpp index d96124bf8c6..500c488ca61 100644 --- a/src/coreComponents/physicsSolvers/surfaceGeneration/EmbeddedSurfaceGenerator.cpp +++ b/src/coreComponents/physicsSolvers/surfaceGeneration/EmbeddedSurfaceGenerator.cpp @@ -86,7 +86,7 @@ void EmbeddedSurfaceGenerator::initializePostSubGroups() */ // Get domain - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); // Get geometric object manager GeometricObjectManager & geometricObjManager = GeometricObjectManager::getInstance(); diff --git a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp index ef2b09b7e6a..d04519ce1d6 100644 --- a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp +++ b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp @@ -19,6 +19,7 @@ #include "SurfaceGenerator.hpp" +#include "dataRepository/ProblemManagerBase.hpp" #include "mesh/mpiCommunications/CommunicationTools.hpp" #include "mesh/mpiCommunications/NeighborCommunicator.hpp" #include "mesh/mpiCommunications/SpatialPartition.hpp" @@ -286,8 +287,7 @@ void SurfaceGenerator::registerDataOnMesh( Group & meshBodies ) // TODO: handle this in registerField(). faceManager.getField< surfaceGeneration::K_IC >().resizeDimension< 1 >( 3 ); - Group & problemManager = this->getGroupByPath( "/Problem" ); - FieldSpecificationManager & fsm = problemManager.getGroup< FieldSpecificationManager >( "FieldSpecifications" ); + FieldSpecificationManager & fsm = getProblemManagerBase( *this ).getFieldSpecificationManager(); fsm.setIsSurfaceGenerationCase( true ); } ); @@ -296,7 +296,7 @@ void SurfaceGenerator::registerDataOnMesh( Group & meshBodies ) void SurfaceGenerator::initializePostInitialConditionsPreSubGroups() { - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &, MeshLevel & meshLevel, string_array const & ) @@ -427,7 +427,7 @@ void SurfaceGenerator::initializePostInitialConditionsPreSubGroups() void SurfaceGenerator::postRestartInitialization() { - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); NumericalMethodsManager & numericalMethodManager = domain.getNumericalMethodManager(); diff --git a/src/coreComponents/physicsSolvers/wavePropagation/dg/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationDG.cpp b/src/coreComponents/physicsSolvers/wavePropagation/dg/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationDG.cpp index d2ed40b724b..b83f68b2fc4 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/dg/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationDG.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/dg/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationDG.cpp @@ -245,7 +245,7 @@ void AcousticWaveEquationDG::initializePostInitialConditionsPreSubGroups() WaveSolverBase::initializePostInitialConditionsPreSubGroups(); } - DomainPartition & domain = getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const & meshBodyName, MeshLevel & mesh, diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/firstOrderEqn/isotropic/AcousticFirstOrderWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/firstOrderEqn/isotropic/AcousticFirstOrderWaveEquationSEM.cpp index e56ca81c75c..0c13b012b5b 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/firstOrderEqn/isotropic/AcousticFirstOrderWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/firstOrderEqn/isotropic/AcousticFirstOrderWaveEquationSEM.cpp @@ -274,7 +274,7 @@ void AcousticFirstOrderWaveEquationSEM::initializePostInitialConditionsPreSubGro { WaveSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); applyFreeSurfaceBC( 0.0, domain ); diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/anisotropic/AcousticVTIWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/anisotropic/AcousticVTIWaveEquationSEM.cpp index 1cd6fafaa2f..754ae26be43 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/anisotropic/AcousticVTIWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/anisotropic/AcousticVTIWaveEquationSEM.cpp @@ -261,7 +261,7 @@ void AcousticVTIWaveEquationSEM::initializePostInitialConditionsPreSubGroups() WaveSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); applyFreeSurfaceBC( 0.0, domain ); precomputeSurfaceFieldIndicator( domain ); diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp index 69c5bdbd525..27d498ae4cf 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp @@ -228,7 +228,7 @@ void AcousticWaveEquationSEM::precomputeSourceAndReceiverTerm( MeshLevel & baseM bool useSourceWaveletTables = m_useSourceWaveletTables; //Correct size for sourceValue - EventManager const & event = getGroupByPath< EventManager >( "/Problem/Events" ); + EventManager const & event = getProblemManagerBase( *this ).getEventManager(); real64 const & maxTime = event.getReference< real64 >( EventManager::viewKeyStruct::maxTimeString() ); real64 const & minTime = event.getReference< real64 >( EventManager::viewKeyStruct::minTimeString() ); real64 dt = 0; @@ -359,7 +359,7 @@ void AcousticWaveEquationSEM::initializePostInitialConditionsPreSubGroups() AcousticWaveEquationSEM::initializePML(); } - DomainPartition & domain = getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); applyFreeSurfaceBC( 0.0, domain ); @@ -447,7 +447,7 @@ void AcousticWaveEquationSEM::initializePostInitialConditionsPreSubGroups() //We use the timeStep defined inside the xml else if( m_timestepStabilityLimit==0 ) { - EventManager const & event = getGroupByPath< EventManager >( "/Problem/Events" ); + EventManager const & event = getProblemManagerBase( *this ).getEventManager(); for( localIndex numSubEvent = 0; numSubEvent < event.numSubGroups(); ++numSubEvent ) { EventBase const * subEvent = static_cast< EventBase const * >( event.getSubGroups()[numSubEvent] ); @@ -503,7 +503,7 @@ void AcousticWaveEquationSEM::initializePostInitialConditionsPreSubGroups() real64 AcousticWaveEquationSEM::computeTimeStep( real64 & dtOut ) { - DomainPartition & domain = getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &, MeshLevel & mesh, @@ -697,7 +697,7 @@ void AcousticWaveEquationSEM::initializePML() } ); /// Now compute the PML parameters above internally - DomainPartition & domain = getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &, MeshLevel & mesh, string_array const & ) @@ -1115,7 +1115,7 @@ real64 AcousticWaveEquationSEM::explicitStepBackward( real64 const & time_n, p_nm1[a] = (p_np1[a] - 2*p_n[a] + p_nm1[a]) / pow( dt, 2 ); } ); - EventManager const & event = getGroupByPath< EventManager >( "/Problem/Events" ); + EventManager const & event = getProblemManagerBase( *this ).getEventManager(); real64 const & maxTime = event.getReference< real64 >( EventManager::viewKeyStruct::maxTimeString() ); int const maxCycle = int(round( maxTime / dt )); @@ -1292,7 +1292,7 @@ void AcousticWaveEquationSEM::computeUnknowns( real64 const & time_n, } //Modification of cycleNember useful when minTime < 0 - EventManager const & event = getGroupByPath< EventManager >( "/Problem/Events" ); + EventManager const & event = getProblemManagerBase( *this ).getEventManager(); real64 const & minTime = event.getReference< real64 >( EventManager::viewKeyStruct::minTimeString() ); //localIndex const cycleNumber = time_n/dt; integer const cycleForSource = int(round( -minTime / dt + cycleNumber )); diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustoelastic/secondOrderEqn/isotropic/AcousticElasticWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustoelastic/secondOrderEqn/isotropic/AcousticElasticWaveEquationSEM.cpp index b543c6643d5..473b68bc6d2 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustoelastic/secondOrderEqn/isotropic/AcousticElasticWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustoelastic/secondOrderEqn/isotropic/AcousticElasticWaveEquationSEM.cpp @@ -66,7 +66,7 @@ void AcousticElasticWaveEquationSEM::initializePostInitialConditionsPreSubGroups m_acousRegions = &(acousSolver->getReference< string_array >( PhysicsSolverBase::viewKeyStruct::targetRegionsString() )); m_elasRegions = &(elasSolver->getReference< string_array >( PhysicsSolverBase::viewKeyStruct::targetRegionsString() )); - DomainPartition & domain = getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &, MeshLevel & mesh, diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/firstOrderEqn/isotropic/ElasticFirstOrderWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/firstOrderEqn/isotropic/ElasticFirstOrderWaveEquationSEM.cpp index 833d8a76c0d..b79b3134c63 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/firstOrderEqn/isotropic/ElasticFirstOrderWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/firstOrderEqn/isotropic/ElasticFirstOrderWaveEquationSEM.cpp @@ -325,7 +325,7 @@ void ElasticFirstOrderWaveEquationSEM::initializePostInitialConditionsPreSubGrou WaveSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); real64 const time = 0.0; applyFreeSurfaceBC( time, domain ); diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp index 07f7c4ad5e4..58027370056 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp @@ -396,7 +396,7 @@ void ElasticWaveEquationSEM::initializePostInitialConditionsPreSubGroups() WaveSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); applyFreeSurfaceBC( 0.0, domain ); @@ -486,7 +486,7 @@ void ElasticWaveEquationSEM::initializePostInitialConditionsPreSubGroups() //We use the timeStep defined inside the xml else if( m_timestepStabilityLimit==0 ) { - EventManager const & event = getGroupByPath< EventManager >( "/Problem/Events" ); + EventManager const & event = getProblemManagerBase( *this ).getEventManager(); for( localIndex numSubEvent = 0; numSubEvent < event.numSubGroups(); ++numSubEvent ) { EventBase const * subEvent = static_cast< EventBase const * >( event.getSubGroups()[numSubEvent] ); @@ -539,7 +539,7 @@ void ElasticWaveEquationSEM::initializePostInitialConditionsPreSubGroups() real64 ElasticWaveEquationSEM::computeTimeStep( real64 & dtOut ) { - DomainPartition & domain = getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &, MeshLevel & mesh, diff --git a/src/coreComponents/physicsSolvers/wavePropagation/shared/WaveSolverBase.cpp b/src/coreComponents/physicsSolvers/wavePropagation/shared/WaveSolverBase.cpp index ca598f505df..53498c7a25c 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/shared/WaveSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/shared/WaveSolverBase.cpp @@ -406,7 +406,7 @@ void WaveSolverBase::postInputInitialization() "Invalid number of physical coordinates for the receivers", InputError, getDataContext() ); - EventManager const & event = getGroupByPath< EventManager >( "/Problem/Events" ); + EventManager const & event = getProblemManagerBase( *this ).getEventManager(); real64 const & maxTime = event.getReference< real64 >( EventManager::viewKeyStruct::maxTimeString() ); if( m_dtSeismoTrace > 0 ) @@ -450,7 +450,7 @@ real64 WaveSolverBase::explicitStep( real64 const & time_n, localIndex WaveSolverBase::getNumNodesPerElem() { - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = getDomainPartition(); NumericalMethodsManager const & numericalMethodManager = domain.getNumericalMethodManager(); From 50e416eb3b44043f724f4e42c2bd1179fc8f8e6a Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 14 Aug 2026 15:11:51 +0200 Subject: [PATCH 05/13] =?UTF-8?q?=F0=9F=9A=A7=20refactor=20to=20encapsulat?= =?UTF-8?q?e=20and=20expose=20the=20managers=20inside=20a=20ProblemReposit?= =?UTF-8?q?ory,=20an=20ABC=20of=20ProblemManager=20Each=20manager=20will?= =?UTF-8?q?=20then=20provide=20a=20global=20access=20method=20within=20the?= =?UTF-8?q?=20current=20problem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataRepository/CMakeLists.txt | 79 ++-- .../dataRepository/GlobalViewKeys.hpp | 69 --- src/coreComponents/dataRepository/Group.cpp | 8 +- .../dataRepository/KeyNames.hpp | 45 -- .../dataRepository/ProblemManagerBase.hpp | 135 ------ .../dataRepository/ProblemRepository.cpp | 68 +++ .../dataRepository/ProblemRepository.hpp | 172 +++++++ .../dataRepository/ProblemRepositoryABC.hpp | 70 +++ .../mainInterface/ProblemManager.cpp | 418 ++++++++---------- .../mainInterface/ProblemManager.hpp | 376 ++++++---------- 10 files changed, 678 insertions(+), 762 deletions(-) delete mode 100644 src/coreComponents/dataRepository/GlobalViewKeys.hpp delete mode 100644 src/coreComponents/dataRepository/KeyNames.hpp delete mode 100644 src/coreComponents/dataRepository/ProblemManagerBase.hpp create mode 100644 src/coreComponents/dataRepository/ProblemRepository.cpp create mode 100644 src/coreComponents/dataRepository/ProblemRepository.hpp create mode 100644 src/coreComponents/dataRepository/ProblemRepositoryABC.hpp diff --git a/src/coreComponents/dataRepository/CMakeLists.txt b/src/coreComponents/dataRepository/CMakeLists.txt index 22f4575df6b..f8362a73c1e 100644 --- a/src/coreComponents/dataRepository/CMakeLists.txt +++ b/src/coreComponents/dataRepository/CMakeLists.txt @@ -22,49 +22,52 @@ Also contains a wrapper to process entries from an xml file into data types. # Specify all headers # set( dataRepository_headers - BufferOps.hpp - BufferOpsDevice.hpp - BufferOps_inline.hpp - ConduitRestart.hpp - DefaultValue.hpp - ExecutableGroup.hpp - GlobalViewKeys.hpp - Group.hpp - HistoryDataSpec.hpp - InputFlags.hpp - KeyIndexT.hpp - KeyNames.hpp - LogLevelsInfo.hpp - LogLevelsRegistry.hpp - MappedVector.hpp - ObjectCatalog.hpp - ProblemManagerBase.hpp - ReferenceWrapper.hpp - RestartFlags.hpp - Utilities.hpp - Wrapper.hpp - WrapperBase.hpp - wrapperHelpers.hpp - xmlWrapper.hpp - DataContext.hpp - GroupContext.hpp - WrapperContext.hpp ) + BufferOps.hpp + BufferOpsDevice.hpp + BufferOps_inline.hpp + ConduitRestart.hpp + DefaultValue.hpp + ExecutableGroup.hpp + GlobalViewKeys.hpp + Group.hpp + HistoryDataSpec.hpp + InputFlags.hpp + KeyIndexT.hpp + KeyNames.hpp + LogLevelsInfo.hpp + LogLevelsRegistry.hpp + MappedVector.hpp + ObjectCatalog.hpp + ProblemManagerBase.hpp + ProblemRepositoryABC.hpp + ProblemRepository.hpp + ReferenceWrapper.hpp + RestartFlags.hpp + Utilities.hpp + Wrapper.hpp + WrapperBase.hpp + wrapperHelpers.hpp + xmlWrapper.hpp + DataContext.hpp + GroupContext.hpp + WrapperContext.hpp ) # # Specify all sources # set( dataRepository_sources - BufferOpsDevice.cpp - ConduitRestart.cpp - ExecutableGroup.cpp - Group.cpp - Utilities.cpp - WrapperBase.cpp - xmlWrapper.cpp - DataContext.cpp - GroupContext.cpp - LogLevelsRegistry.cpp - WrapperContext.cpp ) + BufferOpsDevice.cpp + ConduitRestart.cpp + ExecutableGroup.cpp + Group.cpp + ProblemRepository.cpp + Utilities.cpp + WrapperBase.cpp + xmlWrapper.cpp + DataContext.cpp + GroupContext.cpp + LogLevelsRegistry.cpp + WrapperContext.cpp ) set( dependencyList ${parallelDeps} codingUtilities ) diff --git a/src/coreComponents/dataRepository/GlobalViewKeys.hpp b/src/coreComponents/dataRepository/GlobalViewKeys.hpp deleted file mode 100644 index 4b0c7a53278..00000000000 --- a/src/coreComponents/dataRepository/GlobalViewKeys.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -/** - * @file GlobalViewKeys.hpp - */ - -#ifndef GEOS_DATAREPOSITORY_GLOBALVIEWKEYS_HPP_ -#define GEOS_DATAREPOSITORY_GLOBALVIEWKEYS_HPP_ - - -namespace geos -{ -namespace dataRepository -{ - - -/** - * @struct GlobalViewKeys - */ -struct GlobalViewKeys -{ - /// @return Root problem group name - static constexpr char const * problem() { return "Problem"; } - /// @return Command-line group name - static constexpr char const * commandLine() { return "commandLine"; } - /// @return Domain partition group name - static constexpr char const * domain() { return "domain"; } - /// @return Constitutive manager group name - static constexpr char const * constitutiveManager() { return "Constitutive"; } - /// @return Event manager group name - static constexpr char const * eventManager() { return "Events"; } - /// @return External data source manager group name - static constexpr char const * externalDataSourceManager() { return "ExternalDataSource"; } - /// @return FieldSpecification manager group name - static constexpr char const * fieldSpecificationManager() { return "FieldSpecifications"; } - /// @return Function manager group name - static constexpr char const * functionManager() { return "Functions"; } - /// @return Geometric object manager group name - static constexpr char const * geometricObjectManager() { return "Geometry"; } - /// @return Mesh manager group name - static constexpr char const * meshManager() { return "Mesh"; } - /// @return Numerical methods manager group name - static constexpr char const * numericalMethodsManager() { return "NumericalMethods"; } - /// @return Outputs manager group name - static constexpr char const * outputManager() { return "Outputs"; } - /// @return Physics solvers manager group name - static constexpr char const * physicsSolverManager() { return "Solvers"; } - /// @return Tasks manager group name - static constexpr char const * tasksManager() { return "Tasks"; } -}; - -} /* namespace dataRepository */ -} /* namespace geos */ - - -#endif /* GEOS_DATAREPOSITORY_GLOBALVIEWKEYS_HPP_ */ diff --git a/src/coreComponents/dataRepository/Group.cpp b/src/coreComponents/dataRepository/Group.cpp index a0ef81eac96..bda26ece209 100644 --- a/src/coreComponents/dataRepository/Group.cpp +++ b/src/coreComponents/dataRepository/Group.cpp @@ -21,6 +21,7 @@ #include "common/format/table/TableLayout.hpp" #include "codingUtilities/Utilities.hpp" #include "GroupContext.hpp" +#include "ProblemRepositoryABC.hpp" #if defined(GEOS_USE_PYGEOSX) #include "python/PyGroupType.hpp" #endif @@ -133,12 +134,7 @@ void Group::reserve( indexType const newSize ) } string Group::getPath() const -{ - // In the Conduit node hierarchy everything begins with 'Problem', we should change it so that - // the ProblemManager actually uses the root Conduit Node but that will require a full rebaseline. - string const noProblem = getConduitNode().path().substr( stringutilities::cstrlen( dataRepository::keys::ProblemManager ) ); - return noProblem.empty() ? "/" : noProblem; -} +{ return ProblemRepositoryABC::getNoProblemPath( getConduitNode().path() ); } string Group::processInputName( xmlWrapper::xmlNode const & targetNode, xmlWrapper::xmlNodePos const & targetNodePos, diff --git a/src/coreComponents/dataRepository/KeyNames.hpp b/src/coreComponents/dataRepository/KeyNames.hpp deleted file mode 100644 index d6482837051..00000000000 --- a/src/coreComponents/dataRepository/KeyNames.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -/** - * @file KeyNames.hpp - */ - -#ifndef GEOS_DATAREPOSITORY__KEYNAMES_HPP_ -#define GEOS_DATAREPOSITORY__KEYNAMES_HPP_ - -#include "GlobalViewKeys.hpp" - -#include - -namespace geos -{ -namespace dataRepository -{ -namespace keys -{ - -/// @cond DO_NOT_DOCUMENT - -static constexpr auto ProblemManager = GlobalViewKeys::problem(); -static constexpr auto cellManager = "cellManager"; -static constexpr auto particleManager = "particleManager"; - -/// @endcond - -} -} -} -#endif /* GEOS_DATAREPOSITORY__KEYNAMES_HPP_ */ diff --git a/src/coreComponents/dataRepository/ProblemManagerBase.hpp b/src/coreComponents/dataRepository/ProblemManagerBase.hpp deleted file mode 100644 index 70e6eaf4da4..00000000000 --- a/src/coreComponents/dataRepository/ProblemManagerBase.hpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -/** - * @file ProblemManagerBase.hpp - */ - -#ifndef GEOS_DATAREPOSITORY_PROBLEMMANAGERBASE_HPP_ -#define GEOS_DATAREPOSITORY_PROBLEMMANAGERBASE_HPP_ - -#include "dataRepository/Group.hpp" - -namespace geos -{ - -class DomainPartition; -class EventManager; -class ExternalDataSourceManager; -class FieldSpecificationManager; -class FunctionManager; -class GeometricObjectManager; -class MeshManager; -class NumericalMethodsManager; -class OutputManager; -class PhysicsSolverManager; -class TasksManager; -namespace constitutive -{ -class ConstitutiveManager; -} - -namespace dataRepository -{ - - -/** - * @class ProblemManagerBase - */ -class ProblemManagerBase : public Group -{ -public: - - using Group::Group; - - virtual DomainPartition & getDomainPartition() = 0; - virtual DomainPartition const & getDomainPartition() const = 0; - - virtual constitutive::ConstitutiveManager & getConstitutiveManager() = 0; - virtual constitutive::ConstitutiveManager const & getConstitutiveManager() const = 0; - - virtual EventManager & getEventManager() = 0; - virtual EventManager const & getEventManager() const = 0; - - virtual ExternalDataSourceManager & getExternalDataSourceManager() = 0; - virtual ExternalDataSourceManager const & getExternalDataSourceManager() const = 0; - - virtual FieldSpecificationManager & getFieldSpecificationManager() = 0; - virtual FieldSpecificationManager const & getFieldSpecificationManager() const = 0; - - virtual FunctionManager & getFunctionManager() = 0; - virtual FunctionManager const & getFunctionManager() const = 0; - - virtual GeometricObjectManager & getGeometricObjectManager() = 0; - virtual GeometricObjectManager const & getGeometricObjectManager() const = 0; - - virtual MeshManager & getMeshManager() = 0; - virtual MeshManager const & getMeshManager() const = 0; - - virtual NumericalMethodsManager & getNumericalMethodsManager() = 0; - virtual NumericalMethodsManager const & getNumericalMethodsManager() const = 0; - - virtual OutputManager & getOutputManager() = 0; - virtual OutputManager const & getOutputManager() const = 0; - - virtual PhysicsSolverManager & getPhysicsSolverManager() = 0; - virtual PhysicsSolverManager const & getPhysicsSolverManager() const = 0; - - virtual TasksManager & getTasksManager() = 0; - virtual TasksManager const & getTasksManager() const = 0; - - - virtual string const & getProblemName() const = 0; - virtual string const & getInputFileName() const = 0; - virtual string const & getRestartFileName() const = 0; - virtual string const & getSchemaFileName() const = 0; - -}; - -/** - * @brief Gives the ProblemManagerBase from the given Group - * @param group The current Group in the Problem tree - * @return A reference to the ProblemManagerBase - */ -inline ProblemManagerBase & getProblemManagerBase( Group & group ) -{ - Group * current = &group; - while( current->hasParent() ) - { - current = ¤t->getParent(); - } - ProblemManagerBase * const root = dynamic_cast< ProblemManagerBase * >( current ); - return *root; -} - -/** - * @copydoc getProblemManagerBase( Group & ) - */ -inline ProblemManagerBase const & getProblemManagerBase( Group const & group ) -{ - Group const * current = &group; - while( current->hasParent() ) - { - current = ¤t->getParent(); - } - ProblemManagerBase const * const root = dynamic_cast< ProblemManagerBase const * >( current ); - return *root; -} - -} /* namespace dataRepository */ -} /* namespace geos */ - - -#endif /* GEOS_DATAREPOSITORY_PROBLEMMANAGERBASE_HPP_ */ diff --git a/src/coreComponents/dataRepository/ProblemRepository.cpp b/src/coreComponents/dataRepository/ProblemRepository.cpp new file mode 100644 index 00000000000..f96bc86b7e7 --- /dev/null +++ b/src/coreComponents/dataRepository/ProblemRepository.cpp @@ -0,0 +1,68 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file MeshLevel.cpp + */ + +#include "ProblemRepository.hpp" + +namespace geos +{ +namespace dataRepository +{ + +/** + * @name Inline functions implementation + */ +///@{ + +string ProblemRepositoryABC::getNoProblemPath( string const & originalPath ) +{ + // In the Conduit node hierarchy everything begins with 'Problem', we should change it so that + // the ProblemManager actually uses the root Conduit Node but that will require a full rebaseline. + size_t const lengthToRemove = stringutilities::cstrlen( ProblemGroupKeys::problemString() ); + string const noProblem = originalPath.substr( lengthToRemove ); + return noProblem.empty() ? "/" : noProblem; +} + +ProblemRepository & ProblemRepository::get( Group & group ) +{ + // the ProblemRepository is expected to always be the root Group instance. + Group * current = &group; + while( current->hasParent() ) + { + current = ¤t->getParent(); + } + + ProblemRepository * const root = dynamic_cast< ProblemRepository * >( current ); + return *root; +} + +ProblemRepository const & ProblemRepository::get( Group const & group ) +{ + // the ProblemRepository is expected to always be the root Group instance. + Group const * current = &group; + while( current->hasParent() ) + { + current = ¤t->getParent(); + } + + ProblemRepository const * const root = dynamic_cast< ProblemRepository const * >( current ); + return *root; +} + +} /* namespace dataRepository */ +} /* namespace geos */ diff --git a/src/coreComponents/dataRepository/ProblemRepository.hpp b/src/coreComponents/dataRepository/ProblemRepository.hpp new file mode 100644 index 00000000000..b99ba8b29f6 --- /dev/null +++ b/src/coreComponents/dataRepository/ProblemRepository.hpp @@ -0,0 +1,172 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file ProblemRepository.hpp + */ + +#ifndef GEOS_DATAREPOSITORY_PROBLEMREPOSITORY_HPP_ +#define GEOS_DATAREPOSITORY_PROBLEMREPOSITORY_HPP_ + +#include "dataRepository/ProblemRepositoryABC.hpp" +#include "dataRepository/Group.hpp" + +namespace geos +{ +namespace dataRepository +{ + +/** + * @brief Base class for the problem data-repository repository, gives access to all the roots Groups. + * Usage examples: + * - to consult other managers: + * * from a FS instance: ProblemRepository::get( myFieldSpec ).getManager< FunctionManager >() + * * form a solver instance: ProblemRepository::get( mySolver ).getManager< FieldSpecificationManager >() + * - to consult data from the ProblemManager (mainInterface / high-level testing): + * * get the physics solvers manager: problemManager.getManager< PhysicsSolverManager >() + * * get the CommandLine Group: problemManager.getManager< CommandLine >() + * - to make a mutable problem-unique manager available (DomainPartition here): + * // EventManager is available through the ProblemRepository as a mutable problem-unique manager. + * template<> inline EventManager & dataRepository::ProblemRepository::getManager() + * { return getRootGroup().getGroup< EventManager >( m_gks.domain ); } + * - to make a const problem-unique manager available (DomainPartition here): + * // EventManager is available through the ProblemRepository as a const problem-unique manager. + * template<> inline EventManager const & dataRepository::ProblemRepository::getManager() const + * { return getRootGroup().getGroup< EventManager >( m_gks.domain ); } + * + * Manager that are unique per-problem should provides a getManager() template specialization in its header. + */ +class ProblemRepository : public ProblemRepositoryABC +{ +public: + + /** + * @brief Gives the problem data repository interface from the given Group + * @param group The current Group in the Problem tree + * @return A reference to the problem data repository interface + */ + static ProblemRepository & get( Group & group ); + + /** + * @copydoc get( Group & ) + */ + static ProblemRepository const & get( Group const & group ); + + /** + * @brief Get a root data-repository object (a manager) of a given problem. For each manager: + * - The consumer(s) need to include the type definition, + * - The manager implementation needs to implement a specialization. + * @tparam ManagerType the type of the root data-repository object we want to get (DomainPartition, EventManager...) + * @return ManagerType& the root data-repository object instance reference + */ + template< typename ManagerType > + ManagerType & getManager(); + + /** + * @copydoc getManager() + */ + template< typename ManagerType > + ManagerType const & getManager() const; + + /** + * @return the root Group which contain all the problem data-repository + */ + Group & getRootGroup() + { return m_rootGroup; } + + /** + * @return the root Group which contain all the problem data-repository + */ + Group const & getRootGroup() const + { return m_rootGroup; } + + // if an abstract Group getting method is absolutely needed, we can add: + // + // Group & getManager( string_view managerKey ) = 0; + // Group const & getManager( string_view managerKey ) const = 0; + // + // ... but ideally, we don't want to propose these to remove any "invisible" circular dependency practice. + +protected: + + /** + * @brief Standard GEOS data-managers Group keys for efficient getManager() lookup. + * Note that this list is not a constraint, it can be extended with any type by adding a new + * getManager() specialization. + * This struct remains internal to avoid "invisible dependancies": being dependent of the + * existence of a Group through a specific data-repository path without of mention its type, + * complicating dependencies visibility. + * When adding a new key, const, and optionnally mutable specializations of getManager must be + * added in the Group type header. + */ + struct ProblemGroupKeys : ProblemRepositoryABC::ProblemGroupKeys + { + dataRepository::GroupKey commandLine = { "commandLine" }; + dataRepository::GroupKey domain = { "domain" }; + dataRepository::GroupKey constitutiveManager = { "Constitutive" }; + dataRepository::GroupKey eventManager = { "Events" }; + dataRepository::GroupKey externalDataSourceManager = { "ExternalDataSource" }; + dataRepository::GroupKey fieldSpecificationManager = { "FieldSpecifications" }; + dataRepository::GroupKey functionManager = { "Functions" }; + dataRepository::GroupKey geometricObjectManager = { "Geometry" }; + dataRepository::GroupKey meshManager = { "Mesh" }; + dataRepository::GroupKey numericalMethodsManager = { "NumericalMethods" }; + dataRepository::GroupKey outputManager = { "Outputs" }; + dataRepository::GroupKey physicsSolverManager = { "Solvers" }; + dataRepository::GroupKey tasksManager = { "Tasks" }; + } m_gks; + + /** + * @brief Construct a new ProblemRepository object + * @param rootGroup The Problem root group reference. + */ + ProblemRepository( Group & rootGroup ) + : ProblemRepositoryABC() + , m_rootGroup( rootGroup ) + {} + + /** + * @brief Deleted copy constructor for m_rootGroup reference validity. + */ + ProblemRepository( ProblemRepository const & ) = delete; + + /** + * @brief Deleted move constructor for m_rootGroup reference validity. + */ + ProblemRepository( ProblemRepository && ) = delete; + + /** + * @brief Deleted move operator for m_rootGroup reference validity. + */ + ProblemRepository & operator=( ProblemRepository const & ) = delete; + + /** + * @brief Deleted move operator for m_rootGroup reference validity. + */ + ProblemRepository & operator=( ProblemRepository && ) = delete; + +private: + + /** + * @brief The Problem root group. + */ + Group & m_rootGroup; + +}; + +} /* namespace dataRepository */ +} /* namespace geos */ + +#endif /* GEOS_DATAREPOSITORY_PROBLEMREPOSITORY_HPP_ */ diff --git a/src/coreComponents/dataRepository/ProblemRepositoryABC.hpp b/src/coreComponents/dataRepository/ProblemRepositoryABC.hpp new file mode 100644 index 00000000000..ae57d97f050 --- /dev/null +++ b/src/coreComponents/dataRepository/ProblemRepositoryABC.hpp @@ -0,0 +1,70 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file ProblemRepositoryABC.hpp + */ + +#ifndef GEOS_DATAREPOSITORY_PROBLEMREPOSITORYABC_HPP_ +#define GEOS_DATAREPOSITORY_PROBLEMREPOSITORYABC_HPP_ + +#include "common/DataTypes.hpp" + +namespace geos +{ +namespace dataRepository +{ + +/** + * @brief Interface for an object which gives access all the problem data-repository. + * No dependancy on Group since Group needs some features (getNoProblemPath()). + * - No exposure of the problem GroupKey string, to avoid "invisible dependancies": + * being dependent of the existence + * of a Group at a specific data-repository path without mentionning its type (making it + * hard to see/find the dependency). + */ +class ProblemRepositoryABC +{ +public: + + /** + * @brief Utility function to output a Group/Wrapper path without "Problem": "Problem/commandLine" -> "/commandLine" + * @param originalPath Group/Wrapper conduit node path + * @return string without "Problem" at start + */ + static string getNoProblemPath( string const & originalPath ); + +protected: + + /** + * @brief Group keys for faster lookup. + * Remain internal data to avoid "invisible dependancies": being dependent of the existence + * of a Group at a specific data-repository path without mentionning its type (making it + * hard to see/find the dependency). + */ + struct ProblemGroupKeys + { + static constexpr char const * problemString() { return "Problem"; } + }; + + ProblemRepositoryABC() + {} + +}; + +} /* namespace dataRepository */ +} /* namespace geos */ + +#endif /* GEOS_DATAREPOSITORY_PROBLEMREPOSITORYABC_HPP_ */ diff --git a/src/coreComponents/mainInterface/ProblemManager.cpp b/src/coreComponents/mainInterface/ProblemManager.cpp index ba0a2bf69bc..82b7248c563 100644 --- a/src/coreComponents/mainInterface/ProblemManager.cpp +++ b/src/coreComponents/mainInterface/ProblemManager.cpp @@ -27,7 +27,6 @@ #include "constitutiveDrivers/solid/TriaxialDriver.hpp" #include "dataRepository/ConduitRestart.hpp" #include "dataRepository/RestartFlags.hpp" -#include "dataRepository/KeyNames.hpp" #include "discretizationMethods/NumericalMethodsManager.hpp" #include "events/tasks/TasksManager.hpp" #include "events/EventManager.hpp" @@ -68,6 +67,81 @@ namespace geos using namespace dataRepository; using namespace constitutive; +CommandLine::CommandLine( string const & name, Group * parent ) + : Group( name, parent ) +{ + registerWrapper< string >( m_vks.inputFileName ). + setRestartFlags( RestartFlags::WRITE ). + setDescription( "Name of the input xml file." ); + + registerWrapper< string >( m_vks.restartFileName ). + setRestartFlags( RestartFlags::WRITE ). + setDescription( "Name of the restart file." ); + + registerWrapper< integer >( m_vks.beginFromRestart ). + setRestartFlags( RestartFlags::WRITE ). + setDescription( "Flag to indicate restart run." ); + + registerWrapper< string >( m_vks.problemName ). + setRestartFlags( RestartFlags::WRITE ). + setDescription( "Used in writing the output files, if not specified defaults to the name of the input file." ); + + registerWrapper< string >( m_vks.outputDirectory ). + setRestartFlags( RestartFlags::WRITE ). + setDescription( "Directory in which to put the output files, if not specified defaults to the current directory." ); + + registerWrapper< integer >( m_vks.xPartitionsOverride ). + setApplyDefaultValue( 1 ). + setRestartFlags( RestartFlags::WRITE ). + setDescription( "Number of partitions in the x-direction" ); + + registerWrapper< integer >( m_vks.yPartitionsOverride ). + setApplyDefaultValue( 1 ). + setRestartFlags( RestartFlags::WRITE ). + setDescription( "Number of partitions in the y-direction" ); + + registerWrapper< integer >( m_vks.zPartitionsOverride ). + setApplyDefaultValue( 1 ). + setRestartFlags( RestartFlags::WRITE ). + setDescription( "Number of partitions in the z-direction" ); + + registerWrapper< integer >( m_vks.overridePartitionNumbers ). + setApplyDefaultValue( 0 ). + setRestartFlags( RestartFlags::WRITE ). + setDescription( "Flag to indicate partition number override" ); + + registerWrapper< string >( m_vks.schemaFileName ). + setRestartFlags( RestartFlags::WRITE ). + setDescription( "Name of the output schema" ); + + registerWrapper< integer >( m_vks.useNonblockingMPI ). + setApplyDefaultValue( 0 ). + setRestartFlags( RestartFlags::WRITE ). + setDescription( "Whether to prefer using non-blocking MPI communication where implemented (results in non-deterministic DOF numbering)." ); + + registerWrapper< integer >( m_vks.suppressPinned ). + setApplyDefaultValue( 0 ). + setRestartFlags( RestartFlags::WRITE ). + setDescription( "Whether to disallow using pinned memory allocations for MPI communication buffers." ); +} + +void CommandLine::setValues( CommandLineOptions const & opts, + string_view inputFileName ) +{ + getReference< string >( m_vks.inputFileName ) = inputFileName; + getReference< string >( m_vks.restartFileName ) = opts.restartFileName; + getReference< integer >( m_vks.beginFromRestart ) = opts.beginFromRestart; + getReference< integer >( m_vks.xPartitionsOverride ) = opts.xPartitionsOverride; + getReference< integer >( m_vks.yPartitionsOverride ) = opts.yPartitionsOverride; + getReference< integer >( m_vks.zPartitionsOverride ) = opts.zPartitionsOverride; + getReference< integer >( m_vks.overridePartitionNumbers ) = opts.overridePartitionNumbers; + getReference< string >( m_vks.schemaFileName ) = opts.schemaName; + getReference< string >( m_vks.problemName ) = opts.problemName; + getReference< string >( m_vks.outputDirectory ) = opts.outputDirectory; + getReference< integer >( m_vks.useNonblockingMPI ) = opts.useNonblockingMPI; + getReference< integer >( m_vks.suppressPinned ) = opts.suppressPinned; +} + #ifdef GEOS_USE_HYPREDRV namespace { @@ -159,86 +233,29 @@ void logHypredriveInputs( PhysicsSolverManager & physicsSolverManager, #endif ProblemManager::ProblemManager( conduit::Node & root ): - ProblemManagerBase( keys::ProblemManager, root ), - m_physicsSolverManager( nullptr ), - m_eventManager( nullptr ), - m_functionManager( nullptr ), - m_fieldSpecificationManager( nullptr ) + dataRepository::Group( ProblemGroupKeys::problemString(), root ), + dataRepository::ProblemRepository( (Group &)*this ) { - // Groups that do not read from the xml - registerGroup< DomainPartition >( groupKeys.domain ); - Group & commandLine = registerGroup< Group >( groupKeys.commandLine ); - commandLine.setRestartFlags( RestartFlags::WRITE ); - setInputFlags( InputFlags::PROBLEM_ROOT ); - registerGroup< ExternalDataSourceManager >( groupKeys.externalDataSourceManager ); - - m_fieldSpecificationManager = ®isterGroup< FieldSpecificationManager >( groupKeys.fieldSpecificationManager ); - - m_eventManager = ®isterGroup< EventManager >( groupKeys.eventManager ); - registerGroup< NumericalMethodsManager >( groupKeys.numericalMethodsManager ); - registerGroup< GeometricObjectManager >( groupKeys.geometricObjectManager ); - registerGroup< MeshManager >( groupKeys.meshManager ); - registerGroup< OutputManager >( groupKeys.outputManager ); - m_physicsSolverManager = ®isterGroup< PhysicsSolverManager >( groupKeys.physicsSolverManager ); - m_tasksManager = ®isterGroup< TasksManager >( groupKeys.tasksManager ); - m_functionManager = ®isterGroup< FunctionManager >( groupKeys.functionManager ); - - // Command line entries - commandLine.registerWrapper< string >( viewKeys.inputFileName.key() ). - setRestartFlags( RestartFlags::WRITE ). - setDescription( "Name of the input xml file." ); - - commandLine.registerWrapper< string >( viewKeys.restartFileName.key() ). - setRestartFlags( RestartFlags::WRITE ). - setDescription( "Name of the restart file." ); - - commandLine.registerWrapper< integer >( viewKeys.beginFromRestart.key() ). - setRestartFlags( RestartFlags::WRITE ). - setDescription( "Flag to indicate restart run." ); - - commandLine.registerWrapper< string >( viewKeys.problemName.key() ). - setRestartFlags( RestartFlags::WRITE ). - setDescription( "Used in writing the output files, if not specified defaults to the name of the input file." ); - - commandLine.registerWrapper< string >( viewKeys.outputDirectory.key() ). - setRestartFlags( RestartFlags::WRITE ). - setDescription( "Directory in which to put the output files, if not specified defaults to the current directory." ); - - commandLine.registerWrapper< integer >( viewKeys.xPartitionsOverride.key() ). - setApplyDefaultValue( 1 ). - setRestartFlags( RestartFlags::WRITE ). - setDescription( "Number of partitions in the x-direction" ); - - commandLine.registerWrapper< integer >( viewKeys.yPartitionsOverride.key() ). - setApplyDefaultValue( 1 ). - setRestartFlags( RestartFlags::WRITE ). - setDescription( "Number of partitions in the y-direction" ); - - commandLine.registerWrapper< integer >( viewKeys.zPartitionsOverride.key() ). - setApplyDefaultValue( 1 ). - setRestartFlags( RestartFlags::WRITE ). - setDescription( "Number of partitions in the z-direction" ); - - commandLine.registerWrapper< integer >( viewKeys.overridePartitionNumbers.key() ). - setApplyDefaultValue( 0 ). - setRestartFlags( RestartFlags::WRITE ). - setDescription( "Flag to indicate partition number override" ); - - commandLine.registerWrapper< string >( viewKeys.schemaFileName.key() ). - setRestartFlags( RestartFlags::WRITE ). - setDescription( "Name of the output schema" ); - - commandLine.registerWrapper< integer >( viewKeys.useNonblockingMPI.key() ). - setApplyDefaultValue( 0 ). - setRestartFlags( RestartFlags::WRITE ). - setDescription( "Whether to prefer using non-blocking MPI communication where implemented (results in non-deterministic DOF numbering)." ); + // Groups that do not read from the xml + CommandLine & commandLine = registerGroup< CommandLine >( m_gks.commandLine ); + commandLine.setRestartFlags( RestartFlags::WRITE ); - commandLine.registerWrapper< integer >( viewKeys.suppressPinned.key( ) ). - setApplyDefaultValue( 0 ). - setRestartFlags( RestartFlags::WRITE ). - setDescription( "Whether to disallow using pinned memory allocations for MPI communication buffers." ); + DomainPartition & domain = registerGroup< DomainPartition >( m_gks.domain ); + domain.registerGroup< constitutive::ConstitutiveManager >( m_gks.constitutiveManager ); + domain.groupKeys.constitutiveManager = m_gks.constitutiveManager.index(); + + registerGroup< ExternalDataSourceManager >( m_gks.externalDataSourceManager ); + registerGroup< FieldSpecificationManager >( m_gks.fieldSpecificationManager ); + registerGroup< EventManager >( m_gks.eventManager ); + registerGroup< NumericalMethodsManager >( m_gks.numericalMethodsManager ); + registerGroup< GeometricObjectManager >( m_gks.geometricObjectManager ); + registerGroup< MeshManager >( m_gks.meshManager ); + registerGroup< OutputManager >( m_gks.outputManager ); + registerGroup< PhysicsSolverManager >( m_gks.physicsSolverManager ); + registerGroup< TasksManager >( m_gks.tasksManager ); + registerGroup< FunctionManager >( m_gks.functionManager ); } ProblemManager::~ProblemManager() @@ -280,12 +297,12 @@ void ProblemManager::problemSetup() applyNumericalMethods(); numericalMethodLog.end(); - registerDataOnMeshRecursive( getDomainPartition().getMeshBodies() ); + registerDataOnMeshRecursive( getManager< DomainPartition >().getMeshBodies() ); initialize(); #ifdef GEOS_USE_HYPREDRV - logHypredriveInputs( *m_physicsSolverManager, getDomainPartition() ); + logHypredriveInputs( *m_physicsSolverManager, getManager< DomainPartition >() ); #endif LogPart importFieldsLog( "Import fields", MpiWrapper::commRank() == 0 ); @@ -297,45 +314,29 @@ void ProblemManager::problemSetup() void ProblemManager::parseCommandLineInput() { - Group & commandLine = getGroup< Group >( groupKeys.commandLine ); - CommandLineOptions const & opts = getGlobalState().getCommandLineOptions(); - commandLine.getReference< string >( viewKeys.restartFileName ) = opts.restartFileName; - commandLine.getReference< integer >( viewKeys.beginFromRestart ) = opts.beginFromRestart; - commandLine.getReference< integer >( viewKeys.xPartitionsOverride ) = opts.xPartitionsOverride; - commandLine.getReference< integer >( viewKeys.yPartitionsOverride ) = opts.yPartitionsOverride; - commandLine.getReference< integer >( viewKeys.zPartitionsOverride ) = opts.zPartitionsOverride; - commandLine.getReference< integer >( viewKeys.overridePartitionNumbers ) = opts.overridePartitionNumbers; - commandLine.getReference< integer >( viewKeys.useNonblockingMPI ) = opts.useNonblockingMPI; - commandLine.getReference< integer >( viewKeys.suppressPinned ) = opts.suppressPinned; - - string & outputDirectory = commandLine.getReference< string >( viewKeys.outputDirectory ); - outputDirectory = opts.outputDirectory; - OutputBase::setOutputDirectory( outputDirectory ); - TaskBase::setOutputDirectory( outputDirectory ); - - string & inputFileName = commandLine.getReference< string >( viewKeys.inputFileName ); - - for( string const & xmlFile : opts.inputFileNames ) + string inputFileName = xmlWrapper::buildMultipleInputXML( opts.inputFileNames, + getName(), + opts.outputDirectory ); + if( opts.schemaName.empty()) { - string const absPath = getAbsolutePath( xmlFile ); - GEOS_LOG_RANK_0( "Opened XML file: " << absPath ); + inputFileName = getAbsolutePath( inputFileName ); + Path::setPathPrefix( splitPath( inputFileName ).first ); } - inputFileName = xmlWrapper::buildMultipleInputXML( opts.inputFileNames, outputDirectory ); + CommandLine & commandLine = getManager< CommandLine >(); + commandLine.setValues( opts, inputFileName.c_str() ); - string & schemaName = commandLine.getReference< string >( viewKeys.schemaFileName ); - schemaName = opts.schemaName; + OutputBase::setOutputDirectory( opts.outputDirectory ); + TaskBase::setOutputDirectory( opts.outputDirectory ); - string & problemName = commandLine.getReference< string >( viewKeys.problemName ); - problemName = opts.problemName; - OutputBase::setFileNameRoot( problemName ); + OutputBase::setFileNameRoot( opts.problemName ); - if( schemaName.empty()) + for( string const & xmlFile : opts.inputFileNames ) { - inputFileName = getAbsolutePath( inputFileName ); - Path::setPathPrefix( splitPath( inputFileName ).first ); + string const absPath = getAbsolutePath( xmlFile ); + GEOS_LOG_RANK_0( "Opened XML file: " << absPath ); } if( opts.traceDataMigration ) @@ -346,6 +347,7 @@ void ProblemManager::parseCommandLineInput() { chai::ArrayManager::getInstance()->disableCallbacks(); } + } @@ -394,16 +396,16 @@ void ProblemManager::generateDocumentation() { // Documentation output GEOS_LOG_RANK_0( "Trying to generate schema..." ); - Group & commandLine = getGroup< Group >( groupKeys.commandLine ); - string const & schemaName = commandLine.getReference< string >( viewKeys.schemaFileName ); + CommandLine const & commandLine = getManager< CommandLine >(); + string const & schemaName = commandLine.getReference< string >( commandLine.m_vks.schemaFileName ); if( !schemaName.empty() ) { // Generate an extensive data structure generateDataStructureSkeleton( 0 ); - MeshManager & meshManager = this->getGroup< MeshManager >( groupKeys.meshManager ); - DomainPartition & domain = getDomainPartition(); + MeshManager & meshManager = getManager< MeshManager >(); + DomainPartition & domain = getManager< DomainPartition >(); meshManager.generateMeshLevels( domain ); registerDataOnMeshRecursive( domain.getMeshBodies() ); @@ -431,18 +433,20 @@ void ProblemManager::setSchemaDeviations( xmlWrapper::xmlNode schemaRoot, // These objects are handled differently during the xml read step, // so we need to explicitly add them into the schema structure - DomainPartition & domain = getDomainPartition(); + DomainPartition & domain = getManager< DomainPartition >(); - m_functionManager->generateDataStructureSkeleton( 0 ); - schemaUtilities::SchemaConstruction( *m_functionManager, schemaRoot, targetChoiceNode, documentationType ); + FunctionManager & functionManager = getManager< FunctionManager >(); + functionManager.generateDataStructureSkeleton( 0 ); + schemaUtilities::SchemaConstruction( functionManager, schemaRoot, targetChoiceNode, documentationType ); - m_fieldSpecificationManager->generateDataStructureSkeleton( 0 ); - schemaUtilities::SchemaConstruction( *m_fieldSpecificationManager, schemaRoot, targetChoiceNode, documentationType ); + FieldSpecificationManager & fieldSpecificationManager = getManager< FieldSpecificationManager >(); + fieldSpecificationManager.generateDataStructureSkeleton( 0 ); + schemaUtilities::SchemaConstruction( fieldSpecificationManager, schemaRoot, targetChoiceNode, documentationType ); - ConstitutiveManager & constitutiveManager = domain.getGroup< ConstitutiveManager >( groupKeys.constitutiveManager ); + ConstitutiveManager & constitutiveManager = domain.getConstitutiveManager(); schemaUtilities::SchemaConstruction( constitutiveManager, schemaRoot, targetChoiceNode, documentationType ); - MeshManager & meshManager = this->getGroup< MeshManager >( groupKeys.meshManager ); + MeshManager & meshManager = getManager< MeshManager >(); meshManager.generateMeshLevels( domain ); ElementRegionManager & elementManager = domain.getMeshBody( 0 ).getBaseDiscretization().getElemManager(); elementManager.generateDataStructureSkeleton( 0 ); @@ -525,8 +529,8 @@ void ProblemManager::setSchemaDeviations( xmlWrapper::xmlNode schemaRoot, void ProblemManager::parseInputFile() { - Group & commandLine = getGroup( groupKeys.commandLine ); - string const & inputFileName = commandLine.getReference< string >( viewKeys.inputFileName ); + CommandLine const & commandLine = getManager< CommandLine >(); + string const & inputFileName = commandLine.getReference< string >( commandLine.m_vks.inputFileName ); // Load preprocessed xml file xmlWrapper::xmlDocument xmlDocument; @@ -560,13 +564,13 @@ void ProblemManager::parseXMLDocument( xmlWrapper::xmlDocument & xmlDocument ) // The objects in domain are handled separately for now { - DomainPartition & domain = getDomainPartition(); - ConstitutiveManager & constitutiveManager = domain.getGroup< ConstitutiveManager >( groupKeys.constitutiveManager ); + DomainPartition & domain = getManager< DomainPartition >(); + ConstitutiveManager & constitutiveManager = domain.getConstitutiveManager(); xmlWrapper::xmlNode topLevelNode = xmlProblemNode.child( constitutiveManager.getName().c_str()); constitutiveManager.processInputFileRecursive( xmlDocument, topLevelNode ); // Open mesh levels - MeshManager & meshManager = this->getGroup< MeshManager >( groupKeys.meshManager ); + MeshManager & meshManager = getManager< MeshManager >(); meshManager.generateMeshLevels( domain ); Group & meshBodies = domain.getMeshBodies(); @@ -618,17 +622,17 @@ void ProblemManager::parseXMLDocument( xmlWrapper::xmlDocument & xmlDocument ) void ProblemManager::postInputInitialization() { - DomainPartition & domain = getDomainPartition(); + DomainPartition & domain = getManager< DomainPartition >(); - Group const & commandLine = getGroup< Group >( groupKeys.commandLine ); - integer const & xparCL = commandLine.getReference< integer >( viewKeys.xPartitionsOverride ); - integer const & yparCL = commandLine.getReference< integer >( viewKeys.yPartitionsOverride ); - integer const & zparCL = commandLine.getReference< integer >( viewKeys.zPartitionsOverride ); + CommandLine const & commandLine = getManager< CommandLine >(); + integer const & xparCL = commandLine.getReference< integer >( commandLine.m_vks.xPartitionsOverride ); + integer const & yparCL = commandLine.getReference< integer >( commandLine.m_vks.yPartitionsOverride ); + integer const & zparCL = commandLine.getReference< integer >( commandLine.m_vks.zPartitionsOverride ); - integer const & suppressPinned = commandLine.getReference< integer >( viewKeys.suppressPinned ); + integer const & suppressPinned = commandLine.getReference< integer >( commandLine.m_vks.suppressPinned ); setPreferPinned((suppressPinned == 0)); - PartitionBase & partition = domain.getReference< PartitionBase >( keys::partitionManager ); + PartitionBase & partition = domain.getPartitionManager(); bool repartition = false; integer xpar = 1; integer ypar = 1; @@ -666,19 +670,19 @@ void ProblemManager::initializationOrder( string_array & order ) set< string > usedNames; // first, numerical methods - order.emplace_back( groupKeys.numericalMethodsManager.key() ); - usedNames.insert( groupKeys.numericalMethodsManager.key() ); + order.emplace_back( m_gks.numericalMethodsManager.key() ); + usedNames.insert( m_gks.numericalMethodsManager.key() ); // next, domain - order.emplace_back( groupKeys.domain.key() ); - usedNames.insert( groupKeys.domain.key() ); + order.emplace_back( m_gks.domain.key() ); + usedNames.insert( m_gks.domain.key() ); // next, events - order.emplace_back( groupKeys.eventManager.key() ); - usedNames.insert( groupKeys.eventManager.key() ); + order.emplace_back( m_gks.eventManager.key() ); + usedNames.insert( m_gks.eventManager.key() ); // (keeping outputs for the end) - usedNames.insert( groupKeys.outputManager.key() ); + usedNames.insert( m_gks.outputManager.key() ); // next, everything... for( auto const & subGroup : this->getSubGroups() ) @@ -690,16 +694,16 @@ void ProblemManager::initializationOrder( string_array & order ) } // end with outputs (in order to define the chunk sizes after any data source) - order.emplace_back( groupKeys.outputManager.key() ); + order.emplace_back( m_gks.outputManager.key() ); } void ProblemManager::generateMesh() { GEOS_MARK_FUNCTION; - DomainPartition & domain = getDomainPartition(); + DomainPartition & domain = getManager< DomainPartition >(); - MeshManager & meshManager = this->getGroup< MeshManager >( groupKeys.meshManager ); + MeshManager & meshManager = getManager< MeshManager >(); meshManager.generateMeshes( domain ); @@ -716,7 +720,7 @@ void ProblemManager::generateMesh() if( meshBody.hasParticles() ) // mesh bodies with particles load their data into particle blocks, not cell blocks { - ParticleBlockManagerABC & particleBlockManager = meshBody.getGroup< ParticleBlockManagerABC >( keys::particleManager ); + ParticleBlockManagerABC & particleBlockManager = meshBody.getParticleBlockManager(); this->generateMeshLevel( baseMesh, particleBlockManager, @@ -724,7 +728,7 @@ void ProblemManager::generateMesh() } else { - CellBlockManagerABC & cellBlockManager = meshBody.getGroup< CellBlockManagerABC >( keys::cellManager ); + CellBlockManagerABC & cellBlockManager = meshBody.getCellBlockManager(); this->generateMeshLevel( baseMesh, cellBlockManager, @@ -737,8 +741,8 @@ void ProblemManager::generateMesh() } } ); - Group const & commandLine = this->getGroup< Group >( groupKeys.commandLine ); - integer const useNonblockingMPI = commandLine.getReference< integer >( viewKeys.useNonblockingMPI ); + CommandLine const & commandLine = getManager< CommandLine >(); + integer const useNonblockingMPI = commandLine.getReference< integer >( commandLine.m_vks.useNonblockingMPI ); domain.setupBaseLevelMeshGlobalInfo(); // setup the MeshLevel associated with the discretizations @@ -827,13 +831,12 @@ void ProblemManager::generateMesh() domain.forMeshBodies( [&]( MeshBody & meshBody ) { - if( meshBody.hasGroup( keys::particleManager ) ) + if( meshBody.hasParticleBlockManager() ) { - meshBody.deregisterGroup( keys::particleManager ); + meshBody.deregisterParticleBlockManager(); } - else if( meshBody.hasGroup( keys::cellManager ) ) + else if( meshBody.hasCellBlockManager() ) { - // meshBody.deregisterGroup( keys::cellManager ); meshBody.deregisterCellBlockManager(); } @@ -874,16 +877,16 @@ void ProblemManager::generateMesh() void ProblemManager::importFields() { GEOS_MARK_FUNCTION; - DomainPartition & domain = getDomainPartition(); - MeshManager & meshManager = this->getGroup< MeshManager >( groupKeys.meshManager ); + DomainPartition & domain = getManager< DomainPartition >(); + MeshManager & meshManager = getManager< MeshManager >(); meshManager.importFields( domain ); } void ProblemManager::applyNumericalMethods() { - DomainPartition & domain = getDomainPartition(); - ConstitutiveManager & constitutiveManager = domain.getGroup< ConstitutiveManager >( groupKeys.constitutiveManager ); + DomainPartition & domain = getManager< DomainPartition >(); + ConstitutiveManager & constitutiveManager = domain.getConstitutiveManager(); Group & meshBodies = domain.getMeshBodies(); // this contains a key tuple< mesh body name, mesh level name, region name, subregion name> with a value of the number of quadrature @@ -896,13 +899,13 @@ void ProblemManager::applyNumericalMethods() map< std::pair< string, Group const * const >, string_array const & > -ProblemManager::getDiscretizations() const +ProblemManager::getDiscretizations() { map< std::pair< string, Group const * const >, string_array const & > meshDiscretizations; NumericalMethodsManager const & - numericalMethodManager = getGroup< NumericalMethodsManager >( groupKeys.numericalMethodsManager.key() ); + numericalMethodManager = getManager< NumericalMethodsManager >(); FiniteElementDiscretizationManager const & feDiscretizationManager = numericalMethodManager.getFiniteElementDiscretizationManager(); @@ -910,10 +913,12 @@ ProblemManager::getDiscretizations() const FiniteVolumeManager const & fvDiscretizationManager = numericalMethodManager.getFiniteVolumeManager(); - DomainPartition const & domain = getDomainPartition(); + DomainPartition const & domain = getManager< DomainPartition >(); Group const & meshBodies = domain.getMeshBodies(); - m_physicsSolverManager->forSubGroups< PhysicsSolverBase >( [&]( PhysicsSolverBase & solver ) + PhysicsSolverManager & physicsSolverManager = getManager< PhysicsSolverManager >(); + + physicsSolverManager.forSubGroups< PhysicsSolverBase >( [&]( PhysicsSolverBase & solver ) { solver.generateMeshTargetsFromTargetRegions( meshBodies ); @@ -981,7 +986,7 @@ void ProblemManager::generateMeshLevel( MeshLevel & meshLevel, nodeManager.constructGlobalToLocalMap( cellBlockManager ); // Edge, face and element region managers rely on the sets provided by the node manager. // This is why `nodeManager.buildSets` is called first. - nodeManager.buildSets( cellBlockManager, this->getGroup< GeometricObjectManager >( groupKeys.geometricObjectManager ) ); + nodeManager.buildSets( cellBlockManager, getManager< GeometricObjectManager >() ); edgeManager.buildSets( nodeManager ); faceManager.buildSets( nodeManager ); elemRegionManager.buildSets( nodeManager ); @@ -1051,17 +1056,19 @@ void ProblemManager::generateMeshLevel( MeshLevel & meshLevel, } -map< std::tuple< string, string, string, string >, localIndex > ProblemManager::calculateRegionQuadrature( Group & meshBodies ) +map< std::tuple< string, string, string, string >, localIndex > +ProblemManager::calculateRegionQuadrature( Group & meshBodies ) { - NumericalMethodsManager const & - numericalMethodManager = getGroup< NumericalMethodsManager >( groupKeys.numericalMethodsManager.key() ); + NumericalMethodsManager const & numericalMethodManager = getManager< NumericalMethodsManager >(); + + PhysicsSolverManager & physicsSolverManager = getManager< PhysicsSolverManager >(); map< std::tuple< string, string, string, string >, localIndex > regionQuadrature; - for( localIndex solverIndex=0; solverIndexnumSubGroups(); ++solverIndex ) + for( localIndex solverIndex=0; solverIndexgetGroupPointer< PhysicsSolverBase >( solverIndex ); + PhysicsSolverBase const * const solver = physicsSolverManager.getGroupPointer< PhysicsSolverBase >( solverIndex ); if( solver != nullptr ) { @@ -1267,96 +1274,51 @@ void ProblemManager::setRegionQuadrature( Group & meshBodies, bool ProblemManager::runSimulation() { - return m_eventManager->run( getDomainPartition() ); -} - -ConstitutiveManager & ProblemManager::getConstitutiveManager() -{ - return getDomainPartition().getConstitutiveManager(); -} - -ConstitutiveManager const & ProblemManager::getConstitutiveManager() const -{ - return getDomainPartition().getConstitutiveManager(); -} - -DomainPartition & ProblemManager::getDomainPartition() -{ - return getGroup< DomainPartition >( groupKeys.domain ); -} - -DomainPartition const & ProblemManager::getDomainPartition() const -{ - return getGroup< DomainPartition >( groupKeys.domain ); -} - -ExternalDataSourceManager & ProblemManager::getExternalDataSourceManager() -{ - return getGroup< ExternalDataSourceManager >( groupKeys.externalDataSourceManager );; -} - -ExternalDataSourceManager const & ProblemManager::getExternalDataSourceManager() const -{ - return getGroup< ExternalDataSourceManager >( groupKeys.externalDataSourceManager );; -} - -GeometricObjectManager & ProblemManager::getGeometricObjectManager() -{ - return getGroup< GeometricObjectManager >( groupKeys.geometricObjectManager ); -} - -GeometricObjectManager const & ProblemManager::getGeometricObjectManager() const -{ - return getGroup< GeometricObjectManager >( groupKeys.geometricObjectManager ); -} - -MeshManager & ProblemManager::getMeshManager() -{ - return getGroup< MeshManager >( groupKeys.meshManager ); -} - -MeshManager const & ProblemManager::getMeshManager() const -{ - return getGroup< MeshManager >( groupKeys.meshManager ); + return getManager< EventManager >().run( getManager< DomainPartition >() ); } -NumericalMethodsManager & ProblemManager::getNumericalMethodsManager() +string const & ProblemManager::getProblemName() const { - return getGroup< NumericalMethodsManager >( groupKeys.numericalMethodsManager ); + CommandLine const & commandLine = getManager< CommandLine >(); + return commandLine.getReference< string >( commandLine.m_vks.problemName ); } -NumericalMethodsManager const & ProblemManager::getNumericalMethodsManager() const +string const & ProblemManager::getInputFileName() const { - return getGroup< NumericalMethodsManager >( groupKeys.numericalMethodsManager ); + CommandLine const & commandLine = getManager< CommandLine >(); + return commandLine.getReference< string >( commandLine.m_vks.inputFileName ); } -OutputManager & ProblemManager::getOutputManager() +string const & ProblemManager::getRestartFileName() const { - return getGroup< OutputManager >( groupKeys.outputManager ); + CommandLine const & commandLine = getManager< CommandLine >(); + return commandLine.getReference< string >( commandLine.m_vks.restartFileName ); } -OutputManager const & ProblemManager::getOutputManager() const +string const & ProblemManager::getSchemaFileName() const { - return getGroup< OutputManager >( groupKeys.outputManager ); + CommandLine const & commandLine = getManager< CommandLine >(); + return commandLine.getReference< string >( commandLine.m_vks.schemaFileName ); } void ProblemManager::applyInitialConditions() { + FieldSpecificationManager & fsManager = getManager< FieldSpecificationManager >(); - m_fieldSpecificationManager->forSubGroups< FieldSpecification >( [&]( FieldSpecification & fs ) + fsManager.forSubGroups< FieldSpecification >( [&]( FieldSpecification & fs ) { - fs.setMeshObjectPath( getDomainPartition().getMeshBodies() ); + fs.setMeshObjectPath( getManager< DomainPartition >().getMeshBodies() ); } ); - getDomainPartition().forMeshBodies( [&] ( MeshBody & meshBody ) + getManager< DomainPartition >().forMeshBodies( [&] ( MeshBody & meshBody ) { meshBody.forMeshLevels( [&] ( MeshLevel & meshLevel ) { if( !meshLevel.isShallowCopy() ) // to avoid messages printed three times { - m_fieldSpecificationManager->validateBoundaryConditions( meshLevel ); + fsManager.validateBoundaryConditions( meshLevel ); } - m_fieldSpecificationManager->applyInitialConditions( meshLevel ); + fsManager.applyInitialConditions( meshLevel ); } ); } ); initializePostInitialConditions(); diff --git a/src/coreComponents/mainInterface/ProblemManager.hpp b/src/coreComponents/mainInterface/ProblemManager.hpp index 0d7676d859b..190342f3f47 100644 --- a/src/coreComponents/mainInterface/ProblemManager.hpp +++ b/src/coreComponents/mainInterface/ProblemManager.hpp @@ -21,38 +21,89 @@ #ifndef GEOS_MAININTERFACE_PROBLEMMANAGER_HPP_ #define GEOS_MAININTERFACE_PROBLEMMANAGER_HPP_ -#include "dataRepository/GlobalViewKeys.hpp" -#include "dataRepository/ProblemManagerBase.hpp" +#include "dataRepository/ProblemRepository.hpp" +#include "common/initializeEnvironment.hpp" + +// for helper functions +#include "physicsSolvers/PhysicsSolverManager.hpp" +#include "functions/FunctionManager.hpp" +#include "fieldSpecification/FieldSpecificationManager.hpp" +#include "events/EventManager.hpp" +#include "events/tasks/TasksManager.hpp" +#include "discretizationMethods/NumericalMethodsManager.hpp" +#include "mesh/MeshManager.hpp" +#include "fileIO/Outputs/OutputManager.hpp" +#include "mesh/simpleGeometricObjects/GeometricObjectManager.hpp" +#include "constitutive/ConstitutiveManager.hpp" namespace geos { -class PhysicsSolverManager; -class DomainPartition; -class GeometricObjectManager; -class FiniteElementDiscretization; -class MeshLevel; -class MeshManager; -class NumericalMethodsManager; -class OutputManager; -class ExternalDataSourceManager; -namespace constitutive +/** + * @brief A Group to contain the command line options within the data-repository + */ +class CommandLine : public dataRepository::Group { -class ConstitutiveManager; -} -class EventManager; -class TasksManager; -class FunctionManager; -class FieldSpecificationManager; -struct CommandLineOptions; -class CellBlockManagerABC; -class ParticleBlockManagerABC; +public: + + /// @cond DO_NOT_DOCUMENT + + struct viewKeysStruct + { + dataRepository::ViewKey inputFileName = {"inputFileName"}; ///< Input file name key + dataRepository::ViewKey restartFileName = {"restartFileName"}; ///< Restart file name key + dataRepository::ViewKey beginFromRestart = {"beginFromRestart"}; ///< Flag to begin from restart key + dataRepository::ViewKey xPartitionsOverride = {"xPartitionsOverride"}; ///< Override of number of + ///< subdivisions in x key + dataRepository::ViewKey yPartitionsOverride = {"yPartitionsOverride"}; ///< Override of number of + ///< subdivisions in y key + dataRepository::ViewKey zPartitionsOverride = {"zPartitionsOverride"}; ///< Override of number of + ///< subdivisions in z key + dataRepository::ViewKey overridePartitionNumbers = {"overridePartitionNumbers"}; ///< Flag to override partitioning + ///< key + dataRepository::ViewKey schemaFileName = {"schemaFileName"}; ///< Schema file name key + dataRepository::ViewKey problemName = {"problemName"}; ///< Problem name key + dataRepository::ViewKey outputDirectory = {"outputDirectory"}; ///< Output directory key + dataRepository::ViewKey useNonblockingMPI = {"useNonblockingMPI"}; ///< Flag to use non-block MPI key + dataRepository::ViewKey suppressPinned = {"suppressPinned"}; ///< Flag to suppress use of pinned + ///< memory key + } m_vks; ///< Command line input viewKeys + + /// @endcond + + /** + * @brief Construct a new CommandLine Group to contain the command line options within the data-repository. + * @param name + * @param parent + */ + CommandLine( string const & name, Group * parent ); + + /** + * @brief Setup all the command line Group values from the provided inputs + * @param options provided input options + * @param inputFileName final composed main input filename (returned by `xmlWrapper::buildMultipleInputXML()`) + */ + void setValues( CommandLineOptions const & options, + string_view inputFileName ); + +}; + +// CommandLine Group is available through the ProblemRepository as a mutable problem-unique manager. +template<> inline CommandLine & dataRepository::ProblemRepository::getManager() +{ return getRootGroup().getGroup< CommandLine >( m_gks.commandLine ); } + +// CommandLine Group is available through the ProblemRepository as a const problem-unique manager. +template<> inline CommandLine const & dataRepository::ProblemRepository::getManager() const +{ return getRootGroup().getGroup< CommandLine >( m_gks.commandLine ); } + +namespace constitutive +{ class ConstitutiveManager; } /** * @class ProblemManager * @brief This is the class handling the operation flow of the problem being ran in GEOS */ -class ProblemManager : public dataRepository::ProblemManagerBase +class ProblemManager : public dataRepository::Group, public dataRepository::ProblemRepository { public: @@ -177,252 +228,110 @@ class ProblemManager : public dataRepository::ProblemManagerBase */ void applyInitialConditions(); - /** - * @brief Returns a pointer to the DomainPartition - * @return Pointer to the DomainPartition - */ - DomainPartition & getDomainPartition() override; - - /** - * @brief Returns a pointer to the DomainPartition - * @return Const pointer to the DomainPartition - */ - DomainPartition const & getDomainPartition() const override; - /** * @brief Returns the problem name * @return The problem name */ - string const & getProblemName() const override - { return getGroup< Group >( groupKeys.commandLine ).getReference< string >( viewKeys.problemName ); } + string const & getProblemName() const; /** * @brief Returns the input file name * @return The input file name */ - string const & getInputFileName() const override - { return getGroup< Group >( groupKeys.commandLine ).getReference< string >( viewKeys.inputFileName ); } + string const & getInputFileName() const; /** * @brief Returns the restart file name * @return The restart file name */ - string const & getRestartFileName() const override - { return getGroup< Group >( groupKeys.commandLine ).getReference< string >( viewKeys.restartFileName ); } + string const & getRestartFileName() const; /** * @brief Returns the schema file name * @return The schema file name */ - string const & getSchemaFileName() const override - { return getGroup< Group >( groupKeys.commandLine ).getReference< string >( viewKeys.schemaFileName ); } - - /// Command line input viewKeys - struct viewKeysStruct - { - dataRepository::ViewKey inputFileName = {"inputFileName"}; ///< Input file name key - dataRepository::ViewKey restartFileName = {"restartFileName"}; ///< Restart file name key - dataRepository::ViewKey beginFromRestart = {"beginFromRestart"}; ///< Flag to begin from restart key - dataRepository::ViewKey xPartitionsOverride = {"xPartitionsOverride"}; ///< Override of number of - ///< subdivisions in x key - dataRepository::ViewKey yPartitionsOverride = {"yPartitionsOverride"}; ///< Override of number of - ///< subdivisions in y key - dataRepository::ViewKey zPartitionsOverride = {"zPartitionsOverride"}; ///< Override of number of - ///< subdivisions in z key - dataRepository::ViewKey overridePartitionNumbers = {"overridePartitionNumbers"}; ///< Flag to override partitioning - ///< key - dataRepository::ViewKey schemaFileName = {"schemaFileName"}; ///< Schema file name key - dataRepository::ViewKey problemName = {"problemName"}; ///< Problem name key - dataRepository::ViewKey outputDirectory = {"outputDirectory"}; ///< Output directory key - dataRepository::ViewKey useNonblockingMPI = {"useNonblockingMPI"}; ///< Flag to use non-block MPI key - dataRepository::ViewKey suppressPinned = {"suppressPinned"}; ///< Flag to suppress use of pinned - ///< memory key - } viewKeys; ///< Command line input viewKeys - - /// Child group viewKeys - struct groupKeysStruct - { - /// @return Numerical methods string - // static constexpr char const * numericalMethodsManagerString() - // { return dataRepository::GlobalViewKeys::numericalMethodsManager(); } - dataRepository::GroupKey commandLine = { dataRepository::GlobalViewKeys::commandLine() }; ///< Command line - ///< key - dataRepository::GroupKey constitutiveManager = { dataRepository::GlobalViewKeys::constitutiveManager() }; ///< Constitutive - ///< key - dataRepository::GroupKey domain = { dataRepository::GlobalViewKeys::domain() }; ///< Domain key - dataRepository::GroupKey eventManager = { dataRepository::GlobalViewKeys::eventManager() }; ///< Events key - dataRepository::GroupKey externalDataSourceManager = { dataRepository::GlobalViewKeys::externalDataSourceManager() }; ///< External Data - ///< Source key - dataRepository::GroupKey fieldSpecificationManager = { dataRepository::GlobalViewKeys::fieldSpecificationManager() }; ///< Field - ///< specification - ///< key - dataRepository::GroupKey functionManager = { dataRepository::GlobalViewKeys::functionManager() }; ///< Functions key - dataRepository::GroupKey geometricObjectManager = { dataRepository::GlobalViewKeys::geometricObjectManager() }; ///< Geometry key - dataRepository::GroupKey meshManager = { dataRepository::GlobalViewKeys::meshManager() }; ///< Mesh key - dataRepository::GroupKey numericalMethodsManager = { dataRepository::GlobalViewKeys::numericalMethodsManager() }; ///< Numerical - ///< methods key - dataRepository::GroupKey outputManager = { dataRepository::GlobalViewKeys::outputManager() }; ///< Outputs key - dataRepository::GroupKey physicsSolverManager = { dataRepository::GlobalViewKeys::physicsSolverManager() }; ///< Solvers key - dataRepository::GroupKey tasksManager = { dataRepository::GlobalViewKeys::tasksManager() }; ///< Tasks key - } groupKeys; ///< Child group viewKeys + string const & getSchemaFileName() const; /** - * @brief Returns the PhysicsSolverManager - * @return Reference to the PhysicsSolverManager + * @name Managers access-helper functions for tests */ - PhysicsSolverManager & getPhysicsSolverManager() override - { - return *m_physicsSolverManager; - } + ///@{ + /// @cond DO_NOT_DOCUMENT - /** - * @brief Returns the PhysicsSolverManager - * @return Const reference to the PhysicsSolverManager - */ - PhysicsSolverManager const & getPhysicsSolverManager() const override - { - return *m_physicsSolverManager; - } + CommandLine & getCommandLine() + { return getManager< CommandLine >(); } - /** - * @brief Returns the FunctionManager. - * @return The FunctionManager. - */ - FunctionManager & getFunctionManager() override - { - GEOS_ERROR_IF( m_functionManager == nullptr, "Not initialized." ); - return *m_functionManager; - } + CommandLine const & getCommandLine() const + { return getManager< CommandLine >(); } - /** - * @brief Returns the const FunctionManager. - * @return The const FunctionManager. - */ - FunctionManager const & getFunctionManager() const override - { - GEOS_ERROR_IF( m_functionManager == nullptr, "Not initialized." ); - return *m_functionManager; - } + DomainPartition & getDomainPartition() + { return getManager< DomainPartition >(); } - /** - * @brief Returns the FieldSpecificationManager. - * @return The FieldSpecificationManager. - */ - FieldSpecificationManager & getFieldSpecificationManager() override - { - GEOS_ERROR_IF( m_fieldSpecificationManager == nullptr, "Not initialized." ); - return *m_fieldSpecificationManager; - } + DomainPartition const & getDomainPartition() const + { return getManager< DomainPartition >(); } - /** - * @brief Returns the const FunctionManager. - * @return The const FunctionManager. - */ - FieldSpecificationManager const & getFieldSpecificationManager() const override - { - GEOS_ERROR_IF( m_fieldSpecificationManager == nullptr, "Not initialized." ); - return *m_fieldSpecificationManager; - } + PhysicsSolverManager & getPhysicsSolverManager() + { return getManager< PhysicsSolverManager >(); } - /** - * @brief Returns the EventManager. - * @return The EventManager. - */ - EventManager & getEventManager() override - { return *m_eventManager; } + PhysicsSolverManager const & getPhysicsSolverManager() const + { return getManager< PhysicsSolverManager >(); } - /** - * @brief Returns the const EventManager. - * @return The const EventManager. - */ - EventManager const & getEventManager() const override - { return *m_eventManager; } + FunctionManager & getFunctionManager() + { return getManager< FunctionManager >(); } - /** - * @brief Returns the ExternalDataSourceManager. - * @return The ExternalDataSourceManager. - */ - ExternalDataSourceManager & getExternalDataSourceManager() override; + FunctionManager const & getFunctionManager() const + { return getManager< FunctionManager >(); } - /** - * @brief Returns the const ExternalDataSourceManager. - * @return The const ExternalDataSourceManager. - */ - ExternalDataSourceManager const & getExternalDataSourceManager() const override; + FieldSpecificationManager & getFieldSpecificationManager() + { return getManager< FieldSpecificationManager >(); } - /** - * @brief Returns the TasksManager. - * @return The TasksManager. - */ - TasksManager & getTasksManager() override - { return *m_tasksManager; } + FieldSpecificationManager const & getFieldSpecificationManager() const + { return getManager< FieldSpecificationManager >(); } - /** - * @brief Returns the const TasksManager. - * @return The const TasksManager. - */ - TasksManager const & getTasksManager() const override - { return *m_tasksManager; } + EventManager & getEventManager() + { return getManager< EventManager >(); } - /** - * @brief Returns the NumericalMethodsManager. - * @return The NumericalMethodsManager. - */ - NumericalMethodsManager & getNumericalMethodsManager() override; + EventManager const & getEventManager() const + { return getManager< EventManager >(); } - /** - * @brief Returns the const NumericalMethodsManager. - * @return The const NumericalMethodsManager. - */ - NumericalMethodsManager const & getNumericalMethodsManager() const override; + TasksManager & getTasksManager() + { return getManager< TasksManager >(); } - /** - * @brief Returns the MeshManager. - * @return The MeshManager. - */ - MeshManager & getMeshManager() override; + TasksManager const & getTasksManager() const + { return getManager< TasksManager >(); } - /** - * @brief Returns the const MeshManager. - * @return The const MeshManager. - */ - MeshManager const & getMeshManager() const override; + NumericalMethodsManager & getNumericalMethodsManager() + { return getManager< NumericalMethodsManager >(); } - /** - * @brief Returns the OutputManager. - * @return The OutputManager. - */ - OutputManager & getOutputManager() override; + NumericalMethodsManager const & getNumericalMethodsManager() const + { return getManager< NumericalMethodsManager >(); } - /** - * @brief Returns the const OutputManager. - * @return The const OutputManager. - */ - OutputManager const & getOutputManager() const override; + MeshManager & getMeshManager() + { return getManager< MeshManager >(); } - /** - * @brief Returns the GeometricObjectManager. - * @return The GeometricObjectManager. - */ - GeometricObjectManager & getGeometricObjectManager() override; + MeshManager const & getMeshManager() const + { return getManager< MeshManager >(); } - /** - * @brief Returns the const GeometricObjectManager. - * @return The const GeometricObjectManager. - */ - GeometricObjectManager const & getGeometricObjectManager() const override; + OutputManager & getOutputManager() + { return getManager< OutputManager >(); } - /** - * @brief Returns the ConstitutiveManager. - * @return The ConstitutiveManager. - */ - constitutive::ConstitutiveManager & getConstitutiveManager() override; + OutputManager const & getOutputManager() const + { return getManager< OutputManager >(); } - /** - * @brief Returns the const ConstitutiveManager. - * @return The const ConstitutiveManager. - */ - constitutive::ConstitutiveManager const & getConstitutiveManager() const override; + GeometricObjectManager & getGeometricObjectManager() + { return getManager< GeometricObjectManager >(); } + + GeometricObjectManager const & getGeometricObjectManager() const + { return getManager< GeometricObjectManager >(); } + + constitutive::ConstitutiveManager & getConstitutiveManager() + { return getManager< constitutive::ConstitutiveManager >(); } + + constitutive::ConstitutiveManager const & getConstitutiveManager() const + { return getManager< constitutive::ConstitutiveManager >(); } + + /// @endcond + ///@} protected: /** @@ -445,8 +354,7 @@ class ProblemManager : public dataRepository::ProblemManagerBase map< std::tuple< string, string, string, string >, localIndex > calculateRegionQuadrature( Group & meshBodies ); - map< std::pair< string, Group const * const >, string_array const & > - getDiscretizations() const; + map< std::pair< string, Group const * const >, string_array const & > getDiscretizations(); void generateMeshLevel( MeshLevel & meshLevel, CellBlockManagerABC const & cellBlockManager, @@ -469,20 +377,6 @@ class ProblemManager : public dataRepository::ProblemManagerBase constitutive::ConstitutiveManager const & constitutiveManager, map< std::tuple< string, string, string, string >, localIndex > const & regionQuadrature ); - /// The PhysicsSolverManager - PhysicsSolverManager * m_physicsSolverManager; - - /// The EventManager - EventManager * m_eventManager; - - /// The TasksManager - TasksManager * m_tasksManager; - - /// The FunctionManager - FunctionManager * m_functionManager; - - /// The FieldSpecificationManager - FieldSpecificationManager * m_fieldSpecificationManager; }; } /* namespace geos */ From 31d64778242f6e1bb2de8baac3a6b2eaecb5ac2e Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 14 Aug 2026 15:47:13 +0200 Subject: [PATCH 06/13] =?UTF-8?q?=F0=9F=9A=A7=20Add=20manager=20problem-re?= =?UTF-8?q?pository=20access=20methods=20+=20update=20managers=20getters?= =?UTF-8?q?=20for=20efficient=20look-up=20-=20ConstitutiveManager=20is=20p?= =?UTF-8?q?articular=20since=20it=20is=20owned=20by=20DomainPartition,=20t?= =?UTF-8?q?he=20key=20index=20is=20given=20by=20it=20-=20updated=20mesh-re?= =?UTF-8?q?lated=20views=20to=20use=20GroupKey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constitutive/ConstitutiveManager.hpp | 22 ++++++- .../NumericalMethodsManager.hpp | 9 +++ src/coreComponents/events/EventManager.hpp | 9 +++ .../events/tasks/TasksManager.hpp | 9 +++ .../FieldSpecificationManager.hpp | 8 +++ .../fileIO/Outputs/OutputManager.hpp | 8 +++ .../functions/FunctionManager.hpp | 9 +++ .../mainInterface/GeosxState.cpp | 20 ------- .../mainInterface/GeosxState.hpp | 31 ++-------- src/coreComponents/mesh/DomainPartition.cpp | 24 ++++---- src/coreComponents/mesh/DomainPartition.hpp | 56 ++++++++++-------- .../mesh/ExternalDataSourceManager.hpp | 8 +++ src/coreComponents/mesh/MeshBody.hpp | 58 ++++++++++++++++--- src/coreComponents/mesh/MeshManager.hpp | 8 +++ .../GeometricObjectManager.hpp | 9 +++ .../physicsSolvers/PhysicsSolverManager.hpp | 9 +++ 16 files changed, 207 insertions(+), 90 deletions(-) diff --git a/src/coreComponents/constitutive/ConstitutiveManager.hpp b/src/coreComponents/constitutive/ConstitutiveManager.hpp index 2e3d7cec562..7248a7ddcbd 100644 --- a/src/coreComponents/constitutive/ConstitutiveManager.hpp +++ b/src/coreComponents/constitutive/ConstitutiveManager.hpp @@ -22,6 +22,7 @@ #include "dataRepository/Group.hpp" #include "dataRepository/ReferenceWrapper.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "ConstitutiveBase.hpp" namespace geos @@ -83,8 +84,6 @@ class ConstitutiveManager : public dataRepository::Group }; }; - - template< typename T > ViewAccessor< T > ConstitutiveManager::getConstitutiveData( string const & name, @@ -104,7 +103,26 @@ ConstitutiveManager::getConstitutiveData( string const & name, return rval; } +} /* namespace constitutive */ + +// ConstitutiveManager Group is available through the ProblemRepository as a mutable problem-unique manager. +template<> inline +constitutive::ConstitutiveManager & dataRepository::ProblemRepository::getManager() +{ + return getRootGroup(). + getGroup( m_gks.domain ). + getGroup< constitutive::ConstitutiveManager >( m_gks.constitutiveManager ); +} + +// ConstitutiveManager Group is available through the ProblemRepository as a const problem-unique manager. +template<> inline +constitutive::ConstitutiveManager const & dataRepository::ProblemRepository::getManager() const +{ + return getRootGroup(). + getGroup( m_gks.domain ). + getGroup< constitutive::ConstitutiveManager >( m_gks.constitutiveManager ); } + } /* namespace geos */ #endif /* GEOS_CONSTITUTIVE_CONSTITUTIVEMANAGER_HPP_ */ diff --git a/src/coreComponents/discretizationMethods/NumericalMethodsManager.hpp b/src/coreComponents/discretizationMethods/NumericalMethodsManager.hpp index 503647f206a..7acfeb0012c 100644 --- a/src/coreComponents/discretizationMethods/NumericalMethodsManager.hpp +++ b/src/coreComponents/discretizationMethods/NumericalMethodsManager.hpp @@ -21,6 +21,7 @@ #define GEOS_DISCRETIZATIONMETHODS_NUMERICALMETHODSMANAGER_HPP_ #include "dataRepository/Group.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "finiteElement/FiniteElementDiscretizationManager.hpp" #include "finiteVolume/FiniteVolumeManager.hpp" @@ -101,6 +102,14 @@ class NumericalMethodsManager : public dataRepository::Group }; +// NumericalMethodsManager is available through the ProblemRepository as a mutable problem-unique manager. +template<> inline NumericalMethodsManager & dataRepository::ProblemRepository::getManager() +{ return getRootGroup().getGroup< NumericalMethodsManager >( m_gks.numericalMethodsManager ); } + +// NumericalMethodsManager is available through the ProblemRepository as a const problem-unique manager. +template<> inline NumericalMethodsManager const & dataRepository::ProblemRepository::getManager() const +{ return getRootGroup().getGroup< NumericalMethodsManager >( m_gks.numericalMethodsManager ); } + } /* namespace geos */ #endif /* GEOS_DISCRETIZATIONMETHODS_NUMERICALMETHODSMANAGER_HPP_ */ diff --git a/src/coreComponents/events/EventManager.hpp b/src/coreComponents/events/EventManager.hpp index 0e5024fb07c..e1e23b31eba 100644 --- a/src/coreComponents/events/EventManager.hpp +++ b/src/coreComponents/events/EventManager.hpp @@ -18,6 +18,7 @@ #define GEOS_EVENTS_EVENTMANAGER_HPP_ #include "dataRepository/Group.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "EventBase.hpp" #include "common/format/LogPart.hpp" @@ -183,6 +184,14 @@ ENUM_STRINGS( EventManager::TimeOutputFormat, "years", "full" ); +// EventManager is available through the ProblemRepository as a mutable problem-unique manager. +template<> inline EventManager & dataRepository::ProblemRepository::getManager() +{ return getRootGroup().getGroup< EventManager >( m_gks.eventManager ); } + +// EventManager is available through the ProblemRepository as a const problem-unique manager. +template<> inline EventManager const & dataRepository::ProblemRepository::getManager() const +{ return getRootGroup().getGroup< EventManager >( m_gks.domain ); } + } /* namespace geos */ #endif /* GEOS_EVENTS_EVENTMANAGER_HPP_ */ diff --git a/src/coreComponents/events/tasks/TasksManager.hpp b/src/coreComponents/events/tasks/TasksManager.hpp index 852e0fd8cf4..05384169f88 100644 --- a/src/coreComponents/events/tasks/TasksManager.hpp +++ b/src/coreComponents/events/tasks/TasksManager.hpp @@ -21,6 +21,7 @@ #define GEOS_EVENTS_TASKS_TASKSMANAGER_HPP_ #include "dataRepository/Group.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "TaskBase.hpp" namespace geos @@ -49,6 +50,14 @@ class TasksManager : public dataRepository::Group }; +// TasksManager is available through the ProblemRepository as a mutable problem-unique manager. +template<> inline TasksManager & dataRepository::ProblemRepository::getManager() +{ return getRootGroup().getGroup< TasksManager >( m_gks.tasksManager ); } + +// TasksManager is available through the ProblemRepository as a const problem-unique manager. +template<> inline TasksManager const & dataRepository::ProblemRepository::getManager() const +{ return getRootGroup().getGroup< TasksManager >( m_gks.tasksManager ); } + } /* namespace geos */ #endif diff --git a/src/coreComponents/fieldSpecification/FieldSpecificationManager.hpp b/src/coreComponents/fieldSpecification/FieldSpecificationManager.hpp index cd033d27b62..3bb3be9ad25 100644 --- a/src/coreComponents/fieldSpecification/FieldSpecificationManager.hpp +++ b/src/coreComponents/fieldSpecification/FieldSpecificationManager.hpp @@ -299,6 +299,14 @@ FieldSpecificationManager:: } ); } +// FieldSpecificationManager is available through the ProblemRepository as a mutable problem-unique manager. +template<> inline FieldSpecificationManager & dataRepository::ProblemRepository::getManager() +{ return getRootGroup().getGroup< FieldSpecificationManager >( m_gks.fieldSpecificationManager ); } + +// FieldSpecificationManager is available through the ProblemRepository as a const problem-unique manager. +template<> inline FieldSpecificationManager const & dataRepository::ProblemRepository::getManager() const +{ return getRootGroup().getGroup< FieldSpecificationManager >( m_gks.fieldSpecificationManager ); } + } /* namespace geos */ #endif /* GEOS_FIELDSPECIFICATION_FIELDSPECIFICATIONMANAGER_HPP_ */ diff --git a/src/coreComponents/fileIO/Outputs/OutputManager.hpp b/src/coreComponents/fileIO/Outputs/OutputManager.hpp index 38a68c06568..2c417828cea 100644 --- a/src/coreComponents/fileIO/Outputs/OutputManager.hpp +++ b/src/coreComponents/fileIO/Outputs/OutputManager.hpp @@ -21,6 +21,7 @@ #define GEOS_FILEIO_OUTPUTS_OUTPUTMANAGER_HPP_ #include "dataRepository/Group.hpp" +#include "dataRepository/ProblemRepository.hpp" namespace geos @@ -60,6 +61,13 @@ class OutputManager : public dataRepository::Group /// @endcond }; +// OutputManager is available through the ProblemRepository as a mutable problem-unique manager. +template<> inline OutputManager & dataRepository::ProblemRepository::getManager() +{ return getRootGroup().getGroup< OutputManager >( m_gks.outputManager ); } + +// OutputManager is available through the ProblemRepository as a const problem-unique manager. +template<> inline OutputManager const & dataRepository::ProblemRepository::getManager() const +{ return getRootGroup().getGroup< OutputManager >( m_gks.outputManager ); } } /* namespace geos */ diff --git a/src/coreComponents/functions/FunctionManager.hpp b/src/coreComponents/functions/FunctionManager.hpp index dac7ad85b0a..eb36c44d664 100644 --- a/src/coreComponents/functions/FunctionManager.hpp +++ b/src/coreComponents/functions/FunctionManager.hpp @@ -23,6 +23,7 @@ #include "FunctionBase.hpp" #include "dataRepository/Group.hpp" +#include "dataRepository/ProblemRepository.hpp" namespace geos { @@ -72,6 +73,14 @@ class FunctionManager : public dataRepository::Group static FunctionManager * m_instance; }; +// FunctionManager is available through the ProblemRepository as a mutable problem-unique manager. +template<> inline FunctionManager & dataRepository::ProblemRepository::getManager() +{ return getRootGroup().getGroup< FunctionManager >( m_gks.functionManager ); } + +// FunctionManager is available through the ProblemRepository as a const problem-unique manager. +template<> inline FunctionManager const & dataRepository::ProblemRepository::getManager() const +{ return getRootGroup().getGroup< FunctionManager >( m_gks.functionManager ); } + } /* namespace geos */ #endif /* GEOS_FUNCTIONS_FUNCTIONMANAGER_HPP_ */ diff --git a/src/coreComponents/mainInterface/GeosxState.cpp b/src/coreComponents/mainInterface/GeosxState.cpp index 38a0cd12c9c..6452b81a35c 100644 --- a/src/coreComponents/mainInterface/GeosxState.cpp +++ b/src/coreComponents/mainInterface/GeosxState.cpp @@ -188,24 +188,4 @@ void GeosxState::run() } } -////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -dataRepository::Group & GeosxState::getProblemManagerAsGroup() -{ return getProblemManager(); } - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -dataRepository::ProblemManagerBase & GeosxState::getProblemManagerBase() -{ return getProblemManager(); } - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -dataRepository::ProblemManagerBase const & GeosxState::getProblemManagerBase() const -{ return *m_problemManager; } - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -FieldSpecificationManager & GeosxState::getFieldSpecificationManager() -{ return getProblemManager().getFieldSpecificationManager(); } - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -FunctionManager & GeosxState::getFunctionManager() -{ return getProblemManager().getFunctionManager(); } - } // namespace geos diff --git a/src/coreComponents/mainInterface/GeosxState.hpp b/src/coreComponents/mainInterface/GeosxState.hpp index 3f57d2d32bc..d9a5be2dafe 100644 --- a/src/coreComponents/mainInterface/GeosxState.hpp +++ b/src/coreComponents/mainInterface/GeosxState.hpp @@ -182,32 +182,11 @@ class GeosxState * @note This is useful if you only need at @c dataRepository::Group and don't want to * include @c ProblemManager.hpp. */ - dataRepository::Group & getProblemManagerAsGroup(); - - /** - * @brief Return the @c ProblemManager as a @c ProblemManagerBase. - * @return The @c ProblemManagerBase interface. - * @note Prefer this when you only need accessors to common objects and don't want to - * include @c ProblemManager.hpp. - */ - dataRepository::ProblemManagerBase & getProblemManagerBase(); - - /** - * @copydoc getProblemManagerBase() - */ - dataRepository::ProblemManagerBase const & getProblemManagerBase() const; - - /** - * @brief Return the FieldSpecificationManager. - * @return The FieldSpecificationManager. - */ - FieldSpecificationManager & getFieldSpecificationManager(); - - /** - * @brief Return the FunctionManager. - * @return The FunctionManager. - */ - FunctionManager & getFunctionManager(); + dataRepository::Group & getProblemManagerAsGroup() + { + GEOS_ERROR_IF( m_problemManager == nullptr, "Not initialized." ); + return *(dataRepository::Group *)m_problemManager.get(); + } /** * @brief Return the CommunicationTools. diff --git a/src/coreComponents/mesh/DomainPartition.cpp b/src/coreComponents/mesh/DomainPartition.cpp index 943c6366974..cd984e13d61 100644 --- a/src/coreComponents/mesh/DomainPartition.cpp +++ b/src/coreComponents/mesh/DomainPartition.cpp @@ -18,10 +18,10 @@ */ #include "DomainPartition.hpp" + #include "common/format/table/TableData.hpp" #include "common/format/table/TableFormatter.hpp" #include "common/format/table/TableLayout.hpp" - #include "common/DataTypes.hpp" #include "common/TimingMacros.hpp" #include "constitutive/ConstitutiveManager.hpp" @@ -43,17 +43,15 @@ DomainPartition::DomainPartition( string const & name, setRestartFlags( RestartFlags::NO_WRITE ). setSizedFromParent( false ); - this->registerWrapper< SpatialPartition, PartitionBase >( keys::partitionManager ). + this->registerWrapper< SpatialPartition, PartitionBase >( m_vks.partitionManager ). setRestartFlags( RestartFlags::NO_WRITE ). setSizedFromParent( false ); registerGroup( groupKeys.meshBodies ); - registerGroup< constitutive::ConstitutiveManager >( groupKeys.constitutiveManager ); addLogLevel< logInfo::PartitionCommunication >(); } - DomainPartition::~DomainPartition() {} @@ -61,13 +59,13 @@ void DomainPartition::initializationOrder( string_array & order ) { set< string > usedNames; { - order.emplace_back( string( groupKeysStruct::constitutiveManagerString() ) ); - usedNames.insert( groupKeysStruct::constitutiveManagerString() ); + order.emplace_back( string( ProblemViewKeys::constitutiveManager() ) ); + usedNames.insert( ProblemViewKeys::constitutiveManager() ); } { - order.emplace_back( string( groupKeysStruct::meshBodiesString() ) ); - usedNames.insert( groupKeysStruct::meshBodiesString() ); + order.emplace_back( groupKeys.meshBodies.key() ); + usedNames.insert( groupKeys.meshBodies.key() ); } @@ -85,7 +83,7 @@ void DomainPartition::setupBaseLevelMeshGlobalInfo() GEOS_MARK_FUNCTION; #if defined(GEOS_USE_MPI) - PartitionBase & partition1 = getReference< PartitionBase >( keys::partitionManager ); + PartitionBase & partition1 = getPartitionManager(); SpatialPartition & partition = dynamic_cast< SpatialPartition & >(partition1); const std::set< int > metisNeighborList = partition.getMetisNeighborList(); @@ -279,7 +277,7 @@ void DomainPartition::addNeighbors( const unsigned int idim, MPI_Comm & cartcomm, int * ncoords ) { - PartitionBase & partition1 = getReference< PartitionBase >( keys::partitionManager ); + PartitionBase & partition1 = getPartitionManager(); SpatialPartition & partition = dynamic_cast< SpatialPartition & >(partition1); if( idim == partition.m_nsdof ) @@ -522,4 +520,10 @@ void DomainPartition::outputPartitionInformation() const } +PartitionBase & DomainPartition::getPartitionManager() +{ return this->getReference< PartitionBase >( m_vks.partitionManager ); } + +PartitionBase const & DomainPartition::getPartitionManager() const +{ return this->getReference< PartitionBase >( m_vks.partitionManager ); } + } /* namespace geos */ diff --git a/src/coreComponents/mesh/DomainPartition.hpp b/src/coreComponents/mesh/DomainPartition.hpp index 1b30fc47ddd..fb8eeb62a75 100644 --- a/src/coreComponents/mesh/DomainPartition.hpp +++ b/src/coreComponents/mesh/DomainPartition.hpp @@ -22,8 +22,9 @@ #include "common/MpiWrapper.hpp" #include "constitutive/ConstitutiveManager.hpp" -#include "dataRepository/GlobalViewKeys.hpp" #include "dataRepository/Group.hpp" +#include "dataRepository/ProblemRepository.hpp" +#include "dataRepository/ProblemViewKeys.hpp" #include "discretizationMethods/NumericalMethodsManager.hpp" #include "mesh/MeshBody.hpp" #include "mesh/mpiCommunications/NeighborCommunicator.hpp" @@ -32,15 +33,6 @@ namespace geos { class SiloFile; -namespace dataRepository -{ -namespace keys -{ -/// @return PartitionManager string key -string const partitionManager( "partitionManager" ); -} -} - class ObjectManagerBase; class PartitionBase; @@ -125,25 +117,23 @@ class DomainPartition : public dataRepository::Group ///@} + /** + * @brief struct to serve as a container for wrapper accesses + */ + struct viewKeyStruct + { + dataRepository::ViewKey partitionManager = { "partitionManager" }; + } m_vks; /** - * @brief struct to serve as a container for group strings and keys - * @struct groupKeysStruct + * @brief struct to serve as a container for group accesses */ struct groupKeysStruct { - /// @return String key to the Group holding the MeshBodies - static constexpr char const * meshBodiesString() { return "MeshBodies"; } - /// @return String key to the Group holding the ConstitutiveManager - static constexpr char const * constitutiveManagerString() - { return dataRepository::GlobalViewKeys::constitutiveManager(); } - /// View key to the Group holding the MeshBodies - dataRepository::GroupKey meshBodies = { meshBodiesString() }; + dataRepository::GroupKey meshBodies = { "MeshBodies" }; /// View key to the Group holding the ConstitutiveManager - dataRepository::GroupKey constitutiveManager = { constitutiveManagerString() }; - /// View key to the Group holding the CommunicationManager - dataRepository::GroupKey communicationManager = { "communicationManager" }; + dataRepository::GroupKey::index_type constitutiveManager; } /// groupKey struct for the DomainPartition class groupKeys; @@ -166,13 +156,23 @@ class DomainPartition : public dataRepository::Group * @brief @return Return a reference to const NumericalMethodsManager from ProblemManager */ NumericalMethodsManager const & getNumericalMethodManager() const - { return this->getParent().getGroup< NumericalMethodsManager >( dataRepository::GlobalViewKeys::numericalMethodsManager()); } + { return dataRepository::ProblemRepository::get( *this ).getManager< NumericalMethodsManager >(); } /** * @brief @return Return a reference to NumericalMethodsManager from ProblemManager */ NumericalMethodsManager & getNumericalMethodManager() - { return this->getParent().getGroup< NumericalMethodsManager >( dataRepository::GlobalViewKeys::numericalMethodsManager()); } + { return dataRepository::ProblemRepository::get( *this ).getManager< NumericalMethodsManager >(); } + + /** + * @return Get the global partition. + */ + PartitionBase & getPartitionManager(); + + /** + * @return Get the global partition. + */ + PartitionBase const & getPartitionManager() const; /** * @brief Get the mesh bodies, const version. @@ -299,6 +299,14 @@ class DomainPartition : public dataRepository::Group stdVector< NeighborCommunicator > m_neighbors; }; +// DomainPartition Group is available through the ProblemRepository as a mutable problem-unique manager. +template<> inline DomainPartition & dataRepository::ProblemRepository::getManager() +{ return getRootGroup().getGroup< DomainPartition >( m_gks.domain ); } + +// DomainPartition Group is available through the ProblemRepository as a const problem-unique manager. +template<> inline DomainPartition const & dataRepository::ProblemRepository::getManager() const +{ return getRootGroup().getGroup< DomainPartition >( m_gks.domain ); } + } /* namespace geos */ #endif /* GEOS_MESH_DOMAINPARTITION_HPP_ */ diff --git a/src/coreComponents/mesh/ExternalDataSourceManager.hpp b/src/coreComponents/mesh/ExternalDataSourceManager.hpp index 28ccecb2fc1..c6fb2d207a1 100644 --- a/src/coreComponents/mesh/ExternalDataSourceManager.hpp +++ b/src/coreComponents/mesh/ExternalDataSourceManager.hpp @@ -71,6 +71,14 @@ class ExternalDataSourceManager : public dataRepository::Group }; +// ExternalDataSourceManager is available through the ProblemRepository as a mutable problem-unique manager. +template<> inline ExternalDataSourceManager & dataRepository::ProblemRepository::getManager() +{ return getRootGroup().getGroup< ExternalDataSourceManager >( m_gks.externalDataSourceManager ); } + +// ExternalDataSourceManager is available through the ProblemRepository as a const problem-unique manager. +template<> inline ExternalDataSourceManager const & dataRepository::ProblemRepository::getManager() const +{ return getRootGroup().getGroup< ExternalDataSourceManager >( m_gks.externalDataSourceManager ); } + } /* namespace geos */ #endif /* GEOS_MESH_EXTERNALDATASOURCEMANAGER_HPP_ */ diff --git a/src/coreComponents/mesh/MeshBody.hpp b/src/coreComponents/mesh/MeshBody.hpp index a8f8cbe70af..33a4db11993 100644 --- a/src/coreComponents/mesh/MeshBody.hpp +++ b/src/coreComponents/mesh/MeshBody.hpp @@ -21,7 +21,6 @@ #define GEOS_MESH_MESHBODY_HPP_ #include "MeshLevel.hpp" -#include "dataRepository/KeyNames.hpp" namespace geos { @@ -188,17 +187,52 @@ class MeshBody : public dataRepository::Group * @return The CellBlockManager. */ CellBlockManagerABC const & getCellBlockManager() const - { - return this->getGroup< CellBlockManagerABC >( dataRepository::keys::cellManager ); - } + { return this->getGroup< CellBlockManagerABC >( groupStructKeys::cellManagerString() ); } + + /** + * @return True if a cell-block manager is registered. + */ + bool hasCellBlockManager() const + { return this->hasGroup( groupStructKeys::cellManagerString() ); } + + /** + * @brief Get the Abstract representation of the CellBlockManager attached to the MeshBody. + * @return The CellBlockManager. + */ + CellBlockManagerABC & getCellBlockManager() + { return this->getGroup< CellBlockManagerABC >( groupStructKeys::cellManagerString() ); } + + /** + * @brief Get the Abstract representation of the ParticleBlockManager attached to the MeshBody. + * @return The ParticleBlockManager. + */ + ParticleBlockManagerABC const & getParticleBlockManager() const + { return this->getGroup< ParticleBlockManagerABC >( groupStructKeys::particleManagerString() ); } + + /** + * @return True if a particle-block manager is registered. + */ + bool hasParticleBlockManager() const + { return this->hasGroup( groupStructKeys::particleManagerString() ); } + + /** + * @brief Get the Abstract representation of the ParticleBlockManager attached to the MeshBody. + * @return The ParticleBlockManager. + */ + ParticleBlockManagerABC & getParticleBlockManager() + { return this->getGroup< ParticleBlockManagerABC >( groupStructKeys::particleManagerString() ); } /** * @brief De register the CellBlockManager from this meshBody */ void deregisterCellBlockManager() - { - this->deregisterGroup( dataRepository::keys::cellManager ); - } + { this->deregisterGroup( groupStructKeys::cellManagerString() ); } + + /** + * @brief De register the CellBlockManager from this meshBody + */ + void deregisterParticleBlockManager() + { this->deregisterGroup( groupStructKeys::particleManagerString() ); } /** * @brief Data repository keys @@ -213,9 +247,17 @@ class MeshBody : public dataRepository::Group { /// @return The key/string used to register/access the Group that contains the MeshLevel objects. static constexpr char const * meshLevelsString() { return "meshLevels"; } - /// @return The key/string used to register/access the Group that contains the base discretization. static constexpr char const * baseDiscretizationString() { return "Level0"; } + /// @return the key/string used to register/access the cell block manager + static constexpr char const * cellManagerString() { return "cellManager"; } + /// @return the key/string used to register/access the particle block manager + static constexpr char const * particleManagerString() { return "particleManager"; } + + dataRepository::GroupKey meshLevels = { meshLevelsString() }; + dataRepository::GroupKey baseDiscretization = { baseDiscretizationString() }; + dataRepository::GroupKey cellManager = { cellManagerString() }; + dataRepository::GroupKey particleManager = { particleManagerString() }; } groupKeys; ///< groupKeys diff --git a/src/coreComponents/mesh/MeshManager.hpp b/src/coreComponents/mesh/MeshManager.hpp index 886d85692d8..0be3db4d167 100644 --- a/src/coreComponents/mesh/MeshManager.hpp +++ b/src/coreComponents/mesh/MeshManager.hpp @@ -100,6 +100,14 @@ class MeshManager : public dataRepository::Group }; +// MeshManager is available through the ProblemRepository as a mutable problem-unique manager. +template<> inline MeshManager & dataRepository::ProblemRepository::getManager() +{ return getRootGroup().getGroup< MeshManager >( m_gks.meshManager ); } + +// MeshManager is available through the ProblemRepository as a const problem-unique manager. +template<> inline MeshManager const & dataRepository::ProblemRepository::getManager() const +{ return getRootGroup().getGroup< MeshManager >( m_gks.meshManager ); } + } /* namespace geos */ #endif /* GEOS_MESH_MESHMANAGER_HPP_ */ diff --git a/src/coreComponents/mesh/simpleGeometricObjects/GeometricObjectManager.hpp b/src/coreComponents/mesh/simpleGeometricObjects/GeometricObjectManager.hpp index 7aef070b24f..cdc52072d6a 100644 --- a/src/coreComponents/mesh/simpleGeometricObjects/GeometricObjectManager.hpp +++ b/src/coreComponents/mesh/simpleGeometricObjects/GeometricObjectManager.hpp @@ -21,6 +21,7 @@ #define GEOS_MESH_SIMPLEGEOMETRICOBJECTS_GEOMETRICOBJECTMANAGER_HPP_ #include "dataRepository/Group.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "mesh/simpleGeometricObjects/SimpleGeometricObjectBase.hpp" @@ -84,6 +85,14 @@ class GeometricObjectManager : public dataRepository::Group }; +// GeometricObjectManager is available through the ProblemRepository as a mutable problem-unique manager. +template<> inline GeometricObjectManager & dataRepository::ProblemRepository::getManager() +{ return getRootGroup().getGroup< GeometricObjectManager >( m_gks.geometricObjectManager ); } + +// GeometricObjectManager is available through the ProblemRepository as a const problem-unique manager. +template<> inline GeometricObjectManager const & dataRepository::ProblemRepository::getManager() const +{ return getRootGroup().getGroup< GeometricObjectManager >( m_gks.geometricObjectManager ); } + } /* namespace geos */ #endif /* GEOS_MESH_SIMPLEGEOMETRICOBJECTS_GEOMETRICOBJECTMANAGER_HPP_ */ diff --git a/src/coreComponents/physicsSolvers/PhysicsSolverManager.hpp b/src/coreComponents/physicsSolvers/PhysicsSolverManager.hpp index 8ef3ba43312..c00e0f74866 100644 --- a/src/coreComponents/physicsSolvers/PhysicsSolverManager.hpp +++ b/src/coreComponents/physicsSolvers/PhysicsSolverManager.hpp @@ -17,6 +17,7 @@ #define GEOS_PHYSICSSOLVERS_PHYSICSSOLVERMANAGER_HPP_ #include "dataRepository/Group.hpp" +#include "dataRepository/ProblemRepository.hpp" namespace geos { @@ -48,6 +49,14 @@ class PhysicsSolverManager : public dataRepository::Group R1Tensor m_gravityVector; }; +// PhysicsSolverManager is available through the ProblemRepository as a mutable problem-unique manager. +template<> inline PhysicsSolverManager & dataRepository::ProblemRepository::getManager() +{ return getRootGroup().getGroup< PhysicsSolverManager >( m_gks.physicsSolverManager ); } + +// PhysicsSolverManager is available through the ProblemRepository as a const problem-unique manager. +template<> inline PhysicsSolverManager const & dataRepository::ProblemRepository::getManager() const +{ return getRootGroup().getGroup< PhysicsSolverManager >( m_gks.physicsSolverManager ); } + } /* namespace geos */ #endif /* GEOS_PHYSICSSOLVERS_PHYSICSSOLVERMANAGER_HPP_ */ From 502a078789e0a6d2f37f4fb423126636909202e6 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 14 Aug 2026 18:06:34 +0200 Subject: [PATCH 07/13] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20update=20getters=20c?= =?UTF-8?q?all-sites=20(refactor=20minimum=20stage)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constitutiveDrivers/ConstitutiveDriver.cpp | 6 +++--- .../fluid/multiFluid/reactive/ReactiveFluidDriver.cpp | 4 ++-- src/coreComponents/dataRepository/CMakeLists.txt | 3 --- src/coreComponents/dataRepository/Wrapper.hpp | 1 - src/coreComponents/dataRepository/WrapperBase.cpp | 6 ++---- src/coreComponents/dataRepository/xmlWrapper.cpp | 4 ++-- src/coreComponents/dataRepository/xmlWrapper.hpp | 1 + .../fieldSpecification/FieldSpecificationManager.cpp | 4 ++-- src/coreComponents/fileIO/Outputs/RestartOutput.cpp | 4 ++-- .../fileIO/Outputs/TimeHistoryOutput.cpp | 4 ++-- .../fileIO/python/PyHistoryCollection.cpp | 3 ++- src/coreComponents/fileIO/python/PyHistoryOutput.cpp | 3 ++- src/coreComponents/fileIO/python/PyVTKOutput.cpp | 4 +++- .../fileIO/timeHistory/PackCollection.cpp | 4 ++-- .../unitTests/testConformingVirtualElementOrder1.cpp | 10 ++++------ .../finiteVolume/FluxApproximationBase.cpp | 6 +++--- .../testRecursiveFieldApplication.cpp | 5 +++-- .../fluidFlowTests/testCompFlowUtils.hpp | 9 ++++----- .../testReactiveCompositionalMultiphaseOBL.cpp | 4 +++- .../fluidFlowTests/testSingleFlowUtils.hpp | 10 ++++------ .../testSinglePhaseReactiveTransportUtils.hpp | 10 ++++------ .../linearAlgebraTests/testDofManagerUtils.hpp | 10 +++++----- .../integrationTests/meshTests/testMeshGeneration.cpp | 6 +++--- .../integrationTests/meshTests/testVTKImport.cpp | 2 +- .../integrationTests/xmlTests/testXMLFile.cpp | 4 ++-- src/coreComponents/mainInterface/GeosxState.hpp | 1 - src/coreComponents/mesh/DomainPartition.cpp | 6 ++++-- src/coreComponents/mesh/DomainPartition.hpp | 1 - src/coreComponents/mesh/MeshBody.cpp | 1 + src/coreComponents/mesh/MeshLevel.cpp | 3 +-- src/coreComponents/mesh/MeshLevel.hpp | 2 ++ src/coreComponents/mesh/MeshManager.cpp | 2 +- .../mesh/generators/MeshGeneratorBase.cpp | 6 ++++-- .../mesh/generators/VTKMeshGenerator.cpp | 4 ++-- .../SimpleGeometricObjectBase.cpp | 4 ++-- .../physicsSolvers/FieldStatisticsBase.hpp | 4 ++-- .../physicsSolvers/PhysicsSolverBase.cpp | 6 +++--- .../CompositionalMultiphaseStatisticsTask.cpp | 3 ++- .../physicsSolvers/fluidFlow/StencilDataCollection.cpp | 9 +++++---- .../fluidFlow/wells/CompositionalMultiphaseWell.cpp | 2 +- .../physicsSolvers/multiphysics/FieldApplicator.cpp | 6 +++--- .../solidMechanics/SolidMechanicsInitialization.cpp | 7 ++++--- .../solidMechanics/SolidMechanicsLagrangianFEM.cpp | 2 +- .../solidMechanics/SolidMechanicsMPM.cpp | 5 +++-- .../solidMechanics/SolidMechanicsStateReset.cpp | 4 ++-- .../SolidMechanicsAugmentedLagrangianContact.cpp | 9 +++++---- .../surfaceGeneration/SurfaceGenerator.cpp | 6 +++--- .../isotropic/AcousticWaveEquationSEM.cpp | 8 ++++---- .../isotropic/ElasticWaveEquationSEM.cpp | 2 +- .../wavePropagation/shared/WaveSolverBase.cpp | 3 +-- 50 files changed, 118 insertions(+), 115 deletions(-) diff --git a/src/coreComponents/constitutiveDrivers/ConstitutiveDriver.cpp b/src/coreComponents/constitutiveDrivers/ConstitutiveDriver.cpp index 304f305fb0f..4912ccb96db 100644 --- a/src/coreComponents/constitutiveDrivers/ConstitutiveDriver.cpp +++ b/src/coreComponents/constitutiveDrivers/ConstitutiveDriver.cpp @@ -21,7 +21,7 @@ #include "LogLevelsInfo.hpp" #include "constitutive/ConstitutiveManager.hpp" -#include "dataRepository/ProblemManagerBase.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "common/format/table/TableFormatter.hpp" #include "common/format/StringUtilities.hpp" @@ -247,12 +247,12 @@ void ConstitutiveDriver::allocateTable( integer const numColumns, ConstitutiveManager & ConstitutiveDriver::getConstitutiveManager() { - return getProblemManagerBase( *this ).getConstitutiveManager(); + return ProblemRepository::get( *this ).getManager< ConstitutiveManager >(); } ConstitutiveManager const & ConstitutiveDriver::getConstitutiveManager() const { - return getProblemManagerBase( *this ).getConstitutiveManager(); + return ProblemRepository::get( *this ).getManager< ConstitutiveManager >(); } } /* namespace geos */ diff --git a/src/coreComponents/constitutiveDrivers/fluid/multiFluid/reactive/ReactiveFluidDriver.cpp b/src/coreComponents/constitutiveDrivers/fluid/multiFluid/reactive/ReactiveFluidDriver.cpp index 3ea4fcf69e3..e7a77b68ca3 100644 --- a/src/coreComponents/constitutiveDrivers/fluid/multiFluid/reactive/ReactiveFluidDriver.cpp +++ b/src/coreComponents/constitutiveDrivers/fluid/multiFluid/reactive/ReactiveFluidDriver.cpp @@ -78,7 +78,7 @@ void ReactiveFluidDriver::postInputInitialization() { // get number of phases and components - ConstitutiveManager & constitutiveManager = getProblemManagerBase( *this ).getConstitutiveManager(); + ConstitutiveManager & constitutiveManager = ProblemRepository::get( *this ).getManager< ConstitutiveManager >(); ReactiveMultiFluid & fluid = constitutiveManager.getGroup< ReactiveMultiFluid >( m_fluidName ); m_numPhases = fluid.numFluidPhases(); @@ -132,7 +132,7 @@ bool ReactiveFluidDriver::execute( real64 const GEOS_UNUSED_PARAM( time_n ), // get the fluid out of the constitutive manager. // for the moment it is of type MultiFluidBase. - ConstitutiveManager & constitutiveManager = getProblemManagerBase( *this ).getConstitutiveManager(); + ConstitutiveManager & constitutiveManager = ProblemRepository::get( *this ).getManager< ConstitutiveManager >(); ReactiveMultiFluid & baseFluid = constitutiveManager.getGroup< ReactiveMultiFluid >( m_fluidName ); // depending on logLevel, print some useful info diff --git a/src/coreComponents/dataRepository/CMakeLists.txt b/src/coreComponents/dataRepository/CMakeLists.txt index f8362a73c1e..e5e0431883d 100644 --- a/src/coreComponents/dataRepository/CMakeLists.txt +++ b/src/coreComponents/dataRepository/CMakeLists.txt @@ -28,17 +28,14 @@ set( dataRepository_headers ConduitRestart.hpp DefaultValue.hpp ExecutableGroup.hpp - GlobalViewKeys.hpp Group.hpp HistoryDataSpec.hpp InputFlags.hpp KeyIndexT.hpp - KeyNames.hpp LogLevelsInfo.hpp LogLevelsRegistry.hpp MappedVector.hpp ObjectCatalog.hpp - ProblemManagerBase.hpp ProblemRepositoryABC.hpp ProblemRepository.hpp ReferenceWrapper.hpp diff --git a/src/coreComponents/dataRepository/Wrapper.hpp b/src/coreComponents/dataRepository/Wrapper.hpp index 4f23afa084e..d4d8fd3918d 100644 --- a/src/coreComponents/dataRepository/Wrapper.hpp +++ b/src/coreComponents/dataRepository/Wrapper.hpp @@ -22,7 +22,6 @@ // Source inclues #include "wrapperHelpers.hpp" -#include "KeyNames.hpp" #include "LvArray/src/limits.hpp" #include "common/DataTypes.hpp" #include "codingUtilities/SFINAE_Macros.hpp" diff --git a/src/coreComponents/dataRepository/WrapperBase.cpp b/src/coreComponents/dataRepository/WrapperBase.cpp index 69d8575b422..43d1c3f6e14 100644 --- a/src/coreComponents/dataRepository/WrapperBase.cpp +++ b/src/coreComponents/dataRepository/WrapperBase.cpp @@ -20,6 +20,7 @@ #include "Group.hpp" #include "RestartFlags.hpp" #include "WrapperContext.hpp" +#include "ProblemRepositoryABC.hpp" namespace geos @@ -66,10 +67,7 @@ void WrapperBase::copyWrapperAttributes( WrapperBase const & source ) string WrapperBase::getPath() const { - // In the Conduit node hierarchy everything begins with 'Problem', we should change it so that - // the ProblemManager actually uses the root Conduit Node but that will require a full rebaseline. - string const noProblem = m_conduitNode.path().substr( std::strlen( dataRepository::keys::ProblemManager ) - 1 ); - return noProblem.empty() ? "/" : noProblem; + return ProblemRepositoryABC::getNoProblemPath( m_conduitNode.path() ); } #if defined(USE_TOTALVIEW_OUTPUT) diff --git a/src/coreComponents/dataRepository/xmlWrapper.cpp b/src/coreComponents/dataRepository/xmlWrapper.cpp index 0c5a469a570..dff58bde59d 100644 --- a/src/coreComponents/dataRepository/xmlWrapper.cpp +++ b/src/coreComponents/dataRepository/xmlWrapper.cpp @@ -23,7 +23,6 @@ #include "common/format/StringUtilities.hpp" #include "common/MpiWrapper.hpp" -#include "dataRepository/KeyNames.hpp" namespace geos { @@ -233,6 +232,7 @@ void xmlDocument::addIncludedXML( xmlNode & targetNode, int const level ) } string buildMultipleInputXML( string_array const & inputFileList, + string const & rootNodeName, string const & outputDir ) { if( inputFileList.empty() ) @@ -250,7 +250,7 @@ string buildMultipleInputXML( string_array const & inputFileList, if( MpiWrapper::commRank() == 0 ) { xmlWrapper::xmlDocument compositeTree; - xmlWrapper::xmlNode compositeRoot = compositeTree.appendChild( dataRepository::keys::ProblemManager ); + xmlWrapper::xmlNode compositeRoot = compositeTree.appendChild( rootNodeName ); xmlWrapper::xmlNode includedRoot = compositeRoot.append_child( includedListTag ); for( auto & fileName: inputFileList ) diff --git a/src/coreComponents/dataRepository/xmlWrapper.hpp b/src/coreComponents/dataRepository/xmlWrapper.hpp index 494eb2db119..023cef2ae5d 100644 --- a/src/coreComponents/dataRepository/xmlWrapper.hpp +++ b/src/coreComponents/dataRepository/xmlWrapper.hpp @@ -299,6 +299,7 @@ constexpr char const includedFileTag[] = "File"; * a new input xml file with an included block if neccesary */ string buildMultipleInputXML( string_array const & inputFileList, + string const & rootNodeName, string const & outputDir = {} ); /** diff --git a/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp b/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp index c7b49b13a91..b3b3c95c778 100644 --- a/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp +++ b/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp @@ -14,7 +14,7 @@ */ #include "FieldSpecificationManager.hpp" -#include "dataRepository/ProblemManagerBase.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "mesh/DomainPartition.hpp" #include "mesh/MeshBody.hpp" #include "mesh/MeshObjectPath.hpp" @@ -71,7 +71,7 @@ void FieldSpecificationManager::expandObjectCatalogs() void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) const { - DomainPartition const & domain = getProblemManagerBase( *this ).getDomainPartition(); + DomainPartition const & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); Group const & meshBodies = domain.getMeshBodies(); // loop over all the FieldSpecification of the XML file this->forSubGroups< FieldSpecification >( [&] ( FieldSpecification const & fs ) diff --git a/src/coreComponents/fileIO/Outputs/RestartOutput.cpp b/src/coreComponents/fileIO/Outputs/RestartOutput.cpp index 80a22b8090e..2ef48c6a769 100644 --- a/src/coreComponents/fileIO/Outputs/RestartOutput.cpp +++ b/src/coreComponents/fileIO/Outputs/RestartOutput.cpp @@ -18,7 +18,7 @@ */ #include "RestartOutput.hpp" -#include "dataRepository/ProblemManagerBase.hpp" +#include "dataRepository/ProblemRepository.hpp" namespace geos { @@ -45,7 +45,7 @@ bool RestartOutput::execute( real64 const GEOS_UNUSED_PARAM( time_n ), { Timer timer( m_outputTimer ); - Group & rootGroup = getProblemManagerBase( *this ); + Group & rootGroup = ProblemRepository::get( *this ).getRootGroup(); string const fileName = GEOS_FMT( "{}_restart_{:09}", getFileNameRoot(), cycleNumber ); rootGroup.prepareToWrite(); writeTree( joinPath( getOutputDirectory(), fileName ), *(rootGroup.getConduitNode().parent()) ); diff --git a/src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp b/src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp index e0126e9b772..e8ece8c6103 100644 --- a/src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp +++ b/src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp @@ -15,7 +15,7 @@ #include "TimeHistoryOutput.hpp" -#include "dataRepository/ProblemManagerBase.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "fileIO/timeHistory/HDFFile.hpp" #include "fileIO/LogLevelsInfo.hpp" @@ -131,7 +131,7 @@ void TimeHistoryOutput::initializePostInitialConditionsPostSubGroups() HDFFile( outputFile, (m_recordCount == 0), true, MPI_COMM_GEOS ); } - DomainPartition & domain = getProblemManagerBase( *this ).getDomainPartition(); + DomainPartition & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); GEOS_LOG_LEVEL_BY_RANK( logInfo::DataCollectorInitialization, GEOS_FMT( "TimeHistory: '{}' initializing data collectors.", this->getName() ) ); for( auto collectorPath : m_collectorPaths ) diff --git a/src/coreComponents/fileIO/python/PyHistoryCollection.cpp b/src/coreComponents/fileIO/python/PyHistoryCollection.cpp index b971aefeacd..cb66f687c07 100644 --- a/src/coreComponents/fileIO/python/PyHistoryCollection.cpp +++ b/src/coreComponents/fileIO/python/PyHistoryCollection.cpp @@ -20,6 +20,7 @@ #include "fileIO/timeHistory/HistoryCollection.hpp" #include "PyHistoryCollectionType.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "dataRepository/python/PyGroupType.hpp" @@ -97,7 +98,7 @@ static PyObject * collect( PyHistoryCollection * self, PyObject * args ) return nullptr; } - geos::DomainPartition & domain = geos::dataRepository::getProblemManagerBase( *self->group ).getDomainPartition(); + geos::DomainPartition & domain = geos::dataRepository::ProblemRepository::get( *self->group ).getManager< geos::DomainPartition >(); try { diff --git a/src/coreComponents/fileIO/python/PyHistoryOutput.cpp b/src/coreComponents/fileIO/python/PyHistoryOutput.cpp index 2207597690e..95503707ca6 100644 --- a/src/coreComponents/fileIO/python/PyHistoryOutput.cpp +++ b/src/coreComponents/fileIO/python/PyHistoryOutput.cpp @@ -21,6 +21,7 @@ #include "PyHistoryOutputType.hpp" #include "dataRepository/python/PyGroupType.hpp" +#include "dataRepository/ProblemRepository.hpp" #define VERIFY_NON_NULL_SELF( self ) \ @@ -95,7 +96,7 @@ static PyObject * output( PyHistoryOutput * self, PyObject * args ) return nullptr; } - geos::DomainPartition & domain = geos::dataRepository::getProblemManagerBase( *self->group ).getDomainPartition(); + geos::DomainPartition & domain = geos::dataRepository::ProblemRepository::get( *self->group ).getManager< geos::DomainPartition >(); try { diff --git a/src/coreComponents/fileIO/python/PyVTKOutput.cpp b/src/coreComponents/fileIO/python/PyVTKOutput.cpp index 6294c0dad91..7837ef4733a 100644 --- a/src/coreComponents/fileIO/python/PyVTKOutput.cpp +++ b/src/coreComponents/fileIO/python/PyVTKOutput.cpp @@ -13,6 +13,8 @@ * ------------------------------------------------------------------------------------------------------------ */ +#include "dataRepository/ProblemRepository.hpp" +#include "mesh/DomainPartition.hpp" #define PY_SSIZE_T_CLEAN #include @@ -93,7 +95,7 @@ static PyObject * output( PyVTKOutput * self, PyObject * args ) return nullptr; } - geos::DomainPartition & domain = geos::dataRepository::getProblemManagerBase( *self->group ).getDomainPartition(); + DomainPartition & domain = dataRepository::ProblemRepository::get( *self->group ).getManager< DomainPartition >(); try { diff --git a/src/coreComponents/fileIO/timeHistory/PackCollection.cpp b/src/coreComponents/fileIO/timeHistory/PackCollection.cpp index 9baf7a2ce87..d8fa475b0d7 100644 --- a/src/coreComponents/fileIO/timeHistory/PackCollection.cpp +++ b/src/coreComponents/fileIO/timeHistory/PackCollection.cpp @@ -14,7 +14,7 @@ */ #include "PackCollection.hpp" -#include "dataRepository/ProblemManagerBase.hpp" +#include "dataRepository/ProblemRepository.hpp" namespace geos { @@ -61,7 +61,7 @@ void PackCollection::initializePostSubGroups( ) { if( !m_initialized ) { - DomainPartition & domain = getProblemManagerBase( *this ).getDomainPartition(); + DomainPartition & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); m_collectionCount = collectAll() ? 1 : m_setNames.size(); // determine whether we're collecting from a mesh object manager Group const * const targetObject = this->getTargetObject( domain, m_objectPath ); diff --git a/src/coreComponents/finiteElement/elementFormulations/unitTests/testConformingVirtualElementOrder1.cpp b/src/coreComponents/finiteElement/elementFormulations/unitTests/testConformingVirtualElementOrder1.cpp index dea9c0437fc..f46495864bb 100644 --- a/src/coreComponents/finiteElement/elementFormulations/unitTests/testConformingVirtualElementOrder1.cpp +++ b/src/coreComponents/finiteElement/elementFormulations/unitTests/testConformingVirtualElementOrder1.cpp @@ -282,17 +282,16 @@ TEST( ConformingVirtualElementOrder1, hexahedra ) GEOS_LOG_RANK_0( "Error description: " << xmlResult.description()); GEOS_LOG_RANK_0( "Error offset: " << xmlResult.offset ); } - xmlWrapper::xmlNode xmlProblemNode = inputFile.getChild( dataRepository::keys::ProblemManager ); GeosxState state( std::make_unique< CommandLineOptions >( g_commandLineOptions ) ); ProblemManager & problemManager = state.getProblemManager(); + xmlWrapper::xmlNode xmlProblemNode = inputFile.getChild( problemManager.getName()); problemManager.processInputFileRecursive( inputFile, xmlProblemNode ); // Open mesh levels DomainPartition & domain = problemManager.getDomainPartition(); - MeshManager & meshManager = problemManager.getGroup< MeshManager >( problemManager.groupKeys - .meshManager ); + MeshManager & meshManager = problemManager.getMeshManager(); meshManager.generateMeshLevels( domain ); MeshLevel & mesh = domain.getMeshBody( 0 ).getBaseDiscretization(); ElementRegionManager & elementManager = mesh.getElemManager(); @@ -335,17 +334,16 @@ TEST( ConformingVirtualElementOrder1, wedges ) GEOS_LOG_RANK_0( "Error description: " << xmlResult.description()); GEOS_LOG_RANK_0( "Error offset: " << xmlResult.offset ); } - xmlWrapper::xmlNode xmlProblemNode = inputFile.getChild( dataRepository::keys::ProblemManager ); GeosxState state( std::make_unique< CommandLineOptions >( g_commandLineOptions ) ); ProblemManager & problemManager = state.getProblemManager(); + xmlWrapper::xmlNode xmlProblemNode = inputFile.getChild( problemManager.getName() ); problemManager.processInputFileRecursive( inputFile, xmlProblemNode ); // Open mesh levels DomainPartition & domain = problemManager.getDomainPartition(); - MeshManager & meshManager = problemManager.getGroup< MeshManager > - ( problemManager.groupKeys.meshManager ); + MeshManager & meshManager = problemManager.getMeshManager(); meshManager.generateMeshLevels( domain ); MeshLevel & mesh = domain.getMeshBody( 0 ).getBaseDiscretization(); ElementRegionManager & elementManager = mesh.getElemManager(); diff --git a/src/coreComponents/finiteVolume/FluxApproximationBase.cpp b/src/coreComponents/finiteVolume/FluxApproximationBase.cpp index fdc182ed828..3b880df29ed 100644 --- a/src/coreComponents/finiteVolume/FluxApproximationBase.cpp +++ b/src/coreComponents/finiteVolume/FluxApproximationBase.cpp @@ -20,7 +20,7 @@ #include "FluxApproximationBase.hpp" -#include "dataRepository/ProblemManagerBase.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "fieldSpecification/FieldSpecificationManager.hpp" #include "fieldSpecification/AquiferBoundaryCondition.hpp" @@ -73,7 +73,7 @@ void FluxApproximationBase::initializePreSubGroups() { GEOS_MARK_FUNCTION; - DomainPartition & domain = getProblemManagerBase( *this ).getDomainPartition(); + DomainPartition & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); domain.forMeshBodies( [&]( MeshBody & meshBody ) { @@ -114,7 +114,7 @@ void FluxApproximationBase::initializePostInitialConditionsPreSubGroups() { GEOS_MARK_FUNCTION; - DomainPartition & domain = getProblemManagerBase( *this ).getDomainPartition(); + DomainPartition & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance(); for( auto const & [meshBodyName, meshBodyRegions] : m_targetRegions ) diff --git a/src/coreComponents/integrationTests/fieldSpecificationTests/testRecursiveFieldApplication.cpp b/src/coreComponents/integrationTests/fieldSpecificationTests/testRecursiveFieldApplication.cpp index e257939aa0c..4b085bb473f 100644 --- a/src/coreComponents/integrationTests/fieldSpecificationTests/testRecursiveFieldApplication.cpp +++ b/src/coreComponents/integrationTests/fieldSpecificationTests/testRecursiveFieldApplication.cpp @@ -82,7 +82,8 @@ TEST( FieldSpecification, Recursive ) // Cell blocks should only be used to define the sub regions. // This scope protection is there to make them disappear from the rest of the test. { - CellBlockManager & cellBlockManager = domain.registerGroup< CellBlockManager >( keys::cellManager ); + CellBlockManager & cellBlockManager = + domain.registerGroup< CellBlockManager >( MeshBody::groupStructKeys::cellManagerString() ); CellBlock & reg0Hex = cellBlockManager.registerCellBlock( "reg0hex" ); reg0Hex.setElementType( geos::ElementType::Hexahedron ); @@ -111,7 +112,7 @@ TEST( FieldSpecification, Recursive ) reg1.generateMesh( cellBlocks ); // The cell block manager should not be used anymore. - domain.deregisterGroup( keys::cellManager ); + domain.deregisterGroup( MeshBody::groupStructKeys::cellManagerString() ); } /// Field Definition diff --git a/src/coreComponents/integrationTests/fluidFlowTests/testCompFlowUtils.hpp b/src/coreComponents/integrationTests/fluidFlowTests/testCompFlowUtils.hpp index c5e2492cb16..81f391551c6 100644 --- a/src/coreComponents/integrationTests/fluidFlowTests/testCompFlowUtils.hpp +++ b/src/coreComponents/integrationTests/fluidFlowTests/testCompFlowUtils.hpp @@ -77,13 +77,12 @@ void setupProblemFromXML( ProblemManager & problemManager, char const * const xm int mpiSize = MpiWrapper::commSize( MPI_COMM_GEOS ); - dataRepository::Group & commandLine = - problemManager.getGroup< dataRepository::Group >( problemManager.groupKeys.commandLine ); + CommandLine & commandLine = problemManager.getCommandLine(); - commandLine.registerWrapper< integer >( problemManager.viewKeys.xPartitionsOverride.key() ). + commandLine.registerWrapper< integer >( commandLine.m_vks.xPartitionsOverride ). setApplyDefaultValue( mpiSize ); - xmlWrapper::xmlNode xmlProblemNode = xmlDocument.getChild( dataRepository::keys::ProblemManager ); + xmlWrapper::xmlNode xmlProblemNode = xmlDocument.getChild( problemManager.getName() ); problemManager.processInputFileRecursive( xmlDocument, xmlProblemNode ); DomainPartition & domain = problemManager.getDomainPartition(); @@ -92,7 +91,7 @@ void setupProblemFromXML( ProblemManager & problemManager, char const * const xm xmlWrapper::xmlNode topLevelNode = xmlProblemNode.child( constitutiveManager.getName().c_str()); constitutiveManager.processInputFileRecursive( xmlDocument, topLevelNode ); - MeshManager & meshManager = problemManager.getGroup< MeshManager >( problemManager.groupKeys.meshManager ); + MeshManager & meshManager = problemManager.getMeshManager(); meshManager.generateMeshLevels( domain ); ElementRegionManager & elementManager = domain.getMeshBody( 0 ).getBaseDiscretization().getElemManager(); diff --git a/src/coreComponents/integrationTests/fluidFlowTests/testReactiveCompositionalMultiphaseOBL.cpp b/src/coreComponents/integrationTests/fluidFlowTests/testReactiveCompositionalMultiphaseOBL.cpp index f5b6c74be36..0db779825f0 100644 --- a/src/coreComponents/integrationTests/fluidFlowTests/testReactiveCompositionalMultiphaseOBL.cpp +++ b/src/coreComponents/integrationTests/fluidFlowTests/testReactiveCompositionalMultiphaseOBL.cpp @@ -477,7 +477,9 @@ class CompositionalMultiphaseFlowTest : public ::testing::Test setupProblemFromXML( state.getProblemManager(), xmlInput ); removeFile( "obl_3comp_static.txt" ); - solver = &state.getProblemManager().getPhysicsSolverManager().getGroup< ReactiveCompositionalMultiphaseOBL >( "compflow" ); + solver = &state.getProblemManager(). + getPhysicsSolverManager(). + getGroup< ReactiveCompositionalMultiphaseOBL >( "compflow" ); DomainPartition & domain = state.getProblemManager().getDomainPartition(); diff --git a/src/coreComponents/integrationTests/fluidFlowTests/testSingleFlowUtils.hpp b/src/coreComponents/integrationTests/fluidFlowTests/testSingleFlowUtils.hpp index 24f57efc242..926b4b52869 100644 --- a/src/coreComponents/integrationTests/fluidFlowTests/testSingleFlowUtils.hpp +++ b/src/coreComponents/integrationTests/fluidFlowTests/testSingleFlowUtils.hpp @@ -63,13 +63,11 @@ void setupProblemFromXML( ProblemManager & problemManager, char const * const xm int mpiSize = MpiWrapper::commSize( MPI_COMM_GEOS ); - dataRepository::Group & commandLine = - problemManager.getGroup< dataRepository::Group >( problemManager.groupKeys.commandLine ); - - commandLine.registerWrapper< integer >( problemManager.viewKeys.xPartitionsOverride.key() ). + CommandLine & commandLine = problemManager.getCommandLine(); + commandLine.registerWrapper< integer >( commandLine.m_vks.xPartitionsOverride ). setApplyDefaultValue( mpiSize ); - xmlWrapper::xmlNode xmlProblemNode = xmlDocument.getChild( dataRepository::keys::ProblemManager ); + xmlWrapper::xmlNode xmlProblemNode = xmlDocument.getChild( problemManager.getName() ); problemManager.processInputFileRecursive( xmlDocument, xmlProblemNode ); DomainPartition & domain = problemManager.getDomainPartition(); @@ -78,7 +76,7 @@ void setupProblemFromXML( ProblemManager & problemManager, char const * const xm xmlWrapper::xmlNode topLevelNode = xmlProblemNode.child( constitutiveManager.getName().c_str()); constitutiveManager.processInputFileRecursive( xmlDocument, topLevelNode ); - MeshManager & meshManager = problemManager.getGroup< MeshManager >( problemManager.groupKeys.meshManager ); + MeshManager & meshManager = problemManager.getMeshManager(); meshManager.generateMeshLevels( domain ); ElementRegionManager & elementManager = domain.getMeshBody( 0 ).getBaseDiscretization().getElemManager(); diff --git a/src/coreComponents/integrationTests/fluidFlowTests/testSinglePhaseReactiveTransportUtils.hpp b/src/coreComponents/integrationTests/fluidFlowTests/testSinglePhaseReactiveTransportUtils.hpp index 2cd58eeb87d..6549b3ea229 100644 --- a/src/coreComponents/integrationTests/fluidFlowTests/testSinglePhaseReactiveTransportUtils.hpp +++ b/src/coreComponents/integrationTests/fluidFlowTests/testSinglePhaseReactiveTransportUtils.hpp @@ -65,13 +65,11 @@ void setupProblemFromXML( ProblemManager & problemManager, char const * const xm int mpiSize = MpiWrapper::commSize( MPI_COMM_GEOS ); - dataRepository::Group & commandLine = - problemManager.getGroup< dataRepository::Group >( problemManager.groupKeys.commandLine ); - - commandLine.registerWrapper< integer >( problemManager.viewKeys.xPartitionsOverride.key() ). + CommandLine & commandLine = problemManager.getCommandLine(); + commandLine.registerWrapper< integer >( commandLine.m_vks.xPartitionsOverride ). setApplyDefaultValue( mpiSize ); - xmlWrapper::xmlNode xmlProblemNode = xmlDocument.getChild( dataRepository::keys::ProblemManager ); + xmlWrapper::xmlNode xmlProblemNode = xmlDocument.getChild( problemManager.getName() ); problemManager.processInputFileRecursive( xmlDocument, xmlProblemNode ); DomainPartition & domain = problemManager.getDomainPartition(); @@ -80,7 +78,7 @@ void setupProblemFromXML( ProblemManager & problemManager, char const * const xm xmlWrapper::xmlNode topLevelNode = xmlProblemNode.child( constitutiveManager.getName().c_str()); constitutiveManager.processInputFileRecursive( xmlDocument, topLevelNode ); - MeshManager & meshManager = problemManager.getGroup< MeshManager >( problemManager.groupKeys.meshManager ); + MeshManager & meshManager = problemManager.getMeshManager(); meshManager.generateMeshLevels( domain ); ElementRegionManager & elementManager = domain.getMeshBody( 0 ).getBaseDiscretization().getElemManager(); diff --git a/src/coreComponents/integrationTests/linearAlgebraTests/testDofManagerUtils.hpp b/src/coreComponents/integrationTests/linearAlgebraTests/testDofManagerUtils.hpp index 02dd0d8090c..022bdd1b0a8 100644 --- a/src/coreComponents/integrationTests/linearAlgebraTests/testDofManagerUtils.hpp +++ b/src/coreComponents/integrationTests/linearAlgebraTests/testDofManagerUtils.hpp @@ -22,6 +22,7 @@ #include "common/DataTypes.hpp" #include "mesh/MeshLevel.hpp" +#include "mainInterface/ProblemManager.hpp" #include @@ -48,17 +49,16 @@ void setupProblemFromXML( ProblemManager * const problemManager, char const * co } int mpiSize = MpiWrapper::commSize( MPI_COMM_GEOS ); - dataRepository::Group & commandLine = - problemManager->getGroup< dataRepository::Group >( problemManager->groupKeys.commandLine ); - commandLine.registerWrapper< integer >( problemManager->viewKeys.xPartitionsOverride.key() ). + CommandLine & commandLine = problemManager->getCommandLine(); + commandLine.registerWrapper< integer >( commandLine.m_vks.xPartitionsOverride ). setApplyDefaultValue( mpiSize ); - xmlWrapper::xmlNode xmlProblemNode = xmlDocument.getChild( dataRepository::keys::ProblemManager ); + xmlWrapper::xmlNode xmlProblemNode = xmlDocument.getChild( problemManager->getName() ); problemManager->processInputFileRecursive( xmlDocument, xmlProblemNode ); // Open mesh levels DomainPartition & domain = problemManager->getDomainPartition(); - MeshManager & meshManager = problemManager->getGroup< MeshManager >( problemManager->groupKeys.meshManager ); + MeshManager & meshManager = problemManager->getMeshManager(); meshManager.generateMeshLevels( domain ); ElementRegionManager & elementManager = domain.getMeshBody( 0 ).getBaseDiscretization().getElemManager(); diff --git a/src/coreComponents/integrationTests/meshTests/testMeshGeneration.cpp b/src/coreComponents/integrationTests/meshTests/testMeshGeneration.cpp index 913dbeeb628..c438e25ba48 100644 --- a/src/coreComponents/integrationTests/meshTests/testMeshGeneration.cpp +++ b/src/coreComponents/integrationTests/meshTests/testMeshGeneration.cpp @@ -106,13 +106,13 @@ class MeshGenerationTest : public ::testing::Test xmlWrapper::xmlResult xmlResult = xmlDocument.loadString( inputStream ); ASSERT_TRUE( xmlResult ); - xmlWrapper::xmlNode xmlProblemNode = xmlDocument.getChild( dataRepository::keys::ProblemManager ); ProblemManager & problemManager = getGlobalState().getProblemManager(); + xmlWrapper::xmlNode xmlProblemNode = xmlDocument.getChild( problemManager.getName() ); problemManager.processInputFileRecursive( xmlDocument, xmlProblemNode ); // Open mesh levels DomainPartition & domain = problemManager.getDomainPartition(); - MeshManager & meshManager = problemManager.getGroup< MeshManager >( problemManager.groupKeys.meshManager ); + MeshManager & meshManager = problemManager.getMeshManager(); meshManager.generateMeshLevels( domain ); ElementRegionManager & elementManager = domain.getMeshBody( 0 ).getBaseDiscretization().getElemManager(); @@ -523,7 +523,7 @@ TEST_F( MeshGenerationTest, highOrderMapsSizes ) ProblemManager & problemManager = getGlobalState().getProblemManager(); DomainPartition & domain = problemManager.getDomainPartition(); MeshBody & meshBody = domain.getMeshBody( 0 ); - MeshManager & meshManager = problemManager.getGroup< MeshManager >( problemManager.groupKeys.meshManager ); + MeshManager & meshManager = problemManager.getMeshManager(); meshManager.generateMeshes( domain ); for( int order = minOrder; order < maxOrder; order++ ) { diff --git a/src/coreComponents/integrationTests/meshTests/testVTKImport.cpp b/src/coreComponents/integrationTests/meshTests/testVTKImport.cpp index a2f13b88748..53b7254e97c 100644 --- a/src/coreComponents/integrationTests/meshTests/testVTKImport.cpp +++ b/src/coreComponents/integrationTests/meshTests/testVTKImport.cpp @@ -84,7 +84,7 @@ void TestMeshImport( string const & meshFilePath, V const & validate, string con // TODO Field import is not tested yet. Proper refactoring needs to be done first. - validate( domain.getMeshBody( "mesh" ).getGroup< CellBlockManagerABC >( keys::cellManager ) ); + validate( domain.getMeshBody( "mesh" ).getCellBlockManager() ); } diff --git a/src/coreComponents/integrationTests/xmlTests/testXMLFile.cpp b/src/coreComponents/integrationTests/xmlTests/testXMLFile.cpp index 8c0fd3aad89..9d7423f3970 100644 --- a/src/coreComponents/integrationTests/xmlTests/testXMLFile.cpp +++ b/src/coreComponents/integrationTests/xmlTests/testXMLFile.cpp @@ -192,8 +192,8 @@ TEST( testXML, testXMLFileLines ) { problemManager.parseCommandLineInput(); - Group & commandLine = problemManager.getGroup( problemManager.groupKeys.commandLine ); - string const & inputFileName = commandLine.getReference< string >( problemManager.viewKeys.inputFileName ); + CommandLine & commandLine = problemManager.getCommandLine(); + string const & inputFileName = commandLine.getReference< string >( commandLine.m_vks.inputFileName ); xmlDoc.loadFile( inputFileName, true ); problemManager.parseXMLDocument( xmlDoc ); } diff --git a/src/coreComponents/mainInterface/GeosxState.hpp b/src/coreComponents/mainInterface/GeosxState.hpp index d9a5be2dafe..7f3c86a04d4 100644 --- a/src/coreComponents/mainInterface/GeosxState.hpp +++ b/src/coreComponents/mainInterface/GeosxState.hpp @@ -50,7 +50,6 @@ namespace geos namespace dataRepository { class Group; -class ProblemManagerBase; } class ProblemManager; diff --git a/src/coreComponents/mesh/DomainPartition.cpp b/src/coreComponents/mesh/DomainPartition.cpp index cd984e13d61..2ad00414fcc 100644 --- a/src/coreComponents/mesh/DomainPartition.cpp +++ b/src/coreComponents/mesh/DomainPartition.cpp @@ -57,10 +57,12 @@ DomainPartition::~DomainPartition() void DomainPartition::initializationOrder( string_array & order ) { + constitutive::ConstitutiveManager const & constitutiveManager = getConstitutiveManager(); + set< string > usedNames; { - order.emplace_back( string( ProblemViewKeys::constitutiveManager() ) ); - usedNames.insert( ProblemViewKeys::constitutiveManager() ); + order.emplace_back( string( constitutiveManager.getName() ) ); + usedNames.insert( constitutiveManager.getName() ); } { diff --git a/src/coreComponents/mesh/DomainPartition.hpp b/src/coreComponents/mesh/DomainPartition.hpp index fb8eeb62a75..01d39e31ef4 100644 --- a/src/coreComponents/mesh/DomainPartition.hpp +++ b/src/coreComponents/mesh/DomainPartition.hpp @@ -24,7 +24,6 @@ #include "constitutive/ConstitutiveManager.hpp" #include "dataRepository/Group.hpp" #include "dataRepository/ProblemRepository.hpp" -#include "dataRepository/ProblemViewKeys.hpp" #include "discretizationMethods/NumericalMethodsManager.hpp" #include "mesh/MeshBody.hpp" #include "mesh/mpiCommunications/NeighborCommunicator.hpp" diff --git a/src/coreComponents/mesh/MeshBody.cpp b/src/coreComponents/mesh/MeshBody.cpp index 17d558f0fb7..d8d9a686dd2 100644 --- a/src/coreComponents/mesh/MeshBody.cpp +++ b/src/coreComponents/mesh/MeshBody.cpp @@ -51,6 +51,7 @@ MeshLevel & MeshBody::createMeshLevel( string const & sourceLevelName, return m_meshLevels.registerGroup( newLevelName, std::make_unique< MeshLevel >( newLevelName, this, + getCellBlockManager(), sourceMeshLevel, order ) ); } diff --git a/src/coreComponents/mesh/MeshLevel.cpp b/src/coreComponents/mesh/MeshLevel.cpp index bd288c826c4..da7e8974a7f 100644 --- a/src/coreComponents/mesh/MeshLevel.cpp +++ b/src/coreComponents/mesh/MeshLevel.cpp @@ -111,6 +111,7 @@ MeshLevel::MeshLevel( string const & name, MeshLevel::MeshLevel( string const & name, Group * const meshBody, + CellBlockManagerABC & cellBlockManager, MeshLevel const & source, int const order ): MeshLevel( name, meshBody ) @@ -244,8 +245,6 @@ MeshLevel::MeshLevel( string const & name, } ); - CellBlockManagerABC & cellBlockManager = meshBody->getGroup< CellBlockManagerABC >( keys::cellManager ); - cellBlockManager.generateHighOrderMaps( order, maxVertexGlobalID, maxEdgeGlobalID, diff --git a/src/coreComponents/mesh/MeshLevel.hpp b/src/coreComponents/mesh/MeshLevel.hpp index 085ab9519ee..9850a8c246e 100644 --- a/src/coreComponents/mesh/MeshLevel.hpp +++ b/src/coreComponents/mesh/MeshLevel.hpp @@ -66,11 +66,13 @@ class MeshLevel : public dataRepository::Group * @brief Constructor for the MeshLevel object. * @param[in] name the name of the MeshLevel object in the repository * @param[in] parent the parent group of the MeshLevel object being constructed + * @param[in] cellBlockManager the cellBlockManager of the destination MeshBody * @param[in] source The source MeshLevel to build the new one from * @param[in] order The order of the MeshLevel */ MeshLevel( string const & name, Group * const parent, + CellBlockManagerABC & cellBlockManager, MeshLevel const & source, int const order ); diff --git a/src/coreComponents/mesh/MeshManager.cpp b/src/coreComponents/mesh/MeshManager.cpp index 2a67aa8db22..431c4664753 100644 --- a/src/coreComponents/mesh/MeshManager.cpp +++ b/src/coreComponents/mesh/MeshManager.cpp @@ -68,7 +68,7 @@ void MeshManager::generateMeshes( DomainPartition & domain ) { MeshBody & meshBody = domain.getMeshBodies().registerGroup< MeshBody >( meshGen.getName() ); meshBody.createMeshLevel( 0 ); - SpatialPartition & partition = dynamic_cast< SpatialPartition & >(domain.getReference< PartitionBase >( keys::partitionManager ) ); + SpatialPartition & partition = dynamic_cast< SpatialPartition & >( domain.getPartitionManager() ); meshGen.generateMesh( meshBody, partition ); diff --git a/src/coreComponents/mesh/generators/MeshGeneratorBase.cpp b/src/coreComponents/mesh/generators/MeshGeneratorBase.cpp index 6f6516d7de0..72d5eb54c9e 100644 --- a/src/coreComponents/mesh/generators/MeshGeneratorBase.cpp +++ b/src/coreComponents/mesh/generators/MeshGeneratorBase.cpp @@ -78,7 +78,8 @@ void MeshGeneratorBase::generateMesh( Group & parent, SpatialPartition & partiti MeshBody & meshBody = dynamic_cast< MeshBody & >( parent ); if( meshBody.hasParticles() ) { - ParticleBlockManager & particleBlockManager = parent.registerGroup< ParticleBlockManager >( keys::particleManager ); + ParticleBlockManager & particleBlockManager = + parent.registerGroup< ParticleBlockManager >( MeshBody::groupStructKeys::particleManagerString() ); MeshLevel & meshLevel0 = meshBody.getBaseDiscretization(); ParticleManager & particleManager = meshLevel0.getParticleManager(); @@ -87,7 +88,8 @@ void MeshGeneratorBase::generateMesh( Group & parent, SpatialPartition & partiti } else { - CellBlockManager & cellBlockManager = parent.registerGroup< CellBlockManager >( keys::cellManager ); + CellBlockManager & cellBlockManager = + parent.registerGroup< CellBlockManager >( MeshBody::groupStructKeys::cellManagerString() ); fillCellBlockManager( cellBlockManager, partition ); diff --git a/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp b/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp index 154a4b38e7e..a3bb5c372a2 100644 --- a/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp +++ b/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp @@ -20,7 +20,7 @@ #include "VTKMeshGenerator.hpp" #include "common/DataTypes.hpp" -#include "dataRepository/ProblemManagerBase.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "mesh/ExternalDataSourceManager.hpp" #include "mesh/LogLevelsInfo.hpp" #include "mesh/generators/VTKFaceBlockUtilities.hpp" @@ -119,7 +119,7 @@ void VTKMeshGenerator::postInputInitialization() if( !m_dataSourceName.empty()) { - ExternalDataSourceManager & externalDataManager = getProblemManagerBase( *this ).getExternalDataSourceManager(); + ExternalDataSourceManager & externalDataManager = ProblemRepository::get( *this ).getManager< ExternalDataSourceManager >(); m_dataSource = externalDataManager.getGroupPointer< VTKHierarchicalDataSource >( m_dataSourceName ); diff --git a/src/coreComponents/mesh/simpleGeometricObjects/SimpleGeometricObjectBase.cpp b/src/coreComponents/mesh/simpleGeometricObjects/SimpleGeometricObjectBase.cpp index 6c9d69aeec6..38283da91bf 100644 --- a/src/coreComponents/mesh/simpleGeometricObjects/SimpleGeometricObjectBase.cpp +++ b/src/coreComponents/mesh/simpleGeometricObjects/SimpleGeometricObjectBase.cpp @@ -19,7 +19,7 @@ #include "SimpleGeometricObjectBase.hpp" #include "dataRepository/InputFlags.hpp" -#include "dataRepository/ProblemManagerBase.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "mesh/DomainPartition.hpp" namespace geos @@ -50,7 +50,7 @@ void SimpleGeometricObjectBase::postInputInitialization() { // determine m_epsilon m_epsilon = std::numeric_limits< real64 >::max(); - DomainPartition & domain = getProblemManagerBase( *this ).getDomainPartition(); + DomainPartition & domain = dataRepository::ProblemRepository::get( *this ).getManager< DomainPartition >(); domain.forMeshBodies( [&]( MeshBody const & meshBody ) { m_epsilon = std::min( m_epsilon, 1e-6 * meshBody.getGlobalLengthScale() ); diff --git a/src/coreComponents/physicsSolvers/FieldStatisticsBase.hpp b/src/coreComponents/physicsSolvers/FieldStatisticsBase.hpp index 74da5dfee3d..6756add7343 100644 --- a/src/coreComponents/physicsSolvers/FieldStatisticsBase.hpp +++ b/src/coreComponents/physicsSolvers/FieldStatisticsBase.hpp @@ -20,7 +20,7 @@ #ifndef SRC_CORECOMPONENTS_PHYSICSSOLVERS_FIELDSTATISTICSBASE_HPP_ #define SRC_CORECOMPONENTS_PHYSICSSOLVERS_FIELDSTATISTICSBASE_HPP_ -#include "dataRepository/ProblemManagerBase.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "events/tasks/TaskBase.hpp" #include "physicsSolvers/PhysicsSolverManager.hpp" #include "mesh/MeshLevel.hpp" @@ -97,7 +97,7 @@ class FieldStatisticsBase : public TaskBase void postInputInitialization() override { PhysicsSolverManager & physicsSolverManager = - dataRepository::getProblemManagerBase( *this ).getPhysicsSolverManager(); + dataRepository::ProblemRepository::get( *this ).template getManager< PhysicsSolverManager >(); m_solver = physicsSolverManager.getGroupPointer< SOLVER >( m_solverName ); GEOS_THROW_IF( m_solver == nullptr, diff --git a/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp b/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp index 0e04649306e..8111e2dbfa3 100644 --- a/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp @@ -20,7 +20,7 @@ #include "codingUtilities/RTTypes.hpp" #include "common/format/EnumStrings.hpp" #include "dataRepository/Group.hpp" -#include "dataRepository/ProblemManagerBase.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "physicsSolvers/LogLevelsInfo.hpp" #include "common/format/LogPart.hpp" #include "common/TimingMacros.hpp" @@ -161,12 +161,12 @@ PhysicsSolverBase::~PhysicsSolverBase() = default; DomainPartition & PhysicsSolverBase::getDomainPartition() { - return getProblemManagerBase( *this ).getDomainPartition(); + return ProblemRepository::get( *this ).getManager< DomainPartition >(); } DomainPartition const & PhysicsSolverBase::getDomainPartition() const { - return getProblemManagerBase( *this ).getDomainPartition(); + return ProblemRepository::get( *this ).getManager< DomainPartition >(); } void PhysicsSolverBase::initialize_postMeshGeneration() diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsTask.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsTask.cpp index 281dd658161..8732a21045a 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsTask.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsTask.cpp @@ -20,6 +20,7 @@ #include "CompositionalMultiphaseStatisticsTask.hpp" #include "constitutive/fluid/multifluid/MultiFluidBase.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "physicsSolvers/LogLevelsInfo.hpp" #include "physicsSolvers/fluidFlow/LogLevelsInfo.hpp" #include "physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.hpp" @@ -119,7 +120,7 @@ void StatsTask::prepareFluidMetaData() { using namespace constitutive; - ConstitutiveManager const & constitutiveManager = getProblemManagerBase( *this ).getConstitutiveManager(); + ConstitutiveManager const & constitutiveManager = ProblemRepository::get( *this ).getManager< ConstitutiveManager >(); MultiFluidBase const & fluid = constitutiveManager.getGroup< MultiFluidBase >( m_solver->referenceFluidModelName() ); m_fluid.m_numPhases = fluid.numFluidPhases(); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/StencilDataCollection.cpp b/src/coreComponents/physicsSolvers/fluidFlow/StencilDataCollection.cpp index f94bf37302e..65885ca92cc 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/StencilDataCollection.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/StencilDataCollection.cpp @@ -20,11 +20,13 @@ #include "StencilDataCollection.hpp" #include "common/Units.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "finiteVolume/FluxApproximationBase.hpp" #include "finiteVolume/TwoPointFluxApproximation.hpp" #include "constitutive/permeability/PermeabilityBase.hpp" #include "constitutive/permeability/PermeabilityFields.hpp" #include "mesh/MeshLevel.hpp" +#include "physicsSolvers/PhysicsSolverManager.hpp" #include "physicsSolvers/fluidFlow/FlowSolverBase.hpp" #include "physicsSolvers/fluidFlow/LogLevelsInfo.hpp" #include "physicsSolvers/fluidFlow/StencilAccessors.hpp" @@ -62,10 +64,10 @@ StencilDataCollection::StencilDataCollection( const string & name, void StencilDataCollection::postInputInitialization() { - Group & problemManager = this->getGroupByPath( "/Problem" ); + ProblemRepository & problem = ProblemRepository::get( *this ); { // find targeted solver - Group & physicsSolverManager = problemManager.getGroup( "Solvers" ); + PhysicsSolverManager & physicsSolverManager = problem.getManager< PhysicsSolverManager >(); m_solver = physicsSolverManager.getGroupPointer< FlowSolverBase >( m_solverName ); GEOS_THROW_IF( m_solver == nullptr, @@ -74,8 +76,7 @@ void StencilDataCollection::postInputInitialization() } { // find mesh & discretization -// DomainPartition & domain = problemManager.getDomainPartition(); - DomainPartition & domain = problemManager.getGroup< DomainPartition >( "domain" ); + DomainPartition & domain = problem.getManager< DomainPartition >(); MeshBody const & meshBody = domain.getMeshBody( m_meshName ); m_meshLevel = &meshBody.getBaseDiscretization(); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp index a66f6510672..93d58add128 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp @@ -216,7 +216,7 @@ void CompositionalMultiphaseWell::registerWellDataOnMesh( WellElementSubRegion & { - DomainPartition const & domain = getDomainPartition(); + DomainPartition const & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); ConstitutiveManager const & cm = domain.getConstitutiveManager(); setConstitutiveNames ( subRegion ); if( m_referenceFluidModelName.empty() ) diff --git a/src/coreComponents/physicsSolvers/multiphysics/FieldApplicator.cpp b/src/coreComponents/physicsSolvers/multiphysics/FieldApplicator.cpp index 7212cf946cd..1e1c23c6d8d 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/FieldApplicator.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/FieldApplicator.cpp @@ -14,7 +14,7 @@ */ #include "FieldApplicator.hpp" -#include "dataRepository/ProblemManagerBase.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "events/tasks/TasksManager.hpp" #include "fieldSpecification/FieldSpecification.hpp" #include "fieldSpecification/FieldSpecificationImpl.hpp" @@ -107,7 +107,7 @@ FieldApplicator:: // Find the flow solver to delegate initialization to. // Use m_solverName if provided, otherwise find the first FlowSolverBase. FlowSolverBase * flowSolver = nullptr; - PhysicsSolverManager & solversGroup = getProblemManagerBase( *this ).getPhysicsSolverManager(); + PhysicsSolverManager & solversGroup = ProblemRepository::get( *this ).getManager< PhysicsSolverManager >(); if( !m_solverName.empty() ) { @@ -241,7 +241,7 @@ void FieldApplicator::initializeSubRegionFluidState( DomainPartition & domain, E // Use m_solverName if provided, otherwise search all solvers. CompositionalMultiphaseBase * flowSolver = nullptr; - PhysicsSolverManager & solversGroup = getProblemManagerBase( *this ).getPhysicsSolverManager(); + PhysicsSolverManager & solversGroup = ProblemRepository::get( *this ).getManager< PhysicsSolverManager >(); if( !m_solverName.empty() ) { diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsInitialization.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsInitialization.cpp index 5c8aa7d237e..f49939d2b5f 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsInitialization.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsInitialization.cpp @@ -26,6 +26,7 @@ #include "physicsSolvers/solidMechanics/contact/SolidMechanicsEmbeddedFractures.hpp" #include "physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.hpp" #include "physicsSolvers/LogLevelsInfo.hpp" +#include "dataRepository/ProblemRepository.hpp" namespace geos { @@ -67,8 +68,8 @@ SolidMechanicsInitialization< SOLID_SOLVER >::~SolidMechanicsInitialization() = template< typename SOLID_SOLVER > void SolidMechanicsInitialization< SOLID_SOLVER >::postInputInitialization() { - ProblemManagerBase & problemManager = getProblemManagerBase( *this ); - PhysicsSolverManager & physicsSolverManager = problemManager.getPhysicsSolverManager(); + ProblemRepository & problemManager = ProblemRepository::get( *this ); + PhysicsSolverManager & physicsSolverManager = problemManager.getManager< PhysicsSolverManager >(); GEOS_THROW_IF( !physicsSolverManager.hasGroup( m_solidSolverName ), GEOS_FMT( "{}: {} solver named {} not found", @@ -81,7 +82,7 @@ void SolidMechanicsInitialization< SOLID_SOLVER >::postInputInitialization() if( !m_solidMechanicsStatisticsName.empty() ) { - TasksManager & tasksManager = problemManager.getTasksManager(); + TasksManager & tasksManager = problemManager.getManager< TasksManager >(); GEOS_THROW_IF( !tasksManager.hasGroup( m_solidMechanicsStatisticsName ), GEOS_FMT( "{}: {} task named {} not found", diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp index 80e3cc349a7..7f19a2cfe38 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp @@ -200,7 +200,7 @@ void SolidMechanicsLagrangianFEM::registerDataOnMesh( Group & meshBodies ) nodes.registerField< solidMechanics::incrementalDisplacement >( getName() ). reference().resizeDimension< 1 >( 3 ); - OutputManager const & outputs = getProblemManagerBase( *this ).getOutputManager(); + Group const & outputs = ProblemRepository::get( *this ).getManager< OutputManager >(); if( m_timeIntegrationOption != TimeIntegrationOption::QuasiStatic || outputs.hasSubGroupOfType< ChomboIO >() ) { nodes.registerField< solidMechanics::velocity >( getName() ). diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp index 52ed0af0e34..f358e4d81eb 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp @@ -30,6 +30,7 @@ #include "common/TimingMacros.hpp" #include "constitutive/ConstitutiveManager.hpp" #include "constitutive/contact/FrictionBase.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "finiteElement/FiniteElementDiscretizationManager.hpp" #include "finiteElement/FiniteElementDiscretization.hpp" #include "finiteElement/Kinematics.h" @@ -469,7 +470,7 @@ void SolidMechanicsMPM::initializePreSubGroups() { PhysicsSolverBase::initializePreSubGroups(); - DomainPartition & domain = getProblemManagerBase( *this ).getDomainPartition(); + DomainPartition & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); Group & meshBodies = domain.getMeshBodies(); @@ -927,7 +928,7 @@ real64 SolidMechanicsMPM::explicitStep( real64 const & time_n, //####################################################################################### solverProfiling( "Get spatial partition, get node and particle managers. Resize m_iComm." ); //####################################################################################### - SpatialPartition & partition = dynamic_cast< SpatialPartition & >(domain.getReference< PartitionBase >( keys::partitionManager ) ); + SpatialPartition & partition = dynamic_cast< SpatialPartition & >( domain.getPartitionManager() ); // ***** We assume that there are exactly two mesh bodies, and that one has particles and one does not. ***** Group & meshBodies = domain.getMeshBodies(); diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp index c7bfb3264cc..81680426123 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsStateReset.cpp @@ -19,7 +19,7 @@ #include "SolidMechanicsStateReset.hpp" -#include "dataRepository/ProblemManagerBase.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "physicsSolvers/PhysicsSolverManager.hpp" #include "physicsSolvers/solidMechanics/contact/ContactFields.hpp" #include "physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.hpp" @@ -63,7 +63,7 @@ SolidMechanicsStateReset::~SolidMechanicsStateReset() void SolidMechanicsStateReset::postInputInitialization() { - PhysicsSolverManager & physicsSolverManager = getProblemManagerBase( *this ).getPhysicsSolverManager(); + PhysicsSolverManager & physicsSolverManager = ProblemRepository::get( *this ).getManager< PhysicsSolverManager >(); GEOS_THROW_IF( !physicsSolverManager.hasGroup( m_solidSolverName ), GEOS_FMT( "physics solver named {} not found", m_solidSolverName ), diff --git a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.cpp b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.cpp index 58e97585853..d86d1c659ae 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.cpp @@ -38,9 +38,10 @@ #include "constitutive/solid/PorousSolid.hpp" #include "constitutive/solid/SolidFields.hpp" #include "physicsSolvers/solidMechanics/contact/kernels/SolidMechanicsALMContactPorousKernelsDispatchTypeList.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "finiteElement/FiniteElementDiscretization.hpp" #include "mesh/DomainPartition.hpp" -#include "dataRepository/ProblemManagerBase.hpp" +#include "dataRepository/ProblemRepository.hpp" #include @@ -194,7 +195,7 @@ void SolidMechanicsAugmentedLagrangianContact::initializePostInitialConditionsPr { ContactSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = getProblemManagerBase( *this ).getDomainPartition(); + DomainPartition & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); validateTetrahedralQuadrature( domain.getMeshBodies() ); } @@ -203,7 +204,7 @@ void SolidMechanicsAugmentedLagrangianContact::validateTetrahedralQuadrature( Gr string const discretizationName = getDiscretizationName(); NumericalMethodsManager const & numericalMethodManager = - getProblemManagerBase( *this ).getDomainPartition().getNumericalMethodManager(); + ProblemRepository::get( *this ).getManager< NumericalMethodsManager >(); FiniteElementDiscretizationManager const & feDiscretizationManager = numericalMethodManager.getFiniteElementDiscretizationManager(); FiniteElementDiscretization const & feDiscretization = @@ -329,7 +330,7 @@ void SolidMechanicsAugmentedLagrangianContact::postInputInitialization() { ContactSolverBase::postInputInitialization(); - DomainPartition & domain = getProblemManagerBase( *this ).getDomainPartition(); + DomainPartition & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); NumericalMethodsManager const & numericalMethodManager = domain.getNumericalMethodManager(); FiniteElementDiscretizationManager const & feDiscretizationManager = numericalMethodManager.getFiniteElementDiscretizationManager(); diff --git a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp index d04519ce1d6..91e49e4e1db 100644 --- a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp +++ b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp @@ -19,7 +19,7 @@ #include "SurfaceGenerator.hpp" -#include "dataRepository/ProblemManagerBase.hpp" +#include "dataRepository/ProblemRepository.hpp" #include "mesh/mpiCommunications/CommunicationTools.hpp" #include "mesh/mpiCommunications/NeighborCommunicator.hpp" #include "mesh/mpiCommunications/SpatialPartition.hpp" @@ -287,7 +287,7 @@ void SurfaceGenerator::registerDataOnMesh( Group & meshBodies ) // TODO: handle this in registerField(). faceManager.getField< surfaceGeneration::K_IC >().resizeDimension< 1 >( 3 ); - FieldSpecificationManager & fsm = getProblemManagerBase( *this ).getFieldSpecificationManager(); + FieldSpecificationManager & fsm = ProblemRepository::get( *this ).getManager< FieldSpecificationManager >(); fsm.setIsSurfaceGenerationCase( true ); } ); @@ -481,7 +481,7 @@ real64 SurfaceGenerator::solverStep( real64 const & time_n, MeshLevel & meshLevel, string_array const & ) { - SpatialPartition & partition = dynamicCast< SpatialPartition & >( domain.getReference< PartitionBase >( dataRepository::keys::partitionManager ) ); + SpatialPartition & partition = dynamicCast< SpatialPartition & >( domain.getPartitionManager() ); int const tileColor=partition.getColor(); int const numTileColorsLocal=partition.numColor(); int const numTileColors = MpiWrapper::allReduce( numTileColorsLocal, MpiWrapper::Reduction::Max ); diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp index 27d498ae4cf..d9781baf44b 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp @@ -228,7 +228,7 @@ void AcousticWaveEquationSEM::precomputeSourceAndReceiverTerm( MeshLevel & baseM bool useSourceWaveletTables = m_useSourceWaveletTables; //Correct size for sourceValue - EventManager const & event = getProblemManagerBase( *this ).getEventManager(); + EventManager const & event = ProblemRepository::get( *this ).getManager< EventManager >(); real64 const & maxTime = event.getReference< real64 >( EventManager::viewKeyStruct::maxTimeString() ); real64 const & minTime = event.getReference< real64 >( EventManager::viewKeyStruct::minTimeString() ); real64 dt = 0; @@ -447,7 +447,7 @@ void AcousticWaveEquationSEM::initializePostInitialConditionsPreSubGroups() //We use the timeStep defined inside the xml else if( m_timestepStabilityLimit==0 ) { - EventManager const & event = getProblemManagerBase( *this ).getEventManager(); + EventManager const & event = ProblemRepository::get( *this ).getManager< EventManager >(); for( localIndex numSubEvent = 0; numSubEvent < event.numSubGroups(); ++numSubEvent ) { EventBase const * subEvent = static_cast< EventBase const * >( event.getSubGroups()[numSubEvent] ); @@ -1115,7 +1115,7 @@ real64 AcousticWaveEquationSEM::explicitStepBackward( real64 const & time_n, p_nm1[a] = (p_np1[a] - 2*p_n[a] + p_nm1[a]) / pow( dt, 2 ); } ); - EventManager const & event = getProblemManagerBase( *this ).getEventManager(); + EventManager const & event = ProblemRepository::get( *this ).getManager< EventManager >(); real64 const & maxTime = event.getReference< real64 >( EventManager::viewKeyStruct::maxTimeString() ); int const maxCycle = int(round( maxTime / dt )); @@ -1292,7 +1292,7 @@ void AcousticWaveEquationSEM::computeUnknowns( real64 const & time_n, } //Modification of cycleNember useful when minTime < 0 - EventManager const & event = getProblemManagerBase( *this ).getEventManager(); + EventManager const & event = ProblemRepository::get( *this ).getManager< EventManager >(); real64 const & minTime = event.getReference< real64 >( EventManager::viewKeyStruct::minTimeString() ); //localIndex const cycleNumber = time_n/dt; integer const cycleForSource = int(round( -minTime / dt + cycleNumber )); diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp index 58027370056..340543ed2c4 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp @@ -486,7 +486,7 @@ void ElasticWaveEquationSEM::initializePostInitialConditionsPreSubGroups() //We use the timeStep defined inside the xml else if( m_timestepStabilityLimit==0 ) { - EventManager const & event = getProblemManagerBase( *this ).getEventManager(); + EventManager const & event = ProblemRepository::get( *this ).getManager< EventManager >(); for( localIndex numSubEvent = 0; numSubEvent < event.numSubGroups(); ++numSubEvent ) { EventBase const * subEvent = static_cast< EventBase const * >( event.getSubGroups()[numSubEvent] ); diff --git a/src/coreComponents/physicsSolvers/wavePropagation/shared/WaveSolverBase.cpp b/src/coreComponents/physicsSolvers/wavePropagation/shared/WaveSolverBase.cpp index 53498c7a25c..fc9f7ea5a85 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/shared/WaveSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/shared/WaveSolverBase.cpp @@ -20,7 +20,6 @@ #include "WaveSolverBase.hpp" -#include "dataRepository/KeyNames.hpp" #include "finiteElement/FiniteElementDiscretization.hpp" #include "physicsSolvers/wavePropagation/LogLevelsInfo.hpp" @@ -406,7 +405,7 @@ void WaveSolverBase::postInputInitialization() "Invalid number of physical coordinates for the receivers", InputError, getDataContext() ); - EventManager const & event = getProblemManagerBase( *this ).getEventManager(); + EventManager const & event = ProblemRepository::get( *this ).getManager< EventManager >(); real64 const & maxTime = event.getReference< real64 >( EventManager::viewKeyStruct::maxTimeString() ); if( m_dtSeismoTrace > 0 ) From 05f1a4050fe3e4cb2302978c56aab8640234daae Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 14 Aug 2026 18:06:58 +0200 Subject: [PATCH 08/13] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20allow=20shorter=20(e?= =?UTF-8?q?quivalent)=20syntax?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataRepository/ProblemRepository.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/coreComponents/dataRepository/ProblemRepository.hpp b/src/coreComponents/dataRepository/ProblemRepository.hpp index b99ba8b29f6..57aeb64927d 100644 --- a/src/coreComponents/dataRepository/ProblemRepository.hpp +++ b/src/coreComponents/dataRepository/ProblemRepository.hpp @@ -80,6 +80,20 @@ class ProblemRepository : public ProblemRepositoryABC template< typename ManagerType > ManagerType const & getManager() const; + /** + * @copydoc getManager() + */ + template< typename ManagerType > + static ManagerType const & getManager( Group & group ) + { return ProblemRepository::get( group ).getManager< ManagerType >(); } + + /** + * @copydoc getManager() + */ + template< typename ManagerType > + static ManagerType const & getManager( Group const & group ) + { return ProblemRepository::get( group ).getManager< ManagerType >(); } + /** * @return the root Group which contain all the problem data-repository */ From 556aac0132e4899d10b51c93757b918289094bb1 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Fri, 14 Aug 2026 18:09:49 +0200 Subject: [PATCH 09/13] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20apply=20shorten=20sy?= =?UTF-8?q?ntax=20(few=20places)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/coreComponents/dataRepository/ProblemRepository.hpp | 6 +++--- src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp | 2 +- src/coreComponents/fileIO/python/PyVTKOutput.cpp | 2 +- src/coreComponents/mesh/DomainPartition.hpp | 4 ++-- .../solidMechanics/SolidMechanicsLagrangianFEM.cpp | 2 +- .../physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp | 2 +- .../contact/SolidMechanicsAugmentedLagrangianContact.cpp | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/coreComponents/dataRepository/ProblemRepository.hpp b/src/coreComponents/dataRepository/ProblemRepository.hpp index 57aeb64927d..f7bf963ec44 100644 --- a/src/coreComponents/dataRepository/ProblemRepository.hpp +++ b/src/coreComponents/dataRepository/ProblemRepository.hpp @@ -32,8 +32,8 @@ namespace dataRepository * @brief Base class for the problem data-repository repository, gives access to all the roots Groups. * Usage examples: * - to consult other managers: - * * from a FS instance: ProblemRepository::get( myFieldSpec ).getManager< FunctionManager >() - * * form a solver instance: ProblemRepository::get( mySolver ).getManager< FieldSpecificationManager >() + * * from a FS instance: ProblemRepository::getManager< FunctionManager >( myFieldSpec ) + * * form a solver instance: ProblemRepository::getManager< FieldSpecificationManager >( mySolver ) * - to consult data from the ProblemManager (mainInterface / high-level testing): * * get the physics solvers manager: problemManager.getManager< PhysicsSolverManager >() * * get the CommandLine Group: problemManager.getManager< CommandLine >() @@ -84,7 +84,7 @@ class ProblemRepository : public ProblemRepositoryABC * @copydoc getManager() */ template< typename ManagerType > - static ManagerType const & getManager( Group & group ) + static ManagerType & getManager( Group & group ) { return ProblemRepository::get( group ).getManager< ManagerType >(); } /** diff --git a/src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp b/src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp index e8ece8c6103..4bc7bb1ac94 100644 --- a/src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp +++ b/src/coreComponents/fileIO/Outputs/TimeHistoryOutput.cpp @@ -131,7 +131,7 @@ void TimeHistoryOutput::initializePostInitialConditionsPostSubGroups() HDFFile( outputFile, (m_recordCount == 0), true, MPI_COMM_GEOS ); } - DomainPartition & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); + DomainPartition & domain = ProblemRepository::getManager< DomainPartition >( *this ); GEOS_LOG_LEVEL_BY_RANK( logInfo::DataCollectorInitialization, GEOS_FMT( "TimeHistory: '{}' initializing data collectors.", this->getName() ) ); for( auto collectorPath : m_collectorPaths ) diff --git a/src/coreComponents/fileIO/python/PyVTKOutput.cpp b/src/coreComponents/fileIO/python/PyVTKOutput.cpp index 7837ef4733a..572627a6b2b 100644 --- a/src/coreComponents/fileIO/python/PyVTKOutput.cpp +++ b/src/coreComponents/fileIO/python/PyVTKOutput.cpp @@ -95,7 +95,7 @@ static PyObject * output( PyVTKOutput * self, PyObject * args ) return nullptr; } - DomainPartition & domain = dataRepository::ProblemRepository::get( *self->group ).getManager< DomainPartition >(); + DomainPartition & domain = dataRepository::ProblemRepository::getManager< DomainPartition >( *self->group ); try { diff --git a/src/coreComponents/mesh/DomainPartition.hpp b/src/coreComponents/mesh/DomainPartition.hpp index 01d39e31ef4..3a4d4a93cc8 100644 --- a/src/coreComponents/mesh/DomainPartition.hpp +++ b/src/coreComponents/mesh/DomainPartition.hpp @@ -155,13 +155,13 @@ class DomainPartition : public dataRepository::Group * @brief @return Return a reference to const NumericalMethodsManager from ProblemManager */ NumericalMethodsManager const & getNumericalMethodManager() const - { return dataRepository::ProblemRepository::get( *this ).getManager< NumericalMethodsManager >(); } + { return dataRepository::ProblemRepository::getManager< NumericalMethodsManager >( *this ); } /** * @brief @return Return a reference to NumericalMethodsManager from ProblemManager */ NumericalMethodsManager & getNumericalMethodManager() - { return dataRepository::ProblemRepository::get( *this ).getManager< NumericalMethodsManager >(); } + { return dataRepository::ProblemRepository::getManager< NumericalMethodsManager >( *this ); } /** * @return Get the global partition. diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp index 7f19a2cfe38..f35c7d687bc 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp @@ -200,7 +200,7 @@ void SolidMechanicsLagrangianFEM::registerDataOnMesh( Group & meshBodies ) nodes.registerField< solidMechanics::incrementalDisplacement >( getName() ). reference().resizeDimension< 1 >( 3 ); - Group const & outputs = ProblemRepository::get( *this ).getManager< OutputManager >(); + Group const & outputs = ProblemRepository::getManager< OutputManager >( *this ); if( m_timeIntegrationOption != TimeIntegrationOption::QuasiStatic || outputs.hasSubGroupOfType< ChomboIO >() ) { nodes.registerField< solidMechanics::velocity >( getName() ). diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp index f358e4d81eb..0acdf0cc022 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp @@ -470,7 +470,7 @@ void SolidMechanicsMPM::initializePreSubGroups() { PhysicsSolverBase::initializePreSubGroups(); - DomainPartition & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); + DomainPartition & domain = ProblemRepository::getManager< DomainPartition >( *this ); Group & meshBodies = domain.getMeshBodies(); diff --git a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.cpp b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.cpp index d86d1c659ae..87556209c4d 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.cpp @@ -195,7 +195,7 @@ void SolidMechanicsAugmentedLagrangianContact::initializePostInitialConditionsPr { ContactSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); + DomainPartition & domain = ProblemRepository::getManager< DomainPartition >( *this ); validateTetrahedralQuadrature( domain.getMeshBodies() ); } @@ -204,7 +204,7 @@ void SolidMechanicsAugmentedLagrangianContact::validateTetrahedralQuadrature( Gr string const discretizationName = getDiscretizationName(); NumericalMethodsManager const & numericalMethodManager = - ProblemRepository::get( *this ).getManager< NumericalMethodsManager >(); + ProblemRepository::getManager< NumericalMethodsManager >( *this ); FiniteElementDiscretizationManager const & feDiscretizationManager = numericalMethodManager.getFiniteElementDiscretizationManager(); FiniteElementDiscretization const & feDiscretization = @@ -330,7 +330,7 @@ void SolidMechanicsAugmentedLagrangianContact::postInputInitialization() { ContactSolverBase::postInputInitialization(); - DomainPartition & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); + DomainPartition & domain = ProblemRepository::getManager< DomainPartition >( *this ); NumericalMethodsManager const & numericalMethodManager = domain.getNumericalMethodManager(); FiniteElementDiscretizationManager const & feDiscretizationManager = numericalMethodManager.getFiniteElementDiscretizationManager(); From 829ca341245e9e5ca4b6bf96af72bf896c9fef5a Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Wed, 19 Aug 2026 11:49:51 +0200 Subject: [PATCH 10/13] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20completed=20removal?= =?UTF-8?q?=20of=20all=20manual=20paths?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constitutiveDrivers/ConstitutiveDriver.cpp | 4 ++-- .../fluid/multiFluid/reactive/ReactiveFluidDriver.cpp | 4 ++-- .../fieldSpecification/FieldSpecificationManager.cpp | 2 +- src/coreComponents/fileIO/python/PyHistoryCollection.cpp | 2 +- src/coreComponents/fileIO/python/PyHistoryOutput.cpp | 2 +- src/coreComponents/fileIO/timeHistory/PackCollection.cpp | 2 +- src/coreComponents/finiteVolume/FluxApproximationBase.cpp | 4 ++-- .../solverStatisticsTests/testSolverStats.cpp | 4 ++-- src/coreComponents/mesh/generators/VTKMeshGenerator.cpp | 3 ++- .../simpleGeometricObjects/SimpleGeometricObjectBase.cpp | 2 +- .../fluidFlow/wells/CompositionalMultiphaseWell.cpp | 3 +-- .../physicsSolvers/fluidFlow/wells/WellManager.cpp | 6 +++--- .../CompositionalMultiphaseReservoirAndWells.cpp | 2 +- .../multiphysics/CoupledReservoirAndWellsBase.hpp | 3 ++- .../multiphysics/PoromechanicsInitialization.cpp | 5 ++--- .../physicsSolvers/multiphysics/PoromechanicsSolver.hpp | 4 +++- .../multiphysics/SinglePhaseReservoirAndWells.cpp | 2 +- .../secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp | 8 ++++---- .../secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp | 2 +- .../wavePropagation/shared/WaveSolverBase.cpp | 2 +- 20 files changed, 34 insertions(+), 32 deletions(-) diff --git a/src/coreComponents/constitutiveDrivers/ConstitutiveDriver.cpp b/src/coreComponents/constitutiveDrivers/ConstitutiveDriver.cpp index 4912ccb96db..adf1564e127 100644 --- a/src/coreComponents/constitutiveDrivers/ConstitutiveDriver.cpp +++ b/src/coreComponents/constitutiveDrivers/ConstitutiveDriver.cpp @@ -247,12 +247,12 @@ void ConstitutiveDriver::allocateTable( integer const numColumns, ConstitutiveManager & ConstitutiveDriver::getConstitutiveManager() { - return ProblemRepository::get( *this ).getManager< ConstitutiveManager >(); + return ProblemRepository::getManager< ConstitutiveManager >( *this ); } ConstitutiveManager const & ConstitutiveDriver::getConstitutiveManager() const { - return ProblemRepository::get( *this ).getManager< ConstitutiveManager >(); + return ProblemRepository::getManager< ConstitutiveManager >( *this ); } } /* namespace geos */ diff --git a/src/coreComponents/constitutiveDrivers/fluid/multiFluid/reactive/ReactiveFluidDriver.cpp b/src/coreComponents/constitutiveDrivers/fluid/multiFluid/reactive/ReactiveFluidDriver.cpp index e7a77b68ca3..b912c152456 100644 --- a/src/coreComponents/constitutiveDrivers/fluid/multiFluid/reactive/ReactiveFluidDriver.cpp +++ b/src/coreComponents/constitutiveDrivers/fluid/multiFluid/reactive/ReactiveFluidDriver.cpp @@ -78,7 +78,7 @@ void ReactiveFluidDriver::postInputInitialization() { // get number of phases and components - ConstitutiveManager & constitutiveManager = ProblemRepository::get( *this ).getManager< ConstitutiveManager >(); + ConstitutiveManager & constitutiveManager = ProblemRepository::getManager< ConstitutiveManager >( *this ); ReactiveMultiFluid & fluid = constitutiveManager.getGroup< ReactiveMultiFluid >( m_fluidName ); m_numPhases = fluid.numFluidPhases(); @@ -132,7 +132,7 @@ bool ReactiveFluidDriver::execute( real64 const GEOS_UNUSED_PARAM( time_n ), // get the fluid out of the constitutive manager. // for the moment it is of type MultiFluidBase. - ConstitutiveManager & constitutiveManager = ProblemRepository::get( *this ).getManager< ConstitutiveManager >(); + ConstitutiveManager & constitutiveManager = ProblemRepository::getManager< ConstitutiveManager >( *this ); ReactiveMultiFluid & baseFluid = constitutiveManager.getGroup< ReactiveMultiFluid >( m_fluidName ); // depending on logLevel, print some useful info diff --git a/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp b/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp index b3b3c95c778..0a8573d5b73 100644 --- a/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp +++ b/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp @@ -71,7 +71,7 @@ void FieldSpecificationManager::expandObjectCatalogs() void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) const { - DomainPartition const & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); + DomainPartition const & domain = ProblemRepository::getManager< DomainPartition >( *this ); Group const & meshBodies = domain.getMeshBodies(); // loop over all the FieldSpecification of the XML file this->forSubGroups< FieldSpecification >( [&] ( FieldSpecification const & fs ) diff --git a/src/coreComponents/fileIO/python/PyHistoryCollection.cpp b/src/coreComponents/fileIO/python/PyHistoryCollection.cpp index cb66f687c07..c0de1e55ae8 100644 --- a/src/coreComponents/fileIO/python/PyHistoryCollection.cpp +++ b/src/coreComponents/fileIO/python/PyHistoryCollection.cpp @@ -98,7 +98,7 @@ static PyObject * collect( PyHistoryCollection * self, PyObject * args ) return nullptr; } - geos::DomainPartition & domain = geos::dataRepository::ProblemRepository::get( *self->group ).getManager< geos::DomainPartition >(); + geos::DomainPartition & domain = ProblemRepository::getManager< DomainPartition >( *self->group ); try { diff --git a/src/coreComponents/fileIO/python/PyHistoryOutput.cpp b/src/coreComponents/fileIO/python/PyHistoryOutput.cpp index 95503707ca6..be9a5bb5b58 100644 --- a/src/coreComponents/fileIO/python/PyHistoryOutput.cpp +++ b/src/coreComponents/fileIO/python/PyHistoryOutput.cpp @@ -96,7 +96,7 @@ static PyObject * output( PyHistoryOutput * self, PyObject * args ) return nullptr; } - geos::DomainPartition & domain = geos::dataRepository::ProblemRepository::get( *self->group ).getManager< geos::DomainPartition >(); + geos::DomainPartition & domain = ProblemRepository::getManager< DomainPartition >( *self->group ); try { diff --git a/src/coreComponents/fileIO/timeHistory/PackCollection.cpp b/src/coreComponents/fileIO/timeHistory/PackCollection.cpp index d8fa475b0d7..e5ab6ac0999 100644 --- a/src/coreComponents/fileIO/timeHistory/PackCollection.cpp +++ b/src/coreComponents/fileIO/timeHistory/PackCollection.cpp @@ -61,7 +61,7 @@ void PackCollection::initializePostSubGroups( ) { if( !m_initialized ) { - DomainPartition & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); + DomainPartition & domain = ProblemRepository::getManager< DomainPartition >( *this ); m_collectionCount = collectAll() ? 1 : m_setNames.size(); // determine whether we're collecting from a mesh object manager Group const * const targetObject = this->getTargetObject( domain, m_objectPath ); diff --git a/src/coreComponents/finiteVolume/FluxApproximationBase.cpp b/src/coreComponents/finiteVolume/FluxApproximationBase.cpp index 3b880df29ed..8fdfffb3a37 100644 --- a/src/coreComponents/finiteVolume/FluxApproximationBase.cpp +++ b/src/coreComponents/finiteVolume/FluxApproximationBase.cpp @@ -73,7 +73,7 @@ void FluxApproximationBase::initializePreSubGroups() { GEOS_MARK_FUNCTION; - DomainPartition & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); + DomainPartition & domain = ProblemRepository::getManager< DomainPartition >( *this ); domain.forMeshBodies( [&]( MeshBody & meshBody ) { @@ -114,7 +114,7 @@ void FluxApproximationBase::initializePostInitialConditionsPreSubGroups() { GEOS_MARK_FUNCTION; - DomainPartition & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); + DomainPartition & domain = ProblemRepository::getManager< DomainPartition >( *this ); FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance(); for( auto const & [meshBodyName, meshBodyRegions] : m_targetRegions ) diff --git a/src/coreComponents/integrationTests/solverStatisticsTests/testSolverStats.cpp b/src/coreComponents/integrationTests/solverStatisticsTests/testSolverStats.cpp index 2b254d517f8..442eb60a6c2 100644 --- a/src/coreComponents/integrationTests/solverStatisticsTests/testSolverStats.cpp +++ b/src/coreComponents/integrationTests/solverStatisticsTests/testSolverStats.cpp @@ -216,7 +216,7 @@ TEST( testSolverStats, testLog ) problem.applyInitialConditions(); problem.runSimulation(); - PhysicsSolverBase & solver = problem.getGroupByPath< PhysicsSolverBase >( string( "/Solvers/SinglePhaseFlow" ) ); + PhysicsSolverBase & solver = problem.getPhysicsSolverManager().getGroup< PhysicsSolverBase >( "SinglePhaseFlow" ); IterationTest & solverStat = static_cast< IterationTest & >(solver.getIterationStats()); solverStat.AssertIterationValuesEquals(); @@ -234,7 +234,7 @@ TEST( testSolverStats, testOutputFiles ) problem.applyInitialConditions(); problem.runSimulation(); - PhysicsSolverBase & solver = problem.getGroupByPath< PhysicsSolverBase >( string( "/Solvers/SinglePhaseFlow" ) ); + PhysicsSolverBase & solver = problem.getPhysicsSolverManager().getGroup< PhysicsSolverBase >( "SinglePhaseFlow" ); ConvergenceTest & convergenceStat = static_cast< ConvergenceTest & >(solver.getConvergenceStats()); IterationTest & iterationStat = static_cast< IterationTest & >(solver.getIterationStats()); diff --git a/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp b/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp index a3bb5c372a2..cfd333734c9 100644 --- a/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp +++ b/src/coreComponents/mesh/generators/VTKMeshGenerator.cpp @@ -119,7 +119,8 @@ void VTKMeshGenerator::postInputInitialization() if( !m_dataSourceName.empty()) { - ExternalDataSourceManager & externalDataManager = ProblemRepository::get( *this ).getManager< ExternalDataSourceManager >(); + ExternalDataSourceManager & externalDataManager = + ProblemRepository::getManager< ExternalDataSourceManager >( *this ); m_dataSource = externalDataManager.getGroupPointer< VTKHierarchicalDataSource >( m_dataSourceName ); diff --git a/src/coreComponents/mesh/simpleGeometricObjects/SimpleGeometricObjectBase.cpp b/src/coreComponents/mesh/simpleGeometricObjects/SimpleGeometricObjectBase.cpp index 38283da91bf..298dffae9e8 100644 --- a/src/coreComponents/mesh/simpleGeometricObjects/SimpleGeometricObjectBase.cpp +++ b/src/coreComponents/mesh/simpleGeometricObjects/SimpleGeometricObjectBase.cpp @@ -50,7 +50,7 @@ void SimpleGeometricObjectBase::postInputInitialization() { // determine m_epsilon m_epsilon = std::numeric_limits< real64 >::max(); - DomainPartition & domain = dataRepository::ProblemRepository::get( *this ).getManager< DomainPartition >(); + DomainPartition & domain = dataRepository::ProblemRepository::getManager< DomainPartition >( *this ); domain.forMeshBodies( [&]( MeshBody const & meshBody ) { m_epsilon = std::min( m_epsilon, 1e-6 * meshBody.getGlobalLengthScale() ); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp index 93d58add128..fc75c911bb5 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp @@ -215,8 +215,7 @@ void CompositionalMultiphaseWell::setConstitutiveNames( ElementSubRegionBase & s void CompositionalMultiphaseWell::registerWellDataOnMesh( WellElementSubRegion & subRegion ) { - - DomainPartition const & domain = ProblemRepository::get( *this ).getManager< DomainPartition >(); + DomainPartition const & domain = ProblemRepository::getManager< DomainPartition >( *this ); ConstitutiveManager const & cm = domain.getConstitutiveManager(); setConstitutiveNames ( subRegion ); if( m_referenceFluidModelName.empty() ) diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellManager.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellManager.cpp index 74348a400b2..0e35c4a79e3 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellManager.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellManager.cpp @@ -305,7 +305,7 @@ void WellManager::initializePostSubGroups() // Validate constitutive models if( isCompositional() ) { - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = ProblemRepository::getManager< DomainPartition >( *this ); constitutive::ConstitutiveManager const & cm = domain.getConstitutiveManager(); CompositionalMultiphaseBase const & flowSolver = getParent().getGroup< CompositionalMultiphaseBase >( getFlowSolverName() ); string const referenceFluidName = flowSolver.referenceFluidModelName(); @@ -472,7 +472,7 @@ void WellManager::postRestartInitialization() void WellManager::initializePostInitialConditionsPreSubGroups() { PhysicsSolverBase::initializePostInitialConditionsPreSubGroups(); - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = ProblemRepository::getManager< DomainPartition >( *this ); forDiscretizationOnMeshTargets ( domain.getMeshBodies(), [&] ( string const &, MeshLevel & mesh, string_array const & regionNames ) @@ -493,7 +493,7 @@ void WellManager::initializePostInitialConditionsPreSubGroups() } void WellManager::setKeepVariablesConstantDuringInitStep( bool const keepVariablesConstantDuringInitStep ) { - DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = ProblemRepository::getManager< DomainPartition >( *this ); forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &, MeshLevel & mesh, string_array const & regionNames ) diff --git a/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp b/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp index 11a8ed584e4..ba7467a7f16 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp @@ -165,7 +165,7 @@ initializePreSubGroups() CompositionalMultiphaseBase::viewKeyStruct::isThermalString(), Base::reservoirSolver()->getName(), Base::wellSolver()->getName() ), InputError, this->getDataContext(), Base::reservoirSolver()->getDataContext(), Base::wellSolver()->getDataContext() ); - DomainPartition & domain = this->template getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = ProblemRepository::template getManager< DomainPartition >( *this ); Group & meshBodies = domain.getMeshBodies(); this->template forDiscretizationOnMeshTargets<>( meshBodies, [&] ( string const &, diff --git a/src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.hpp b/src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.hpp index c7a1f3ea030..c5ea6fb0f9f 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.hpp +++ b/src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.hpp @@ -167,7 +167,8 @@ class CoupledReservoirAndWellsBase : public CoupledSolver< RESERVOIR_SOLVER, WEL { Base::initializePostInitialConditionsPreSubGroups( ); - DomainPartition & domain = this->template getGroupByPath< DomainPartition >( "/Problem/domain" ); + using namespace dataRepository; + DomainPartition & domain = ProblemRepository::template getManager< DomainPartition >( *this ); // Validate well perforations: Ensure that each perforation is in a region targeted by the solver if( !validateWellPerforations( domain )) diff --git a/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsInitialization.cpp b/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsInitialization.cpp index 40cb0eaba82..fa698781197 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsInitialization.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsInitialization.cpp @@ -75,8 +75,7 @@ void PoromechanicsInitialization< POROMECHANICS_SOLVER >:: postInputInitialization() { - Group & problemManager = this->getGroupByPath( "/Problem" ); - Group & physicsSolverManager = problemManager.getGroup( "Solvers" ); + PhysicsSolverManager & physicsSolverManager = ProblemRepository::getManager< PhysicsSolverManager >( *this ); GEOS_THROW_IF( !physicsSolverManager.hasGroup( m_poromechanicsSolverName ), GEOS_FMT( "{} solver named {} not found", @@ -88,7 +87,7 @@ postInputInitialization() if( !m_solidMechanicsStatisticsName.empty()) { - TasksManager & tasksManager = problemManager.getGroup< TasksManager >( "Tasks" ); + TasksManager & tasksManager = ProblemRepository::getManager< TasksManager >( *this ); GEOS_THROW_IF( !tasksManager.hasGroup( m_solidMechanicsStatisticsName ), GEOS_FMT( "{} task named {} not found", diff --git a/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsSolver.hpp b/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsSolver.hpp index 1b34ab94f65..700abac2898 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsSolver.hpp +++ b/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsSolver.hpp @@ -26,6 +26,7 @@ #include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp" #include "physicsSolvers/multiphysics/PoromechanicsFields.hpp" #include "physicsSolvers/solidMechanics/SolidMechanicsFields.hpp" + #include "constitutive/solid/CoupledSolidBase.hpp" #include "constitutive/contact/HydraulicApertureBase.hpp" #include "mesh/DomainPartition.hpp" @@ -161,7 +162,8 @@ class PoromechanicsSolver : public CoupledSolver< FLOW_SOLVER, MECHANICS_SOLVER this->getWrapperDataContext( viewKeyStruct::stabilizationTypeString() ) ), InputError, this->getWrapperDataContext( viewKeyStruct::stabilizationTypeString() ) ); - DomainPartition & domain = this->template getGroupByPath< DomainPartition >( "/Problem/domain" ); + using namespace dataRepository; + DomainPartition & domain = ProblemRepository::template getManager< DomainPartition >( *this ); this->template forDiscretizationOnMeshTargets<>( domain.getMeshBodies(), [&] ( string const &, MeshLevel & mesh, diff --git a/src/coreComponents/physicsSolvers/multiphysics/SinglePhaseReservoirAndWells.cpp b/src/coreComponents/physicsSolvers/multiphysics/SinglePhaseReservoirAndWells.cpp index 898be9c3055..ee59985785e 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/SinglePhaseReservoirAndWells.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/SinglePhaseReservoirAndWells.cpp @@ -145,7 +145,7 @@ initializePreSubGroups() this->getDataContext(), SinglePhaseBase::viewKeyStruct::isThermalString(), Base::reservoirSolver()->getDataContext(), Base::wellSolver()->getDataContext() ), InputError, this->getDataContext(), Base::reservoirSolver()->getDataContext(), Base::wellSolver()->getDataContext() ); - DomainPartition & domain = this->template getGroupByPath< DomainPartition >( "/Problem/domain" ); + DomainPartition & domain = ProblemRepository::template getManager< DomainPartition >( *this ); this->template forDiscretizationOnMeshTargets<>( domain.getMeshBodies(), [&] ( string const &, MeshLevel & mesh, diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp index d9781baf44b..cfdff0d1d89 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/isotropic/AcousticWaveEquationSEM.cpp @@ -228,7 +228,7 @@ void AcousticWaveEquationSEM::precomputeSourceAndReceiverTerm( MeshLevel & baseM bool useSourceWaveletTables = m_useSourceWaveletTables; //Correct size for sourceValue - EventManager const & event = ProblemRepository::get( *this ).getManager< EventManager >(); + EventManager const & event = ProblemRepository::getManager< EventManager >( *this ); real64 const & maxTime = event.getReference< real64 >( EventManager::viewKeyStruct::maxTimeString() ); real64 const & minTime = event.getReference< real64 >( EventManager::viewKeyStruct::minTimeString() ); real64 dt = 0; @@ -447,7 +447,7 @@ void AcousticWaveEquationSEM::initializePostInitialConditionsPreSubGroups() //We use the timeStep defined inside the xml else if( m_timestepStabilityLimit==0 ) { - EventManager const & event = ProblemRepository::get( *this ).getManager< EventManager >(); + EventManager const & event = ProblemRepository::getManager< EventManager >( *this ); for( localIndex numSubEvent = 0; numSubEvent < event.numSubGroups(); ++numSubEvent ) { EventBase const * subEvent = static_cast< EventBase const * >( event.getSubGroups()[numSubEvent] ); @@ -1115,7 +1115,7 @@ real64 AcousticWaveEquationSEM::explicitStepBackward( real64 const & time_n, p_nm1[a] = (p_np1[a] - 2*p_n[a] + p_nm1[a]) / pow( dt, 2 ); } ); - EventManager const & event = ProblemRepository::get( *this ).getManager< EventManager >(); + EventManager const & event = ProblemRepository::getManager< EventManager >( *this ); real64 const & maxTime = event.getReference< real64 >( EventManager::viewKeyStruct::maxTimeString() ); int const maxCycle = int(round( maxTime / dt )); @@ -1292,7 +1292,7 @@ void AcousticWaveEquationSEM::computeUnknowns( real64 const & time_n, } //Modification of cycleNember useful when minTime < 0 - EventManager const & event = ProblemRepository::get( *this ).getManager< EventManager >(); + EventManager const & event = ProblemRepository::getManager< EventManager >( *this ); real64 const & minTime = event.getReference< real64 >( EventManager::viewKeyStruct::minTimeString() ); //localIndex const cycleNumber = time_n/dt; integer const cycleForSource = int(round( -minTime / dt + cycleNumber )); diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp index 340543ed2c4..fcea5255998 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/isotropic/ElasticWaveEquationSEM.cpp @@ -486,7 +486,7 @@ void ElasticWaveEquationSEM::initializePostInitialConditionsPreSubGroups() //We use the timeStep defined inside the xml else if( m_timestepStabilityLimit==0 ) { - EventManager const & event = ProblemRepository::get( *this ).getManager< EventManager >(); + EventManager const & event = ProblemRepository::getManager< EventManager >( *this ); for( localIndex numSubEvent = 0; numSubEvent < event.numSubGroups(); ++numSubEvent ) { EventBase const * subEvent = static_cast< EventBase const * >( event.getSubGroups()[numSubEvent] ); diff --git a/src/coreComponents/physicsSolvers/wavePropagation/shared/WaveSolverBase.cpp b/src/coreComponents/physicsSolvers/wavePropagation/shared/WaveSolverBase.cpp index fc9f7ea5a85..85f96876898 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/shared/WaveSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/shared/WaveSolverBase.cpp @@ -405,7 +405,7 @@ void WaveSolverBase::postInputInitialization() "Invalid number of physical coordinates for the receivers", InputError, getDataContext() ); - EventManager const & event = ProblemRepository::get( *this ).getManager< EventManager >(); + EventManager const & event = ProblemRepository::getManager< EventManager >( *this ); real64 const & maxTime = event.getReference< real64 >( EventManager::viewKeyStruct::maxTimeString() ); if( m_dtSeismoTrace > 0 ) From e2212abc7958636c047b01b6a2559028ded23c59 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Wed, 19 Aug 2026 12:12:42 +0200 Subject: [PATCH 11/13] =?UTF-8?q?=F0=9F=8E=A8formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataRepository/CMakeLists.txt | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/coreComponents/dataRepository/CMakeLists.txt b/src/coreComponents/dataRepository/CMakeLists.txt index 0730d7c121a..dddfa2464cd 100644 --- a/src/coreComponents/dataRepository/CMakeLists.txt +++ b/src/coreComponents/dataRepository/CMakeLists.txt @@ -54,18 +54,18 @@ set( dataRepository_headers # Specify all sources # set( dataRepository_sources - BufferOpsDevice.cpp - ConduitRestart.cpp - ExecutableGroup.cpp - Group.cpp - ProblemRepository.cpp - Utilities.cpp - WrapperBase.cpp - xmlWrapper.cpp - DataContext.cpp - GroupContext.cpp - LogLevelsRegistry.cpp - WrapperContext.cpp ) + BufferOpsDevice.cpp + ConduitRestart.cpp + ExecutableGroup.cpp + Group.cpp + ProblemRepository.cpp + Utilities.cpp + WrapperBase.cpp + xmlWrapper.cpp + DataContext.cpp + GroupContext.cpp + LogLevelsRegistry.cpp + WrapperContext.cpp ) set( dependencyList ${parallelDeps} codingUtilities ) From d3b07f5c55d8396d2fd842973e92d48299fbdd4c Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Wed, 19 Aug 2026 14:29:41 +0200 Subject: [PATCH 12/13] =?UTF-8?q?=F0=9F=90=9B=20hyperdrive=20build=20bugfi?= =?UTF-8?q?x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/coreComponents/mainInterface/ProblemManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreComponents/mainInterface/ProblemManager.cpp b/src/coreComponents/mainInterface/ProblemManager.cpp index 82b7248c563..0e7726699a7 100644 --- a/src/coreComponents/mainInterface/ProblemManager.cpp +++ b/src/coreComponents/mainInterface/ProblemManager.cpp @@ -302,7 +302,7 @@ void ProblemManager::problemSetup() initialize(); #ifdef GEOS_USE_HYPREDRV - logHypredriveInputs( *m_physicsSolverManager, getManager< DomainPartition >() ); + logHypredriveInputs( getManager< PhysicsSolverManager >(), getManager< DomainPartition >() ); #endif LogPart importFieldsLog( "Import fields", MpiWrapper::commRank() == 0 ); From 4249f6ce5219df2caff66d2d0422f1a99ab0f6fd Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Wed, 19 Aug 2026 15:26:14 +0200 Subject: [PATCH 13/13] =?UTF-8?q?=F0=9F=93=A6=20schema?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/coreComponents/schema/schema.xsd.other | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreComponents/schema/schema.xsd.other b/src/coreComponents/schema/schema.xsd.other index 1d9ea57c5f2..acd3c24b757 100644 --- a/src/coreComponents/schema/schema.xsd.other +++ b/src/coreComponents/schema/schema.xsd.other @@ -526,7 +526,7 @@ A field can represent a physical variable. (pressure, temperature, global compos - + @@ -1638,7 +1638,7 @@ A field can represent a physical variable. (pressure, temperature, global compos - +