diff --git a/src/coreComponents/constitutive/ConstitutiveBase.cpp b/src/coreComponents/constitutive/ConstitutiveBase.cpp index e83ef788e13..1b58c7e07ba 100644 --- a/src/coreComponents/constitutive/ConstitutiveBase.cpp +++ b/src/coreComponents/constitutive/ConstitutiveBase.cpp @@ -63,11 +63,11 @@ ConstitutiveBase::CatalogInterface::CatalogType & ConstitutiveBase::getCatalog() return catalog; } -void ConstitutiveBase::allocateConstitutiveData( dataRepository::Group * const parent, +void ConstitutiveBase::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { m_numQuadraturePoints = numConstitutivePointsPerParentIndex; - m_constitutiveDataGroup = parent; + m_constitutiveDataGroup = &parent; for( auto & group : this->getSubGroups() ) { @@ -76,7 +76,7 @@ void ConstitutiveBase::allocateConstitutiveData( dataRepository::Group * const p if( wrapper.second->sizedFromParent() ) { string const & wrapperName = wrapper.first; - parent->registerWrapper( makeFieldName( this->getName(), wrapperName ), wrapper.second->clone( wrapperName, parent ) ). + parent.registerWrapper( makeFieldName( this->getName(), wrapperName ), wrapper.second->clone( wrapperName, parent ) ). setRestartFlags( RestartFlags::NO_WRITE ); } } @@ -87,12 +87,12 @@ void ConstitutiveBase::allocateConstitutiveData( dataRepository::Group * const p if( wrapper.second->sizedFromParent() ) { string const wrapperName = wrapper.first; - parent->registerWrapper( makeFieldName( this->getName(), wrapperName ), wrapper.second->clone( wrapperName, parent ) ). + parent.registerWrapper( makeFieldName( this->getName(), wrapperName ), wrapper.second->clone( wrapperName, parent ) ). setRestartFlags( RestartFlags::NO_WRITE ); } } - this->resize( parent->size() ); + this->resize( parent.size() ); } std::unique_ptr< ConstitutiveBase > diff --git a/src/coreComponents/constitutive/ConstitutiveBase.hpp b/src/coreComponents/constitutive/ConstitutiveBase.hpp index 8b544a94d9b..1a0c34a1bc0 100644 --- a/src/coreComponents/constitutive/ConstitutiveBase.hpp +++ b/src/coreComponents/constitutive/ConstitutiveBase.hpp @@ -94,14 +94,14 @@ class ConstitutiveBase : public dataRepository::Group /** * @brief Allocate constitutive data and make views to data on parent objects - * @param[in] parent pointer to the group that holds the constitutive relation + * @param[in] parent reference to the group that holds the constitutive relation * @param[in] numConstitutivePointsPerParentIndex number of quadrature points * * This function does 2 things: * 1) Allocate data according to the size of parent and numConstitutivePointsPerParentIndex * 2) Create wrappers to the constitutive data in the parent for easier access */ - virtual void allocateConstitutiveData( dataRepository::Group * const parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ); struct viewKeyStruct diff --git a/src/coreComponents/constitutive/ConstitutiveManager.cpp b/src/coreComponents/constitutive/ConstitutiveManager.cpp index c665faa3300..4a9d2f12087 100644 --- a/src/coreComponents/constitutive/ConstitutiveManager.cpp +++ b/src/coreComponents/constitutive/ConstitutiveManager.cpp @@ -64,7 +64,7 @@ ConstitutiveManager::hangConstitutiveRelation( string const & constitutiveRelati std::unique_ptr< ConstitutiveBase > material = constitutiveRelation.deliverClone( constitutiveRelationInstanceName, parent ); - material->allocateConstitutiveData( parent, + material->allocateConstitutiveData( *parent, numConstitutivePointsPerParentIndex ); dataRepository::Group * constitutiveGroup = parent->getGroupPointer( groupKeyStruct::constitutiveModelsString() ); diff --git a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp index 6533d4280ab..a1887521966 100644 --- a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp +++ b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp @@ -111,7 +111,7 @@ void CapillaryPressureBase::resizeFields( localIndex const size, } -void CapillaryPressureBase::allocateConstitutiveData( dataRepository::Group * const parent, +void CapillaryPressureBase::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { resizeFields( 0, numConstitutivePointsPerParentIndex ); diff --git a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp index 8ffd4e7b0ba..c17352f0574 100644 --- a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp +++ b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp @@ -116,7 +116,7 @@ class CapillaryPressureBase : public ConstitutiveBase virtual ~CapillaryPressureBase() override; - virtual void allocateConstitutiveData( dataRepository::Group * const parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) override; localIndex numFluidPhases() const { return m_phaseNames.size(); } diff --git a/src/coreComponents/constitutive/fluid/CompressibleSinglePhaseFluid.cpp b/src/coreComponents/constitutive/fluid/CompressibleSinglePhaseFluid.cpp index 7b707ea564d..c77a3c33eb3 100644 --- a/src/coreComponents/constitutive/fluid/CompressibleSinglePhaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/CompressibleSinglePhaseFluid.cpp @@ -69,7 +69,7 @@ CompressibleSinglePhaseFluid::CompressibleSinglePhaseFluid( string const & name, CompressibleSinglePhaseFluid::~CompressibleSinglePhaseFluid() = default; -void CompressibleSinglePhaseFluid::allocateConstitutiveData( dataRepository::Group * const parent, +void CompressibleSinglePhaseFluid::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { SingleFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); diff --git a/src/coreComponents/constitutive/fluid/CompressibleSinglePhaseFluid.hpp b/src/coreComponents/constitutive/fluid/CompressibleSinglePhaseFluid.hpp index 3adaba40ed0..607d55e72a0 100644 --- a/src/coreComponents/constitutive/fluid/CompressibleSinglePhaseFluid.hpp +++ b/src/coreComponents/constitutive/fluid/CompressibleSinglePhaseFluid.hpp @@ -121,7 +121,7 @@ class CompressibleSinglePhaseFluid : public SingleFluidBase virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( dataRepository::Group * const parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) override; /// Type of kernel wrapper for in-kernel update (TODO: support multiple EAT, not just linear) diff --git a/src/coreComponents/constitutive/fluid/MultiFluidBase.cpp b/src/coreComponents/constitutive/fluid/MultiFluidBase.cpp index 54ae5f806d8..24aca2f1c34 100644 --- a/src/coreComponents/constitutive/fluid/MultiFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/MultiFluidBase.cpp @@ -138,11 +138,11 @@ void MultiFluidBase::resizeFields( localIndex const size, localIndex const numPt m_dTotalDensity_dGlobalCompFraction.resize( size, numPts, NC ); } -void MultiFluidBase::allocateConstitutiveData( dataRepository::Group * const parent, +void MultiFluidBase::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - resizeFields( parent->size(), numConstitutivePointsPerParentIndex ); + resizeFields( parent.size(), numConstitutivePointsPerParentIndex ); } MultiFluidBase::~MultiFluidBase() diff --git a/src/coreComponents/constitutive/fluid/MultiFluidBase.hpp b/src/coreComponents/constitutive/fluid/MultiFluidBase.hpp index bb22f0118f7..7518d30c4e5 100644 --- a/src/coreComponents/constitutive/fluid/MultiFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/MultiFluidBase.hpp @@ -217,7 +217,7 @@ class MultiFluidBase : public ConstitutiveBase virtual ~MultiFluidBase() override; - virtual void allocateConstitutiveData( dataRepository::Group * const parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) override; // *** MultiFluid-specific interface diff --git a/src/coreComponents/constitutive/fluid/ParticleFluidBase.cpp b/src/coreComponents/constitutive/fluid/ParticleFluidBase.cpp index 06afe811a35..4605b9d08f3 100644 --- a/src/coreComponents/constitutive/fluid/ParticleFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/ParticleFluidBase.cpp @@ -59,13 +59,13 @@ void ParticleFluidBase::postProcessInput() ConstitutiveBase::postProcessInput(); } -void ParticleFluidBase::allocateConstitutiveData( Group * const parent, +void ParticleFluidBase::allocateConstitutiveData( Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - this->resize( parent->size() ); - m_dSettlingFactor_dComponentConcentration.resize( parent->size(), MAX_NUM_COMPONENTS ); + this->resize( parent.size() ); + m_dSettlingFactor_dComponentConcentration.resize( parent.size(), MAX_NUM_COMPONENTS ); } } //namespace constitutive diff --git a/src/coreComponents/constitutive/fluid/ParticleFluidBase.hpp b/src/coreComponents/constitutive/fluid/ParticleFluidBase.hpp index 4733f9e1e81..a1b6f9c5ac4 100644 --- a/src/coreComponents/constitutive/fluid/ParticleFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/ParticleFluidBase.hpp @@ -149,7 +149,7 @@ class ParticleFluidBase : public ConstitutiveBase virtual ~ParticleFluidBase() override; // *** ConstitutiveBase interface - virtual void allocateConstitutiveData( dataRepository::Group * const parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) override; static constexpr localIndex MAX_NUM_COMPONENTS = 4; diff --git a/src/coreComponents/constitutive/fluid/ProppantSlurryFluid.cpp b/src/coreComponents/constitutive/fluid/ProppantSlurryFluid.cpp index dc250a49091..5d575c3a3b7 100644 --- a/src/coreComponents/constitutive/fluid/ProppantSlurryFluid.cpp +++ b/src/coreComponents/constitutive/fluid/ProppantSlurryFluid.cpp @@ -63,7 +63,7 @@ ProppantSlurryFluid::ProppantSlurryFluid( string const & name, Group * const par ProppantSlurryFluid::~ProppantSlurryFluid() = default; -void ProppantSlurryFluid::allocateConstitutiveData( dataRepository::Group * const parent, +void ProppantSlurryFluid::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { SlurryFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); diff --git a/src/coreComponents/constitutive/fluid/ProppantSlurryFluid.hpp b/src/coreComponents/constitutive/fluid/ProppantSlurryFluid.hpp index b671aea6ece..5da40cc5b22 100644 --- a/src/coreComponents/constitutive/fluid/ProppantSlurryFluid.hpp +++ b/src/coreComponents/constitutive/fluid/ProppantSlurryFluid.hpp @@ -294,7 +294,7 @@ class ProppantSlurryFluid : public SlurryFluidBase virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( dataRepository::Group * const parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) override; using KernelWrapper = ProppantSlurryFluidUpdate; diff --git a/src/coreComponents/constitutive/fluid/SingleFluidBase.cpp b/src/coreComponents/constitutive/fluid/SingleFluidBase.cpp index de87184cfdd..2d8b9713bda 100644 --- a/src/coreComponents/constitutive/fluid/SingleFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/SingleFluidBase.cpp @@ -56,18 +56,18 @@ void SingleFluidBase::postProcessInput() } -void SingleFluidBase::allocateConstitutiveData( Group * const parent, +void SingleFluidBase::allocateConstitutiveData( Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - this->resize( parent->size() ); + this->resize( parent.size() ); - m_density.resize( parent->size(), numConstitutivePointsPerParentIndex ); - m_dDensity_dPressure.resize( parent->size(), numConstitutivePointsPerParentIndex ); + m_density.resize( parent.size(), numConstitutivePointsPerParentIndex ); + m_dDensity_dPressure.resize( parent.size(), numConstitutivePointsPerParentIndex ); - m_viscosity.resize( parent->size(), numConstitutivePointsPerParentIndex ); - m_dViscosity_dPressure.resize( parent->size(), numConstitutivePointsPerParentIndex ); + m_viscosity.resize( parent.size(), numConstitutivePointsPerParentIndex ); + m_dViscosity_dPressure.resize( parent.size(), numConstitutivePointsPerParentIndex ); } } //namespace constitutive diff --git a/src/coreComponents/constitutive/fluid/SingleFluidBase.hpp b/src/coreComponents/constitutive/fluid/SingleFluidBase.hpp index dcd12641ec6..e8552fcec09 100644 --- a/src/coreComponents/constitutive/fluid/SingleFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/SingleFluidBase.hpp @@ -163,7 +163,7 @@ class SingleFluidBase : public ConstitutiveBase // *** ConstitutiveBase interface - virtual void allocateConstitutiveData( dataRepository::Group * const parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) override; // *** SingleFluid-specific interface diff --git a/src/coreComponents/constitutive/fluid/SlurryFluidBase.cpp b/src/coreComponents/constitutive/fluid/SlurryFluidBase.cpp index 12f3116283e..b279f8bba80 100644 --- a/src/coreComponents/constitutive/fluid/SlurryFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/SlurryFluidBase.cpp @@ -103,37 +103,37 @@ localIndex SlurryFluidBase::numFluidComponents() const return LvArray::integerConversion< localIndex >( m_componentNames.size()); } -void SlurryFluidBase::allocateConstitutiveData( Group * const parent, +void SlurryFluidBase::allocateConstitutiveData( Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - this->resize( parent->size() ); + this->resize( parent.size() ); localIndex const NC = numFluidComponents(); - m_density.resize( parent->size(), numConstitutivePointsPerParentIndex ); - m_dDens_dPres.resize( parent->size(), numConstitutivePointsPerParentIndex ); - m_dDens_dProppantConc.resize( parent->size(), numConstitutivePointsPerParentIndex ); - m_dDens_dCompConc.resize( parent->size(), numConstitutivePointsPerParentIndex, NC ); + m_density.resize( parent.size(), numConstitutivePointsPerParentIndex ); + m_dDens_dPres.resize( parent.size(), numConstitutivePointsPerParentIndex ); + m_dDens_dProppantConc.resize( parent.size(), numConstitutivePointsPerParentIndex ); + m_dDens_dCompConc.resize( parent.size(), numConstitutivePointsPerParentIndex, NC ); - m_componentDensity.resize( parent->size(), numConstitutivePointsPerParentIndex, NC ); - m_dCompDens_dPres.resize( parent->size(), numConstitutivePointsPerParentIndex, NC ); - m_dCompDens_dCompConc.resize( parent->size(), numConstitutivePointsPerParentIndex, NC, NC ); + m_componentDensity.resize( parent.size(), numConstitutivePointsPerParentIndex, NC ); + m_dCompDens_dPres.resize( parent.size(), numConstitutivePointsPerParentIndex, NC ); + m_dCompDens_dCompConc.resize( parent.size(), numConstitutivePointsPerParentIndex, NC, NC ); - m_fluidDensity.resize( parent->size(), numConstitutivePointsPerParentIndex ); - m_dFluidDens_dPres.resize( parent->size(), numConstitutivePointsPerParentIndex ); - m_dFluidDens_dCompConc.resize( parent->size(), numConstitutivePointsPerParentIndex, NC ); + m_fluidDensity.resize( parent.size(), numConstitutivePointsPerParentIndex ); + m_dFluidDens_dPres.resize( parent.size(), numConstitutivePointsPerParentIndex ); + m_dFluidDens_dCompConc.resize( parent.size(), numConstitutivePointsPerParentIndex, NC ); - m_fluidViscosity.resize( parent->size(), numConstitutivePointsPerParentIndex ); - m_dFluidVisc_dPres.resize( parent->size(), numConstitutivePointsPerParentIndex ); - m_dFluidVisc_dCompConc.resize( parent->size(), numConstitutivePointsPerParentIndex, NC ); + m_fluidViscosity.resize( parent.size(), numConstitutivePointsPerParentIndex ); + m_dFluidVisc_dPres.resize( parent.size(), numConstitutivePointsPerParentIndex ); + m_dFluidVisc_dCompConc.resize( parent.size(), numConstitutivePointsPerParentIndex, NC ); - m_viscosity.resize( parent->size(), numConstitutivePointsPerParentIndex ); - m_dVisc_dPres.resize( parent->size(), numConstitutivePointsPerParentIndex ); - m_dVisc_dProppantConc.resize( parent->size(), numConstitutivePointsPerParentIndex ); - m_dVisc_dCompConc.resize( parent->size(), numConstitutivePointsPerParentIndex, NC ); + m_viscosity.resize( parent.size(), numConstitutivePointsPerParentIndex ); + m_dVisc_dPres.resize( parent.size(), numConstitutivePointsPerParentIndex ); + m_dVisc_dProppantConc.resize( parent.size(), numConstitutivePointsPerParentIndex ); + m_dVisc_dCompConc.resize( parent.size(), numConstitutivePointsPerParentIndex, NC ); } diff --git a/src/coreComponents/constitutive/fluid/SlurryFluidBase.hpp b/src/coreComponents/constitutive/fluid/SlurryFluidBase.hpp index d66d00a99d3..ba6def0b3a9 100644 --- a/src/coreComponents/constitutive/fluid/SlurryFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/SlurryFluidBase.hpp @@ -247,7 +247,7 @@ class SlurryFluidBase : public ConstitutiveBase virtual ~SlurryFluidBase() override; // *** ConstitutiveBase interface - virtual void allocateConstitutiveData( dataRepository::Group * const parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) override; static constexpr localIndex MAX_NUM_COMPONENTS = 3; diff --git a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp index ac3a01ee662..65962903760 100644 --- a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp +++ b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp @@ -102,11 +102,11 @@ void RelativePermeabilityBase::resizeFields( localIndex const size, localIndex c m_dPhaseRelPerm_dPhaseVolFrac.resize( size, numPts, NP, NP ); } -void RelativePermeabilityBase::allocateConstitutiveData( dataRepository::Group * const parent, +void RelativePermeabilityBase::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - resizeFields( parent->size(), numConstitutivePointsPerParentIndex ); + resizeFields( parent.size(), numConstitutivePointsPerParentIndex ); } } // namespace constitutive diff --git a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp index 39a44cebe23..9eab8d6cab5 100644 --- a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp +++ b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp @@ -126,7 +126,7 @@ class RelativePermeabilityBase : public ConstitutiveBase virtual ~RelativePermeabilityBase() override; - virtual void allocateConstitutiveData( dataRepository::Group * const parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) override; localIndex numFluidPhases() const { return m_phaseNames.size(); } diff --git a/src/coreComponents/constitutive/solid/Damage.cpp b/src/coreComponents/constitutive/solid/Damage.cpp index db9fa02a1e2..045bdfc89ce 100644 --- a/src/coreComponents/constitutive/solid/Damage.cpp +++ b/src/coreComponents/constitutive/solid/Damage.cpp @@ -68,7 +68,7 @@ void Damage< BASE >::postProcessInput() } template< typename BASE > -void Damage< BASE >::allocateConstitutiveData( dataRepository::Group * const parent, +void Damage< BASE >::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { m_damage.resize( 0, numConstitutivePointsPerParentIndex ); diff --git a/src/coreComponents/constitutive/solid/Damage.hpp b/src/coreComponents/constitutive/solid/Damage.hpp index c7f9adf2d3a..ae2c1257b18 100644 --- a/src/coreComponents/constitutive/solid/Damage.hpp +++ b/src/coreComponents/constitutive/solid/Damage.hpp @@ -196,7 +196,7 @@ class Damage : public BASE virtual void postProcessInput() override; - virtual void allocateConstitutiveData( dataRepository::Group * const parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) override; diff --git a/src/coreComponents/constitutive/solid/DruckerPrager.cpp b/src/coreComponents/constitutive/solid/DruckerPrager.cpp index a2b3e972708..5ad9700fcf2 100644 --- a/src/coreComponents/constitutive/solid/DruckerPrager.cpp +++ b/src/coreComponents/constitutive/solid/DruckerPrager.cpp @@ -87,7 +87,7 @@ DruckerPrager::~DruckerPrager() {} -void DruckerPrager::allocateConstitutiveData( dataRepository::Group * const parent, +void DruckerPrager::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { m_newCohesion.resize( 0, numConstitutivePointsPerParentIndex ); diff --git a/src/coreComponents/constitutive/solid/DruckerPrager.hpp b/src/coreComponents/constitutive/solid/DruckerPrager.hpp index 887d14c9275..1e109a2a10d 100644 --- a/src/coreComponents/constitutive/solid/DruckerPrager.hpp +++ b/src/coreComponents/constitutive/solid/DruckerPrager.hpp @@ -314,7 +314,7 @@ class DruckerPrager : public ElasticIsotropic virtual ~DruckerPrager() override; - virtual void allocateConstitutiveData( dataRepository::Group * const parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) override; virtual void saveConvergedState() const override; diff --git a/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp b/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp index ae5e1568224..b8225a7acad 100644 --- a/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp +++ b/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp @@ -103,7 +103,7 @@ DruckerPragerExtended::~DruckerPragerExtended() {} -void DruckerPragerExtended::allocateConstitutiveData( dataRepository::Group * const parent, +void DruckerPragerExtended::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { m_newState.resize( 0, numConstitutivePointsPerParentIndex ); diff --git a/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp b/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp index 3e56ad34f70..3092db033c1 100644 --- a/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp +++ b/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp @@ -340,7 +340,7 @@ class DruckerPragerExtended : public ElasticIsotropic virtual ~DruckerPragerExtended() override; - virtual void allocateConstitutiveData( dataRepository::Group * const parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) override; virtual void saveConvergedState() const override; diff --git a/src/coreComponents/constitutive/solid/PoreVolumeCompressibleSolid.cpp b/src/coreComponents/constitutive/solid/PoreVolumeCompressibleSolid.cpp index 4c784756bd0..fdfc3a70e1e 100644 --- a/src/coreComponents/constitutive/solid/PoreVolumeCompressibleSolid.cpp +++ b/src/coreComponents/constitutive/solid/PoreVolumeCompressibleSolid.cpp @@ -60,15 +60,15 @@ PoreVolumeCompressibleSolid::deliverClone( string const & name, return clone; } -void PoreVolumeCompressibleSolid::allocateConstitutiveData( dataRepository::Group * const parent, +void PoreVolumeCompressibleSolid::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - this->resize( parent->size() ); + this->resize( parent.size() ); - m_poreVolumeMultiplier.resize( parent->size(), numConstitutivePointsPerParentIndex ); - m_dPVMult_dPressure.resize( parent->size(), numConstitutivePointsPerParentIndex ); + m_poreVolumeMultiplier.resize( parent.size(), numConstitutivePointsPerParentIndex ); + m_dPVMult_dPressure.resize( parent.size(), numConstitutivePointsPerParentIndex ); m_poreVolumeMultiplier.setValues< serialPolicy >( 1.0 ); } diff --git a/src/coreComponents/constitutive/solid/PoreVolumeCompressibleSolid.hpp b/src/coreComponents/constitutive/solid/PoreVolumeCompressibleSolid.hpp index 5017aad020b..4e805771409 100644 --- a/src/coreComponents/constitutive/solid/PoreVolumeCompressibleSolid.hpp +++ b/src/coreComponents/constitutive/solid/PoreVolumeCompressibleSolid.hpp @@ -39,7 +39,7 @@ class PoreVolumeCompressibleSolid : public ConstitutiveBase std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, Group * const parent ) const override; - virtual void allocateConstitutiveData( dataRepository::Group * const parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) override; diff --git a/src/coreComponents/constitutive/solid/PoroElastic.cpp b/src/coreComponents/constitutive/solid/PoroElastic.cpp index f88f3dd3d22..0df7f05b802 100644 --- a/src/coreComponents/constitutive/solid/PoroElastic.cpp +++ b/src/coreComponents/constitutive/solid/PoroElastic.cpp @@ -90,7 +90,7 @@ PoroElastic< BASE >::deliverClone( string const & name, } template< typename BASE > -void PoroElastic< BASE >::allocateConstitutiveData( dataRepository::Group * const parent, +void PoroElastic< BASE >::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { m_poreVolumeMultiplier.resize( 0, numConstitutivePointsPerParentIndex ); diff --git a/src/coreComponents/constitutive/solid/PoroElastic.hpp b/src/coreComponents/constitutive/solid/PoroElastic.hpp index 10df3504171..be938053457 100644 --- a/src/coreComponents/constitutive/solid/PoroElastic.hpp +++ b/src/coreComponents/constitutive/solid/PoroElastic.hpp @@ -137,7 +137,7 @@ class PoroElastic : public BASE * @param parent Object's parent group (an element region) * @param numConstitutivePointsPerParentIndex (number of quadrature points per element) */ - virtual void allocateConstitutiveData( dataRepository::Group * const parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) override; /** diff --git a/src/coreComponents/constitutive/solid/SolidBase.cpp b/src/coreComponents/constitutive/solid/SolidBase.cpp index 0f97edc9b39..aef73fe520c 100644 --- a/src/coreComponents/constitutive/solid/SolidBase.cpp +++ b/src/coreComponents/constitutive/solid/SolidBase.cpp @@ -62,7 +62,7 @@ void SolidBase::postProcessInput() } -void SolidBase::allocateConstitutiveData( dataRepository::Group * const parent, +void SolidBase::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { m_density.resize( 0, numConstitutivePointsPerParentIndex ); diff --git a/src/coreComponents/constitutive/solid/SolidBase.hpp b/src/coreComponents/constitutive/solid/SolidBase.hpp index a32f8ec3dda..a2bcbb7b0dd 100644 --- a/src/coreComponents/constitutive/solid/SolidBase.hpp +++ b/src/coreComponents/constitutive/solid/SolidBase.hpp @@ -573,7 +573,7 @@ class SolidBase : public constitutive::ConstitutiveBase * @param parent Object's parent group (element subregion) * @param numConstitutivePointsPerParentIndex Number of quadrature points per element */ - virtual void allocateConstitutiveData( dataRepository::Group * const parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) override; /// Save state data in preparation for next timestep diff --git a/src/coreComponents/constitutive/unitTests/testDamage.cpp b/src/coreComponents/constitutive/unitTests/testDamage.cpp index ac23579bb2f..5895b960d71 100644 --- a/src/coreComponents/constitutive/unitTests/testDamage.cpp +++ b/src/coreComponents/constitutive/unitTests/testDamage.cpp @@ -65,7 +65,7 @@ TEST( DamageTests, testDamageSpectral ) disc.resize( numElem ); DamageSpectral< ElasticIsotropic > & cm = constitutiveManager.getConstitutiveRelation< DamageSpectral< ElasticIsotropic > >( "shale" ); - cm.allocateConstitutiveData( &disc, numQuad ); + cm.allocateConstitutiveData( disc, numQuad ); // confirm allocation sizes diff --git a/src/coreComponents/constitutive/unitTests/testDruckerPrager.cpp b/src/coreComponents/constitutive/unitTests/testDruckerPrager.cpp index 4769d5d6e92..975401b29ee 100644 --- a/src/coreComponents/constitutive/unitTests/testDruckerPrager.cpp +++ b/src/coreComponents/constitutive/unitTests/testDruckerPrager.cpp @@ -92,7 +92,7 @@ void testDruckerPragerDriver() disc.resize( numElem ); DruckerPrager & cm = constitutiveManager.getConstitutiveRelation< DruckerPrager >( "granite" ); - cm.allocateConstitutiveData( &disc, numQuad ); + cm.allocateConstitutiveData( disc, numQuad ); // confirm allocation sizes @@ -208,7 +208,7 @@ void testDruckerPragerExtendedDriver() disc.resize( numElem ); DruckerPragerExtended & cm = constitutiveManager.getConstitutiveRelation< DruckerPragerExtended >( "granite" ); - cm.allocateConstitutiveData( &disc, numQuad ); + cm.allocateConstitutiveData( disc, numQuad ); // confirm allocation sizes diff --git a/src/coreComponents/constitutive/unitTests/testElasticIsotropic.cpp b/src/coreComponents/constitutive/unitTests/testElasticIsotropic.cpp index a7a1278d07c..581ad480bbe 100644 --- a/src/coreComponents/constitutive/unitTests/testElasticIsotropic.cpp +++ b/src/coreComponents/constitutive/unitTests/testElasticIsotropic.cpp @@ -35,7 +35,7 @@ TEST( ElasticIsotropicTests, testAllocation ) dataRepository::Group disc( "discretization", &rootGroup ); disc.resize( numElems ); - cm.allocateConstitutiveData( &disc, numQuadraturePoints ); + cm.allocateConstitutiveData( disc, numQuadraturePoints ); EXPECT_EQ( cm.size(), numElems ); EXPECT_EQ( cm.numQuadraturePoints(), numQuadraturePoints ); @@ -87,7 +87,7 @@ TEST( ElasticIsotropicTests, testStateUpdatePoint ) ElasticIsotropic & cm = constitutiveManager.getConstitutiveRelation< ElasticIsotropic >( "granite" ); - cm.allocateConstitutiveData( &disc, 2 ); + cm.allocateConstitutiveData( disc, 2 ); ElasticIsotropic::KernelWrapper cmw = cm.createKernelUpdates(); arrayView3d< real64, solid::STRESS_USD > const & stress = cm.getStress(); diff --git a/src/coreComponents/dataRepository/Group.cpp b/src/coreComponents/dataRepository/Group.cpp index c3504982b1f..79961bda246 100644 --- a/src/coreComponents/dataRepository/Group.cpp +++ b/src/coreComponents/dataRepository/Group.cpp @@ -584,7 +584,7 @@ Group const & Group::getBaseGroupByPath( string const & path ) const } else if( curGroupName == ".." ) { - currentGroup = this->getParent(); + currentGroup = &this->getParent(); } else { diff --git a/src/coreComponents/dataRepository/Group.hpp b/src/coreComponents/dataRepository/Group.hpp index 00588df5113..6e99fcda2db 100644 --- a/src/coreComponents/dataRepository/Group.hpp +++ b/src/coreComponents/dataRepository/Group.hpp @@ -1148,16 +1148,23 @@ class Group /** * @brief Access the group's parent. - * @return pointer to parent Group + * @return reference to parent Group + * @throw std::domain_error if the Group doesn't have a parent. */ - Group * getParent() - { return m_parent; } + Group & getParent() + { + GEOSX_THROW_IF( m_parent == nullptr, "Group at " << getPath() << " does not have a parent.", std::domain_error ); + return *m_parent; + } /** * @copydoc getParent() */ - Group const * getParent() const - { return m_parent; } + Group const & getParent() const + { + GEOSX_THROW_IF( m_parent == nullptr, "Group at " << getPath() << " does not have a parent.", std::domain_error ); + return *m_parent; + } /** * @brief Get the group's index withing its parent group @@ -1375,7 +1382,7 @@ Wrapper< TBASE > & Group::registerWrapper( string const & name, { std::unique_ptr< TBASE > newObj = std::make_unique< T >(); m_wrappers.insert( name, - new Wrapper< TBASE >( name, this, std::move( newObj ) ), + new Wrapper< TBASE >( name, *this, std::move( newObj ) ), true ); if( rkey != nullptr ) @@ -1408,7 +1415,7 @@ Wrapper< T > & Group::registerWrapper( string const & name, std::unique_ptr< T > newObject ) { m_wrappers.insert( name, - new Wrapper< T >( name, this, std::move( newObject ) ), + new Wrapper< T >( name, *this, std::move( newObject ) ), true ); Wrapper< T > & rval = getWrapper< T >( name ); @@ -1424,7 +1431,7 @@ Wrapper< T > & Group::registerWrapper( string const & name, T * newObject ) { m_wrappers.insert( name, - new Wrapper< T >( name, this, newObject ), + new Wrapper< T >( name, *this, newObject ), true ); Wrapper< T > & rval = getWrapper< T >( name ); diff --git a/src/coreComponents/dataRepository/Wrapper.hpp b/src/coreComponents/dataRepository/Wrapper.hpp index 7c54960e4c3..90358281a53 100644 --- a/src/coreComponents/dataRepository/Wrapper.hpp +++ b/src/coreComponents/dataRepository/Wrapper.hpp @@ -73,7 +73,7 @@ class Wrapper final : public WrapperBase * @param parent parent group which owns the Wrapper */ explicit Wrapper( string const & name, - Group * const parent ): + Group & parent ): WrapperBase( name, parent ), m_ownsData( true ), m_data( new T() ), @@ -94,7 +94,7 @@ class Wrapper final : public WrapperBase * @param object object that is being wrapped by the Wrapper */ explicit Wrapper( string const & name, - Group * const parent, + Group & parent, std::unique_ptr< T > object ): WrapperBase( name, parent ), m_ownsData( true ), @@ -116,7 +116,7 @@ class Wrapper final : public WrapperBase * @param object object that is being wrapped by the Wrapper */ explicit Wrapper( string const & name, - Group * const parent, + Group & parent, T * object ): WrapperBase( name, parent ), m_ownsData( false ), @@ -177,7 +177,7 @@ class Wrapper final : public WrapperBase /////////////////////////////////////////////////////////////////////////////////////////////////// virtual std::unique_ptr< WrapperBase > clone( string const & name, - Group * const parent ) override + Group & parent ) override { std::unique_ptr< WrapperBase > clonedWrapper = std::make_unique< Wrapper< T > >( name, parent, m_data ); @@ -752,7 +752,7 @@ class Wrapper final : public WrapperBase GEOSX_ERROR_IF( ptr == nullptr, "Failed to average over the second dimension of." ); - return std::make_unique< Wrapper< U > >( name, &group, std::move( ptr ) ); + return std::make_unique< Wrapper< U > >( name, group, std::move( ptr ) ); } /////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/coreComponents/dataRepository/WrapperBase.cpp b/src/coreComponents/dataRepository/WrapperBase.cpp index d64614efd9c..e14750d2616 100644 --- a/src/coreComponents/dataRepository/WrapperBase.cpp +++ b/src/coreComponents/dataRepository/WrapperBase.cpp @@ -27,19 +27,17 @@ namespace dataRepository WrapperBase::WrapperBase( string const & name, - Group * const parent ): + Group & parent ): m_name( name ), - m_parent( parent ), + m_parent( &parent ), m_sizedFromParent( 1 ), m_restart_flags( RestartFlags::WRITE_AND_READ ), m_plotLevel( PlotLevel::NOPLOT ), m_inputFlag( InputFlags::INVALID ), m_description(), m_registeringObjects(), - m_conduitNode( parent->getConduitNode()[ name ] ) -{ - GEOSX_ERROR_IF( parent == nullptr, "Cannot have a view with no parent." ); -} + m_conduitNode( parent.getConduitNode()[ name ] ) +{} WrapperBase::~WrapperBase() diff --git a/src/coreComponents/dataRepository/WrapperBase.hpp b/src/coreComponents/dataRepository/WrapperBase.hpp index 2b54b9669f8..0dc4a9821c5 100644 --- a/src/coreComponents/dataRepository/WrapperBase.hpp +++ b/src/coreComponents/dataRepository/WrapperBase.hpp @@ -64,7 +64,7 @@ class WrapperBase * @param[in] parent pointer to Group that holds this WrapperBase */ explicit WrapperBase( string const & name, - Group * const parent ); + Group & parent ); /// @cond DO_NOT_DOCUMENT WrapperBase() = delete; @@ -493,7 +493,7 @@ class WrapperBase * The overridden function will create a copy of the derived Wrapper the using the provided * values of name and parent to differentiate itself from the source. */ - virtual std::unique_ptr< WrapperBase > clone( string const & name, Group * const parent ) = 0; + virtual std::unique_ptr< WrapperBase > clone( string const & name, Group & parent ) = 0; /** * @brief Copy the the data contained in another wrapper into this wrapper. diff --git a/src/coreComponents/dataRepository/unitTests/testWrapper.cpp b/src/coreComponents/dataRepository/unitTests/testWrapper.cpp index 7cba02aac4f..8998d1b6f4d 100644 --- a/src/coreComponents/dataRepository/unitTests/testWrapper.cpp +++ b/src/coreComponents/dataRepository/unitTests/testWrapper.cpp @@ -30,7 +30,7 @@ class WrapperSetGet : public ::testing::Test WrapperSetGet(): m_node(), m_group( "root", m_node ), - m_wrapper( "wrapper", &m_group ), + m_wrapper( "wrapper", m_group ), m_wrapperBase( m_wrapper ) {} diff --git a/src/coreComponents/finiteVolume/FluxApproximationBase.cpp b/src/coreComponents/finiteVolume/FluxApproximationBase.cpp index aecbd17194b..15ac738279e 100644 --- a/src/coreComponents/finiteVolume/FluxApproximationBase.cpp +++ b/src/coreComponents/finiteVolume/FluxApproximationBase.cpp @@ -81,7 +81,7 @@ void FluxApproximationBase::registerDataOnMesh( Group & meshBodies ) registerFractureStencil( stencilGroup ); // For each face-based boundary condition on target field, create a boundary stencil fsManager.apply( 0.0, - dynamicCast< DomainPartition & >( *meshBodies.getParent() ), // TODO: Apply() should take a MeshLevel directly + dynamicCast< DomainPartition & >( meshBodies.getParent() ), // TODO: Apply() should take a MeshLevel directly "faceManager", m_fieldName, [&] ( FieldSpecificationBase const &, diff --git a/src/coreComponents/managers/DomainPartition.hpp b/src/coreComponents/managers/DomainPartition.hpp index c9d8db8e41a..3845e298157 100644 --- a/src/coreComponents/managers/DomainPartition.hpp +++ b/src/coreComponents/managers/DomainPartition.hpp @@ -160,13 +160,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 >( "NumericalMethods" ); } /** * @brief @return Return a reference to NumericalMethodsManager from ProblemManager */ NumericalMethodsManager & getNumericalMethodManager() - { return this->getParent()->getGroup< NumericalMethodsManager >( "NumericalMethods" ); } + { return this->getParent().getGroup< NumericalMethodsManager >( "NumericalMethods" ); } /** * @brief Get the mesh bodies, const version. diff --git a/src/coreComponents/managers/Events/EventBase.cpp b/src/coreComponents/managers/Events/EventBase.cpp index 8b9b6817224..3a5d9fd7de3 100644 --- a/src/coreComponents/managers/Events/EventBase.cpp +++ b/src/coreComponents/managers/Events/EventBase.cpp @@ -130,7 +130,7 @@ void EventBase::expandObjectCatalogs() { // Only add children if the parent is of type EventManager // otherwise, this would fall into a loop - if( strcmp( this->getParent()->getName().c_str(), "Events" ) == 0 ) + if( strcmp( this->getParent().getName().c_str(), "Events" ) == 0 ) { for( auto & catalogIter: EventBase::getCatalog()) { diff --git a/src/coreComponents/managers/FieldSpecification/FieldSpecificationManager.hpp b/src/coreComponents/managers/FieldSpecification/FieldSpecificationManager.hpp index f4941f1fbe3..03d42d4aa91 100644 --- a/src/coreComponents/managers/FieldSpecification/FieldSpecificationManager.hpp +++ b/src/coreComponents/managers/FieldSpecification/FieldSpecificationManager.hpp @@ -277,7 +277,7 @@ class FieldSpecificationManager : public dataRepository::Group LAMBDA && lambda ) const { - if( ( target.getParent()->getName() == ElementRegionBase::viewKeyStruct::elementSubRegions() + if( ( target.getParent().getName() == ElementRegionBase::viewKeyStruct::elementSubRegions() || target.getName() == "nodeManager" || target.getName() == "FaceManager" || target.getName() == "edgeManager" ) // TODO these 3 strings are harcoded because for the moment, there are diff --git a/src/coreComponents/mesh/FaceElementSubRegion.cpp b/src/coreComponents/mesh/FaceElementSubRegion.cpp index df0418aed73..eee1954a0cc 100644 --- a/src/coreComponents/mesh/FaceElementSubRegion.cpp +++ b/src/coreComponents/mesh/FaceElementSubRegion.cpp @@ -57,7 +57,7 @@ FaceElementSubRegion::FaceElementSubRegion( string const & name, #endif m_surfaceElementsToCells.resize( 0, 2 ); - m_surfaceElementsToCells.setElementRegionManager( dynamicCast< ElementRegionManager & >( *getParent()->getParent()->getParent()->getParent() ) ); + m_surfaceElementsToCells.setElementRegionManager( dynamicCast< ElementRegionManager & >( getParent().getParent().getParent().getParent() ) ); m_numNodesPerElement = 8; } diff --git a/src/coreComponents/mesh/WellElementSubRegion.cpp b/src/coreComponents/mesh/WellElementSubRegion.cpp index ca630a5cd79..da4bca60751 100644 --- a/src/coreComponents/mesh/WellElementSubRegion.cpp +++ b/src/coreComponents/mesh/WellElementSubRegion.cpp @@ -743,7 +743,7 @@ void WellElementSubRegion::updateNodeManagerNodeToElementMap( MeshLevel & mesh ) ArrayOfArrays< localIndex > & toElementList = nodeManager.elementList(); // we get the region and subregion indices in the elemManager - WellElementRegion const & elemRegion = dynamicCast< WellElementRegion & >( *this->getParent()->getParent() ); + WellElementRegion const & elemRegion = dynamicCast< WellElementRegion & >( this->getParent().getParent() ); string const & elemRegionName = elemRegion.getName(); localIndex const iregion = elemManager.getRegions().getIndex( elemRegionName ); diff --git a/src/coreComponents/physicsSolvers/SolverBase.cpp b/src/coreComponents/physicsSolvers/SolverBase.cpp index 481ab93100e..33a7947f143 100644 --- a/src/coreComponents/physicsSolvers/SolverBase.cpp +++ b/src/coreComponents/physicsSolvers/SolverBase.cpp @@ -882,9 +882,9 @@ void SolverBase::implicitStepComplete( real64 const & GEOSX_UNUSED_PARAM( time ) R1Tensor const SolverBase::gravityVector() const { R1Tensor rval; - if( dynamicCast< PhysicsSolverManager const * >( getParent() ) != nullptr ) + if( dynamicCast< PhysicsSolverManager const * >( &getParent() ) != nullptr ) { - rval = getParent()->getReference< R1Tensor >( PhysicsSolverManager::viewKeyStruct::gravityVectorString() ); + rval = getParent().getReference< R1Tensor >( PhysicsSolverManager::viewKeyStruct::gravityVectorString() ); } else { diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFlow.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFlow.cpp index 4f0e1883a12..d5e245e8c3c 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFlow.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFlow.cpp @@ -1111,8 +1111,8 @@ void CompositionalMultiphaseFlow::applyDirichletBC( real64 const time, string const & ) { // TODO: hack! Find a better way to get the fluid - Group const * const region = subRegion.getParent()->getParent(); - string const & fluidName = m_fluidModelNames[ targetRegionIndex( region->getName() ) ]; + Group const & region = subRegion.getParent().getParent(); + string const & fluidName = m_fluidModelNames[ targetRegionIndex( region.getName() ) ]; MultiFluidBase & fluid = getConstitutiveModel< MultiFluidBase >( subRegion, fluidName ); arrayView1d< integer const > const ghostRank = diff --git a/src/coreComponents/physicsSolvers/fluidFlow/unitTests/testCompMultiphaseFlow.cpp b/src/coreComponents/physicsSolvers/fluidFlow/unitTests/testCompMultiphaseFlow.cpp index 7c2aa3961dc..5b061ce7ad5 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/unitTests/testCompMultiphaseFlow.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/unitTests/testCompMultiphaseFlow.cpp @@ -187,7 +187,7 @@ void testCompositionNumericalDerivatives( CompositionalMultiphaseFlow & solver, solver.forTargetSubRegions( mesh, [&]( localIndex const targetIndex, ElementSubRegionBase & subRegion ) { - SCOPED_TRACE( subRegion.getParent()->getParent()->getName() + "/" + subRegion.getName() ); + SCOPED_TRACE( subRegion.getParent().getParent().getName() + "/" + subRegion.getName() ); string const & fluidName = solver.fluidModelNames()[targetIndex]; MultiFluidBase const & fluid = subRegion.getConstitutiveModel< MultiFluidBase >( fluidName ); @@ -269,7 +269,7 @@ void testPhaseVolumeFractionNumericalDerivatives( CompositionalMultiphaseFlow & solver.forTargetSubRegions( mesh, [&]( localIndex const targetIndex, ElementSubRegionBase & subRegion ) { - SCOPED_TRACE( subRegion.getParent()->getParent()->getName() + "/" + subRegion.getName() ); + SCOPED_TRACE( subRegion.getParent().getParent().getName() + "/" + subRegion.getName() ); string const & fluidName = solver.fluidModelNames()[targetIndex]; MultiFluidBase const & fluid = subRegion.getConstitutiveModel< MultiFluidBase >( fluidName ); @@ -388,7 +388,7 @@ void testPhaseMobilityNumericalDerivatives( CompositionalMultiphaseFlow & solver solver.forTargetSubRegions( mesh, [&]( localIndex const targetIndex, ElementSubRegionBase & subRegion ) { - SCOPED_TRACE( subRegion.getParent()->getName() + "/" + subRegion.getName() ); + SCOPED_TRACE( subRegion.getParent().getName() + "/" + subRegion.getName() ); string const & fluidName = solver.fluidModelNames()[targetIndex]; MultiFluidBase const & fluid = subRegion.getConstitutiveModel< MultiFluidBase >( fluidName ); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp index a83e60d2a10..c46dded6f3e 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp @@ -102,7 +102,7 @@ void CompositionalMultiphaseWell::postProcessInput() WellSolverBase::postProcessInput(); checkModelNames( m_relPermModelNames, viewKeyStruct::relPermNamesString() ); - CompositionalMultiphaseFlow const & flowSolver = getParent()->getGroup< CompositionalMultiphaseFlow >( getFlowSolverName() ); + CompositionalMultiphaseFlow const & flowSolver = getParent().getGroup< CompositionalMultiphaseFlow >( getFlowSolverName() ); GEOSX_UNUSED_VAR( flowSolver ); GEOSX_ERROR_IF_GT_MSG( m_maxCompFracChange, 1.0, @@ -226,7 +226,7 @@ void CompareMulticomponentModels( MODEL1_TYPE const & lhs, MODEL2_TYPE const & r void CompositionalMultiphaseWell::validateConstitutiveModels( MeshLevel const & meshLevel, ConstitutiveManager const & cm ) const { - CompositionalMultiphaseFlow const & flowSolver = getParent()->getGroup< CompositionalMultiphaseFlow >( getFlowSolverName() ); + CompositionalMultiphaseFlow const & flowSolver = getParent().getGroup< CompositionalMultiphaseFlow >( getFlowSolverName() ); arrayView1d< string const > const & flowTargetRegionNames = flowSolver.targetRegionNames(); arrayView1d< string const > const & flowFluidModels = flowSolver.fluidModelNames(); arrayView1d< string const > const & flowRelPermModels = flowSolver.relPermModelNames(); @@ -1397,7 +1397,7 @@ void CompositionalMultiphaseWell::resetViews( DomainPartition & domain ) MeshLevel & mesh = domain.getMeshBody( 0 ).getMeshLevel( 0 ); ElementRegionManager & elemManager = mesh.getElemManager(); - CompositionalMultiphaseFlow & flowSolver = getParent()->getGroup< CompositionalMultiphaseFlow >( getFlowSolverName() ); + CompositionalMultiphaseFlow & flowSolver = getParent().getGroup< CompositionalMultiphaseFlow >( getFlowSolverName() ); { using keys = CompositionalMultiphaseFlow::viewKeyStruct; diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp index adc806ab005..75842fe9adf 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp @@ -51,7 +51,7 @@ void SinglePhaseWell::postProcessInput() { WellSolverBase::postProcessInput(); - SinglePhaseBase const & flowSolver = getParent()->getGroup< SinglePhaseBase >( getFlowSolverName() ); + SinglePhaseBase const & flowSolver = getParent().getGroup< SinglePhaseBase >( getFlowSolverName() ); GEOSX_UNUSED_VAR( flowSolver ); } @@ -700,7 +700,7 @@ void SinglePhaseWell::resetViews( DomainPartition & domain ) MeshLevel & mesh = domain.getMeshBody( 0 ).getMeshLevel( 0 ); ElementRegionManager & elemManager = mesh.getElemManager(); - SinglePhaseBase & flowSolver = getParent()->getGroup< SinglePhaseBase >( getFlowSolverName() ); + SinglePhaseBase & flowSolver = getParent().getGroup< SinglePhaseBase >( getFlowSolverName() ); { using keys = SinglePhaseBase::viewKeyStruct; diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp index b6a85ee5e54..72af6f81904 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellSolverBase.cpp @@ -173,7 +173,7 @@ void WellSolverBase::initializePreSubGroups() validateModelMapping( meshLevel.getElemManager(), m_fluidModelNames ); } - FlowSolverBase const & flowSolver = getParent()->getGroup< FlowSolverBase >( getFlowSolverName() ); + FlowSolverBase const & flowSolver = getParent().getGroup< FlowSolverBase >( getFlowSolverName() ); m_numDofPerResElement = flowSolver.numDofPerCell(); } diff --git a/src/coreComponents/physicsSolvers/multiphysics/FlowProppantTransportSolver.cpp b/src/coreComponents/physicsSolvers/multiphysics/FlowProppantTransportSolver.cpp index e2f1751b529..6df1b70d013 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/FlowProppantTransportSolver.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/FlowProppantTransportSolver.cpp @@ -55,8 +55,8 @@ void FlowProppantTransportSolver::postProcessInput() { SolverBase::postProcessInput(); - m_proppantSolver = &this->getParent()->getGroup< ProppantTransport >( m_proppantSolverName ); - m_flowSolver = &this->getParent()->getGroup< FlowSolverBase >( m_flowSolverName ); + m_proppantSolver = &this->getParent().getGroup< ProppantTransport >( m_proppantSolverName ); + m_flowSolver = &this->getParent().getGroup< FlowSolverBase >( m_flowSolverName ); } FlowProppantTransportSolver::~FlowProppantTransportSolver() = default; diff --git a/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp b/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp index a075803980e..20460651f73 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp @@ -149,8 +149,8 @@ void HydrofractureSolver::implicitStepComplete( real64 const & time_n, void HydrofractureSolver::postProcessInput() { - m_solidSolver = &this->getParent()->getGroup< SolidMechanicsLagrangianFEM >( m_solidSolverName ); - m_flowSolver = &this->getParent()->getGroup< FlowSolverBase >( m_flowSolverName ); + m_solidSolver = &this->getParent().getGroup< SolidMechanicsLagrangianFEM >( m_solidSolverName ); + m_flowSolver = &this->getParent().getGroup< FlowSolverBase >( m_flowSolverName ); } void HydrofractureSolver::initializePostInitialConditionsPreSubGroups() @@ -174,7 +174,7 @@ real64 HydrofractureSolver::solverStep( real64 const & time_n, { real64 dtReturn = dt; - SolverBase * const surfaceGenerator = this->getParent()->getGroupPointer< SolverBase >( "SurfaceGen" ); + SolverBase * const surfaceGenerator = this->getParent().getGroupPointer< SolverBase >( "SurfaceGen" ); if( m_couplingTypeOption == CouplingTypeOption::SIM_FixedStress ) { @@ -1026,7 +1026,7 @@ void HydrofractureSolver::setNextDt( real64 const & currentDt, } else { - SolverBase & surfaceGenerator = this->getParent()->getGroup< SolverBase >( "SurfaceGen" ); + SolverBase & surfaceGenerator = this->getParent().getGroup< SolverBase >( "SurfaceGen" ); nextDt = surfaceGenerator.GetTimestepRequest() < 1e99 ? surfaceGenerator.GetTimestepRequest() : currentDt; } diff --git a/src/coreComponents/physicsSolvers/multiphysics/LagrangianContactSolver.cpp b/src/coreComponents/physicsSolvers/multiphysics/LagrangianContactSolver.cpp index a906add541b..cd23464a8eb 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/LagrangianContactSolver.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/LagrangianContactSolver.cpp @@ -269,7 +269,7 @@ void LagrangianContactSolver::implicitStepComplete( real64 const & time_n, void LagrangianContactSolver::postProcessInput() { - m_solidSolver = &this->getParent()->getGroup< SolidMechanicsLagrangianFEM >( m_solidSolverName ); + m_solidSolver = &this->getParent().getGroup< SolidMechanicsLagrangianFEM >( m_solidSolverName ); SolverBase::postProcessInput(); } @@ -1695,7 +1695,7 @@ void LagrangianContactSolver::assembleStabilization( DomainPartition const & dom // Form the SurfaceGenerator, get the fracture name and use it to retrieve the faceMap (from fracture element to face) SurfaceGenerator const & - surfaceGenerator = this->getParent()->getGroup< SurfaceGenerator >( "SurfaceGen" ); + surfaceGenerator = this->getParent().getGroup< SurfaceGenerator >( "SurfaceGen" ); SurfaceElementRegion const & fractureRegion = elemManager.getRegion< SurfaceElementRegion >( surfaceGenerator.getFractureRegionName() ); FaceElementSubRegion const & fractureSubRegion = fractureRegion.getSubRegion< FaceElementSubRegion >( "faceElementSubRegion" ); GEOSX_ERROR_IF( !fractureSubRegion.hasWrapper( m_tractionKey ), "The fracture subregion must contain traction field." ); diff --git a/src/coreComponents/physicsSolvers/multiphysics/PhaseFieldFractureSolver.cpp b/src/coreComponents/physicsSolvers/multiphysics/PhaseFieldFractureSolver.cpp index e1c38ad5f06..b23a7e8e937 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/PhaseFieldFractureSolver.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/PhaseFieldFractureSolver.cpp @@ -113,11 +113,11 @@ void PhaseFieldFractureSolver::postProcessInput() // For this coupled solver the minimum number of Newton Iter should be 0 for both flow and solid solver otherwise it // will never converge. SolidMechanicsLagrangianFEM & - solidSolver = this->getParent()->getGroup< SolidMechanicsLagrangianFEM >( m_solidSolverName ); + solidSolver = this->getParent().getGroup< SolidMechanicsLagrangianFEM >( m_solidSolverName ); integer & minNewtonIterSolid = solidSolver.getNonlinearSolverParameters().m_minIterNewton; PhaseFieldDamageFEM & - damageSolver = this->getParent()->getGroup< PhaseFieldDamageFEM >( m_damageSolverName ); + damageSolver = this->getParent().getGroup< PhaseFieldDamageFEM >( m_damageSolverName ); integer & minNewtonIterFluid = damageSolver.getNonlinearSolverParameters().m_minIterNewton; minNewtonIterSolid = 0; @@ -181,10 +181,10 @@ real64 PhaseFieldFractureSolver::splitOperatorStep( real64 const & time_n, real64 dtReturnTemporary; SolidMechanicsLagrangianFEM & - solidSolver = this->getParent()->getGroup< SolidMechanicsLagrangianFEM >( m_solidSolverName ); + solidSolver = this->getParent().getGroup< SolidMechanicsLagrangianFEM >( m_solidSolverName ); PhaseFieldDamageFEM & - damageSolver = this->getParent()->getGroup< PhaseFieldDamageFEM >( m_damageSolverName ); + damageSolver = this->getParent().getGroup< PhaseFieldDamageFEM >( m_damageSolverName ); damageSolver.setupSystem( domain, damageSolver.getDofManager(), @@ -291,10 +291,10 @@ void PhaseFieldFractureSolver::mapDamageToQuadrature( DomainPartition & domain ) NodeManager & nodeManager = mesh.getNodeManager(); SolidMechanicsLagrangianFEM & - solidSolver = this->getParent()->getGroup< SolidMechanicsLagrangianFEM >( m_solidSolverName ); + solidSolver = this->getParent().getGroup< SolidMechanicsLagrangianFEM >( m_solidSolverName ); PhaseFieldDamageFEM const & - damageSolver = this->getParent()->getGroup< PhaseFieldDamageFEM >( m_damageSolverName ); + damageSolver = this->getParent().getGroup< PhaseFieldDamageFEM >( m_damageSolverName ); string const & damageFieldName = damageSolver.getFieldName(); diff --git a/src/coreComponents/physicsSolvers/multiphysics/PoroelasticSolver.cpp b/src/coreComponents/physicsSolvers/multiphysics/PoroelasticSolver.cpp index 5b8eac4119c..34c2b6115fb 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/PoroelasticSolver.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/PoroelasticSolver.cpp @@ -157,8 +157,8 @@ void PoroelasticSolver::postProcessInput() { SolverBase::postProcessInput(); - m_flowSolver = &this->getParent()->getGroup< SinglePhaseBase >( m_flowSolverName ); - m_solidSolver = &this->getParent()->getGroup< SolidMechanicsLagrangianFEM >( m_solidSolverName ); + m_flowSolver = &this->getParent().getGroup< SinglePhaseBase >( m_flowSolverName ); + m_solidSolver = &this->getParent().getGroup< SolidMechanicsLagrangianFEM >( m_solidSolverName ); m_solidSolver->setEffectiveStress( 1 ); diff --git a/src/coreComponents/physicsSolvers/multiphysics/PoroelasticSolverEmbeddedFractures.cpp b/src/coreComponents/physicsSolvers/multiphysics/PoroelasticSolverEmbeddedFractures.cpp index 104295bd8f4..5f5076f5ba9 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/PoroelasticSolverEmbeddedFractures.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/PoroelasticSolverEmbeddedFractures.cpp @@ -67,7 +67,7 @@ void PoroelasticSolverEmbeddedFractures::postProcessInput() { PoroelasticSolver::postProcessInput(); - m_fracturesSolver = &this->getParent()->getGroup< SolidMechanicsEmbeddedFractures >( m_fracturesSolverName ); + m_fracturesSolver = &this->getParent().getGroup< SolidMechanicsEmbeddedFractures >( m_fracturesSolverName ); } void PoroelasticSolverEmbeddedFractures::registerDataOnMesh( dataRepository::Group & meshBodies ) diff --git a/src/coreComponents/physicsSolvers/multiphysics/ReservoirSolverBase.cpp b/src/coreComponents/physicsSolvers/multiphysics/ReservoirSolverBase.cpp index 54e10b68856..19fb838d131 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/ReservoirSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/ReservoirSolverBase.cpp @@ -61,8 +61,8 @@ void ReservoirSolverBase::postProcessInput() { SolverBase::postProcessInput(); - m_flowSolver = &this->getParent()->getGroup< FlowSolverBase >( m_flowSolverName ); - m_wellSolver = &this->getParent()->getGroup< WellSolverBase >( m_wellSolverName ); + m_flowSolver = &this->getParent().getGroup< FlowSolverBase >( m_flowSolverName ); + m_wellSolver = &this->getParent().getGroup< WellSolverBase >( m_wellSolverName ); m_wellSolver->setFlowSolverName( m_flowSolverName ); m_flowSolver->setReservoirWellsCoupling(); diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsEmbeddedFractures.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsEmbeddedFractures.cpp index 9809f801fef..8b19e48a912 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsEmbeddedFractures.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsEmbeddedFractures.cpp @@ -75,7 +75,7 @@ SolidMechanicsEmbeddedFractures::~SolidMechanicsEmbeddedFractures() void SolidMechanicsEmbeddedFractures::postProcessInput() { - m_solidSolver = &this->getParent()->getGroup< SolidMechanicsLagrangianFEM >( m_solidSolverName ); + m_solidSolver = &this->getParent().getGroup< SolidMechanicsLagrangianFEM >( m_solidSolverName ); } void SolidMechanicsEmbeddedFractures::registerDataOnMesh( dataRepository::Group & meshBodies ) diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp index 55b8022ca43..3f3e84fb83d 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp @@ -500,7 +500,7 @@ real64 SolidMechanicsLagrangianFEM::solverStep( real64 const & time_n, GEOSX_MARK_FUNCTION; real64 dtReturn = dt; - SolverBase * const surfaceGenerator = this->getParent()->getGroupPointer< SolverBase >( "SurfaceGen" ); + SolverBase * const surfaceGenerator = this->getParent().getGroupPointer< SolverBase >( "SurfaceGen" ); if( m_timeIntegrationOption == TimeIntegrationOption::ExplicitDynamic ) { diff --git a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp index 043fc2273b7..26387c68fc3 100644 --- a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp +++ b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp @@ -1906,7 +1906,7 @@ void SurfaceGenerator::performFracture( const localIndex nodeID, const std::pair< CellElementSubRegion *, localIndex > & elem = iter_elem->first; CellElementSubRegion & elemSubRegion = *(elem.first); - ElementRegionBase & elemRegion = dynamicCast< ElementRegionBase & >( *elemSubRegion.getParent()->getParent() ); + ElementRegionBase & elemRegion = dynamicCast< ElementRegionBase & >( elemSubRegion.getParent().getParent() ); string const & elemRegionName = elemRegion.getName(); localIndex const regionIndex = elementManager.getRegions().getIndex( elemRegionName );