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/dataRepository/CMakeLists.txt b/src/coreComponents/dataRepository/CMakeLists.txt index 8d0fc0e09ce..22f4575df6b 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 @@ -37,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/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/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_ */ 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/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: /** 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. 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();