From 766daa3ec758e26ddf0a54cecbaeec628b4cf145 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Thu, 14 Aug 2025 14:23:39 -0500 Subject: [PATCH 01/43] refactor: constitutive cleanup --- .../constitutive/CMakeLists.txt | 2 +- .../constitutive/ConstitutiveBase.cpp | 2 + .../constitutive/ConstitutiveBase.hpp | 13 ++++ src/coreComponents/constitutive/NullModel.cpp | 3 - src/coreComponents/constitutive/NullModel.hpp | 8 +-- .../CapillaryPressureBase.cpp | 7 -- .../CapillaryPressureBase.hpp | 17 ++--- .../JFunctionCapillaryPressure.cpp | 8 +-- .../JFunctionCapillaryPressure.hpp | 11 ++- .../constitutive/contact/BartonBandis.cpp | 3 - .../constitutive/contact/BartonBandis.hpp | 16 ++--- .../constitutive/contact/CoulombFriction.cpp | 11 +-- .../constitutive/contact/CoulombFriction.hpp | 51 +++++++------ .../constitutive/contact/FrictionBase.cpp | 3 - .../constitutive/contact/FrictionBase.hpp | 5 -- .../contact/FrictionlessContact.cpp | 3 - .../contact/FrictionlessContact.hpp | 13 ---- .../contact/HydraulicApertureBase.cpp | 5 -- .../contact/HydraulicApertureBase.hpp | 2 +- .../contact/HydraulicApertureTable.cpp | 14 ---- .../contact/HydraulicApertureTable.hpp | 12 +--- .../contact/RateAndStateFriction.cpp | 11 --- .../contact/RateAndStateFriction.hpp | 71 +++++++++---------- .../diffusion/ConstantDiffusion.cpp | 14 +--- .../diffusion/ConstantDiffusion.hpp | 13 ++-- .../constitutive/diffusion/DiffusionBase.cpp | 14 ++-- .../constitutive/diffusion/DiffusionBase.hpp | 13 ++-- .../dispersion/DispersionBase.cpp | 5 +- .../dispersion/DispersionBase.hpp | 13 ++-- .../dispersion/LinearIsotropicDispersion.cpp | 7 -- .../dispersion/LinearIsotropicDispersion.hpp | 3 - .../functions/EzrokhiBrineDensity.hpp | 2 - .../functions/EzrokhiBrineViscosity.hpp | 2 - .../functions/FenghourCO2Viscosity.hpp | 2 - .../CO2Brine/functions/NoOpPVTFunction.hpp | 2 - .../functions/PhillipsBrineViscosity.hpp | 2 - .../fluid/multifluid/MultiFluidBase.cpp | 7 -- .../fluid/multifluid/MultiFluidBase.hpp | 7 +- .../CompositionalMultiphaseFluid.cpp | 15 ++-- .../CompositionalMultiphaseFluid.hpp | 3 - .../compositional/models/NullModel.hpp | 2 - .../CompressibleSinglePhaseFluid.cpp | 7 +- .../CompressibleSinglePhaseFluid.hpp | 7 +- .../fluid/singlefluid/ParticleFluid.cpp | 2 - .../fluid/singlefluid/ParticleFluid.hpp | 2 - .../fluid/singlefluid/ParticleFluidBase.cpp | 15 +--- .../fluid/singlefluid/ParticleFluidBase.hpp | 8 +-- .../fluid/singlefluid/ProppantSlurryFluid.cpp | 8 +-- .../fluid/singlefluid/ProppantSlurryFluid.hpp | 7 +- .../fluid/singlefluid/SingleFluidBase.cpp | 29 +++----- .../fluid/singlefluid/SingleFluidBase.hpp | 7 +- .../fluid/singlefluid/SlurryFluidBase.cpp | 38 +++++----- .../fluid/singlefluid/SlurryFluidBase.hpp | 35 ++++----- .../ThermalCompressibleSinglePhaseFluid.cpp | 10 +-- .../ThermalCompressibleSinglePhaseFluid.hpp | 7 +- .../TwoPhaseImmiscibleFluid.cpp | 15 ---- .../TwoPhaseImmiscibleFluid.hpp | 9 +-- .../permeability/CarmanKozenyPermeability.cpp | 8 +-- .../permeability/CarmanKozenyPermeability.hpp | 7 +- .../permeability/ConstantPermeability.cpp | 7 +- .../permeability/ConstantPermeability.hpp | 5 +- .../permeability/DamagePermeability.cpp | 18 +---- .../permeability/DamagePermeability.hpp | 10 --- .../ExponentialDecayPermeability.cpp | 18 ++--- .../ExponentialDecayPermeability.hpp | 10 ++- .../ParallelPlatesPermeability.cpp | 14 +--- .../ParallelPlatesPermeability.hpp | 12 ++-- .../permeability/PermeabilityBase.cpp | 16 +---- .../permeability/PermeabilityBase.hpp | 8 +-- .../permeability/PressurePermeability.cpp | 30 +++----- .../permeability/PressurePermeability.hpp | 8 +-- .../permeability/ProppantPermeability.cpp | 13 +--- .../permeability/ProppantPermeability.hpp | 8 +-- .../SlipDependentPermeability.cpp | 14 +--- .../SlipDependentPermeability.hpp | 10 ++- .../WillisRichardsPermeability.cpp | 18 ++--- .../WillisRichardsPermeability.hpp | 10 ++- .../RelativePermeabilityBase.cpp | 7 -- .../RelativePermeabilityBase.hpp | 5 +- .../constitutive/solid/CeramicDamage.cpp | 19 ++--- .../constitutive/solid/CeramicDamage.hpp | 23 ++---- .../constitutive/solid/CompressibleSolid.cpp | 4 -- .../constitutive/solid/CompressibleSolid.hpp | 3 - .../constitutive/solid/CoupledSolid.hpp | 9 --- .../constitutive/solid/CoupledSolidBase.cpp | 3 +- .../constitutive/solid/CoupledSolidBase.hpp | 3 - .../constitutive/solid/Damage.cpp | 29 ++++---- .../constitutive/solid/Damage.hpp | 8 +-- .../constitutive/solid/DamageSpectral.cpp | 4 -- .../constitutive/solid/DamageSpectral.hpp | 7 +- .../constitutive/solid/DamageVolDev.cpp | 4 -- .../constitutive/solid/DamageVolDev.hpp | 3 +- .../constitutive/solid/DelftEgg.cpp | 13 ++-- .../constitutive/solid/DelftEgg.hpp | 21 ++---- .../PoreVolumeCompressibleSolid.cpp | 13 +--- .../PoreVolumeCompressibleSolid.hpp | 9 +-- .../solid/Deprecated/PoroElastic.cpp | 14 ++-- .../solid/Deprecated/PoroElastic.hpp | 16 ++--- .../constitutive/solid/DruckerPrager.cpp | 13 ++-- .../constitutive/solid/DruckerPrager.hpp | 21 ++---- .../solid/DruckerPragerExtended.cpp | 13 ++-- .../solid/DruckerPragerExtended.hpp | 21 ++---- .../constitutive/solid/DuvautLionsSolid.cpp | 13 ---- .../constitutive/solid/DuvautLionsSolid.hpp | 11 +-- .../constitutive/solid/ElasticIsotropic.cpp | 3 - .../constitutive/solid/ElasticIsotropic.hpp | 10 +-- .../ElasticIsotropicPressureDependent.cpp | 4 -- .../ElasticIsotropicPressureDependent.hpp | 14 ++-- .../constitutive/solid/ElasticOrthotropic.cpp | 3 - .../constitutive/solid/ElasticOrthotropic.hpp | 10 +-- .../solid/ElasticTransverseIsotropic.cpp | 3 - .../solid/ElasticTransverseIsotropic.hpp | 10 +-- .../constitutive/solid/ModifiedCamClay.cpp | 14 ++-- .../constitutive/solid/ModifiedCamClay.hpp | 24 ++----- .../constitutive/solid/PerfectlyPlastic.cpp | 17 ----- .../constitutive/solid/PerfectlyPlastic.hpp | 20 +----- .../constitutive/solid/PorousDamageSolid.cpp | 3 - .../constitutive/solid/PorousDamageSolid.hpp | 3 - .../constitutive/solid/PorousSolid.cpp | 3 - .../constitutive/solid/PorousSolid.hpp | 3 - .../constitutive/solid/ProppantSolid.cpp | 4 -- .../constitutive/solid/ProppantSolid.hpp | 3 - .../constitutive/solid/SolidBase.cpp | 15 ++-- .../constitutive/solid/SolidBase.hpp | 15 +--- .../solid/SolidInternalEnergy.cpp | 11 ++- .../solid/SolidInternalEnergy.hpp | 7 +- ...odelDiscretizationOpsFullyAnisotropic.hpp} | 12 ++-- .../solid/porosity/BiotPorosity.cpp | 7 +- .../solid/porosity/BiotPorosity.hpp | 4 +- .../solid/porosity/PorosityBase.cpp | 15 ++-- .../solid/porosity/PorosityBase.hpp | 7 +- .../solid/porosity/PressurePorosity.cpp | 12 ---- .../solid/porosity/PressurePorosity.hpp | 4 -- .../solid/porosity/ProppantPorosity.cpp | 15 ---- .../solid/porosity/ProppantPorosity.hpp | 8 --- .../MultiPhaseConstantThermalConductivity.cpp | 16 ++--- .../MultiPhaseConstantThermalConductivity.hpp | 8 +-- .../MultiPhaseThermalConductivityBase.cpp | 9 +-- .../MultiPhaseThermalConductivityBase.hpp | 14 +--- ...PhaseVolumeWeightedThermalConductivity.cpp | 16 ++--- ...PhaseVolumeWeightedThermalConductivity.hpp | 8 +-- .../SinglePhaseThermalConductivity.cpp | 13 ---- .../SinglePhaseThermalConductivity.hpp | 6 -- .../SinglePhaseThermalConductivityBase.cpp | 9 +-- .../SinglePhaseThermalConductivityBase.hpp | 14 +--- .../fluidFlow/FlowSolverBase.cpp | 1 - 146 files changed, 425 insertions(+), 1148 deletions(-) rename src/coreComponents/constitutive/solid/{SolidModelDiscretizationOpsFullyAnisotroipic.hpp => SolidModelDiscretizationOpsFullyAnisotropic.hpp} (97%) diff --git a/src/coreComponents/constitutive/CMakeLists.txt b/src/coreComponents/constitutive/CMakeLists.txt index dae28e482e0..022e08f5671 100644 --- a/src/coreComponents/constitutive/CMakeLists.txt +++ b/src/coreComponents/constitutive/CMakeLists.txt @@ -194,7 +194,7 @@ set( constitutive_headers solid/SolidUtilities.hpp solid/SolidInternalEnergy.hpp solid/SolidModelDiscretizationOps.hpp - solid/SolidModelDiscretizationOpsFullyAnisotroipic.hpp + solid/SolidModelDiscretizationOpsFullyAnisotropic.hpp solid/SolidModelDiscretizationOpsIsotropic.hpp solid/SolidModelDiscretizationOpsTransverseIsotropic.hpp solid/SolidModelDiscretizationOpsOrthotropic.hpp diff --git a/src/coreComponents/constitutive/ConstitutiveBase.cpp b/src/coreComponents/constitutive/ConstitutiveBase.cpp index 7323a649605..338ba871edf 100644 --- a/src/coreComponents/constitutive/ConstitutiveBase.cpp +++ b/src/coreComponents/constitutive/ConstitutiveBase.cpp @@ -47,6 +47,8 @@ void ConstitutiveBase::allocateConstitutiveData( dataRepository::Group & parent, { m_numQuadraturePoints = numConstitutivePointsPerParentIndex; + resizeFields( parent.size(), numConstitutivePointsPerParentIndex ); + for( auto & group : this->getSubGroups() ) { for( auto & wrapper : group.second->wrappers() ) diff --git a/src/coreComponents/constitutive/ConstitutiveBase.hpp b/src/coreComponents/constitutive/ConstitutiveBase.hpp index dd872e450cc..99b5cdbc8a4 100644 --- a/src/coreComponents/constitutive/ConstitutiveBase.hpp +++ b/src/coreComponents/constitutive/ConstitutiveBase.hpp @@ -176,6 +176,19 @@ class ConstitutiveBase : public dataRepository::Group return m_userFields; } +protected: + + /** + * @brief Function called internally to resize member arrays + * @param size primary dimension (e.g. number of cells) + * @param numPts secondary dimension (e.g. number of gauss points per cell) + */ + virtual void resizeFields( localIndex const GEOS_UNUSED_PARAM( size ), + localIndex const GEOS_UNUSED_PARAM( numPts ) ) + { + // Nothing to do + } + private: /** diff --git a/src/coreComponents/constitutive/NullModel.cpp b/src/coreComponents/constitutive/NullModel.cpp index 9676802af3d..c8b2141a3ec 100644 --- a/src/coreComponents/constitutive/NullModel.cpp +++ b/src/coreComponents/constitutive/NullModel.cpp @@ -25,9 +25,6 @@ NullModel::NullModel( string const & name, ConstitutiveBase( name, parent ) {} -NullModel::~NullModel() -{} - REGISTER_CATALOG_ENTRY( ConstitutiveBase, NullModel, string const &, dataRepository::Group * const ) } // constitutive diff --git a/src/coreComponents/constitutive/NullModel.hpp b/src/coreComponents/constitutive/NullModel.hpp index ceddf84a4ac..8a93ca7b726 100644 --- a/src/coreComponents/constitutive/NullModel.hpp +++ b/src/coreComponents/constitutive/NullModel.hpp @@ -34,16 +34,10 @@ class NullModel : public constitutive::ConstitutiveBase NullModel( string const & name, Group * const parent ); - /// Destrutor - virtual ~NullModel(); - - /// string name to use for this class in the catalog - static constexpr auto m_catalogNameString = "NullModel"; - /** * @return A string that is used to register/lookup this class in the registry */ - static string catalogName() { return m_catalogNameString; } + static string catalogName() { return "NullModel"; } virtual string getCatalogName() const override { return catalogName(); } diff --git a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp index 97eb0127978..8482009b9c1 100644 --- a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp +++ b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp @@ -103,13 +103,6 @@ void CapillaryPressureBase::setLabels() setDimLabels( 2, m_phaseNames ); } -void CapillaryPressureBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - resizeFields( parent.size(), numConstitutivePointsPerParentIndex ); - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); -} - } // namespace constitutive } // namespace geos diff --git a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp index 7c581cc4e58..c6671df2be6 100644 --- a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp +++ b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp @@ -104,9 +104,6 @@ class CapillaryPressureBase : public ConstitutiveBase CapillaryPressureBase( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - /** * @brief Initialize the capillary pressure state (needed when capillary pressure depends on porosity and permeability) * @param[in] initialPorosity the initial porosity field after reservoir initialization @@ -163,13 +160,6 @@ class CapillaryPressureBase : public ConstitutiveBase private: - /** - * @brief Function called internally to resize member arrays - * @param size primary dimension (e.g. number of cells) - * @param numPts secondary dimension (e.g. number of gauss points per cell) - */ - void resizeFields( localIndex const size, localIndex const numPts ); - /** * @brief Called internally to set array dim labels. */ @@ -179,6 +169,13 @@ class CapillaryPressureBase : public ConstitutiveBase virtual void postInputInitialization() override; + /** + * @brief Function called internally to resize member arrays + * @param size primary dimension (e.g. number of cells) + * @param numPts secondary dimension (e.g. number of gauss points per cell) + */ + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + // phase names read from input string_array m_phaseNames; diff --git a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp index 3e67db4b27b..c5bf26cfcf1 100644 --- a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp +++ b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp @@ -340,11 +340,11 @@ JFunctionCapillaryPressure::createKernelWrapper() m_dPhaseCapPressure_dPhaseVolFrac ); } -void JFunctionCapillaryPressure::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void JFunctionCapillaryPressure::resizeFields( localIndex const size, localIndex const numPts ) { - m_jFuncMultiplier.resize( parent.size(), numFluidPhases()-1 ); - CapillaryPressureBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + CapillaryPressureBase::resizeFields( size, numPts ); + + m_jFuncMultiplier.resize( size, numFluidPhases()-1 ); } diff --git a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp index 55f099e24fa..97cb104e6e5 100644 --- a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp +++ b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp @@ -46,9 +46,6 @@ class JFunctionCapillaryPressure : public CapillaryPressureBase JFunctionCapillaryPressure( std::string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - virtual void initializeRockState( arrayView2d< real64 const > const & initialPorosity, arrayView3d< real64 const > const & initialPermeability ) const override; @@ -126,6 +123,14 @@ class JFunctionCapillaryPressure : public CapillaryPressureBase Z, ///< use permz only }; +protected: + + /** + * @brief Function called internally to resize member arrays + * @param size primary dimension (e.g. number of cells) + * @param numPts secondary dimension (e.g. number of gauss points per cell) + */ + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; private: diff --git a/src/coreComponents/constitutive/contact/BartonBandis.cpp b/src/coreComponents/constitutive/contact/BartonBandis.cpp index 6ff08287cf6..e2c52f87d42 100644 --- a/src/coreComponents/constitutive/contact/BartonBandis.cpp +++ b/src/coreComponents/constitutive/contact/BartonBandis.cpp @@ -38,9 +38,6 @@ BartonBandis::BartonBandis( string const & name, Group * const parent ): setDescription( " Reference normal stress." ); } -BartonBandis::~BartonBandis() -{} - void BartonBandis::postInputInitialization() { GEOS_THROW_IF( m_referenceNormalStress <= 0.0, diff --git a/src/coreComponents/constitutive/contact/BartonBandis.hpp b/src/coreComponents/constitutive/contact/BartonBandis.hpp index 9cb4c9fc465..e8949781147 100644 --- a/src/coreComponents/constitutive/contact/BartonBandis.hpp +++ b/src/coreComponents/constitutive/contact/BartonBandis.hpp @@ -99,11 +99,6 @@ class BartonBandis : public HydraulicApertureBase BartonBandis( string const & name, Group * const parent ); - /** - * @brief default destructor - */ - virtual ~BartonBandis() override; - static string catalogName() { return "BartonBandis"; } virtual string getCatalogName() const override { return catalogName(); } @@ -118,17 +113,18 @@ class BartonBandis : public HydraulicApertureBase */ KernelWrapper createKernelWrapper() const; + struct viewKeyStruct : public HydraulicApertureBase::viewKeyStruct + { + /// string/key for reference normal stress + static constexpr char const * referenceNormalStressString() { return "referenceNormalStress"; } + }; + protected: virtual void postInputInitialization() override; private: - struct viewKeyStruct : public HydraulicApertureBase::viewKeyStruct - { - /// string/key for reference normal stress - static constexpr char const * referenceNormalStressString() { return "referenceNormalStress"; } - }; /// Reference normal stress real64 m_referenceNormalStress; }; diff --git a/src/coreComponents/constitutive/contact/CoulombFriction.cpp b/src/coreComponents/constitutive/contact/CoulombFriction.cpp index d59d3d99a45..7e38ef0eaa2 100644 --- a/src/coreComponents/constitutive/contact/CoulombFriction.cpp +++ b/src/coreComponents/constitutive/contact/CoulombFriction.cpp @@ -52,9 +52,6 @@ CoulombFriction::CoulombFriction( string const & name, Group * const parent ): setDescription( "Elastic Slip" ); } -CoulombFriction::~CoulombFriction() -{} - void CoulombFriction::postInputInitialization() { GEOS_THROW_IF( m_frictionCoefficient < 0.0, @@ -63,15 +60,13 @@ void CoulombFriction::postInputInitialization() } -void CoulombFriction::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void CoulombFriction::resizeFields( localIndex const size, localIndex const numPts ) { - m_elasticSlip.resize( 0, 2 ); + FrictionBase::resizeFields( size, numPts ); - FrictionBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_elasticSlip.resize( 0, 2 ); } - CoulombFrictionUpdates CoulombFriction::createKernelUpdates() const { return CoulombFrictionUpdates( m_displacementJumpThreshold, diff --git a/src/coreComponents/constitutive/contact/CoulombFriction.hpp b/src/coreComponents/constitutive/contact/CoulombFriction.hpp index 32b975acc97..06935f5386d 100644 --- a/src/coreComponents/constitutive/contact/CoulombFriction.hpp +++ b/src/coreComponents/constitutive/contact/CoulombFriction.hpp @@ -164,20 +164,12 @@ class CoulombFriction : public FrictionBase */ CoulombFriction( string const & name, Group * const parent ); - /** - * Default Destructor - */ - virtual ~CoulombFriction() override; - static string catalogName() { return "Coulomb"; } virtual string getCatalogName() const override { return catalogName(); } ///@} - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override final; - /// Type of kernel wrapper for in-kernel update using KernelWrapper = CoulombFrictionUpdates; @@ -187,10 +179,35 @@ class CoulombFriction : public FrictionBase */ KernelWrapper createKernelUpdates() const; + /** + * @struct Set of "char const *" and keys for data specified in this class. + */ + struct viewKeyStruct : public FrictionBase::viewKeyStruct + { + /// string/key for shear stiffness + static constexpr char const * shearStiffnessString() { return "shearStiffness"; } + + /// string/key for cohesion + static constexpr char const * cohesionString() { return "cohesion"; } + + /// string/key for friction coefficient + static constexpr char const * frictionCoefficientString() { return "frictionCoefficient"; } + + /// string/key for the elastic slip + static constexpr char const * elasticSlipString() { return "elasticSlip"; } + }; + protected: virtual void postInputInitialization() override; + /** + * @brief Function called internally to resize member arrays + * @param size primary dimension (e.g. number of cells) + * @param numPts secondary dimension (e.g. number of gauss points per cell) + */ + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + private: /// The shear stiffness @@ -205,24 +222,6 @@ class CoulombFriction : public FrictionBase /// Elastic slip array2d< real64 > m_elasticSlip; -/** - * @struct Set of "char const *" and keys for data specified in this class. - */ - struct viewKeyStruct : public FrictionBase::viewKeyStruct - { - /// string/key for shear stiffness - static constexpr char const * shearStiffnessString() { return "shearStiffness"; } - - /// string/key for cohesion - static constexpr char const * cohesionString() { return "cohesion"; } - - /// string/key for friction coefficient - static constexpr char const * frictionCoefficientString() { return "frictionCoefficient"; } - - /// string/key for the elastic slip - static constexpr char const * elasticSlipString() { return "elasticSlip"; } - }; - }; diff --git a/src/coreComponents/constitutive/contact/FrictionBase.cpp b/src/coreComponents/constitutive/contact/FrictionBase.cpp index d440e9c53bb..859d0375081 100644 --- a/src/coreComponents/constitutive/contact/FrictionBase.cpp +++ b/src/coreComponents/constitutive/contact/FrictionBase.cpp @@ -39,9 +39,6 @@ FrictionBase::FrictionBase( string const & name, setDescription( "A threshold valued to determine whether a fracture is open or not." ); } -FrictionBase::~FrictionBase() -{} - FrictionBaseUpdates FrictionBase::createKernelWrapper() const { return FrictionBaseUpdates( m_displacementJumpThreshold ); diff --git a/src/coreComponents/constitutive/contact/FrictionBase.hpp b/src/coreComponents/constitutive/contact/FrictionBase.hpp index 290c09a4b56..eb755268feb 100644 --- a/src/coreComponents/constitutive/contact/FrictionBase.hpp +++ b/src/coreComponents/constitutive/contact/FrictionBase.hpp @@ -223,11 +223,6 @@ class FrictionBase : public ConstitutiveBase FrictionBase( string const & name, Group * const parent ); - /** - * @brief default destructor - */ - virtual ~FrictionBase() override; - /// Type of kernel wrapper for in-kernel update using KernelWrapper = FrictionBaseUpdates; diff --git a/src/coreComponents/constitutive/contact/FrictionlessContact.cpp b/src/coreComponents/constitutive/contact/FrictionlessContact.cpp index de63d4d8812..52f911eab62 100644 --- a/src/coreComponents/constitutive/contact/FrictionlessContact.cpp +++ b/src/coreComponents/constitutive/contact/FrictionlessContact.cpp @@ -32,9 +32,6 @@ FrictionlessContact::FrictionlessContact( string const & name, FrictionBase( name, parent ) {} -FrictionlessContact::~FrictionlessContact() -{} - FrictionlessContactUpdates FrictionlessContact::createKernelUpdates() const { return FrictionlessContactUpdates( m_displacementJumpThreshold ); diff --git a/src/coreComponents/constitutive/contact/FrictionlessContact.hpp b/src/coreComponents/constitutive/contact/FrictionlessContact.hpp index 06a8f9c3429..5f57c892201 100644 --- a/src/coreComponents/constitutive/contact/FrictionlessContact.hpp +++ b/src/coreComponents/constitutive/contact/FrictionlessContact.hpp @@ -85,11 +85,6 @@ class FrictionlessContact : public FrictionBase FrictionlessContact( string const & name, Group * const parent ); - /** - * @brief default destructor - */ - virtual ~FrictionlessContact() override; - /** * @return A string that is used to register/lookup this class in the registry */ @@ -106,14 +101,6 @@ class FrictionlessContact : public FrictionBase */ KernelWrapper createKernelUpdates() const; - /** - * @struct Structure to hold scoped key names - */ - struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct - {}; - -protected: - }; diff --git a/src/coreComponents/constitutive/contact/HydraulicApertureBase.cpp b/src/coreComponents/constitutive/contact/HydraulicApertureBase.cpp index 2f5c715453c..8efdc7c2825 100644 --- a/src/coreComponents/constitutive/contact/HydraulicApertureBase.cpp +++ b/src/coreComponents/constitutive/contact/HydraulicApertureBase.cpp @@ -39,11 +39,6 @@ HydraulicApertureBase::HydraulicApertureBase( string const & name, setDescription( "Reference hydraulic aperture. It is the aperture at zero normal stress." ); } -HydraulicApertureBase::~HydraulicApertureBase() -{} - - - } /* namespace constitutive */ } /* namespace geos */ diff --git a/src/coreComponents/constitutive/contact/HydraulicApertureBase.hpp b/src/coreComponents/constitutive/contact/HydraulicApertureBase.hpp index 377e6894810..e6c22934403 100644 --- a/src/coreComponents/constitutive/contact/HydraulicApertureBase.hpp +++ b/src/coreComponents/constitutive/contact/HydraulicApertureBase.hpp @@ -51,7 +51,7 @@ class HydraulicApertureBase : public ConstitutiveBase /** * @brief default destructor */ - virtual ~HydraulicApertureBase() override; + virtual ~HydraulicApertureBase() override = default; protected: diff --git a/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp b/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp index 6fe5c08b42f..a11cdbeb70d 100644 --- a/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp +++ b/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp @@ -50,25 +50,12 @@ HydraulicApertureTable::HydraulicApertureTable( string const & name, setDescription( "Name of the aperture table" ); } -HydraulicApertureTable::~HydraulicApertureTable() -{} - - - void HydraulicApertureTable::postInputInitialization() { GEOS_THROW_IF( m_apertureTableName.empty(), getFullName() << ": the aperture table name " << m_apertureTableName << " is empty", InputError ); -} - - -void HydraulicApertureTable::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - FunctionManager & functionManager = FunctionManager::getInstance(); GEOS_THROW_IF( !functionManager.hasGroup( m_apertureTableName ), @@ -116,7 +103,6 @@ void HydraulicApertureTable::allocateConstitutiveData( Group & parent, m_apertureTable = &apertureTable; } - void HydraulicApertureTable::validateApertureTable( TableFunction const & apertureTable ) const { ArrayOfArraysView< real64 const > const coords = apertureTable.getCoordinates(); diff --git a/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp b/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp index 1ac93693ec4..61f157259b8 100644 --- a/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp +++ b/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp @@ -98,20 +98,10 @@ class HydraulicApertureTable : public HydraulicApertureBase HydraulicApertureTable( string const & name, Group * const parent ); - /** - * @brief default destructor - */ - virtual ~HydraulicApertureTable() override; - static string catalogName() { return "HydraulicApertureTable"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override final; - - - /// Type of kernel wrapper for in-kernel update using KernelWrapper = HydraulicApertureTableUpdates; @@ -124,7 +114,7 @@ class HydraulicApertureTable : public HydraulicApertureBase /** * @struct Structure to hold scoped key names */ - struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct + struct viewKeyStruct : public HydraulicApertureBase::viewKeyStruct { /// string/key for aperture tolerance static constexpr char const * apertureToleranceString() { return "apertureTolerance"; } diff --git a/src/coreComponents/constitutive/contact/RateAndStateFriction.cpp b/src/coreComponents/constitutive/contact/RateAndStateFriction.cpp index 8e0d6f684df..690e608f120 100644 --- a/src/coreComponents/constitutive/contact/RateAndStateFriction.cpp +++ b/src/coreComponents/constitutive/contact/RateAndStateFriction.cpp @@ -75,10 +75,6 @@ RateAndStateFriction< USE_SLIP_LAW >::RateAndStateFriction( string const & name, setDescription( "Default value of the Rate- and State-dependent friction reference friction coefficient." ); } -template< typename USE_SLIP_LAW > -RateAndStateFriction< USE_SLIP_LAW >::~RateAndStateFriction() -{} - template< typename USE_SLIP_LAW > void RateAndStateFriction< USE_SLIP_LAW >::postInputInitialization() { @@ -101,13 +97,6 @@ void RateAndStateFriction< USE_SLIP_LAW >::postInputInitialization() setApplyDefaultValue( m_defaultMu0 ); } -template< typename USE_SLIP_LAW > -void RateAndStateFriction< USE_SLIP_LAW >::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - FrictionBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); -} - namespace { typedef RateAndStateFriction< std::integral_constant< bool, true > > RateAndStateFrictionWithSlipLaw; diff --git a/src/coreComponents/constitutive/contact/RateAndStateFriction.hpp b/src/coreComponents/constitutive/contact/RateAndStateFriction.hpp index 0973319fd0c..3e272e1465d 100644 --- a/src/coreComponents/constitutive/contact/RateAndStateFriction.hpp +++ b/src/coreComponents/constitutive/contact/RateAndStateFriction.hpp @@ -55,11 +55,6 @@ class RateAndStateFriction : public FrictionBase */ RateAndStateFriction( string const & name, Group * const parent ); - /** - * Default Destructor - */ - virtual ~RateAndStateFriction() override; - static string catalogName() { if constexpr ( USE_SLIP_LAW::value ) @@ -76,15 +71,41 @@ class RateAndStateFriction : public FrictionBase ///@} - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override final; - enum class StateEvolutionLawType : integer { slipLaw, agingLaw }; + /** + * @struct Set of "char const *" and keys for data specified in this class. + */ + struct viewKeyStruct : public FrictionBase::viewKeyStruct + { + /// string/key for friction coefficient + static constexpr char const * frictionCoefficientString() { return "frictionCoefficient"; } + /// string/key for Rate and State coefficient a + static constexpr char const * aCoefficientString() { return "a"; } + /// string/key for Rate and State coefficient b + static constexpr char const * bCoefficientString() { return "b"; } + /// string/key for Rate and State characteristic length + static constexpr char const * DcCoefficientString() { return "Dc"; } + /// string/key for reference slip rate + static constexpr char const * referenceVelocityString() { return "referenceVelocity"; } + /// string/key for reference friction coefficient + static constexpr char const * referenceFrictionCoefficientString() { return "referenceFrictionCoefficient"; } + /// string/key for the default value of Rate and State coefficient a + static constexpr char const * defaultACoefficientString() { return "defaultA"; } + /// string/key for the default value of Rate and State coefficient b + static constexpr char const * defaultBCoefficientString() { return "defaultB"; } + /// string/key for the default value of Rate and State characteristic length + static constexpr char const * defaultDcCoefficientString() { return "defaultDc"; } + /// string/key for the default value ofreference slip rate + static constexpr char const * defaultReferenceVelocityString() { return "defaultReferenceVelocity"; } + /// string/key for the default value of reference friction coefficient + static constexpr char const * defaultReferenceFrictionCoefficientString() { return "defaultReferenceFrictionCoefficient"; } + }; + class KernelWrapper : public FrictionBaseUpdates { public: @@ -185,17 +206,18 @@ class RateAndStateFriction : public FrictionBase StateEvolutionLawType m_stateEvolutionLawType; }; - /** * @brief Create an update kernel wrapper. * @return the wrapper */ KernelWrapper createKernelUpdates() const; -private: +protected: virtual void postInputInitialization() override; +private: + /// The friction coefficient for each upper level dimension (i.e. cell) of *this array1d< real64 > m_frictionCoefficient; @@ -228,35 +250,6 @@ class RateAndStateFriction : public FrictionBase /// Default value of Rate and State reference friction coefficient real64 m_defaultMu0; -/** - * @struct Set of "char const *" and keys for data specified in this class. - */ - struct viewKeyStruct : public FrictionBase::viewKeyStruct - { - /// string/key for friction coefficient - static constexpr char const * frictionCoefficientString() { return "frictionCoefficient"; } - /// string/key for Rate and State coefficient a - static constexpr char const * aCoefficientString() { return "a"; } - /// string/key for Rate and State coefficient b - static constexpr char const * bCoefficientString() { return "b"; } - /// string/key for Rate and State characteristic length - static constexpr char const * DcCoefficientString() { return "Dc"; } - /// string/key for reference slip rate - static constexpr char const * referenceVelocityString() { return "referenceVelocity"; } - /// string/key for reference friction coefficient - static constexpr char const * referenceFrictionCoefficientString() { return "referenceFrictionCoefficient"; } - /// string/key for the default value of Rate and State coefficient a - static constexpr char const * defaultACoefficientString() { return "defaultA"; } - /// string/key for the default value of Rate and State coefficient b - static constexpr char const * defaultBCoefficientString() { return "defaultB"; } - /// string/key for the default value of Rate and State characteristic length - static constexpr char const * defaultDcCoefficientString() { return "defaultDc"; } - /// string/key for the default value ofreference slip rate - static constexpr char const * defaultReferenceVelocityString() { return "defaultReferenceVelocity"; } - /// string/key for the default value of reference friction coefficient - static constexpr char const * defaultReferenceFrictionCoefficientString() { return "defaultReferenceFrictionCoefficient"; } - }; - }; template< typename USE_SLIP_LAW > diff --git a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.cpp b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.cpp index cff80fed216..4edc26c8da2 100644 --- a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.cpp +++ b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.cpp @@ -36,19 +36,11 @@ ConstantDiffusion::ConstantDiffusion( string const & name, Group * const parent setDescription( "xx, yy, and zz components of a diffusivity tensor [m^2/s]" ); } -std::unique_ptr< ConstitutiveBase > -ConstantDiffusion::deliverClone( string const & name, - Group * const parent ) const +void ConstantDiffusion::resizeFields( localIndex const size, localIndex const numPts ) { - return DiffusionBase::deliverClone( name, parent ); -} - -void ConstantDiffusion::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - DiffusionBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + DiffusionBase::resizeFields( size, numPts ); - for( localIndex ei = 0; ei < parent.size(); ++ei ) + for( localIndex ei = 0; ei < size; ++ei ) { // NOTE: enforcing 1 quadrature point for( localIndex q = 0; q < 1; ++q ) diff --git a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp index 66f586ab637..d847984c617 100644 --- a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp +++ b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp @@ -66,12 +66,6 @@ class ConstantDiffusion : public DiffusionBase */ ConstantDiffusion( string const & name, Group * const parent ); - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static string catalogName() { return "ConstantDiffusion"; } virtual string getCatalogName() const override { return catalogName(); } @@ -98,6 +92,13 @@ class ConstantDiffusion : public DiffusionBase virtual void postInputInitialization() override; + /** + * @brief Function called internally to resize member arrays + * @param size primary dimension (e.g. number of cells) + * @param numPts secondary dimension (e.g. number of gauss points per cell) + */ + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + private: /// default diffusivity in the subRegion diff --git a/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp b/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp index 491bc987a99..b1617d21209 100644 --- a/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp +++ b/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp @@ -67,17 +67,14 @@ void DiffusionBase::postInputInitialization() m_phaseDiffusivityMultiplier.resize( 0, 0, 3 ); } -void DiffusionBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void DiffusionBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) { // NOTE: enforcing 1 quadrature point - m_diffusivity.resize( 0, 1, 3 ); - m_dDiffusivity_dTemperature.resize( 0, 1, 3 ); - m_phaseDiffusivityMultiplier.resize( 0, 1, 3 ); + m_diffusivity.resize( size, 1, 3 ); + m_dDiffusivity_dTemperature.resize( size, 1, 3 ); + m_phaseDiffusivityMultiplier.resize( size, 1, 3 ); - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - - for( localIndex ei = 0; ei < parent.size(); ++ei ) + for( localIndex ei = 0; ei < size; ++ei ) { // NOTE: enforcing 1 quadrature point for( localIndex q = 0; q < 1; ++q ) @@ -88,7 +85,6 @@ void DiffusionBase::allocateConstitutiveData( dataRepository::Group & parent, } } } - } } // namespace constitutive diff --git a/src/coreComponents/constitutive/diffusion/DiffusionBase.hpp b/src/coreComponents/constitutive/diffusion/DiffusionBase.hpp index 01ee722ae37..0ab8ba58db8 100644 --- a/src/coreComponents/constitutive/diffusion/DiffusionBase.hpp +++ b/src/coreComponents/constitutive/diffusion/DiffusionBase.hpp @@ -101,9 +101,6 @@ class DiffusionBase : public ConstitutiveBase */ DiffusionBase( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - /** * @brief Getter for the number of fluid phases * @return the number of fluid phases @@ -158,18 +155,16 @@ class DiffusionBase : public ConstitutiveBase static constexpr char const * defaultPhaseDiffusivityMultiplierString() { return "defaultPhaseDiffusivityMultipliers"; } }; -private: +protected: + + virtual void postInputInitialization() override; /** * @brief Function called internally to resize member arrays * @param size primary dimension (e.g. number of cells) * @param numPts secondary dimension (e.g. number of gauss points per cell) */ - void resizeFields( localIndex const size, localIndex const numPts ); - -protected: - - virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; /// phase names read from input string_array m_phaseNames; diff --git a/src/coreComponents/constitutive/dispersion/DispersionBase.cpp b/src/coreComponents/constitutive/dispersion/DispersionBase.cpp index 2789f5a07d9..47e752b8be2 100644 --- a/src/coreComponents/constitutive/dispersion/DispersionBase.cpp +++ b/src/coreComponents/constitutive/dispersion/DispersionBase.cpp @@ -41,13 +41,10 @@ void DispersionBase::postInputInitialization() m_dispersivity.resize( 0, 0, 3 ); } -void DispersionBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void DispersionBase::resizeFields( localIndex const GEOS_UNUSED_PARAM( size ), localIndex const GEOS_UNUSED_PARAM( numPts ) ) { // NOTE: enforcing 1 quadrature point m_dispersivity.resize( 0, 1, 3 ); - - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); } } // namespace constitutive diff --git a/src/coreComponents/constitutive/dispersion/DispersionBase.hpp b/src/coreComponents/constitutive/dispersion/DispersionBase.hpp index 4a653aed6e0..86ec501d11e 100644 --- a/src/coreComponents/constitutive/dispersion/DispersionBase.hpp +++ b/src/coreComponents/constitutive/dispersion/DispersionBase.hpp @@ -92,9 +92,6 @@ class DispersionBase : public ConstitutiveBase */ DispersionBase( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - /** * @brief Getter for the dispersivities in the subRegion * @return an arrayView of dispersivities @@ -119,18 +116,16 @@ class DispersionBase : public ConstitutiveBase virtual void saveConvergedVelocityState( arrayView2d< real64 const > const & convergedVelocity ) const { GEOS_UNUSED_VAR( convergedVelocity ); } -private: +protected: + + virtual void postInputInitialization() override; /** * @brief Function called internally to resize member arrays * @param size primary dimension (e.g. number of cells) * @param numPts secondary dimension (e.g. number of gauss points per cell) */ - void resizeFields( localIndex const size, localIndex const numPts ); - -protected: - - virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; /// cell-wise dispersivity in the subregion /// TODO: support full tensor if linear isotropic diffusion is no longer enough diff --git a/src/coreComponents/constitutive/dispersion/LinearIsotropicDispersion.cpp b/src/coreComponents/constitutive/dispersion/LinearIsotropicDispersion.cpp index 88e0339f142..c01a6945059 100644 --- a/src/coreComponents/constitutive/dispersion/LinearIsotropicDispersion.cpp +++ b/src/coreComponents/constitutive/dispersion/LinearIsotropicDispersion.cpp @@ -36,13 +36,6 @@ LinearIsotropicDispersion::LinearIsotropicDispersion( string const & name, Group setDescription( "Longitudinal dispersivity [m]" ); } -std::unique_ptr< ConstitutiveBase > -LinearIsotropicDispersion::deliverClone( string const & name, - Group * const parent ) const -{ - return DispersionBase::deliverClone( name, parent ); -} - void LinearIsotropicDispersion::postInputInitialization() { GEOS_THROW_IF( m_longitudinalDispersivity < 0, diff --git a/src/coreComponents/constitutive/dispersion/LinearIsotropicDispersion.hpp b/src/coreComponents/constitutive/dispersion/LinearIsotropicDispersion.hpp index de7193694b1..23f96131168 100644 --- a/src/coreComponents/constitutive/dispersion/LinearIsotropicDispersion.hpp +++ b/src/coreComponents/constitutive/dispersion/LinearIsotropicDispersion.hpp @@ -81,9 +81,6 @@ class LinearIsotropicDispersion : public DispersionBase */ LinearIsotropicDispersion( string const & name, Group * const parent ); - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; - static string catalogName() { return "LinearIsotropicDispersion"; } virtual string getCatalogName() const override { return catalogName(); } diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.hpp index 1c76f535cf6..a11815623a4 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.hpp @@ -111,8 +111,6 @@ class EzrokhiBrineDensity : public PVTFunctionBase array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ); - virtual ~EzrokhiBrineDensity() override = default; - static string catalogName() { return "EzrokhiBrineDensity"; } virtual string getCatalogName() const override final { return catalogName(); } diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.hpp index 07fac03c1ee..0c65c125a7b 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.hpp @@ -100,8 +100,6 @@ class EzrokhiBrineViscosity : public PVTFunctionBase array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ); - virtual ~EzrokhiBrineViscosity() override = default; - static string catalogName() { return "EzrokhiBrineViscosity"; } virtual string getCatalogName() const override final { return catalogName(); } diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.hpp index 3212b51a268..da959eff77a 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.hpp @@ -78,8 +78,6 @@ class FenghourCO2Viscosity : public PVTFunctionBase array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ); - virtual ~FenghourCO2Viscosity() override = default; - static string catalogName() { return "FenghourCO2Viscosity"; } virtual string getCatalogName() const override final { return catalogName(); } diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/NoOpPVTFunction.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/NoOpPVTFunction.hpp index 4be877cc7d7..e3aca977273 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/NoOpPVTFunction.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/NoOpPVTFunction.hpp @@ -79,8 +79,6 @@ class NoOpPVTFunction : public PVTFunctionBase GEOS_UNUSED_VAR( inputPara, pvtOutputOpts ); } - virtual ~NoOpPVTFunction() override = default; - static string catalogName() { return "NoOpPVTFunction"; } virtual string getCatalogName() const override final { return catalogName(); } diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.hpp index 5569ecc8507..678d781046e 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.hpp @@ -86,8 +86,6 @@ class PhillipsBrineViscosity : public PVTFunctionBase array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ); - virtual ~PhillipsBrineViscosity() override = default; - static string catalogName() { return "PhillipsBrineViscosity"; } virtual string getCatalogName() const override final { return catalogName(); } diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp index 03e574667c0..a792a3b2cec 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp @@ -151,13 +151,6 @@ void MultiFluidBase::setLabels() setDimLabels( 3, m_componentNames ); } -void MultiFluidBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - resizeFields( parent.size(), numConstitutivePointsPerParentIndex ); -} - void MultiFluidBase::postInputInitialization() { ConstitutiveBase::postInputInitialization(); diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp index 761793b93a8..803a7da5152 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp @@ -38,9 +38,6 @@ class MultiFluidBase : public ConstitutiveBase MultiFluidBase( string const & name, Group * const parent ); - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - // *** MultiFluid-specific interface /** @@ -664,12 +661,12 @@ class MultiFluidBase : public ConstitutiveBase * @param size primary dimension (e.g. number of cells) * @param numPts secondary dimension (e.g. number of gauss points per cell) */ - virtual void resizeFields( localIndex const size, localIndex const numPts ); + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; virtual void postInputInitialization() override; // flag indicating whether input/output component fractions are treated as mass fractions - int m_useMass; + integer m_useMass; /// Enable an error when checkTableParameters() is called and the input pressure or temperature of the PVT tables is out of range integer m_checkPVTTablesRanges; diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp index 6d6993c4c39..08be394d856 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp @@ -100,10 +100,11 @@ string CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::catalogNam } template< typename FLASH, typename PHASE1, typename PHASE2, typename PHASE3 > -void CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::resizeFields( localIndex const size, localIndex const numPts ) { - MultiFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + MultiFluidBase::resizeFields( size, numPts ); + + m_kValues.resize( size, numPts, numFluidPhases()-1, numFluidComponents() ); // Zero k-Values to force initialisation with Wilson k-Values m_kValues.zero(); @@ -199,14 +200,6 @@ void CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::initializePo createModels(); } -template< typename FLASH, typename PHASE1, typename PHASE2, typename PHASE3 > -void CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::resizeFields( localIndex const size, localIndex const numPts ) -{ - MultiFluidBase::resizeFields( size, numPts ); - - m_kValues.resize( size, numPts, numFluidPhases()-1, numFluidComponents() ); -} - template< typename FLASH, typename PHASE1, typename PHASE2, typename PHASE3 > std::unique_ptr< ConstitutiveBase > CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::deliverClone( string const & name, diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp index 1206c974f9f..98a3b356783 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp @@ -84,9 +84,6 @@ class CompositionalMultiphaseFluid : public MultiFluidBase GEOS_UNUSED_VAR( pressure, temperature ); } - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - virtual integer getWaterPhaseIndex() const override final; struct viewKeyStruct : MultiFluidBase::viewKeyStruct diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/NullModel.hpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/NullModel.hpp index dd10f7caef5..769ef53336f 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/NullModel.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/NullModel.hpp @@ -76,8 +76,6 @@ class NullModel : public FunctionBase GEOS_UNUSED_VAR( modelParameters ); } - virtual ~NullModel() override = default; - static string catalogName() { return "NullPVTModel"; } static constexpr FunctionType function(){ return FunctionType::UNKNOWN; } diff --git a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp index a5475f846a9..ee0a6638848 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp @@ -79,12 +79,9 @@ CompressibleSinglePhaseFluid::CompressibleSinglePhaseFluid( string const & name, } -CompressibleSinglePhaseFluid::~CompressibleSinglePhaseFluid() = default; - -void CompressibleSinglePhaseFluid::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void CompressibleSinglePhaseFluid::resizeFields( localIndex const size, localIndex const numPts ) { - SingleFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + SingleFluidBase::resizeFields( size, numPts ); getField< fields::singlefluid::density >().setApplyDefaultValue( m_defaultDensity ); getField< fields::singlefluid::viscosity >().setApplyDefaultValue( m_defaultViscosity ); diff --git a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.hpp b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.hpp index c86f9c25b19..8fbf991c070 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.hpp @@ -146,15 +146,10 @@ class CompressibleSinglePhaseFluid : public SingleFluidBase using DerivOffset = singlefluid::DerivativeOffset; CompressibleSinglePhaseFluid( string const & name, Group * const parent ); - virtual ~CompressibleSinglePhaseFluid() override; - static string catalogName() { return "CompressibleSinglePhaseFluid"; } virtual string getCatalogName() const override { return catalogName(); } - 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) using KernelWrapper = CompressibleSinglePhaseUpdate< ExponentApproximationType::Linear, ExponentApproximationType::Linear >; @@ -184,6 +179,8 @@ class CompressibleSinglePhaseFluid : public SingleFluidBase virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + /// default density value real64 m_defaultDensity; diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.cpp index adf166a4540..e6f32fa932d 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.cpp @@ -78,8 +78,6 @@ ParticleFluid::ParticleFluid( string const & name, Group * const parent ): } -ParticleFluid::~ParticleFluid() = default; - void ParticleFluid::postInputInitialization() { ParticleFluidBase::postInputInitialization(); diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.hpp b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.hpp index a6a724f0933..7545919a13a 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.hpp @@ -191,8 +191,6 @@ class ParticleFluid : public ParticleFluidBase ParticleFluid( string const & name, Group * const parent ); - virtual ~ParticleFluid() override; - // *** ConstitutiveBase interface static string catalogName() { return "ParticleFluid"; } diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp index d4faa0d8a20..5652af4b725 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp @@ -53,20 +53,9 @@ ParticleFluidBase::ParticleFluidBase( string const & name, Group * const parent registerField( fields::particlefluid::proppantPackPermeability{}, &m_proppantPackPermeability ); } -ParticleFluidBase::~ParticleFluidBase() = default; - -void ParticleFluidBase::postInputInitialization() +void ParticleFluidBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) { - ConstitutiveBase::postInputInitialization(); -} - -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 ); + m_dSettlingFactor_dComponentConcentration.resize( size, MAX_NUM_COMPONENTS ); } } //namespace constitutive diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.hpp b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.hpp index 9960b7376ee..10e18c7b233 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.hpp @@ -151,17 +151,11 @@ class ParticleFluidBase : public ConstitutiveBase ParticleFluidBase( string const & name, Group * const parent ); - virtual ~ParticleFluidBase() override; - - // *** ConstitutiveBase interface - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static constexpr localIndex MAX_NUM_COMPONENTS = 4; protected: - virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; array1d< real64 > m_settlingFactor; array1d< real64 > m_dSettlingFactor_dPressure; diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.cpp index c73569ebb3c..649ef50415b 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.cpp @@ -62,18 +62,14 @@ ProppantSlurryFluid::ProppantSlurryFluid( string const & name, Group * const par } -ProppantSlurryFluid::~ProppantSlurryFluid() = default; - -void ProppantSlurryFluid::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void ProppantSlurryFluid::resizeFields( localIndex const size, localIndex const numPts ) { - SlurryFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + SlurryFluidBase::resizeFields( size, numPts ); m_density.value.setValues< serialPolicy >( m_referenceDensity ); m_viscosity.value.setValues< serialPolicy >( m_referenceViscosity ); } - void ProppantSlurryFluid::postInputInitialization() { SlurryFluidBase::postInputInitialization(); diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.hpp b/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.hpp index 2e398fd6b49..9bb4632062c 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.hpp @@ -290,16 +290,11 @@ class ProppantSlurryFluid : public SlurryFluidBase ProppantSlurryFluid( string const & name, Group * const parent ); - virtual ~ProppantSlurryFluid() override; - // *** ConstitutiveBase interface static string catalogName() { return "ProppantSlurryFluid"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - using KernelWrapper = ProppantSlurryFluidUpdate; /** @@ -339,6 +334,8 @@ class ProppantSlurryFluid : public SlurryFluidBase virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + private: real64 m_compressibility; diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp index 85fbe1e1bc7..538965a835e 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp @@ -83,33 +83,26 @@ void SingleFluidBase::saveConvergedState() const } ); } -//START_SPHINX_INCLUDE_00 -void SingleFluidBase::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void SingleFluidBase::resizeFields( localIndex const size, localIndex const numPts ) { - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - - resize( parent.size() ); - // density - m_density.value.resize( parent.size(), numConstitutivePointsPerParentIndex ); - m_density.derivs.resize( parent.size(), numConstitutivePointsPerParentIndex, m_numDOF ); - m_density_n.resize( parent.size(), numConstitutivePointsPerParentIndex ); + m_density.value.resize( size, numPts ); + m_density.derivs.resize( size, numPts, m_numDOF ); + m_density_n.resize( size, numPts ); // viscosity - m_viscosity.value.resize( parent.size(), numConstitutivePointsPerParentIndex ); - m_viscosity.derivs.resize( parent.size(), numConstitutivePointsPerParentIndex, m_numDOF ); + m_viscosity.value.resize( size, numPts ); + m_viscosity.derivs.resize( size, numPts, m_numDOF ); // internal energy - m_internalEnergy.value.resize( parent.size(), numConstitutivePointsPerParentIndex ); - m_internalEnergy.derivs.resize( parent.size(), numConstitutivePointsPerParentIndex, m_numDOF ); - m_internalEnergy_n.resize( parent.size(), numConstitutivePointsPerParentIndex ); + m_internalEnergy.value.resize( size, numPts ); + m_internalEnergy.derivs.resize( size, numPts, m_numDOF ); + m_internalEnergy_n.resize( size, numPts ); // enthalpy - m_enthalpy.value.resize( parent.size(), numConstitutivePointsPerParentIndex ); - m_enthalpy.derivs.resize( parent.size(), numConstitutivePointsPerParentIndex, m_numDOF ); + m_enthalpy.value.resize( size, numPts ); + m_enthalpy.derivs.resize( size, numPts, m_numDOF ); } -//END_SPHINX_INCLUDE_00 } //namespace constitutive diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp index 9d8d3cbfb2d..bbd088a843b 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp @@ -231,11 +231,6 @@ class SingleFluidBase : public ConstitutiveBase virtual void saveConvergedState() const override; - // *** ConstitutiveBase interface - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - // *** SingleFluid-specific interface arrayView2d< real64 const, constitutive::singlefluid::USD_FLUID > density() const { return m_density.value; } @@ -289,6 +284,8 @@ class SingleFluidBase : public ConstitutiveBase virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + // Degrees of freedom in fluid characterization integer m_numDOF; //START_SPHINX_INCLUDE_00 diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp index 1993c2993a4..2256a823220 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp @@ -82,8 +82,6 @@ SlurryFluidBase::SlurryFluidBase( string const & name, Group * const parent ): registerField( fields::slurryfluid::dViscosity_dComponentConcentration{}, &m_dViscosity_dCompConc ); } -SlurryFluidBase::~SlurryFluidBase() = default; - void SlurryFluidBase::postInputInitialization() { SingleFluidBase::postInputInitialization(); @@ -106,36 +104,32 @@ localIndex SlurryFluidBase::numFluidComponents() const return LvArray::integerConversion< localIndex >( m_componentNames.size()); } -void SlurryFluidBase::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void SlurryFluidBase::resizeFields( localIndex const size, localIndex const numPts ) { + SingleFluidBase::resizeFields( size, numPts ); + localIndex const NC = numFluidComponents(); m_numDOF = 2 + NC; // pressure,proppantconc, NC compconc - SingleFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - - this->resize( parent.size() ); - - // These are also sized in m_dDenisty in base class , only dP and dT are populated // Future dev should incorporate concentration derivatives in dDensity - m_dDensity_dProppantConc.resize( parent.size(), numConstitutivePointsPerParentIndex ); - m_dDensity_dCompConc.resize( parent.size(), numConstitutivePointsPerParentIndex, NC ); + m_dDensity_dProppantConc.resize( size, numPts ); + m_dDensity_dCompConc.resize( size, numPts, 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( size, numPts, NC ); + m_dCompDens_dPres.resize( size, numPts, NC ); + m_dCompDens_dCompConc.resize( size, numPts, NC, NC ); - m_fluidDensity.value.resize( parent.size(), numConstitutivePointsPerParentIndex ); - m_dFluidDens_dPres.resize( parent.size(), numConstitutivePointsPerParentIndex ); - m_dFluidDens_dCompConc.resize( parent.size(), numConstitutivePointsPerParentIndex, NC ); + m_fluidDensity.value.resize( size, numPts ); + m_dFluidDens_dPres.resize( size, numPts ); + m_dFluidDens_dCompConc.resize( size, numPts, 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( size, numPts ); + m_dFluidVisc_dPres.resize( size, numPts ); + m_dFluidVisc_dCompConc.resize( size, numPts, NC ); - m_dViscosity_dProppantConc.resize( parent.size(), numConstitutivePointsPerParentIndex ); - m_dViscosity_dCompConc.resize( parent.size(), numConstitutivePointsPerParentIndex, NC ); + m_dViscosity_dProppantConc.resize( size, numPts ); + m_dViscosity_dCompConc.resize( size, numPts, NC ); } diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp index f811e016ba4..84f80580b0a 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp @@ -254,12 +254,6 @@ class SlurryFluidBase : public SingleFluidBase SlurryFluidBase( string const & name, Group * const parent ); - virtual ~SlurryFluidBase() override; - - // *** ConstitutiveBase interface - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static constexpr localIndex MAX_NUM_COMPONENTS = 3; localIndex numFluidComponents() const; @@ -308,10 +302,25 @@ class SlurryFluidBase : public SingleFluidBase bool isNewtonianFluid() const { return m_isNewtonianFluid; } + // *** Data repository keys + struct viewKeyStruct + { + static constexpr char const * componentNamesString() { return "componentNames"; } + + static constexpr char const * defaultComponentDensityString() { return "defaultComponentDensity"; } + static constexpr char const * defaultCompressibilityString() { return "defaultCompressibility"; } + static constexpr char const * defaultComponentViscosityString() { return "defaultComponentViscosity"; } + + static constexpr char const * flowBehaviorIndexString() { return "flowBehaviorIndex"; } + static constexpr char const * flowConsistencyIndexString() { return "flowConsistencyIndex"; } + }; + protected: virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + string_array m_componentNames; array1d< real64 > m_defaultComponentDensity; @@ -342,20 +351,6 @@ class SlurryFluidBase : public SingleFluidBase bool m_isNewtonianFluid; -private: - - // *** Data repository keys - struct viewKeyStruct - { - static constexpr char const * componentNamesString() { return "componentNames"; } - - static constexpr char const * defaultComponentDensityString() { return "defaultComponentDensity"; } - static constexpr char const * defaultCompressibilityString() { return "defaultCompressibility"; } - static constexpr char const * defaultComponentViscosityString() { return "defaultComponentViscosity"; } - - static constexpr char const * flowBehaviorIndexString() { return "flowBehaviorIndex"; } - static constexpr char const * flowConsistencyIndexString() { return "flowConsistencyIndex"; } - }; }; } //namespace constitutive diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp index 5adb8c48282..ae8739f6348 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp @@ -62,12 +62,12 @@ ThermalCompressibleSinglePhaseFluid::ThermalCompressibleSinglePhaseFluid( string } -ThermalCompressibleSinglePhaseFluid::~ThermalCompressibleSinglePhaseFluid() = default; - -void ThermalCompressibleSinglePhaseFluid::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void ThermalCompressibleSinglePhaseFluid::resizeFields( localIndex const size, localIndex const numPts ) { - CompressibleSinglePhaseFluid::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + CompressibleSinglePhaseFluid::resizeFields( size, numPts ); + + m_internalEnergy.value.resize( size, numPts ); + m_internalEnergy.derivs.resize( size, numPts, m_numDOF ); m_internalEnergy.value.setValues< serialPolicy >( m_referenceInternalEnergy ); } diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp index 2a97afae9e5..b952da91488 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp @@ -195,15 +195,10 @@ class ThermalCompressibleSinglePhaseFluid : public CompressibleSinglePhaseFluid ThermalCompressibleSinglePhaseFluid( string const & name, Group * const parent ); - virtual ~ThermalCompressibleSinglePhaseFluid() override; - static string catalogName() { return "ThermalCompressibleSinglePhaseFluid"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - using CompressibleSinglePhaseFluid::m_densityModelType; /// Type of kernel wrapper for in-kernel update (TODO: support multiple EAT, not just linear) @@ -228,6 +223,8 @@ class ThermalCompressibleSinglePhaseFluid : public CompressibleSinglePhaseFluid virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + private: /// scalar fluid thermal expansion coefficient diff --git a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.cpp b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.cpp index 09ac85ef7b4..f0b30ebfc0d 100644 --- a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.cpp +++ b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.cpp @@ -69,13 +69,6 @@ TwoPhaseImmiscibleFluid::TwoPhaseImmiscibleFluid( string const & name, Group * c } -std::unique_ptr< ConstitutiveBase > -TwoPhaseImmiscibleFluid::deliverClone( string const & name, Group * const parent ) const -{ - return ConstitutiveBase::deliverClone( name, parent ); -} - - void TwoPhaseImmiscibleFluid::resizeFields( localIndex const size, localIndex const numPts ) { // Assume sole dependency on pressure, i.e. one derivative @@ -89,14 +82,6 @@ void TwoPhaseImmiscibleFluid::resizeFields( localIndex const size, localIndex co } -void TwoPhaseImmiscibleFluid::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - resizeFields( parent.size(), numConstitutivePointsPerParentIndex ); -} - - void TwoPhaseImmiscibleFluid::postInputInitialization() { ConstitutiveBase::postInputInitialization(); diff --git a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp index b72eb248635..9f12321d971 100644 --- a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp +++ b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp @@ -42,13 +42,6 @@ class TwoPhaseImmiscibleFluid : public ConstitutiveBase TwoPhaseImmiscibleFluid( string const & name, Group * const parent ); - virtual std::unique_ptr< ConstitutiveBase > - deliverClone( string const & name, - Group * const parent ) const override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - /** * @name Static Factory Catalog members and functions */ @@ -215,7 +208,7 @@ class TwoPhaseImmiscibleFluid : public ConstitutiveBase array3d< real64, multifluid::LAYOUT_PHASE > m_phaseDensity_n; - virtual void resizeFields( localIndex const size, localIndex const numPts ); + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; virtual void postInputInitialization() override; diff --git a/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp b/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp index f57f52ffd77..d7eee445cba 100644 --- a/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp @@ -55,12 +55,12 @@ CarmanKozenyPermeability::deliverClone( string const & name, return PermeabilityBase::deliverClone( name, parent ); } -void CarmanKozenyPermeability::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void CarmanKozenyPermeability::resizeFields( localIndex const size, localIndex const numPts ) { + PermeabilityBase::resizeFields( size, numPts ); + // NOTE: enforcing 1 quadrature point - m_dPerm_dPorosity.resize( 0, 1, 3 ); - PermeabilityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_dPerm_dPorosity.resize( size, 1, 3 ); } REGISTER_CATALOG_ENTRY( ConstitutiveBase, CarmanKozenyPermeability, string const &, Group * const ) diff --git a/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.hpp b/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.hpp index 2d7605b4871..f50cacdfeb7 100644 --- a/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.hpp @@ -88,9 +88,6 @@ class CarmanKozenyPermeability : public PermeabilityBase std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, Group * const parent ) const override; - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static string catalogName() { return "CarmanKozenyPermeability"; } virtual string getCatalogName() const override { return catalogName(); } @@ -121,6 +118,10 @@ class CarmanKozenyPermeability : public PermeabilityBase static constexpr char const * anisotropyString() { return "anisotropy"; } } viewKeys; +protected: + + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + private: /// dPermeability_dPorosity diff --git a/src/coreComponents/constitutive/permeability/ConstantPermeability.cpp b/src/coreComponents/constitutive/permeability/ConstantPermeability.cpp index eecbc1c6645..b9c0045a218 100644 --- a/src/coreComponents/constitutive/permeability/ConstantPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ConstantPermeability.cpp @@ -44,14 +44,13 @@ ConstantPermeability::deliverClone( string const & name, return PermeabilityBase::deliverClone( name, parent ); } -void ConstantPermeability::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void ConstantPermeability::resizeFields( localIndex const size, localIndex const numPts ) { - PermeabilityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + PermeabilityBase::resizeFields( size, numPts ); integer const numQuad = 1; // NOTE: enforcing 1 quadrature point - for( localIndex ei = 0; ei < parent.size(); ++ei ) + for( localIndex ei = 0; ei < size; ++ei ) { for( localIndex q = 0; q < numQuad; ++q ) { diff --git a/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp b/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp index 4357ea50b5d..2a2daf75ff1 100644 --- a/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp @@ -51,9 +51,6 @@ class ConstantPermeability : public PermeabilityBase std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, Group * const parent ) const override; - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static string catalogName() { return "ConstantPermeability"; } virtual string getCatalogName() const override { return catalogName(); } @@ -83,6 +80,8 @@ class ConstantPermeability : public PermeabilityBase virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + private: R1Tensor m_permeabilityComponents; diff --git a/src/coreComponents/constitutive/permeability/DamagePermeability.cpp b/src/coreComponents/constitutive/permeability/DamagePermeability.cpp index dfca83e384f..b0811a249b3 100644 --- a/src/coreComponents/constitutive/permeability/DamagePermeability.cpp +++ b/src/coreComponents/constitutive/permeability/DamagePermeability.cpp @@ -39,25 +39,9 @@ DamagePermeability::DamagePermeability( string const & name, Group * const paren registerWrapper( viewKeyStruct::damageDependenceConstantString(), &m_damageDependenceConstant ). setInputFlag( InputFlags::REQUIRED ). setRestartFlags( RestartFlags::NO_WRITE ). - setDescription( "Damage dependeny coefficient" ); + setDescription( "Damage dependency coefficient" ); } -std::unique_ptr< ConstitutiveBase > -DamagePermeability::deliverClone( string const & name, - Group * const parent ) const -{ - return PermeabilityBase::deliverClone( name, parent ); -} - -void DamagePermeability::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - PermeabilityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); -} - -void DamagePermeability::postInputInitialization() -{} - REGISTER_CATALOG_ENTRY( ConstitutiveBase, DamagePermeability, string const &, Group * const ) } diff --git a/src/coreComponents/constitutive/permeability/DamagePermeability.hpp b/src/coreComponents/constitutive/permeability/DamagePermeability.hpp index 95132ec5679..5d9fa0d51a4 100644 --- a/src/coreComponents/constitutive/permeability/DamagePermeability.hpp +++ b/src/coreComponents/constitutive/permeability/DamagePermeability.hpp @@ -70,12 +70,6 @@ class DamagePermeability : public PermeabilityBase DamagePermeability( string const & name, Group * const parent ); - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static string catalogName() { return "DamagePermeability"; } virtual string getCatalogName() const override { return catalogName(); } @@ -102,10 +96,6 @@ class DamagePermeability : public PermeabilityBase static constexpr char const * damageDependenceConstantString() { return "damageDependenceConstant"; } }; -protected: - - virtual void postInputInitialization() override; - private: /// Permeability of the intact bulk material diff --git a/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.cpp b/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.cpp index c6c876812b9..a988eb7cb58 100644 --- a/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.cpp @@ -44,21 +44,13 @@ ExponentialDecayPermeability::ExponentialDecayPermeability( string const & name, registerField( fields::permeability::dPerm_dDispJump{}, &m_dPerm_dDispJump ); } -std::unique_ptr< ConstitutiveBase > -ExponentialDecayPermeability::deliverClone( string const & name, - Group * const parent ) const +void ExponentialDecayPermeability::resizeFields( localIndex const size, localIndex const numPts ) { - return ConstitutiveBase::deliverClone( name, parent ); -} - -void ExponentialDecayPermeability::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ -// NOTE: enforcing 1 quadrature point - m_dPerm_dTraction.resize( 0, 1, 3, 3 ); - m_dPerm_dDispJump.resize( 0, 1, 3, 3 ); + PermeabilityBase::resizeFields( size, numPts ); - PermeabilityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + // NOTE: enforcing 1 quadrature point + m_dPerm_dTraction.resize( size, 1, 3, 3 ); + m_dPerm_dDispJump.resize( size, 1, 3, 3 ); } REGISTER_CATALOG_ENTRY( ConstitutiveBase, ExponentialDecayPermeability, string const &, Group * const ) diff --git a/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.hpp b/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.hpp index c8d39b0bfcf..24c9702a29e 100644 --- a/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.hpp @@ -94,12 +94,6 @@ class ExponentialDecayPermeability : public PermeabilityBase ExponentialDecayPermeability( string const & name, Group * const parent ); - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static string catalogName() { return "ExponentialDecayPermeability"; } virtual string getCatalogName() const override { return catalogName(); } @@ -121,6 +115,10 @@ class ExponentialDecayPermeability : public PermeabilityBase m_initialPermeability ); } + +protected: + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + private: /// Derivative of fracture permeability to traction acting on fracture surfaces diff --git a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp index 379a584bbd0..59adbda430d 100644 --- a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp @@ -43,25 +43,17 @@ ParallelPlatesPermeability::ParallelPlatesPermeability( string const & name, Gro registerField( fields::permeability::dPerm_dDispJump{}, &m_dPerm_dDispJump ); } -std::unique_ptr< ConstitutiveBase > -ParallelPlatesPermeability::deliverClone( string const & name, - Group * const parent ) const +void ParallelPlatesPermeability::resizeFields( localIndex const size, localIndex const numPts ) { - return PermeabilityBase::deliverClone( name, parent ); -} + PermeabilityBase::resizeFields( size, numPts ); -void ParallelPlatesPermeability::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ // NOTE: enforcing 1 quadrature point - m_dPerm_dDispJump.resize( 0, 1, 3, 3 ); + m_dPerm_dDispJump.resize( size, 1, 3, 3 ); if( m_transversalPermeability > -1 ) { m_updateTransversalComponent = false; } - - PermeabilityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); } void ParallelPlatesPermeability::initializeState() const diff --git a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.hpp b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.hpp index 6977221fbfd..a19d8e714a2 100644 --- a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.hpp @@ -108,12 +108,6 @@ class ParallelPlatesPermeability : public PermeabilityBase ParallelPlatesPermeability( string const & name, Group * const parent ); - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static string catalogName() { return "ParallelPlatesPermeability"; } virtual string getCatalogName() const override { return catalogName(); } @@ -139,7 +133,11 @@ class ParallelPlatesPermeability : public PermeabilityBase struct viewKeyStruct : public PermeabilityBase::viewKeyStruct { static constexpr char const * transversalPermeabilityString() { return "transversalPermeability"; } - } viewKeys; + }; + +protected: + + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; private: diff --git a/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp b/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp index 0086cf6dc13..3f54401ea9b 100644 --- a/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp +++ b/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp @@ -38,13 +38,6 @@ PermeabilityBase::PermeabilityBase( string const & name, Group * const parent ): registerField( fields::permeability::dPerm_dPressure{}, &m_dPerm_dPressure ); } -std::unique_ptr< ConstitutiveBase > -PermeabilityBase::deliverClone( string const & name, - Group * const parent ) const -{ - return ConstitutiveBase::deliverClone( name, parent ); -} - void PermeabilityBase::scaleHorizontalPermeability( arrayView1d< real64 const > scalingFactors ) const { localIndex const numElems = m_permeability.size( 0 ); @@ -59,14 +52,11 @@ void PermeabilityBase::scaleHorizontalPermeability( arrayView1d< real64 const > } } -void PermeabilityBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void PermeabilityBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) { // NOTE: enforcing 1 quadrature point - m_permeability.resize( 0, 1, 3 ); - m_dPerm_dPressure.resize( 0, 1, 3 ); - - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_permeability.resize( size, 1, 3 ); + m_dPerm_dPressure.resize( size, 1, 3 ); } } diff --git a/src/coreComponents/constitutive/permeability/PermeabilityBase.hpp b/src/coreComponents/constitutive/permeability/PermeabilityBase.hpp index d983bcf8d8e..b613303069e 100644 --- a/src/coreComponents/constitutive/permeability/PermeabilityBase.hpp +++ b/src/coreComponents/constitutive/permeability/PermeabilityBase.hpp @@ -109,12 +109,6 @@ class PermeabilityBase : public ConstitutiveBase PermeabilityBase( string const & name, Group * const parent ); - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - /** * @brief Const/non-mutable accessor for permeability. * @return Accessor @@ -141,6 +135,8 @@ class PermeabilityBase : public ConstitutiveBase protected: + virtual void resizeFields( localIndex const size, localIndex const numPts ); + /// Vector of absolute permeability array3d< real64 > m_permeability; diff --git a/src/coreComponents/constitutive/permeability/PressurePermeability.cpp b/src/coreComponents/constitutive/permeability/PressurePermeability.cpp index abcb8cde307..bf07adef2d8 100644 --- a/src/coreComponents/constitutive/permeability/PressurePermeability.cpp +++ b/src/coreComponents/constitutive/permeability/PressurePermeability.cpp @@ -60,13 +60,6 @@ PressurePermeability::PressurePermeability( string const & name, Group * const p setDescription( "Type of the pressure dependence model. " ); } -std::unique_ptr< ConstitutiveBase > -PressurePermeability::deliverClone( string const & name, - Group * const parent ) const -{ - return PermeabilityBase::deliverClone( name, parent ); -} - void PressurePermeability::postInputInitialization() { for( localIndex i=0; i < 3; i++ ) @@ -76,16 +69,19 @@ void PressurePermeability::postInputInitialization() } } -void PressurePermeability::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void PressurePermeability::resizeFields( localIndex const size, localIndex const numPts ) { - m_referencePermeability.resize( 0, 1, 3 ); + PermeabilityBase::resizeFields( size, numPts ); - PermeabilityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_referencePermeability.resize( 0, 1, 3 ); +} - integer const numQuad = 1; // NOTE: enforcing 1 quadrature point +void PressurePermeability::initializeState() const +{ + localIndex const numE = m_permeability.size( 0 ); + integer constexpr numQuad = 1; // NOTE: enforcing 1 quadrature point - for( localIndex ei = 0; ei < parent.size(); ++ei ) + for( localIndex ei = 0; ei < numE; ++ei ) { for( localIndex q = 0; q < numQuad; ++q ) { @@ -94,12 +90,6 @@ void PressurePermeability::allocateConstitutiveData( dataRepository::Group & par m_referencePermeability[ei][q][2] = m_referencePermeabilityComponents[2]; } } -} - -void PressurePermeability::initializeState() const -{ - localIndex const numE = m_permeability.size( 0 ); - integer constexpr numQuad = 1; // NOTE: enforcing 1 quadrature point auto permView = m_permeability.toView(); real64 const permComponents[3] = { m_referencePermeabilityComponents[0], @@ -115,7 +105,7 @@ void PressurePermeability::initializeState() const // The default value is -1 so if it still -1 it needs to be set to something physical if( permView[ei][q][dim] < 0 ) { - permView[ei][q][dim] = permComponents[dim]; + permView[ei][q][dim] = permComponents[dim]; } } } diff --git a/src/coreComponents/constitutive/permeability/PressurePermeability.hpp b/src/coreComponents/constitutive/permeability/PressurePermeability.hpp index df517530771..1a535eff1d7 100644 --- a/src/coreComponents/constitutive/permeability/PressurePermeability.hpp +++ b/src/coreComponents/constitutive/permeability/PressurePermeability.hpp @@ -143,12 +143,6 @@ class PressurePermeability : public PermeabilityBase PressurePermeability( string const & name, Group * const parent ); - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static string catalogName() { return "PressurePermeability"; } virtual string getCatalogName() const override { return catalogName(); } @@ -187,6 +181,8 @@ class PressurePermeability : public PermeabilityBase virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + private: /// Permeability components at the reference pressure diff --git a/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp b/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp index 201afe3fd63..01c9d5a043a 100644 --- a/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp @@ -54,13 +54,6 @@ ProppantPermeability::ProppantPermeability( string const & name, Group * const p } -std::unique_ptr< ConstitutiveBase > -ProppantPermeability::deliverClone( string const & name, - Group * const parent ) const -{ - return ConstitutiveBase::deliverClone( name, parent ); -} - void ProppantPermeability::postInputInitialization() { real64 const oneMinusMaxConcentration = ( 1.0 - m_maxProppantConcentration ); @@ -69,13 +62,13 @@ void ProppantPermeability::postInputInitialization() / ( m_maxProppantConcentration * m_maxProppantConcentration ); } -void ProppantPermeability::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void ProppantPermeability::resizeFields( localIndex const size, localIndex const numPts ) { + PermeabilityBase::resizeFields( size, numPts ); + // NOTE: enforcing 1 quadrature point m_dPerm_dDispJump.resize( 0, 1, 3, 3 ); m_permeabilityMultiplier.resize( 0, 1, 3 ); - PermeabilityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); } diff --git a/src/coreComponents/constitutive/permeability/ProppantPermeability.hpp b/src/coreComponents/constitutive/permeability/ProppantPermeability.hpp index 73b54febf02..7977a2e8181 100644 --- a/src/coreComponents/constitutive/permeability/ProppantPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ProppantPermeability.hpp @@ -115,12 +115,6 @@ class ProppantPermeability : public PermeabilityBase ProppantPermeability( string const & name, Group * const parent ); - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static string catalogName() { return "ProppantPermeability"; } virtual string getCatalogName() const override { return catalogName(); } @@ -155,6 +149,8 @@ class ProppantPermeability : public PermeabilityBase virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + private: array4d< real64 > m_dPerm_dDispJump; diff --git a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp index b3d05280ec4..f821ed39c16 100644 --- a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp @@ -47,20 +47,12 @@ SlipDependentPermeability::SlipDependentPermeability( string const & name, Group registerField( fields::permeability::dPerm_dDispJump{}, &m_dPerm_dDispJump ); } -std::unique_ptr< ConstitutiveBase > -SlipDependentPermeability::deliverClone( string const & name, - Group * const parent ) const +void SlipDependentPermeability::resizeFields( localIndex const size, localIndex const numPts ) { - return ConstitutiveBase::deliverClone( name, parent ); -} + PermeabilityBase::resizeFields( size, numPts ); -void SlipDependentPermeability::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ -// NOTE: enforcing 1 quadrature point + // NOTE: enforcing 1 quadrature point m_dPerm_dDispJump.resize( 0, 1, 3, 3 ); - - PermeabilityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); } REGISTER_CATALOG_ENTRY( ConstitutiveBase, SlipDependentPermeability, string const &, Group * const ) diff --git a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.hpp b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.hpp index 2c883115fa9..ee3311d30c5 100644 --- a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.hpp @@ -92,12 +92,6 @@ class SlipDependentPermeability : public PermeabilityBase SlipDependentPermeability( string const & name, Group * const parent ); - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static string catalogName() { return "SlipDependentPermeability"; } virtual string getCatalogName() const override { return catalogName(); } @@ -119,6 +113,10 @@ class SlipDependentPermeability : public PermeabilityBase m_initialPermeability ); } +protected: + + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + private: /// Derivative of fracture permeability w.r.t. displacement jump diff --git a/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.cpp b/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.cpp index 30383aa7bdf..b67bbdcaf42 100644 --- a/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.cpp @@ -48,21 +48,13 @@ WillisRichardsPermeability::WillisRichardsPermeability( string const & name, Gro registerField( fields::permeability::dPerm_dTraction{}, &m_dPerm_dTraction ); } -std::unique_ptr< ConstitutiveBase > -WillisRichardsPermeability::deliverClone( string const & name, - Group * const parent ) const +void WillisRichardsPermeability::resizeFields( localIndex const size, localIndex const numPts ) { - return ConstitutiveBase::deliverClone( name, parent ); -} - -void WillisRichardsPermeability::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ -// NOTE: enforcing 1 quadrature point - m_dPerm_dDispJump.resize( 0, 1, 3, 3 ); - m_dPerm_dTraction.resize( 0, 1, 3, 3 ); + PermeabilityBase::resizeFields( size, numPts ); - PermeabilityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + // NOTE: enforcing 1 quadrature point + m_dPerm_dDispJump.resize( size, 1, 3, 3 ); + m_dPerm_dTraction.resize( size, 1, 3, 3 ); } REGISTER_CATALOG_ENTRY( ConstitutiveBase, WillisRichardsPermeability, string const &, Group * const ) diff --git a/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.hpp b/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.hpp index 400e8f8356c..7f10a306996 100644 --- a/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.hpp @@ -99,12 +99,6 @@ class WillisRichardsPermeability : public PermeabilityBase WillisRichardsPermeability( string const & name, Group * const parent ); - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static string catalogName() { return "WillisRichardsPermeability"; } virtual string getCatalogName() const override { return catalogName(); } @@ -127,6 +121,10 @@ class WillisRichardsPermeability : public PermeabilityBase m_refClosureStress ); } +protected: + + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + private: /// Derivative of fracture permeability to shear displacement jump between fracture surfaces diff --git a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp index 1376c0a6b6a..0ec31914c31 100644 --- a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp +++ b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp @@ -117,13 +117,6 @@ void RelativePermeabilityBase::saveConvergedState( ) const m_phaseRelPerm_n.setValues< parallelDevicePolicy<> >( m_phaseRelPerm.toViewConst() ); } -void RelativePermeabilityBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - resizeFields( parent.size(), numConstitutivePointsPerParentIndex ); -} - /// for use in RelpermDriver to browse the drainage curves /// by setting the MaxHistoricalNonWettingSat to Snwmin and MinWettingSat to Sw std::tuple< integer, integer > RelativePermeabilityBase::wettingAndNonWettingPhaseIndices() const diff --git a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp index 0d24b1621ed..2c5246517ec 100644 --- a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp +++ b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp @@ -150,9 +150,6 @@ class RelativePermeabilityBase : public ConstitutiveBase RelativePermeabilityBase( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - integer numFluidPhases() const { return LvArray::integerConversion< integer >( m_phaseNames.size() ); } string_array const & phaseNames() const { return m_phaseNames; } @@ -199,7 +196,7 @@ class RelativePermeabilityBase : public ConstitutiveBase * @param size primary dimension (e.g. number of cells) * @param numPts secondary dimension (e.g. number of gauss points per cell) */ - virtual void resizeFields( localIndex const size, localIndex const numPts ); + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; virtual void postInputInitialization() override; diff --git a/src/coreComponents/constitutive/solid/CeramicDamage.cpp b/src/coreComponents/constitutive/solid/CeramicDamage.cpp index 389cf93a711..ed59327dd73 100644 --- a/src/coreComponents/constitutive/solid/CeramicDamage.cpp +++ b/src/coreComponents/constitutive/solid/CeramicDamage.cpp @@ -70,17 +70,12 @@ CeramicDamage::CeramicDamage( string const & name, Group * const parent ): } -CeramicDamage::~CeramicDamage() -{} - - -void CeramicDamage::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void CeramicDamage::resizeFields( localIndex const size, localIndex const numPts ) { - ElasticIsotropic::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + ElasticIsotropic::resizeFields( size, numPts ); - m_damage.resize( 0, numConstitutivePointsPerParentIndex ); - m_jacobian.resize( 0, numConstitutivePointsPerParentIndex ); + m_damage.resize( size, numPts ); + m_jacobian.resize( size, numPts ); } @@ -95,12 +90,6 @@ void CeramicDamage::postInputInitialization() } -void CeramicDamage::saveConvergedState() const -{ - SolidBase::saveConvergedState(); -} - - REGISTER_CATALOG_ENTRY( ConstitutiveBase, CeramicDamage, std::string const &, Group * const ) } } /* namespace geos */ diff --git a/src/coreComponents/constitutive/solid/CeramicDamage.hpp b/src/coreComponents/constitutive/solid/CeramicDamage.hpp index 1575fe84fac..c7cdfcfe5ba 100644 --- a/src/coreComponents/constitutive/solid/CeramicDamage.hpp +++ b/src/coreComponents/constitutive/solid/CeramicDamage.hpp @@ -36,7 +36,7 @@ #include "ElasticIsotropic.hpp" #include "InvariantDecompositions.hpp" #include "PropertyConversions.hpp" -#include "SolidModelDiscretizationOpsFullyAnisotroipic.hpp" +#include "SolidModelDiscretizationOpsFullyAnisotropic.hpp" #include "LvArray/src/tensorOps.hpp" namespace geos @@ -109,7 +109,7 @@ class CeramicDamageUpdates : public ElasticIsotropicUpdates CeramicDamageUpdates & operator=( CeramicDamageUpdates && ) = delete; /// Use the uncompressed version of the stiffness bilinear form - using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotroipic; // TODO: typo in anistropic (fix in DiscOps PR) + using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotropic; // Bring in base implementations to prevent hiding warnings using ElasticIsotropicUpdates::smallStrainUpdate; @@ -422,29 +422,15 @@ class CeramicDamage : public ElasticIsotropic */ CeramicDamage( string const & name, Group * const parent ); - /** - * Default Destructor - */ - virtual ~CeramicDamage() override; - - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - - virtual void saveConvergedState() const override; - /** * @name Static Factory Catalog members and functions */ ///@{ - /// string name to use for this class in the catalog - static constexpr auto m_catalogNameString = "CeramicDamage"; - /** * @return A string that is used to register/lookup this class in the registry */ - static string catalogName() { return m_catalogNameString; } + static string catalogName() { return "CeramicDamage"; } virtual string getCatalogName() const override { return catalogName(); } @@ -526,8 +512,11 @@ class CeramicDamage : public ElasticIsotropic protected: + virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + /// State variable: The damage values for each quadrature point array2d< real64 > m_damage; diff --git a/src/coreComponents/constitutive/solid/CompressibleSolid.cpp b/src/coreComponents/constitutive/solid/CompressibleSolid.cpp index a0e5609b618..5519d77543a 100644 --- a/src/coreComponents/constitutive/solid/CompressibleSolid.cpp +++ b/src/coreComponents/constitutive/solid/CompressibleSolid.cpp @@ -42,10 +42,6 @@ CompressibleSolid< PORO_TYPE, PERM_TYPE >::CompressibleSolid( string const & nam CoupledSolid< NullModel, PORO_TYPE, PERM_TYPE >( name, parent ) {} -template< typename PORO_TYPE, - typename PERM_TYPE > -CompressibleSolid< PORO_TYPE, PERM_TYPE >::~CompressibleSolid() = default; - // Register all CompressibleSolid model types. typedef CompressibleSolid< PressurePorosity, ConstantPermeability > CompressibleRockConstant; typedef CompressibleSolid< PressurePorosity, CarmanKozenyPermeability > CompressibleRockCK; diff --git a/src/coreComponents/constitutive/solid/CompressibleSolid.hpp b/src/coreComponents/constitutive/solid/CompressibleSolid.hpp index be4ec85d6c8..fb1832b2804 100644 --- a/src/coreComponents/constitutive/solid/CompressibleSolid.hpp +++ b/src/coreComponents/constitutive/solid/CompressibleSolid.hpp @@ -130,9 +130,6 @@ class CompressibleSolid : public CoupledSolid< NullModel, PORO_TYPE, PERM_TYPE > */ CompressibleSolid( string const & name, dataRepository::Group * const parent ); - /// Destructor - virtual ~CompressibleSolid() override; - /** * @brief Catalog name * @return Static catalog string diff --git a/src/coreComponents/constitutive/solid/CoupledSolid.hpp b/src/coreComponents/constitutive/solid/CoupledSolid.hpp index cb7b7da5b78..93e26caa84a 100644 --- a/src/coreComponents/constitutive/solid/CoupledSolid.hpp +++ b/src/coreComponents/constitutive/solid/CoupledSolid.hpp @@ -145,9 +145,6 @@ class CoupledSolid : public CoupledSolidBase */ CoupledSolid( string const & name, dataRepository::Group * const parent ); - /// Destructor - virtual ~CoupledSolid() override; - virtual void initializePreSubGroups() override; /** @@ -185,12 +182,6 @@ CoupledSolid< SOLID_TYPE, PORO_TYPE, PERM_TYPE >::CoupledSolid( string const & n CoupledSolidBase( name, parent ) {} -template< typename SOLID_TYPE, - typename PORO_TYPE, - typename PERM_TYPE > -CoupledSolid< SOLID_TYPE, PORO_TYPE, PERM_TYPE >::~CoupledSolid() = default; - - template< typename SOLID_TYPE, typename PORO_TYPE, typename PERM_TYPE > diff --git a/src/coreComponents/constitutive/solid/CoupledSolidBase.cpp b/src/coreComponents/constitutive/solid/CoupledSolidBase.cpp index e6ea3142cc7..90bcc41f62e 100644 --- a/src/coreComponents/constitutive/solid/CoupledSolidBase.cpp +++ b/src/coreComponents/constitutive/solid/CoupledSolidBase.cpp @@ -56,7 +56,6 @@ CoupledSolidBase::CoupledSolidBase( string const & name, Group * const parent ): setDescription( "Name of the solid internal energy model." ); } -CoupledSolidBase::~CoupledSolidBase() = default; +} /* namespace constitutive */ -} } /* namespace geos */ diff --git a/src/coreComponents/constitutive/solid/CoupledSolidBase.hpp b/src/coreComponents/constitutive/solid/CoupledSolidBase.hpp index ca941f69cac..a5081d2b7eb 100644 --- a/src/coreComponents/constitutive/solid/CoupledSolidBase.hpp +++ b/src/coreComponents/constitutive/solid/CoupledSolidBase.hpp @@ -44,9 +44,6 @@ class CoupledSolidBase : public ConstitutiveBase */ CoupledSolidBase( string const & name, dataRepository::Group * const parent ); - /// Destructor - virtual ~CoupledSolidBase() override; - struct viewKeyStruct { static constexpr char const * solidModelNameString() { return "solidModelName"; } diff --git a/src/coreComponents/constitutive/solid/Damage.cpp b/src/coreComponents/constitutive/solid/Damage.cpp index c1131d0378f..e61d7d63d3b 100644 --- a/src/coreComponents/constitutive/solid/Damage.cpp +++ b/src/coreComponents/constitutive/solid/Damage.cpp @@ -176,21 +176,22 @@ void Damage< BASE >::postInputInitialization() } template< typename BASE > -void Damage< BASE >::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void Damage< BASE >::resizeFields( localIndex const size, + localIndex const numPts ) { - m_newDamage.resize( 0, numConstitutivePointsPerParentIndex ); - m_oldDamage.resize( 0, numConstitutivePointsPerParentIndex ); - m_damageGrad.resize( 0, numConstitutivePointsPerParentIndex, 3 ); - m_strainEnergyDensity.resize( 0, numConstitutivePointsPerParentIndex ); - m_volStrain.resize( 0, numConstitutivePointsPerParentIndex ); - m_extDrivingForce.resize( 0, numConstitutivePointsPerParentIndex ); - m_biotCoefficient.resize( parent.size() ); - m_criticalFractureEnergy.resize( parent.size() ); - m_tensileStrength.resize( parent.size() ); - m_compressStrength.resize( parent.size() ); - m_deltaCoefficient.resize( parent.size() ); - BASE::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + BASE::resizeFields( size, numPts ); + + m_newDamage.resize( size, numPts ); + m_oldDamage.resize( size, numPts ); + m_damageGrad.resize( size, numPts, 3 ); + m_strainEnergyDensity.resize( size, numPts ); + m_volStrain.resize( size, numPts ); + m_extDrivingForce.resize( size, numPts ); + m_biotCoefficient.resize( size ); + m_criticalFractureEnergy.resize( size ); + m_tensileStrength.resize( size ); + m_compressStrength.resize( size ); + m_deltaCoefficient.resize( size ); } template< typename BASE > diff --git a/src/coreComponents/constitutive/solid/Damage.hpp b/src/coreComponents/constitutive/solid/Damage.hpp index 97d5d251515..ccfb9e2dac3 100644 --- a/src/coreComponents/constitutive/solid/Damage.hpp +++ b/src/coreComponents/constitutive/solid/Damage.hpp @@ -422,16 +422,12 @@ class Damage : public BASE using KernelWrapper = DamageUpdates< typename BASE::KernelWrapper >; Damage( string const & name, dataRepository::Group * const parent ); - virtual ~Damage() override = default; - static string catalogName() { return string( "Damage" ) + BASE::m_catalogNameString; } + static string catalogName() { return string( "Damage" ) + BASE::catalogName(); } virtual string getCatalogName() const override { return catalogName(); } virtual void postInputInitialization() override; - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - virtual void saveConvergedState() const override; /// *** The interface to get member variables arrayView2d< real64 const > getNewDamage() const { return m_newDamage; } @@ -498,6 +494,8 @@ class Damage : public BASE protected: + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + /// The new damage value on all quadrature points array2d< real64 > m_newDamage; diff --git a/src/coreComponents/constitutive/solid/DamageSpectral.cpp b/src/coreComponents/constitutive/solid/DamageSpectral.cpp index 68e67cd0fb6..45d6631ebb8 100644 --- a/src/coreComponents/constitutive/solid/DamageSpectral.cpp +++ b/src/coreComponents/constitutive/solid/DamageSpectral.cpp @@ -34,10 +34,6 @@ DamageSpectral< BASE >::DamageSpectral( string const & name, Group * const paren Damage< BASE >( name, parent ) {} -template< typename BASE > -DamageSpectral< BASE >::~DamageSpectral() -{} - typedef DamageSpectral< ElasticIsotropic > DamageSpectralElasticIsotropic; REGISTER_CATALOG_ENTRY( ConstitutiveBase, DamageSpectralElasticIsotropic, string const &, Group * const ) diff --git a/src/coreComponents/constitutive/solid/DamageSpectral.hpp b/src/coreComponents/constitutive/solid/DamageSpectral.hpp index 3e7dccff201..0d821be68e2 100644 --- a/src/coreComponents/constitutive/solid/DamageSpectral.hpp +++ b/src/coreComponents/constitutive/solid/DamageSpectral.hpp @@ -25,7 +25,7 @@ #include "DamageSpectralUtilities.hpp" #include "PropertyConversions.hpp" #include "SolidBase.hpp" -#include "SolidModelDiscretizationOpsFullyAnisotroipic.hpp" +#include "SolidModelDiscretizationOpsFullyAnisotropic.hpp" #define QUADRATIC_DISSIPATION 0 @@ -61,7 +61,7 @@ class DamageSpectralUpdates : public DamageUpdates< UPDATE_BASE > std::forward< PARAMS >( baseParams )... ) {} - using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotroipic; // could maybe optimize, but general for now + using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotropic; using DamageUpdates< UPDATE_BASE >::smallStrainUpdate; using DamageUpdates< UPDATE_BASE >::saveConvergedState; @@ -314,10 +314,9 @@ class DamageSpectral : public Damage< BASE > using Damage< BASE >::m_biotCoefficient; DamageSpectral( string const & name, dataRepository::Group * const parent ); - virtual ~DamageSpectral() override; - static string catalogName() { return string( "DamageSpectral" ) + BASE::m_catalogNameString; } + static string catalogName() { return string( "DamageSpectral" ) + BASE::catalogName(); } virtual string getCatalogName() const override { return catalogName(); } diff --git a/src/coreComponents/constitutive/solid/DamageVolDev.cpp b/src/coreComponents/constitutive/solid/DamageVolDev.cpp index 0bacfa2a8dd..0aa0e6983c8 100644 --- a/src/coreComponents/constitutive/solid/DamageVolDev.cpp +++ b/src/coreComponents/constitutive/solid/DamageVolDev.cpp @@ -34,10 +34,6 @@ DamageVolDev< BASE >::DamageVolDev( string const & name, Group * const parent ): Damage< BASE >( name, parent ) {} -template< typename BASE > -DamageVolDev< BASE >::~DamageVolDev() -{} - typedef DamageVolDev< ElasticIsotropic > DamageVolDevElasticIsotropic; REGISTER_CATALOG_ENTRY( ConstitutiveBase, DamageVolDevElasticIsotropic, string const &, Group * const ) diff --git a/src/coreComponents/constitutive/solid/DamageVolDev.hpp b/src/coreComponents/constitutive/solid/DamageVolDev.hpp index db4c32f36c3..8133f82836a 100644 --- a/src/coreComponents/constitutive/solid/DamageVolDev.hpp +++ b/src/coreComponents/constitutive/solid/DamageVolDev.hpp @@ -188,10 +188,9 @@ class DamageVolDev : public Damage< BASE > using Damage< BASE >::m_biotCoefficient; DamageVolDev( string const & name, dataRepository::Group * const parent ); - virtual ~DamageVolDev() override; - static string catalogName() { return string( "DamageVolDev" ) + BASE::m_catalogNameString; } + static string catalogName() { return string( "DamageVolDev" ) + BASE::catalogName(); } virtual string getCatalogName() const override { return catalogName(); } diff --git a/src/coreComponents/constitutive/solid/DelftEgg.cpp b/src/coreComponents/constitutive/solid/DelftEgg.cpp index cd45347cb72..03eeefcc413 100644 --- a/src/coreComponents/constitutive/solid/DelftEgg.cpp +++ b/src/coreComponents/constitutive/solid/DelftEgg.cpp @@ -95,17 +95,12 @@ DelftEgg::DelftEgg( string const & name, Group * const parent ): } -DelftEgg::~DelftEgg() -{} - - -void DelftEgg::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void DelftEgg::resizeFields( localIndex const size, localIndex const numPts ) { - m_newPreConsolidationPressure.resize( 0, numConstitutivePointsPerParentIndex ); - m_oldPreConsolidationPressure.resize( 0, numConstitutivePointsPerParentIndex ); + ElasticIsotropic::resizeFields( size, numPts ); - ElasticIsotropic::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_newPreConsolidationPressure.resize( size, numPts ); + m_oldPreConsolidationPressure.resize( size, numPts ); } diff --git a/src/coreComponents/constitutive/solid/DelftEgg.hpp b/src/coreComponents/constitutive/solid/DelftEgg.hpp index 5789b46178c..a12446a24f1 100644 --- a/src/coreComponents/constitutive/solid/DelftEgg.hpp +++ b/src/coreComponents/constitutive/solid/DelftEgg.hpp @@ -23,7 +23,7 @@ #include "ElasticIsotropic.hpp" #include "InvariantDecompositions.hpp" #include "PropertyConversions.hpp" -#include "SolidModelDiscretizationOpsFullyAnisotroipic.hpp" +#include "SolidModelDiscretizationOpsFullyAnisotropic.hpp" #include "LvArray/src/tensorOps.hpp" namespace geos @@ -95,7 +95,7 @@ class DelftEggUpdates : public ElasticIsotropicUpdates DelftEggUpdates & operator=( DelftEggUpdates && ) = delete; /// Use the uncompressed version of the stiffness bilinear form - using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotroipic; // TODO: typo in anistropic (fix in DiscOps PR) + using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotropic; // Bring in base implementations to prevent hiding warnings using ElasticIsotropicUpdates::smallStrainUpdate; @@ -470,15 +470,6 @@ class DelftEgg : public ElasticIsotropic */ DelftEgg( string const & name, Group * const parent ); - /** - * Default Destructor - */ - virtual ~DelftEgg() override; - - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - virtual void saveConvergedState() const override; /** @@ -486,13 +477,10 @@ class DelftEgg : public ElasticIsotropic */ ///@{ - /// string name to use for this class in the catalog - static constexpr auto m_catalogNameString = "DelftEgg"; - /** * @return A string that is used to register/lookup this class in the registry */ - static string catalogName() { return m_catalogNameString; } + static string catalogName() { return "DelftEgg"; } virtual string getCatalogName() const override { return catalogName(); } @@ -584,8 +572,11 @@ class DelftEgg : public ElasticIsotropic protected: + virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + /// Material parameter: The default value of the recompression index real64 m_defaultRecompressionIndex; diff --git a/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp b/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp index 6952ec194cf..ba250402750 100644 --- a/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp +++ b/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp @@ -45,8 +45,6 @@ PoreVolumeCompressibleSolid::PoreVolumeCompressibleSolid( string const & name, G registerWrapper( viewKeyStruct::dPVMult_dPresString(), &m_dPVMult_dPressure ); } -PoreVolumeCompressibleSolid::~PoreVolumeCompressibleSolid() = default; - std::unique_ptr< ConstitutiveBase > PoreVolumeCompressibleSolid::deliverClone( string const & name, Group * const parent ) const @@ -61,15 +59,10 @@ PoreVolumeCompressibleSolid::deliverClone( string const & name, return clone; } -void PoreVolumeCompressibleSolid::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void PoreVolumeCompressibleSolid::resizeFields( localIndex const size, localIndex const numPts ) { - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - - this->resize( parent.size() ); - - m_poreVolumeMultiplier.resize( parent.size(), numConstitutivePointsPerParentIndex ); - m_dPVMult_dPressure.resize( parent.size(), numConstitutivePointsPerParentIndex ); + m_poreVolumeMultiplier.resize( size, numPts ); + m_dPVMult_dPressure.resize( size, numPts ); m_poreVolumeMultiplier.setValues< serialPolicy >( 1.0 ); } diff --git a/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.hpp b/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.hpp index fa60f97d4ab..ef69a3bb03d 100644 --- a/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.hpp +++ b/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.hpp @@ -35,15 +35,9 @@ class PoreVolumeCompressibleSolid : public ConstitutiveBase public: PoreVolumeCompressibleSolid( string const & name, Group * const parent ); - virtual ~PoreVolumeCompressibleSolid() override; - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, Group * const parent ) const override; - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - - static string catalogName() { return "PoreVolumeCompressibleSolid"; } virtual string getCatalogName() const override { return catalogName(); } @@ -62,8 +56,11 @@ class PoreVolumeCompressibleSolid : public ConstitutiveBase }; protected: + virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + private: /// scalar compressibility parameter diff --git a/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.cpp b/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.cpp index 688140ec100..5b01ab9605e 100644 --- a/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.cpp +++ b/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.cpp @@ -69,10 +69,6 @@ PoroElastic< BASE >::PoroElastic( string const & name, Group * const parent ): setDescription( "" ); } -template< typename BASE > -PoroElastic< BASE >::~PoroElastic() -{} - template< typename BASE > void PoroElastic< BASE >::postInputInitialization() { @@ -93,12 +89,12 @@ PoroElastic< BASE >::deliverClone( string const & name, } template< typename BASE > -void PoroElastic< BASE >::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void PoroElastic< BASE >::resizeFields( localIndex const size, localIndex const numPts ) { - m_poreVolumeMultiplier.resize( 0, numConstitutivePointsPerParentIndex ); - m_dPVMult_dPressure.resize( 0, numConstitutivePointsPerParentIndex ); - BASE::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + BASE::resizeFields( size, numPts ); + + m_poreVolumeMultiplier.resize( size, numPts ); + m_dPVMult_dPressure.resize( size, numPts ); } template< typename BASE > diff --git a/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.hpp b/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.hpp index 9d3c1e9a359..c9d7bb356f7 100644 --- a/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.hpp +++ b/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.hpp @@ -106,14 +106,11 @@ class PoroElastic : public BASE */ PoroElastic( string const & name, dataRepository::Group * const parent ); - /// Destructor - virtual ~PoroElastic() override; - /** * @brief Catalog name * @return Static catalog string */ - static string catalogName() { return string( "Poro" ) + BASE::m_catalogNameString; } + static string catalogName() { return string( "Poro" ) + BASE::catalogName(); } /** * @brief Get catalog name @@ -134,14 +131,6 @@ class PoroElastic : public BASE deliverClone( string const & name, dataRepository::Group * const parent ) const override; - /** - * @brief Allocate constitutive arrays - * @param parent Object's parent group (an element region) - * @param numConstitutivePointsPerParentIndex (number of quadrature points per element) - */ - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - /** * @brief Perform pore volume updates point-wise * @param[in] pres Current pressure @@ -183,6 +172,9 @@ class PoroElastic : public BASE protected: + + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + /// scalar compressibility parameter real64 m_compressibility; diff --git a/src/coreComponents/constitutive/solid/DruckerPrager.cpp b/src/coreComponents/constitutive/solid/DruckerPrager.cpp index cfdbfb05253..479241ebdeb 100644 --- a/src/coreComponents/constitutive/solid/DruckerPrager.cpp +++ b/src/coreComponents/constitutive/solid/DruckerPrager.cpp @@ -84,17 +84,12 @@ DruckerPrager::DruckerPrager( string const & name, Group * const parent ): } -DruckerPrager::~DruckerPrager() -{} - - -void DruckerPrager::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void DruckerPrager::resizeFields( localIndex const size, localIndex const numPts ) { - m_newCohesion.resize( 0, numConstitutivePointsPerParentIndex ); - m_oldCohesion.resize( 0, numConstitutivePointsPerParentIndex ); + ElasticIsotropic::resizeFields( size, numPts ); - ElasticIsotropic::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_newCohesion.resize( size, numPts ); + m_oldCohesion.resize( size, numPts ); } diff --git a/src/coreComponents/constitutive/solid/DruckerPrager.hpp b/src/coreComponents/constitutive/solid/DruckerPrager.hpp index f741f60166d..e406699c8bf 100644 --- a/src/coreComponents/constitutive/solid/DruckerPrager.hpp +++ b/src/coreComponents/constitutive/solid/DruckerPrager.hpp @@ -23,7 +23,7 @@ #include "ElasticIsotropic.hpp" #include "InvariantDecompositions.hpp" #include "PropertyConversions.hpp" -#include "SolidModelDiscretizationOpsFullyAnisotroipic.hpp" +#include "SolidModelDiscretizationOpsFullyAnisotropic.hpp" #include "LvArray/src/tensorOps.hpp" namespace geos @@ -91,7 +91,7 @@ class DruckerPragerUpdates : public ElasticIsotropicUpdates DruckerPragerUpdates & operator=( DruckerPragerUpdates && ) = delete; /// Use the uncompressed version of the stiffness bilinear form - using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotroipic; // TODO: typo in anistropic (fix in DiscOps PR) + using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotropic; // Bring in base implementations to prevent hiding warnings using ElasticIsotropicUpdates::smallStrainUpdate; @@ -360,15 +360,6 @@ class DruckerPrager : public ElasticIsotropic */ DruckerPrager( string const & name, Group * const parent ); - /** - * Default Destructor - */ - virtual ~DruckerPrager() override; - - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - virtual void saveConvergedState() const override; /** @@ -376,13 +367,10 @@ class DruckerPrager : public ElasticIsotropic */ ///@{ - /// string name to use for this class in the catalog - static constexpr auto m_catalogNameString = "DruckerPrager"; - /** * @return A string that is used to register/lookup this class in the registry */ - static string catalogName() { return m_catalogNameString; } + static string catalogName() { return "DruckerPrager"; } virtual string getCatalogName() const override { return catalogName(); } @@ -466,8 +454,11 @@ class DruckerPrager : public ElasticIsotropic protected: + virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + /// Material parameter: The default value of yield surface slope real64 m_defaultFrictionAngle; diff --git a/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp b/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp index 2158e78f3a0..216389b7fba 100644 --- a/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp +++ b/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp @@ -100,17 +100,12 @@ DruckerPragerExtended::DruckerPragerExtended( string const & name, Group * const } -DruckerPragerExtended::~DruckerPragerExtended() -{} - - -void DruckerPragerExtended::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void DruckerPragerExtended::resizeFields( localIndex const size, localIndex const numPts ) { - m_newState.resize( 0, numConstitutivePointsPerParentIndex ); - m_oldState.resize( 0, numConstitutivePointsPerParentIndex ); + ElasticIsotropic::resizeFields( size, numPts ); - ElasticIsotropic::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_newState.resize( size, numPts ); + m_oldState.resize( size, numPts ); } diff --git a/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp b/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp index 20869d79e66..770fc09c77c 100644 --- a/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp +++ b/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp @@ -23,7 +23,7 @@ #include "ElasticIsotropic.hpp" #include "InvariantDecompositions.hpp" #include "PropertyConversions.hpp" -#include "SolidModelDiscretizationOpsFullyAnisotroipic.hpp" +#include "SolidModelDiscretizationOpsFullyAnisotropic.hpp" #include "LvArray/src/tensorOps.hpp" namespace geos @@ -87,7 +87,7 @@ class DruckerPragerExtendedUpdates : public ElasticIsotropicUpdates DruckerPragerExtendedUpdates & operator=( DruckerPragerExtendedUpdates && ) = delete; /// Use the uncompressed version of the stiffness bilinear form - using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotroipic; // TODO: typo in anistropic (fix in DiscOps PR) + using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotropic; // Bring in base implementations to prevent hiding warnings using ElasticIsotropicUpdates::smallStrainUpdate; @@ -386,15 +386,6 @@ class DruckerPragerExtended : public ElasticIsotropic */ DruckerPragerExtended( string const & name, Group * const parent ); - /** - * Default Destructor - */ - virtual ~DruckerPragerExtended() override; - - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - virtual void saveConvergedState() const override; /** @@ -402,13 +393,10 @@ class DruckerPragerExtended : public ElasticIsotropic */ ///@{ - /// string name to use for this class in the catalog - static constexpr auto m_catalogNameString = "ExtendedDruckerPrager"; - /** * @return A string that is used to register/lookup this class in the registry */ - static string catalogName() { return m_catalogNameString; } + static string catalogName() { return "ExtendedDruckerPrager"; } virtual string getCatalogName() const override { return catalogName(); } @@ -505,8 +493,11 @@ class DruckerPragerExtended : public ElasticIsotropic protected: + virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + /// Material parameter: The default value of the initial yield surface slope real64 m_defaultInitialFrictionAngle; diff --git a/src/coreComponents/constitutive/solid/DuvautLionsSolid.cpp b/src/coreComponents/constitutive/solid/DuvautLionsSolid.cpp index 4e3e128adee..eb4ba0f77bf 100644 --- a/src/coreComponents/constitutive/solid/DuvautLionsSolid.cpp +++ b/src/coreComponents/constitutive/solid/DuvautLionsSolid.cpp @@ -43,19 +43,6 @@ DuvautLionsSolid< BASE >::DuvautLionsSolid( string const & name, Group * const p } -template< typename BASE > -void DuvautLionsSolid< BASE >::postInputInitialization() -{ - BASE::postInputInitialization(); -} - -template< typename BASE > -void DuvautLionsSolid< BASE >::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - BASE::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); -} - //typedef DuvautLionsSolid< ElasticIsotropic > ViscoElasticIsotropic; typedef DuvautLionsSolid< DruckerPrager > ViscoDruckerPrager; typedef DuvautLionsSolid< DruckerPragerExtended > ViscoDruckerPragerExtended; diff --git a/src/coreComponents/constitutive/solid/DuvautLionsSolid.hpp b/src/coreComponents/constitutive/solid/DuvautLionsSolid.hpp index 8c3bd5d849c..a3a857b82ee 100644 --- a/src/coreComponents/constitutive/solid/DuvautLionsSolid.hpp +++ b/src/coreComponents/constitutive/solid/DuvautLionsSolid.hpp @@ -27,7 +27,7 @@ #include "ElasticIsotropic.hpp" #include "DruckerPrager.hpp" #include "DruckerPragerExtended.hpp" -#include "SolidModelDiscretizationOpsFullyAnisotroipic.hpp" +#include "SolidModelDiscretizationOpsFullyAnisotropic.hpp" #include "SolidModelDiscretizationOpsIsotropic.hpp" #include "LvArray/src/tensorOps.hpp" @@ -149,24 +149,17 @@ class DuvautLionsSolid : public BASE using KernelWrapper = DuvautLionsSolidUpdates< typename BASE::KernelWrapper >; DuvautLionsSolid( string const & name, dataRepository::Group * const parent ); - virtual ~DuvautLionsSolid() override = default; /** * @brief Catalog name * @return Static catalog string */ - static string catalogName() { return string( "Visco" ) + BASE::m_catalogNameString; } + static string catalogName() { return string( "Visco" ) + BASE::catalogName(); } virtual string getCatalogName() const override { return catalogName(); } real64 relaxationTime() const { return m_relaxationTime; } - virtual void postInputInitialization() override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - - KernelWrapper createKernelUpdates() const { return BASE::template createDerivedKernelUpdates< KernelWrapper >( m_relaxationTime ); diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropic.cpp b/src/coreComponents/constitutive/solid/ElasticIsotropic.cpp index 773087398a4..b6a7b1569db 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropic.cpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropic.cpp @@ -61,9 +61,6 @@ ElasticIsotropic::ElasticIsotropic( string const & name, Group * const parent ): setDescription( "Elastic Shear Modulus Field" ); } -ElasticIsotropic::~ElasticIsotropic() -{} - void ElasticIsotropic::postInputInitialization() { // check what constants the user actually input, and do conversions as needed diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropic.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropic.hpp index 97573fce5f3..2cc79e9941b 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropic.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropic.hpp @@ -446,24 +446,16 @@ class ElasticIsotropic : public SolidBase */ ElasticIsotropic( string const & name, Group * const parent ); - /** - * Default Destructor - */ - virtual ~ElasticIsotropic() override; - /** * @name Static Factory Catalog members and functions */ ///@{ - /// string name to use for this class in the catalog - static constexpr auto m_catalogNameString = "ElasticIsotropic"; - /** * @brief Static catalog string * @return A string that is used to register/lookup this class in the registry */ - static std::string catalogName() { return m_catalogNameString; } + static std::string catalogName() { return "ElasticIsotropic"; } /** * @brief Get catalog name diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.cpp b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.cpp index 95172384a19..77f62bc178b 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.cpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.cpp @@ -74,10 +74,6 @@ ElasticIsotropicPressureDependent::ElasticIsotropicPressureDependent( string con } -ElasticIsotropicPressureDependent::~ElasticIsotropicPressureDependent() -{} - - void ElasticIsotropicPressureDependent::postInputInitialization() { // check what constants the user actually input, and do conversions as needed diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp index 054cb2118e5..f6217042857 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp @@ -365,8 +365,10 @@ void ElasticIsotropicPressureDependentUpdates::smallStrainUpdate( localIndex con // Calculate trial mean and deviatoric stress + std::cout << "Cr = " << Cr << ", eps_v_elastic = " << eps_v_elastic << " eps_v0 = " << eps_v0 << std::endl; P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); Q = 3. * mu * eps_s_elastic; + std::cout << "P = " << P << ", Q = " << Q << std::endl; twoInvariant::stressRecomposition( P, Q, @@ -452,8 +454,10 @@ void ElasticIsotropicPressureDependentUpdates::smallStrainUpdate( localIndex con // Calculate mean and deviatoric stress + std::cout << "Cr = " << Cr << ", eps_v_elastic = " << eps_v_elastic << " eps_v0 = " << eps_v0 << std::endl; P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); Q = 3. * mu * eps_s_elastic; + std::cout << "P = " << P << ", Q = " << Q << std::endl; twoInvariant::stressRecomposition( P, Q, @@ -498,24 +502,16 @@ class ElasticIsotropicPressureDependent : public SolidBase */ ElasticIsotropicPressureDependent( string const & name, Group * const parent ); - /** - * Default Destructor - */ - virtual ~ElasticIsotropicPressureDependent() override; - /** * @name Static Factory Catalog members and functions */ ///@{ - /// string name to use for this class in the catalog - static constexpr auto m_catalogNameString = "ElasticIsotropicPressureDependent"; - /** * @brief Static catalog string * @return A string that is used to register/lookup this class in the registry */ - static std::string catalogName() { return m_catalogNameString; } + static std::string catalogName() { return "ElasticIsotropicPressureDependent"; } /** * @brief Get catalog name diff --git a/src/coreComponents/constitutive/solid/ElasticOrthotropic.cpp b/src/coreComponents/constitutive/solid/ElasticOrthotropic.cpp index 7c707d690cc..5a1d163b027 100644 --- a/src/coreComponents/constitutive/solid/ElasticOrthotropic.cpp +++ b/src/coreComponents/constitutive/solid/ElasticOrthotropic.cpp @@ -173,9 +173,6 @@ ElasticOrthotropic::ElasticOrthotropic( string const & name, Group * const paren setDescription( "Elastic Stiffness Field C66" ); } -ElasticOrthotropic::~ElasticOrthotropic() -{} - void ElasticOrthotropic::postInputInitialization() { SolidBase::postInputInitialization(); diff --git a/src/coreComponents/constitutive/solid/ElasticOrthotropic.hpp b/src/coreComponents/constitutive/solid/ElasticOrthotropic.hpp index 49179c5a95a..2ea1f4f549a 100644 --- a/src/coreComponents/constitutive/solid/ElasticOrthotropic.hpp +++ b/src/coreComponents/constitutive/solid/ElasticOrthotropic.hpp @@ -415,23 +415,15 @@ class ElasticOrthotropic : public SolidBase */ ElasticOrthotropic( string const & name, Group * const parent ); - /** - * Destructor - */ - virtual ~ElasticOrthotropic() override; - /** * @name Static Factory Catalog members and functions */ ///@{ - /// string name to use for this class in the catalog - static constexpr auto m_catalogNameString = "ElasticOrthotropic"; - /** * @return A string that is used to register/lookup this class in the registry */ - static string catalogName() { return m_catalogNameString; } + static string catalogName() { return "ElasticOrthotropic"; } virtual string getCatalogName() const override { return catalogName(); } ///@} diff --git a/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.cpp b/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.cpp index 9cad0340f36..9dd1296b7cb 100644 --- a/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.cpp +++ b/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.cpp @@ -110,9 +110,6 @@ ElasticTransverseIsotropic::ElasticTransverseIsotropic( string const & name, Gro setDescription( "Elastic Stiffness Field C66" ); } -ElasticTransverseIsotropic::~ElasticTransverseIsotropic() -{} - void ElasticTransverseIsotropic::postInputInitialization() { SolidBase::postInputInitialization(); diff --git a/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.hpp b/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.hpp index 17fabe5479e..5048ac2bce6 100644 --- a/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.hpp +++ b/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.hpp @@ -379,23 +379,15 @@ class ElasticTransverseIsotropic : public SolidBase */ ElasticTransverseIsotropic( string const & name, Group * const parent ); - /** - * Destructor - */ - virtual ~ElasticTransverseIsotropic() override; - /** * @name Static Factory Catalog members and functions */ ///@{ - /// string name to use for this class in the catalog - static constexpr auto m_catalogNameString = "ElasticTransverseIsotropic"; - /** * @return A string that is used to register/lookup this class in the registry */ - static string catalogName() { return m_catalogNameString; } + static string catalogName() { return "ElasticTransverseIsotropic"; } virtual string getCatalogName() const override { return catalogName(); } ///@} diff --git a/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp b/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp index 6d0e8f401d6..e8db17ce775 100644 --- a/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp +++ b/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp @@ -73,20 +73,14 @@ ModifiedCamClay::ModifiedCamClay( string const & name, Group * const parent ): } -ModifiedCamClay::~ModifiedCamClay() -{} - - -void ModifiedCamClay::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void ModifiedCamClay::resizeFields( localIndex const size, localIndex const numPts ) { - m_newPreConsolidationPressure.resize( 0, numConstitutivePointsPerParentIndex ); - m_oldPreConsolidationPressure.resize( 0, numConstitutivePointsPerParentIndex ); + ElasticIsotropicPressureDependent::resizeFields( size, numPts ); - ElasticIsotropicPressureDependent::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_newPreConsolidationPressure.resize( size, numPts ); + m_oldPreConsolidationPressure.resize( size, numPts ); } - void ModifiedCamClay::postInputInitialization() { ElasticIsotropicPressureDependent::postInputInitialization(); diff --git a/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp b/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp index 4377571e603..0ee208b359d 100644 --- a/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp +++ b/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp @@ -23,7 +23,7 @@ #include "ElasticIsotropicPressureDependent.hpp" #include "InvariantDecompositions.hpp" #include "PropertyConversions.hpp" -#include "SolidModelDiscretizationOpsFullyAnisotroipic.hpp" +#include "SolidModelDiscretizationOpsFullyAnisotropic.hpp" #include "LvArray/src/tensorOps.hpp" namespace geos @@ -94,10 +94,10 @@ class ModifiedCamClayUpdates : public ElasticIsotropicPressureDependentUpdates ModifiedCamClayUpdates & operator=( ModifiedCamClayUpdates && ) = delete; /// Use the uncompressed version of the stiffness bilinear form - using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotroipic; // TODO: typo in anistropic (fix in DiscOps PR) + using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotropic; // Bring in base implementations to prevent hiding warnings - using ElasticIsotropicPressureDependentUpdates::smallStrainUpdate; + //using ElasticIsotropicPressureDependentUpdates::smallStrainUpdate; GEOS_HOST_DEVICE void evaluateYield( real64 const p, @@ -487,15 +487,6 @@ class ModifiedCamClay : public ElasticIsotropicPressureDependent */ ModifiedCamClay( string const & name, Group * const parent ); - /** - * Default Destructor - */ - virtual ~ModifiedCamClay() override; - - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - virtual void saveConvergedState() const override; /** @@ -503,13 +494,10 @@ class ModifiedCamClay : public ElasticIsotropicPressureDependent */ ///@{ - /// string name to use for this class in the catalog - static constexpr auto m_catalogNameString = "ModifiedCamClay"; - /** * @return A string that is used to register/lookup this class in the registry */ - static string catalogName() { return m_catalogNameString; } + static string catalogName() { return "ModifiedCamClay"; } virtual string getCatalogName() const override { return catalogName(); } @@ -587,10 +575,12 @@ class ModifiedCamClay : public ElasticIsotropicPressureDependent m_disableInelasticity ); } - protected: + virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + /// Material parameter: The default value of the virgin compression index real64 m_defaultVirginCompressionIndex; diff --git a/src/coreComponents/constitutive/solid/PerfectlyPlastic.cpp b/src/coreComponents/constitutive/solid/PerfectlyPlastic.cpp index a1d39db1f50..96d73602516 100644 --- a/src/coreComponents/constitutive/solid/PerfectlyPlastic.cpp +++ b/src/coreComponents/constitutive/solid/PerfectlyPlastic.cpp @@ -43,17 +43,6 @@ PerfectlyPlastic::PerfectlyPlastic( string const & name, Group * const parent ): } -PerfectlyPlastic::~PerfectlyPlastic() -{} - - -void PerfectlyPlastic::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - ElasticIsotropic::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); -} - - void PerfectlyPlastic::postInputInitialization() { ElasticIsotropic::postInputInitialization(); @@ -64,12 +53,6 @@ void PerfectlyPlastic::postInputInitialization() } -void PerfectlyPlastic::saveConvergedState() const -{ - SolidBase::saveConvergedState(); -} - - REGISTER_CATALOG_ENTRY( ConstitutiveBase, PerfectlyPlastic, std::string const &, Group * const ) } } /* namespace geos */ diff --git a/src/coreComponents/constitutive/solid/PerfectlyPlastic.hpp b/src/coreComponents/constitutive/solid/PerfectlyPlastic.hpp index d1faf2ff686..bc307a8fc7c 100644 --- a/src/coreComponents/constitutive/solid/PerfectlyPlastic.hpp +++ b/src/coreComponents/constitutive/solid/PerfectlyPlastic.hpp @@ -23,7 +23,7 @@ #include "ElasticIsotropic.hpp" #include "InvariantDecompositions.hpp" #include "PropertyConversions.hpp" -#include "SolidModelDiscretizationOpsFullyAnisotroipic.hpp" +#include "SolidModelDiscretizationOpsFullyAnisotropic.hpp" #include "LvArray/src/tensorOps.hpp" namespace geos @@ -78,7 +78,7 @@ class PerfectlyPlasticUpdates : public ElasticIsotropicUpdates PerfectlyPlasticUpdates & operator=( PerfectlyPlasticUpdates && ) = delete; /// Use the uncompressed version of the stiffness bilinear form - using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotroipic; // TODO: typo in anistropic (fix in DiscOps PR) + using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotropic; // Bring in base implementations to prevent hiding warnings using ElasticIsotropicUpdates::smallStrainUpdate; @@ -248,29 +248,15 @@ class PerfectlyPlastic : public ElasticIsotropic */ PerfectlyPlastic( string const & name, Group * const parent ); - /** - * Default Destructor - */ - virtual ~PerfectlyPlastic() override; - - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - - virtual void saveConvergedState() const override; - /** * @name Static Factory Catalog members and functions */ ///@{ - /// string name to use for this class in the catalog - static constexpr auto m_catalogNameString = "PerfectlyPlastic"; - /** * @return A string that is used to register/lookup this class in the registry */ - static string catalogName() { return m_catalogNameString; } + static string catalogName() { return "PerfectlyPlastic"; } virtual string getCatalogName() const override { return catalogName(); } diff --git a/src/coreComponents/constitutive/solid/PorousDamageSolid.cpp b/src/coreComponents/constitutive/solid/PorousDamageSolid.cpp index b75f0b45e4f..9c22d88031f 100644 --- a/src/coreComponents/constitutive/solid/PorousDamageSolid.cpp +++ b/src/coreComponents/constitutive/solid/PorousDamageSolid.cpp @@ -37,9 +37,6 @@ PorousDamageSolid< SOLID_TYPE >::PorousDamageSolid( string const & name, Group * CoupledSolid< SOLID_TYPE, BiotPorosity, DamagePermeability >( name, parent ) {} -template< typename SOLID_TYPE > -PorousDamageSolid< SOLID_TYPE >::~PorousDamageSolid() = default; - // Register all PorousDamageSolid model types. typedef PorousDamageSolid< Damage< ElasticIsotropic > > PorousDamageElasticIsotropic; typedef PorousDamageSolid< DamageSpectral< ElasticIsotropic > > PorousDamageSpectralElasticIsotropic; diff --git a/src/coreComponents/constitutive/solid/PorousDamageSolid.hpp b/src/coreComponents/constitutive/solid/PorousDamageSolid.hpp index f5d3358483e..d32923f83de 100644 --- a/src/coreComponents/constitutive/solid/PorousDamageSolid.hpp +++ b/src/coreComponents/constitutive/solid/PorousDamageSolid.hpp @@ -338,9 +338,6 @@ class PorousDamageSolid : public CoupledSolid< SOLID_TYPE, BiotPorosity, DamageP */ PorousDamageSolid( string const & name, dataRepository::Group * const parent ); - /// Destructor - virtual ~PorousDamageSolid() override; - /** * @brief Catalog name * @return Static catalog string diff --git a/src/coreComponents/constitutive/solid/PorousSolid.cpp b/src/coreComponents/constitutive/solid/PorousSolid.cpp index 375b8e1fed7..7fb15c8bf44 100644 --- a/src/coreComponents/constitutive/solid/PorousSolid.cpp +++ b/src/coreComponents/constitutive/solid/PorousSolid.cpp @@ -41,9 +41,6 @@ PorousSolid< SOLID_TYPE >::PorousSolid( string const & name, Group * const paren CoupledSolid< SOLID_TYPE, BiotPorosity, ConstantPermeability >( name, parent ) {} -template< typename SOLID_TYPE > -PorousSolid< SOLID_TYPE >::~PorousSolid() = default; - template< typename SOLID_TYPE > void PorousSolid< SOLID_TYPE >::initializeState() const { diff --git a/src/coreComponents/constitutive/solid/PorousSolid.hpp b/src/coreComponents/constitutive/solid/PorousSolid.hpp index 98f9945361b..537c0f69d9b 100644 --- a/src/coreComponents/constitutive/solid/PorousSolid.hpp +++ b/src/coreComponents/constitutive/solid/PorousSolid.hpp @@ -344,9 +344,6 @@ class PorousSolid : public CoupledSolid< SOLID_TYPE, BiotPorosity, ConstantPerme */ PorousSolid( string const & name, dataRepository::Group * const parent ); - /// Destructor - virtual ~PorousSolid() override; - /** * @brief Catalog name * @return Static catalog string diff --git a/src/coreComponents/constitutive/solid/ProppantSolid.cpp b/src/coreComponents/constitutive/solid/ProppantSolid.cpp index db1d67d2aac..467235815ee 100644 --- a/src/coreComponents/constitutive/solid/ProppantSolid.cpp +++ b/src/coreComponents/constitutive/solid/ProppantSolid.cpp @@ -36,10 +36,6 @@ ProppantSolid< PORO_TYPE, PERM_TYPE >::ProppantSolid( string const & name, Group CoupledSolid< NullModel, PORO_TYPE, PERM_TYPE >( name, parent ) {} -template< typename PORO_TYPE, - typename PERM_TYPE > -ProppantSolid< PORO_TYPE, PERM_TYPE >::~ProppantSolid() = default; - typedef ProppantSolid< ProppantPorosity, ProppantPermeability > ProppantSolidModel; REGISTER_CATALOG_ENTRY( ConstitutiveBase, ProppantSolidModel, string const &, Group * const ) diff --git a/src/coreComponents/constitutive/solid/ProppantSolid.hpp b/src/coreComponents/constitutive/solid/ProppantSolid.hpp index 084689a7c73..3da2dc0f000 100644 --- a/src/coreComponents/constitutive/solid/ProppantSolid.hpp +++ b/src/coreComponents/constitutive/solid/ProppantSolid.hpp @@ -104,9 +104,6 @@ class ProppantSolid : public CoupledSolid< NullModel, PORO_TYPE, PERM_TYPE > */ ProppantSolid( string const & name, dataRepository::Group * const parent ); - /// Destructor - virtual ~ProppantSolid() override; - /** * @brief Catalog name * @return Static catalog string diff --git a/src/coreComponents/constitutive/solid/SolidBase.cpp b/src/coreComponents/constitutive/solid/SolidBase.cpp index f22cec62d93..a750789dd75 100644 --- a/src/coreComponents/constitutive/solid/SolidBase.cpp +++ b/src/coreComponents/constitutive/solid/SolidBase.cpp @@ -66,10 +66,6 @@ SolidBase::SolidBase( string const & name, Group * const parent ): } -SolidBase::~SolidBase() -{} - - void SolidBase::postInputInitialization() { this->getWrapper< array2d< real64 > >( viewKeyStruct::densityString() ). @@ -80,14 +76,11 @@ void SolidBase::postInputInitialization() } -void SolidBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void SolidBase::resizeFields( localIndex const size, localIndex const numPts ) { - m_density.resize( 0, numConstitutivePointsPerParentIndex ); - m_newStress.resize( 0, numConstitutivePointsPerParentIndex, 6 ); - m_oldStress.resize( 0, numConstitutivePointsPerParentIndex, 6 ); - - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_density.resize( size, numPts ); + m_newStress.resize( size, numPts, 6 ); + m_oldStress.resize( size, numPts, 6 ); } diff --git a/src/coreComponents/constitutive/solid/SolidBase.hpp b/src/coreComponents/constitutive/solid/SolidBase.hpp index b56bd38b53a..df4a2fabe12 100644 --- a/src/coreComponents/constitutive/solid/SolidBase.hpp +++ b/src/coreComponents/constitutive/solid/SolidBase.hpp @@ -562,11 +562,6 @@ class SolidBase : public constitutive::ConstitutiveBase SolidBase( string const & name, Group * const parent ); - /** - * Destructor - */ - virtual ~SolidBase() override; - /// Keys for data in this class struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct { @@ -585,14 +580,6 @@ class SolidBase : public constitutive::ConstitutiveBase // key }; - /** - * @brief Allocate constitutive arrays - * @param parent Object's parent group (element subregion) - * @param numConstitutivePointsPerParentIndex Number of quadrature points per element - */ - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - /// Save state data in preparation for next timestep virtual void saveConvergedState() const override; @@ -698,6 +685,8 @@ class SolidBase : public constitutive::ConstitutiveBase /// Post-process XML input virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + /// The current stress at a quadrature point (i.e. at timestep n, global newton iteration k) array3d< real64, solid::STRESS_PERMUTATION > m_newStress; diff --git a/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp b/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp index 6f78fd8c78b..e9de9c17db9 100644 --- a/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp +++ b/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp @@ -67,14 +67,11 @@ SolidInternalEnergy::SolidInternalEnergy( string const & name, Group * const par setDescription( "Internal energy at the reference temperature [J/kg]" ); } -void SolidInternalEnergy::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void SolidInternalEnergy::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) { - m_internalEnergy.resize( 0, 1 ); - m_dInternalEnergy_dTemperature.resize( 0, 1 ); - m_internalEnergy_n.resize( 0, 1 ); - - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_internalEnergy.resize( size, 1 ); + m_dInternalEnergy_dTemperature.resize( size, 1 ); + m_internalEnergy_n.resize( size, 1 ); } void SolidInternalEnergy::saveConvergedState() const diff --git a/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp b/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp index 20dcdf52abb..537e94219f3 100644 --- a/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp +++ b/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp @@ -99,9 +99,6 @@ class SolidInternalEnergy : public ConstitutiveBase virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct { static constexpr char const * internalEnergyString() { return "internalEnergy"; } @@ -151,6 +148,10 @@ class SolidInternalEnergy : public ConstitutiveBase /// Save state data in preparation for next timestep virtual void saveConvergedState() const override; +protected: + + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + private: /// Solid internal energy diff --git a/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotroipic.hpp b/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotropic.hpp similarity index 97% rename from src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotroipic.hpp rename to src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotropic.hpp index 6eefc6d686f..f29cbeca238 100644 --- a/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotroipic.hpp +++ b/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotropic.hpp @@ -14,7 +14,7 @@ */ /** - * @file SolidModelDiscretizationOpsFullyAnisotroipic.hpp + * @file SolidModelDiscretizationOpsFullyAnisotropic.hpp */ #ifndef GEOS_CONSTITUTIVE_SOLID_SOLIDMODELDISCRETIAZTIONOPSFULLYANISOTROPIC_HPP_ @@ -28,7 +28,7 @@ namespace constitutive { -struct SolidModelDiscretizationOpsFullyAnisotroipic : public SolidModelDiscretizationOps // TODO: spelling error, +struct SolidModelDiscretizationOpsFullyAnisotropic : public SolidModelDiscretizationOps // TODO: spelling error, // convert to "General" anyway { template< int NUM_SUPPORT_POINTS, @@ -75,7 +75,7 @@ template< int NUM_SUPPORT_POINTS, typename BASIS_GRADIENT > GEOS_HOST_DEVICE inline -void SolidModelDiscretizationOpsFullyAnisotroipic::BTDB( BASIS_GRADIENT const & gradN, +void SolidModelDiscretizationOpsFullyAnisotropic::BTDB( BASIS_GRADIENT const & gradN, real64 const & detJxW, real64 (& elementStiffness)[NUM_SUPPORT_POINTS *3][NUM_SUPPORT_POINTS *3] ) { @@ -134,7 +134,7 @@ template< int NUM_SUPPORT_POINTS, typename BASIS_GRADIENT > GEOS_HOST_DEVICE inline -void SolidModelDiscretizationOpsFullyAnisotroipic::upperBTDB( BASIS_GRADIENT const & gradN, +void SolidModelDiscretizationOpsFullyAnisotropic::upperBTDB( BASIS_GRADIENT const & gradN, real64 const & detJxW, real64 (& elementStiffness)[NUM_SUPPORT_POINTS *3][NUM_SUPPORT_POINTS *3] ) { @@ -193,7 +193,7 @@ template< int NUM_SUPPORT_POINTS, typename BASIS_GRADIENT > GEOS_HOST_DEVICE inline -void SolidModelDiscretizationOpsFullyAnisotroipic::diagBTDB( BASIS_GRADIENT const & gradN, +void SolidModelDiscretizationOpsFullyAnisotropic::diagBTDB( BASIS_GRADIENT const & gradN, real64 const & detJxW, real64 (& diagElementStiffness)[NUM_SUPPORT_POINTS *3] ) { @@ -223,7 +223,7 @@ template< int NUM_SUPPORT_POINTS, typename BASIS_GRADIENT > GEOS_HOST_DEVICE inline -void SolidModelDiscretizationOpsFullyAnisotroipic::diagRowSumBTDB( BASIS_GRADIENT const & gradN, +void SolidModelDiscretizationOpsFullyAnisotropic::diagRowSumBTDB( BASIS_GRADIENT const & gradN, real64 const & detJxW, real64 ( & diagSumElementStiffness )[NUM_SUPPORT_POINTS*3] ) { diff --git a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.cpp b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.cpp index 37454064d27..f7860429e01 100644 --- a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.cpp +++ b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.cpp @@ -71,12 +71,11 @@ BiotPorosity::BiotPorosity( string const & name, Group * const parent ): setDescription( "Solid shear modulus" ); } -void BiotPorosity::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void BiotPorosity::resizeFields( localIndex const size, localIndex const numPts ) { - PorosityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + PorosityBase::resizeFields( size, numPts ); - m_meanTotalStressIncrement_k.resize( 0, numConstitutivePointsPerParentIndex ); + m_meanTotalStressIncrement_k.resize( size, numPts ); } void BiotPorosity::postInputInitialization() diff --git a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp index 54730c0b73c..cff41627a15 100644 --- a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp +++ b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp @@ -233,9 +233,6 @@ class BiotPorosity : public PorosityBase public: BiotPorosity( string const & name, Group * const parent ); - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static string catalogName() { return "BiotPorosity"; } virtual string getCatalogName() const override { return catalogName(); } @@ -314,6 +311,7 @@ class BiotPorosity : public PorosityBase protected: virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; /// Default thermal expansion coefficients (read from XML) real64 m_defaultThermalExpansionCoefficient; diff --git a/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp b/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp index 8b354eaebcc..9846af46f0c 100644 --- a/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp +++ b/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp @@ -56,16 +56,13 @@ PorosityBase::PorosityBase( string const & name, Group * const parent ): registerField( fields::porosity::referencePorosity{}, &m_referencePorosity ); } -void PorosityBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void PorosityBase::resizeFields( localIndex const size, localIndex const numPts ) { - m_newPorosity.resize( 0, numConstitutivePointsPerParentIndex ); - m_porosity_n.resize( 0, numConstitutivePointsPerParentIndex ); - m_dPorosity_dPressure.resize( 0, numConstitutivePointsPerParentIndex ); - m_dPorosity_dTemperature.resize( 0, numConstitutivePointsPerParentIndex ); - m_initialPorosity.resize( 0, numConstitutivePointsPerParentIndex ); - - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_newPorosity.resize( size, numPts ); + m_porosity_n.resize( size, numPts ); + m_dPorosity_dPressure.resize( size, numPts ); + m_dPorosity_dTemperature.resize( size, numPts ); + m_initialPorosity.resize( size, numPts ); } void PorosityBase::postInputInitialization() diff --git a/src/coreComponents/constitutive/solid/porosity/PorosityBase.hpp b/src/coreComponents/constitutive/solid/porosity/PorosityBase.hpp index 07f97ac5b91..3f77693b3c3 100644 --- a/src/coreComponents/constitutive/solid/porosity/PorosityBase.hpp +++ b/src/coreComponents/constitutive/solid/porosity/PorosityBase.hpp @@ -111,13 +111,10 @@ class PorosityBase : public ConstitutiveBase public: PorosityBase( string const & name, Group * const parent ); - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct { static constexpr char const * defaultReferencePorosityString() { return "defaultReferencePorosity"; } - } viewKeys; + }; /** * @brief Number of elements storing solid data @@ -247,6 +244,8 @@ class PorosityBase : public ConstitutiveBase protected: virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + array2d< real64 > m_newPorosity; array2d< real64 > m_porosity_n; diff --git a/src/coreComponents/constitutive/solid/porosity/PressurePorosity.cpp b/src/coreComponents/constitutive/solid/porosity/PressurePorosity.cpp index cf62672c08d..0f7167ccdce 100644 --- a/src/coreComponents/constitutive/solid/porosity/PressurePorosity.cpp +++ b/src/coreComponents/constitutive/solid/porosity/PressurePorosity.cpp @@ -41,18 +41,6 @@ PressurePorosity::PressurePorosity( string const & name, Group * const parent ): setDescription( "Solid compressibility" ); } -void PressurePorosity::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - PorosityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); -} - -void PressurePorosity::postInputInitialization() -{ - PorosityBase::postInputInitialization(); - // TODO valdate input -} - REGISTER_CATALOG_ENTRY( ConstitutiveBase, PressurePorosity, string const &, Group * const ) } } /* namespace geos */ diff --git a/src/coreComponents/constitutive/solid/porosity/PressurePorosity.hpp b/src/coreComponents/constitutive/solid/porosity/PressurePorosity.hpp index 37228c53c65..a6e45bf4d39 100644 --- a/src/coreComponents/constitutive/solid/porosity/PressurePorosity.hpp +++ b/src/coreComponents/constitutive/solid/porosity/PressurePorosity.hpp @@ -96,9 +96,6 @@ class PressurePorosity : public PorosityBase public: PressurePorosity( string const & name, Group * const parent ); - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static string catalogName() { return "PressurePorosity"; } virtual string getCatalogName() const override { return catalogName(); } @@ -129,7 +126,6 @@ class PressurePorosity : public PorosityBase private: - virtual void postInputInitialization() override; real64 m_referencePressure; diff --git a/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.cpp b/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.cpp index fb27663d63d..19577658662 100644 --- a/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.cpp +++ b/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.cpp @@ -37,21 +37,6 @@ ProppantPorosity::ProppantPorosity( string const & name, Group * const parent ): setDescription( "Maximum proppant concentration " ); } -ProppantPorosity::~ProppantPorosity() = default; - -std::unique_ptr< ConstitutiveBase > -ProppantPorosity::deliverClone( string const & name, - Group * const parent ) const -{ - return ConstitutiveBase::deliverClone( name, parent ); -} - -void ProppantPorosity::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - PorosityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); -} - void ProppantPorosity::postInputInitialization() { getField< fields::porosity::referencePorosity >(). diff --git a/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.hpp b/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.hpp index 45a23163aec..e33a4239bc1 100644 --- a/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.hpp +++ b/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.hpp @@ -75,14 +75,6 @@ class ProppantPorosity : public PorosityBase public: ProppantPorosity( string const & name, Group * const parent ); - virtual ~ProppantPorosity() override; - - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static string catalogName() { return "ProppantPorosity"; } virtual string getCatalogName() const override { return catalogName(); } diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.cpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.cpp index 3ca4d0ba26a..d8ab24a9021 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.cpp @@ -36,21 +36,15 @@ MultiPhaseConstantThermalConductivity::MultiPhaseConstantThermalConductivity( st setDescription( "xx, yy, and zz components of a diagonal thermal conductivity tensor [J/(s.m.K)]" ); } -std::unique_ptr< ConstitutiveBase > -MultiPhaseConstantThermalConductivity::deliverClone( string const & name, - Group * const parent ) const +void MultiPhaseConstantThermalConductivity::resizeFields( localIndex const size, localIndex const numPts ) { - return MultiPhaseThermalConductivityBase::deliverClone( name, parent ); -} + MultiPhaseThermalConductivityBase::resizeFields( size, numPts ); -void MultiPhaseConstantThermalConductivity::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - MultiPhaseThermalConductivityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + // NOTE: enforcing 1 quadrature point + m_effectiveConductivity.resize( size, 1, 3 ); - for( localIndex ei = 0; ei < parent.size(); ++ei ) + for( localIndex ei = 0; ei < size; ++ei ) { - // NOTE: enforcing 1 quadrature point for( localIndex q = 0; q < 1; ++q ) { m_effectiveConductivity[ei][q][0] = m_thermalConductivityComponents[0]; diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp index 8d9edf7bd91..13d5221a98a 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp @@ -69,12 +69,6 @@ class MultiPhaseConstantThermalConductivity : public MultiPhaseThermalConductivi */ MultiPhaseConstantThermalConductivity( string const & name, Group * const parent ); - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static string catalogName() { return "MultiPhaseConstantThermalConductivity"; } virtual string getCatalogName() const override { return catalogName(); } @@ -101,6 +95,8 @@ class MultiPhaseConstantThermalConductivity : public MultiPhaseThermalConductivi virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + private: /// default thermal conductivity in the subRegion diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp index 8e74a96e8ed..8e6aa0e24f2 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp @@ -57,15 +57,12 @@ void MultiPhaseThermalConductivityBase::postInputInitialization() m_dEffectiveConductivity_dPhaseVolFrac.resize( 0, 0, 3, numPhases ); } -void MultiPhaseThermalConductivityBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void MultiPhaseThermalConductivityBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) { // NOTE: enforcing 1 quadrature point integer const numPhases = numFluidPhases(); - m_effectiveConductivity.resize( 0, 1, 3 ); - m_dEffectiveConductivity_dPhaseVolFrac.resize( 0, 1, 3, numPhases ); - - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_effectiveConductivity.resize( size, 1, 3 ); + m_dEffectiveConductivity_dPhaseVolFrac.resize( size, 1, 3, numPhases ); } } // namespace constitutive diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.hpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.hpp index b1a7e8ae26c..f855f7943fc 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.hpp @@ -111,9 +111,6 @@ class MultiPhaseThermalConductivityBase : public ConstitutiveBase */ MultiPhaseThermalConductivityBase( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - /** * @brief Initialize the thermal conductivity state (needed when thermal conductivity depends on porosity and phase volume fraction) * @param[in] initialPorosity the initial porosity field after reservoir initialization @@ -165,19 +162,12 @@ class MultiPhaseThermalConductivityBase : public ConstitutiveBase static constexpr char const * phaseNamesString() { return "phaseNames"; } }; -private: - - /** - * @brief Function called internally to resize member arrays - * @param size primary dimension (e.g. number of cells) - * @param numPts secondary dimension (e.g. number of gauss points per cell) - */ - void resizeFields( localIndex const size, localIndex const numPts ); - protected: virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + /// phase names read from input string_array m_phaseNames; diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp index f72e78bfdb3..06e5201e1f4 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp @@ -46,22 +46,14 @@ MultiPhaseVolumeWeightedThermalConductivity::MultiPhaseVolumeWeightedThermalCond registerField( fields::thermalconductivity::rockThermalConductivity{}, &m_rockThermalConductivity ); } -std::unique_ptr< ConstitutiveBase > -MultiPhaseVolumeWeightedThermalConductivity::deliverClone( string const & name, - Group * const parent ) const +void MultiPhaseVolumeWeightedThermalConductivity::resizeFields( localIndex const size, localIndex const numPts ) { - return MultiPhaseThermalConductivityBase::deliverClone( name, parent ); -} + MultiPhaseThermalConductivityBase::resizeFields( size, numPts ); -void MultiPhaseVolumeWeightedThermalConductivity::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ // NOTE: enforcing 1 quadrature point - m_rockThermalConductivity.resize( 0, 1, 3 ); - - MultiPhaseThermalConductivityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_rockThermalConductivity.resize( size, 1, 3 ); - for( localIndex ei = 0; ei < parent.size(); ++ei ) + for( localIndex ei = 0; ei < size; ++ei ) { for( localIndex q = 0; q < 1; ++q ) { diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp index ad1c4b37680..9b473471574 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp @@ -122,12 +122,6 @@ class MultiPhaseVolumeWeightedThermalConductivity : public MultiPhaseThermalCond */ MultiPhaseVolumeWeightedThermalConductivity( string const & name, Group * const parent ); - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - virtual void initializeRockFluidState( arrayView2d< real64 const > const & initialPorosity, arrayView2d< real64 const, compflow::USD_PHASE > const & initialPhaseVolumeFraction ) const override; @@ -163,6 +157,8 @@ class MultiPhaseVolumeWeightedThermalConductivity : public MultiPhaseThermalCond virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + private: /// default rock thermal conductivity in the subRegion diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.cpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.cpp index 51a8082165e..fb5e2a410a2 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.cpp @@ -46,13 +46,6 @@ SinglePhaseThermalConductivity::SinglePhaseThermalConductivity( string const & n setDescription( "The reference temperature at which the conductivity components are equal to the default values" ); } -std::unique_ptr< ConstitutiveBase > -SinglePhaseThermalConductivity::deliverClone( string const & name, - Group * const parent ) const -{ - return SinglePhaseThermalConductivityBase::deliverClone( name, parent ); -} - void SinglePhaseThermalConductivity::initializeRockFluidState( arrayView2d< real64 const > const & initialPorosity ) const { arrayView3d< real64 > dEffectiveConductivity_dT = m_dEffectiveConductivity_dT.toView(); @@ -110,12 +103,6 @@ void SinglePhaseThermalConductivity::updateFromTemperature( arrayView1d< real64 } ); } -void SinglePhaseThermalConductivity::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - SinglePhaseThermalConductivityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); -} - void SinglePhaseThermalConductivity::postInputInitialization() { GEOS_THROW_IF( m_defaultThermalConductivityComponents[0] <= 0 || diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.hpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.hpp index e19319c841b..f6b61b80914 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.hpp @@ -68,12 +68,6 @@ class SinglePhaseThermalConductivity : public SinglePhaseThermalConductivityBase */ SinglePhaseThermalConductivity( string const & name, Group * const parent ); - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - static string catalogName() { return "SinglePhaseThermalConductivity"; } virtual string getCatalogName() const override { return catalogName(); } diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp index c0a4b0a47ed..b96c2c3a77b 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp @@ -43,14 +43,11 @@ void SinglePhaseThermalConductivityBase::postInputInitialization() m_dEffectiveConductivity_dT.resize( 0, 0, 3 ); } -void SinglePhaseThermalConductivityBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void SinglePhaseThermalConductivityBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) { // NOTE: enforcing 1 quadrature point - m_effectiveConductivity.resize( 0, 1, 3 ); - m_dEffectiveConductivity_dT.resize( 0, 1, 3 ); - - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_effectiveConductivity.resize( size, 1, 3 ); + m_dEffectiveConductivity_dT.resize( size, 1, 3 ); } } // namespace constitutive diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp index fd51086b7fa..a2b5aaba35e 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp @@ -96,9 +96,6 @@ class SinglePhaseThermalConductivityBase : public ConstitutiveBase */ SinglePhaseThermalConductivityBase( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - /** * @brief Initialize the thermal conductivity state (needed when thermal conductivity depends on porosity and phase volume fraction) * @param[in] initialPorosity the initial porosity field after reservoir initialization @@ -146,19 +143,12 @@ class SinglePhaseThermalConductivityBase : public ConstitutiveBase */ arrayView3d< real64 const > dEffectiveConductivity_dT() const { return m_dEffectiveConductivity_dT; } -private: - - /** - * @brief Function called internally to resize member arrays - * @param size primary dimension (e.g. number of cells) - * @param numPts secondary dimension (e.g. number of gauss points per cell) - */ - void resizeFields( localIndex const size, localIndex const numPts ); - protected: virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + /// cell-wise effective conductivities in the subregion array3d< real64 > m_effectiveConductivity; diff --git a/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp index faaf94487f1..4fac2e2eb15 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp @@ -23,7 +23,6 @@ #include "constitutive/ConstitutivePassThru.hpp" #include "constitutive/permeability/PermeabilityFields.hpp" #include "constitutive/solid/SolidInternalEnergy.hpp" -#include "constitutive/contact/HydraulicApertureBase.hpp" #include "discretizationMethods/NumericalMethodsManager.hpp" #include "fieldSpecification/AquiferBoundaryCondition.hpp" #include "fieldSpecification/LogLevelsInfo.hpp" From a571ba0b19c1e1aeaad27967e6a1916e1dfee5b5 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Thu, 14 Aug 2025 15:02:16 -0500 Subject: [PATCH 02/43] code style and build fix --- .../constitutive/solid/ModifiedCamClay.hpp | 2 +- ...dModelDiscretizationOpsFullyAnisotropic.hpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp b/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp index 0ee208b359d..996546ce608 100644 --- a/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp +++ b/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp @@ -97,7 +97,7 @@ class ModifiedCamClayUpdates : public ElasticIsotropicPressureDependentUpdates using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotropic; // Bring in base implementations to prevent hiding warnings - //using ElasticIsotropicPressureDependentUpdates::smallStrainUpdate; + using ElasticIsotropicPressureDependentUpdates::smallStrainUpdate; GEOS_HOST_DEVICE void evaluateYield( real64 const p, diff --git a/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotropic.hpp b/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotropic.hpp index f29cbeca238..0193f5b69a6 100644 --- a/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotropic.hpp +++ b/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotropic.hpp @@ -29,7 +29,7 @@ namespace constitutive struct SolidModelDiscretizationOpsFullyAnisotropic : public SolidModelDiscretizationOps // TODO: spelling error, - // convert to "General" anyway + // convert to "General" anyway { template< int NUM_SUPPORT_POINTS, typename BASIS_GRADIENT > @@ -76,8 +76,8 @@ template< int NUM_SUPPORT_POINTS, GEOS_HOST_DEVICE inline void SolidModelDiscretizationOpsFullyAnisotropic::BTDB( BASIS_GRADIENT const & gradN, - real64 const & detJxW, - real64 (& elementStiffness)[NUM_SUPPORT_POINTS *3][NUM_SUPPORT_POINTS *3] ) + real64 const & detJxW, + real64 (& elementStiffness)[NUM_SUPPORT_POINTS *3][NUM_SUPPORT_POINTS *3] ) { for( int a=0; a Date: Fri, 15 Aug 2025 08:23:23 -0500 Subject: [PATCH 03/43] fix unit tests --- .../constitutive/ConstitutiveBase.cpp | 12 ++++++++++ .../CapillaryPressureBase.cpp | 2 +- .../constitutive/contact/CoulombFriction.cpp | 2 +- .../diffusion/ConstantDiffusion.cpp | 2 +- .../constitutive/diffusion/DiffusionBase.cpp | 8 +++---- .../dispersion/DispersionBase.cpp | 6 ++--- .../fluid/multifluid/MultiFluidBase.cpp | 2 +- .../CompressibleSinglePhaseFluid.cpp | 2 ++ .../permeability/ConstantPermeability.cpp | 2 ++ .../permeability/PressurePermeability.cpp | 2 +- .../permeability/ProppantPermeability.cpp | 4 ++-- .../SlipDependentPermeability.cpp | 2 +- .../RelativePermeabilityBase.cpp | 2 +- .../constitutive/solid/CeramicDamage.cpp | 5 ++-- .../constitutive/solid/Damage.cpp | 23 ++++++++++--------- .../constitutive/solid/DelftEgg.cpp | 5 ++-- .../PoreVolumeCompressibleSolid.cpp | 6 ++--- .../solid/Deprecated/PoroElastic.cpp | 5 ++-- .../constitutive/solid/DruckerPrager.cpp | 5 ++-- .../solid/DruckerPragerExtended.cpp | 5 ++-- .../ElasticIsotropicPressureDependent.hpp | 2 ++ .../solid/InvariantDecompositions.hpp | 10 ++++++++ .../constitutive/solid/ModifiedCamClay.cpp | 5 ++-- .../constitutive/solid/SolidBase.cpp | 7 +++--- .../solid/SolidInternalEnergy.cpp | 7 +++--- .../MultiPhaseConstantThermalConductivity.cpp | 4 +--- .../MultiPhaseThermalConductivityBase.cpp | 4 ++-- ...PhaseVolumeWeightedThermalConductivity.cpp | 4 +--- .../SinglePhaseThermalConductivityBase.cpp | 4 ++-- 29 files changed, 91 insertions(+), 58 deletions(-) diff --git a/src/coreComponents/constitutive/ConstitutiveBase.cpp b/src/coreComponents/constitutive/ConstitutiveBase.cpp index 338ba871edf..b02c8903c4e 100644 --- a/src/coreComponents/constitutive/ConstitutiveBase.cpp +++ b/src/coreComponents/constitutive/ConstitutiveBase.cpp @@ -45,30 +45,42 @@ ConstitutiveBase::CatalogInterface::CatalogType & ConstitutiveBase::getCatalog() void ConstitutiveBase::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { + + std::cout << "Allocating constitutive data for " << this->getFullName() + << " with " << parent.size() << " parent indices and " + << numConstitutivePointsPerParentIndex << " quadrature points per parent index." << std::endl; + m_numQuadraturePoints = numConstitutivePointsPerParentIndex; resizeFields( parent.size(), numConstitutivePointsPerParentIndex ); for( auto & group : this->getSubGroups() ) { + std::cout << "Allocating constitutive data for sub-group " << group.first << std::endl; for( auto & wrapper : group.second->wrappers() ) { + std::cout << " Checking wrapper " << wrapper.first + << ", sizedFromParent = " << wrapper.second->sizedFromParent() << std::endl; if( wrapper.second->sizedFromParent() ) { string const wrapperName = makeFieldName( this->getName(), wrapper.first ); parent.registerWrapper( wrapper.second->clone( wrapperName, parent ) ). setRestartFlags( RestartFlags::NO_WRITE ); + std::cout << " Registered wrapper " << wrapperName << " on parent group." << std::endl; } } } for( auto & wrapper : this->wrappers() ) { + std::cout << " Checking wrapper " << wrapper.first + << ", sizedFromParent = " << wrapper.second->sizedFromParent() << std::endl; if( wrapper.second->sizedFromParent() ) { string const wrapperName = makeFieldName( this->getName(), wrapper.first ); parent.registerWrapper( wrapper.second->clone( wrapperName, parent ) ). setRestartFlags( RestartFlags::NO_WRITE ); + std::cout << " Registered wrapper " << wrapperName << " on parent group." << std::endl; } } diff --git a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp index 8482009b9c1..94d9f4abd48 100644 --- a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp +++ b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp @@ -82,7 +82,7 @@ void CapillaryPressureBase::postInputInitialization() } // call to correctly set member array tertiary sizes on the 'main' material object - resizeFields( 0, 0 ); + //resizeFields( 0, 0 ); // set labels on array wrappers for plottable fields setLabels(); diff --git a/src/coreComponents/constitutive/contact/CoulombFriction.cpp b/src/coreComponents/constitutive/contact/CoulombFriction.cpp index 7e38ef0eaa2..4df5607d4eb 100644 --- a/src/coreComponents/constitutive/contact/CoulombFriction.cpp +++ b/src/coreComponents/constitutive/contact/CoulombFriction.cpp @@ -64,7 +64,7 @@ void CoulombFriction::resizeFields( localIndex const size, localIndex const numP { FrictionBase::resizeFields( size, numPts ); - m_elasticSlip.resize( 0, 2 ); + m_elasticSlip.resize( 0, 2 ); // 0 to resize and assign default value later } CoulombFrictionUpdates CoulombFriction::createKernelUpdates() const diff --git a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.cpp b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.cpp index 4edc26c8da2..762cfd75068 100644 --- a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.cpp +++ b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.cpp @@ -40,7 +40,7 @@ void ConstantDiffusion::resizeFields( localIndex const size, localIndex const nu { DiffusionBase::resizeFields( size, numPts ); - for( localIndex ei = 0; ei < size; ++ei ) + for( localIndex ei = 0; ei < size; ++ei ) // TODO move into initializeState? { // NOTE: enforcing 1 quadrature point for( localIndex q = 0; q < 1; ++q ) diff --git a/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp b/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp index b1617d21209..ac372dedae4 100644 --- a/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp +++ b/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp @@ -62,9 +62,9 @@ void DiffusionBase::postInputInitialization() getFullName(), viewKeyStruct::phaseNamesString(), viewKeyStruct::defaultPhaseDiffusivityMultiplierString() ), InputError ); - m_diffusivity.resize( 0, 0, 3 ); - m_dDiffusivity_dTemperature.resize( 0, 0, 3 ); - m_phaseDiffusivityMultiplier.resize( 0, 0, 3 ); + //m_diffusivity.resize( 0, 0, 3 ); + //m_dDiffusivity_dTemperature.resize( 0, 0, 3 ); + //m_phaseDiffusivityMultiplier.resize( 0, 0, 3 ); } void DiffusionBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) @@ -74,7 +74,7 @@ void DiffusionBase::resizeFields( localIndex const size, localIndex const GEOS_U m_dDiffusivity_dTemperature.resize( size, 1, 3 ); m_phaseDiffusivityMultiplier.resize( size, 1, 3 ); - for( localIndex ei = 0; ei < size; ++ei ) + for( localIndex ei = 0; ei < size; ++ei ) // TODO move into initializeState? { // NOTE: enforcing 1 quadrature point for( localIndex q = 0; q < 1; ++q ) diff --git a/src/coreComponents/constitutive/dispersion/DispersionBase.cpp b/src/coreComponents/constitutive/dispersion/DispersionBase.cpp index 47e752b8be2..2713f7468c3 100644 --- a/src/coreComponents/constitutive/dispersion/DispersionBase.cpp +++ b/src/coreComponents/constitutive/dispersion/DispersionBase.cpp @@ -38,13 +38,13 @@ void DispersionBase::postInputInitialization() { ConstitutiveBase::postInputInitialization(); - m_dispersivity.resize( 0, 0, 3 ); + //m_dispersivity.resize( 0, 0, 3 ); } -void DispersionBase::resizeFields( localIndex const GEOS_UNUSED_PARAM( size ), localIndex const GEOS_UNUSED_PARAM( numPts ) ) +void DispersionBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) { // NOTE: enforcing 1 quadrature point - m_dispersivity.resize( 0, 1, 3 ); + m_dispersivity.resize( size, 1, 3 ); } } // namespace constitutive diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp index a792a3b2cec..5481fa9148c 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp @@ -201,7 +201,7 @@ void MultiFluidBase::postInputInitialization() } // call to correctly set member array tertiary sizes on the 'main' material object - resizeFields( 0, 0 ); + //resizeFields( 0, 0 ); // set labels on array wrappers for plottable fields setLabels(); diff --git a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp index ee0a6638848..415b9b3e58e 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp @@ -83,6 +83,8 @@ void CompressibleSinglePhaseFluid::resizeFields( localIndex const size, localInd { SingleFluidBase::resizeFields( size, numPts ); + // TODO : reconsider the necessity of this + getField< fields::singlefluid::density >().setApplyDefaultValue( m_defaultDensity ); getField< fields::singlefluid::viscosity >().setApplyDefaultValue( m_defaultViscosity ); diff --git a/src/coreComponents/constitutive/permeability/ConstantPermeability.cpp b/src/coreComponents/constitutive/permeability/ConstantPermeability.cpp index b9c0045a218..be2d1987c6e 100644 --- a/src/coreComponents/constitutive/permeability/ConstantPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ConstantPermeability.cpp @@ -48,6 +48,8 @@ void ConstantPermeability::resizeFields( localIndex const size, localIndex const { PermeabilityBase::resizeFields( size, numPts ); + // TODO move into initializeState? + integer const numQuad = 1; // NOTE: enforcing 1 quadrature point for( localIndex ei = 0; ei < size; ++ei ) diff --git a/src/coreComponents/constitutive/permeability/PressurePermeability.cpp b/src/coreComponents/constitutive/permeability/PressurePermeability.cpp index bf07adef2d8..20fb4237367 100644 --- a/src/coreComponents/constitutive/permeability/PressurePermeability.cpp +++ b/src/coreComponents/constitutive/permeability/PressurePermeability.cpp @@ -73,7 +73,7 @@ void PressurePermeability::resizeFields( localIndex const size, localIndex const { PermeabilityBase::resizeFields( size, numPts ); - m_referencePermeability.resize( 0, 1, 3 ); + m_referencePermeability.resize( 0, 1, 3 ); // 0 to resize and assign default value later } void PressurePermeability::initializeState() const diff --git a/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp b/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp index 01c9d5a043a..ec51c08a2f8 100644 --- a/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp @@ -67,8 +67,8 @@ void ProppantPermeability::resizeFields( localIndex const size, localIndex const PermeabilityBase::resizeFields( size, numPts ); // NOTE: enforcing 1 quadrature point - m_dPerm_dDispJump.resize( 0, 1, 3, 3 ); - m_permeabilityMultiplier.resize( 0, 1, 3 ); + m_dPerm_dDispJump.resize( size, 1, 3, 3 ); + m_permeabilityMultiplier.resize( size, 1, 3 ); } diff --git a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp index f821ed39c16..bc1ed82375a 100644 --- a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp @@ -52,7 +52,7 @@ void SlipDependentPermeability::resizeFields( localIndex const size, localIndex PermeabilityBase::resizeFields( size, numPts ); // NOTE: enforcing 1 quadrature point - m_dPerm_dDispJump.resize( 0, 1, 3, 3 ); + m_dPerm_dDispJump.resize( size, 1, 3, 3 ); } REGISTER_CATALOG_ENTRY( ConstitutiveBase, SlipDependentPermeability, string const &, Group * const ) diff --git a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp index 0ec31914c31..06ba2dcfedb 100644 --- a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp +++ b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp @@ -84,7 +84,7 @@ void RelativePermeabilityBase::postInputInitialization() } // call to correctly set member array tertiary sizes on the 'main' material object - resizeFields( 0, 0 ); + //resizeFields( 0, 0 ); // set labels on array wrappers for plottable fields setLabels(); diff --git a/src/coreComponents/constitutive/solid/CeramicDamage.cpp b/src/coreComponents/constitutive/solid/CeramicDamage.cpp index ed59327dd73..be6a40cd560 100644 --- a/src/coreComponents/constitutive/solid/CeramicDamage.cpp +++ b/src/coreComponents/constitutive/solid/CeramicDamage.cpp @@ -74,8 +74,9 @@ void CeramicDamage::resizeFields( localIndex const size, localIndex const numPts { ElasticIsotropic::resizeFields( size, numPts ); - m_damage.resize( size, numPts ); - m_jacobian.resize( size, numPts ); + // 0 to resize and assign default value later + m_damage.resize( 0, numPts ); + m_jacobian.resize( 0, numPts ); } diff --git a/src/coreComponents/constitutive/solid/Damage.cpp b/src/coreComponents/constitutive/solid/Damage.cpp index e61d7d63d3b..07fdfca5edc 100644 --- a/src/coreComponents/constitutive/solid/Damage.cpp +++ b/src/coreComponents/constitutive/solid/Damage.cpp @@ -181,17 +181,18 @@ void Damage< BASE >::resizeFields( localIndex const size, { BASE::resizeFields( size, numPts ); - m_newDamage.resize( size, numPts ); - m_oldDamage.resize( size, numPts ); - m_damageGrad.resize( size, numPts, 3 ); - m_strainEnergyDensity.resize( size, numPts ); - m_volStrain.resize( size, numPts ); - m_extDrivingForce.resize( size, numPts ); - m_biotCoefficient.resize( size ); - m_criticalFractureEnergy.resize( size ); - m_tensileStrength.resize( size ); - m_compressStrength.resize( size ); - m_deltaCoefficient.resize( size ); + // 0 to resize and assign default value later + m_newDamage.resize( 0, numPts ); + m_oldDamage.resize( 0, numPts ); + m_damageGrad.resize( 0, numPts, 3 ); + m_strainEnergyDensity.resize( 0, numPts ); + m_volStrain.resize( 0, numPts ); + m_extDrivingForce.resize( 0, numPts ); + m_biotCoefficient.resize( 0 ); + m_criticalFractureEnergy.resize( 0 ); + m_tensileStrength.resize( 0 ); + m_compressStrength.resize( 0 ); + m_deltaCoefficient.resize( 0 ); } template< typename BASE > diff --git a/src/coreComponents/constitutive/solid/DelftEgg.cpp b/src/coreComponents/constitutive/solid/DelftEgg.cpp index 03eeefcc413..d71c25e3009 100644 --- a/src/coreComponents/constitutive/solid/DelftEgg.cpp +++ b/src/coreComponents/constitutive/solid/DelftEgg.cpp @@ -99,8 +99,9 @@ void DelftEgg::resizeFields( localIndex const size, localIndex const numPts ) { ElasticIsotropic::resizeFields( size, numPts ); - m_newPreConsolidationPressure.resize( size, numPts ); - m_oldPreConsolidationPressure.resize( size, numPts ); + // 0 to resize and assign default value later + m_newPreConsolidationPressure.resize( 0, numPts ); + m_oldPreConsolidationPressure.resize( 0, numPts ); } diff --git a/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp b/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp index ba250402750..51c579ba8d3 100644 --- a/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp +++ b/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp @@ -61,9 +61,9 @@ PoreVolumeCompressibleSolid::deliverClone( string const & name, void PoreVolumeCompressibleSolid::resizeFields( localIndex const size, localIndex const numPts ) { - m_poreVolumeMultiplier.resize( size, numPts ); - m_dPVMult_dPressure.resize( size, numPts ); - m_poreVolumeMultiplier.setValues< serialPolicy >( 1.0 ); + // 0 to resize and assign default value later + m_poreVolumeMultiplier.resize( 0, numPts ); + m_dPVMult_dPressure.resize( 0, numPts ); } void PoreVolumeCompressibleSolid::postInputInitialization() diff --git a/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.cpp b/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.cpp index 5b01ab9605e..fa7caff8ed3 100644 --- a/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.cpp +++ b/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.cpp @@ -93,8 +93,9 @@ void PoroElastic< BASE >::resizeFields( localIndex const size, localIndex const { BASE::resizeFields( size, numPts ); - m_poreVolumeMultiplier.resize( size, numPts ); - m_dPVMult_dPressure.resize( size, numPts ); + // 0 to resize and assign default value later + m_poreVolumeMultiplier.resize( 0, numPts ); + m_dPVMult_dPressure.resize( 0, numPts ); } template< typename BASE > diff --git a/src/coreComponents/constitutive/solid/DruckerPrager.cpp b/src/coreComponents/constitutive/solid/DruckerPrager.cpp index 479241ebdeb..2020b171a16 100644 --- a/src/coreComponents/constitutive/solid/DruckerPrager.cpp +++ b/src/coreComponents/constitutive/solid/DruckerPrager.cpp @@ -88,8 +88,9 @@ void DruckerPrager::resizeFields( localIndex const size, localIndex const numPts { ElasticIsotropic::resizeFields( size, numPts ); - m_newCohesion.resize( size, numPts ); - m_oldCohesion.resize( size, numPts ); + // 0 to resize and assign default value later + m_newCohesion.resize( 0, numPts ); + m_oldCohesion.resize( 0, numPts ); } diff --git a/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp b/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp index 216389b7fba..dcb25d911ce 100644 --- a/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp +++ b/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp @@ -104,8 +104,9 @@ void DruckerPragerExtended::resizeFields( localIndex const size, localIndex cons { ElasticIsotropic::resizeFields( size, numPts ); - m_newState.resize( size, numPts ); - m_oldState.resize( size, numPts ); + // 0 to resize and assign default value later + m_newState.resize( 0, numPts ); + m_oldState.resize( 0, numPts ); } diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp index f6217042857..0e442b41368 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp @@ -355,6 +355,8 @@ void ElasticIsotropicPressureDependentUpdates::smallStrainUpdate( localIndex con for( localIndex i=0; i<6; ++i ) { strainElasticTotal[i] = oldStrainElastic[i] + strainIncrement[i]; + std::cout << "strainElasticTotal[" << i << "] = " << strainElasticTotal[i] << " oldStrainElastic[i] = " + << oldStrainElastic[i] << " strainIncrement[i] = " << strainIncrement[i] << std::endl; } // two-invariant decomposition of trial elastic strain diff --git a/src/coreComponents/constitutive/solid/InvariantDecompositions.hpp b/src/coreComponents/constitutive/solid/InvariantDecompositions.hpp index 588d3e69f33..9b5b1576445 100644 --- a/src/coreComponents/constitutive/solid/InvariantDecompositions.hpp +++ b/src/coreComponents/constitutive/solid/InvariantDecompositions.hpp @@ -68,6 +68,9 @@ void strainDecomposition( real64 const ( &strain )[6], { volStrain = strain[0] + strain[1] + strain[2]; + std::cout << "volStrain = " << volStrain << " strain[0] = " << strain[0] + << " strain[1] = " << strain[1] << " strain[2] = " << strain[2] << std::endl; + for( localIndex i=0; i<3; ++i ) { deviator[i] = strain[i] - volStrain/3.; @@ -169,10 +172,17 @@ void strainRecomposition( real64 const & volStrain, { real64 const tmp = sqrt( 1.5 )*devStrain; + std::cout << "tmp = " << tmp << " volStrain = " << volStrain + << " devStrain = " << devStrain << std::endl; + for( localIndex i=0; i<3; ++i ) { strain[i] = volStrain/3. + tmp * deviator[i]; strain[i+3] = 2 * tmp * deviator[i+3]; // engineering strain + std::cout << "strain[" << i << "] = " << strain[i] + << " strain[" << i+3 << "] = " << strain[i+3] << std::endl; + std::cout << "deviator[" << i << "] = " << deviator[i] + << " deviator[" << i+3 << "] = " << deviator[i+3] << std::endl; } return; diff --git a/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp b/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp index e8db17ce775..694860bd28e 100644 --- a/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp +++ b/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp @@ -77,8 +77,9 @@ void ModifiedCamClay::resizeFields( localIndex const size, localIndex const numP { ElasticIsotropicPressureDependent::resizeFields( size, numPts ); - m_newPreConsolidationPressure.resize( size, numPts ); - m_oldPreConsolidationPressure.resize( size, numPts ); + // 0 to resize and assign default value later + m_newPreConsolidationPressure.resize( 0, numPts ); + m_oldPreConsolidationPressure.resize( 0, numPts ); } void ModifiedCamClay::postInputInitialization() diff --git a/src/coreComponents/constitutive/solid/SolidBase.cpp b/src/coreComponents/constitutive/solid/SolidBase.cpp index a750789dd75..00ac4398440 100644 --- a/src/coreComponents/constitutive/solid/SolidBase.cpp +++ b/src/coreComponents/constitutive/solid/SolidBase.cpp @@ -78,9 +78,10 @@ void SolidBase::postInputInitialization() void SolidBase::resizeFields( localIndex const size, localIndex const numPts ) { - m_density.resize( size, numPts ); - m_newStress.resize( size, numPts, 6 ); - m_oldStress.resize( size, numPts, 6 ); + // 0 to resize and assign default value later + m_density.resize( 0, numPts ); + m_newStress.resize( 0, numPts, 6 ); + m_oldStress.resize( 0, numPts, 6 ); } diff --git a/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp b/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp index e9de9c17db9..5e96d97a71c 100644 --- a/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp +++ b/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp @@ -69,9 +69,10 @@ SolidInternalEnergy::SolidInternalEnergy( string const & name, Group * const par void SolidInternalEnergy::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) { - m_internalEnergy.resize( size, 1 ); - m_dInternalEnergy_dTemperature.resize( size, 1 ); - m_internalEnergy_n.resize( size, 1 ); + // 0 to resize and assign default value later + m_internalEnergy.resize( 0, 1 ); + m_dInternalEnergy_dTemperature.resize( 0, 1 ); + m_internalEnergy_n.resize( 0, 1 ); } void SolidInternalEnergy::saveConvergedState() const diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.cpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.cpp index d8ab24a9021..153b2f73d88 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.cpp @@ -40,9 +40,7 @@ void MultiPhaseConstantThermalConductivity::resizeFields( localIndex const size, { MultiPhaseThermalConductivityBase::resizeFields( size, numPts ); - // NOTE: enforcing 1 quadrature point - m_effectiveConductivity.resize( size, 1, 3 ); - + // TODO move into initializeState? for( localIndex ei = 0; ei < size; ++ei ) { for( localIndex q = 0; q < 1; ++q ) diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp index 8e6aa0e24f2..d025173230a 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp @@ -53,8 +53,8 @@ void MultiPhaseThermalConductivityBase::postInputInitialization() GEOS_FMT( "{}: invalid number of phases", getFullName() ), InputError ); - m_effectiveConductivity.resize( 0, 0, 3 ); - m_dEffectiveConductivity_dPhaseVolFrac.resize( 0, 0, 3, numPhases ); + //m_effectiveConductivity.resize( 0, 0, 3 ); + //m_dEffectiveConductivity_dPhaseVolFrac.resize( 0, 0, 3, numPhases ); } void MultiPhaseThermalConductivityBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp index 06e5201e1f4..d789cbd5671 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp @@ -50,9 +50,7 @@ void MultiPhaseVolumeWeightedThermalConductivity::resizeFields( localIndex const { MultiPhaseThermalConductivityBase::resizeFields( size, numPts ); - // NOTE: enforcing 1 quadrature point - m_rockThermalConductivity.resize( size, 1, 3 ); - + // TODO move into initializeState? for( localIndex ei = 0; ei < size; ++ei ) { for( localIndex q = 0; q < 1; ++q ) diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp index b96c2c3a77b..4f7b9f79ffd 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp @@ -39,8 +39,8 @@ void SinglePhaseThermalConductivityBase::postInputInitialization() { ConstitutiveBase::postInputInitialization(); - m_effectiveConductivity.resize( 0, 0, 3 ); - m_dEffectiveConductivity_dT.resize( 0, 0, 3 ); + //m_effectiveConductivity.resize( 0, 0, 3 ); + //m_dEffectiveConductivity_dT.resize( 0, 0, 3 ); } void SinglePhaseThermalConductivityBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) From 6883847cd24539a31a7ff51aae9912ba5dbf383f Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 15 Aug 2025 08:52:31 -0500 Subject: [PATCH 04/43] unused --- .../solid/Deprecated/PoreVolumeCompressibleSolid.cpp | 2 +- src/coreComponents/constitutive/solid/SolidBase.cpp | 2 +- src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp b/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp index 51c579ba8d3..7a06ed5727c 100644 --- a/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp +++ b/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp @@ -59,7 +59,7 @@ PoreVolumeCompressibleSolid::deliverClone( string const & name, return clone; } -void PoreVolumeCompressibleSolid::resizeFields( localIndex const size, localIndex const numPts ) +void PoreVolumeCompressibleSolid::resizeFields( localIndex const GEOS_UNUSED_PARAM( size ), localIndex const numPts ) { // 0 to resize and assign default value later m_poreVolumeMultiplier.resize( 0, numPts ); diff --git a/src/coreComponents/constitutive/solid/SolidBase.cpp b/src/coreComponents/constitutive/solid/SolidBase.cpp index 00ac4398440..4c81250bc31 100644 --- a/src/coreComponents/constitutive/solid/SolidBase.cpp +++ b/src/coreComponents/constitutive/solid/SolidBase.cpp @@ -76,7 +76,7 @@ void SolidBase::postInputInitialization() } -void SolidBase::resizeFields( localIndex const size, localIndex const numPts ) +void SolidBase::resizeFields( localIndex const GEOS_UNUSED_PARAM( size ), localIndex const numPts ) { // 0 to resize and assign default value later m_density.resize( 0, numPts ); diff --git a/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp b/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp index 5e96d97a71c..07aa62a9e0d 100644 --- a/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp +++ b/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp @@ -67,7 +67,7 @@ SolidInternalEnergy::SolidInternalEnergy( string const & name, Group * const par setDescription( "Internal energy at the reference temperature [J/kg]" ); } -void SolidInternalEnergy::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) +void SolidInternalEnergy::resizeFields( localIndex const GEOS_UNUSED_PARAM( size ), localIndex const GEOS_UNUSED_PARAM( numPts ) ) { // 0 to resize and assign default value later m_internalEnergy.resize( 0, 1 ); From 376710335ed6daaf13d2ea4709a9c51f9568aa4a Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 15 Aug 2025 10:41:53 -0500 Subject: [PATCH 05/43] revert for hydrofrac --- src/coreComponents/constitutive/ConstitutiveBase.cpp | 12 ------------ .../constitutive/contact/HydraulicApertureBase.hpp | 5 ----- .../constitutive/contact/HydraulicApertureTable.cpp | 10 +++++++++- .../constitutive/contact/HydraulicApertureTable.hpp | 2 ++ 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/coreComponents/constitutive/ConstitutiveBase.cpp b/src/coreComponents/constitutive/ConstitutiveBase.cpp index b02c8903c4e..338ba871edf 100644 --- a/src/coreComponents/constitutive/ConstitutiveBase.cpp +++ b/src/coreComponents/constitutive/ConstitutiveBase.cpp @@ -45,42 +45,30 @@ ConstitutiveBase::CatalogInterface::CatalogType & ConstitutiveBase::getCatalog() void ConstitutiveBase::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numConstitutivePointsPerParentIndex ) { - - std::cout << "Allocating constitutive data for " << this->getFullName() - << " with " << parent.size() << " parent indices and " - << numConstitutivePointsPerParentIndex << " quadrature points per parent index." << std::endl; - m_numQuadraturePoints = numConstitutivePointsPerParentIndex; resizeFields( parent.size(), numConstitutivePointsPerParentIndex ); for( auto & group : this->getSubGroups() ) { - std::cout << "Allocating constitutive data for sub-group " << group.first << std::endl; for( auto & wrapper : group.second->wrappers() ) { - std::cout << " Checking wrapper " << wrapper.first - << ", sizedFromParent = " << wrapper.second->sizedFromParent() << std::endl; if( wrapper.second->sizedFromParent() ) { string const wrapperName = makeFieldName( this->getName(), wrapper.first ); parent.registerWrapper( wrapper.second->clone( wrapperName, parent ) ). setRestartFlags( RestartFlags::NO_WRITE ); - std::cout << " Registered wrapper " << wrapperName << " on parent group." << std::endl; } } } for( auto & wrapper : this->wrappers() ) { - std::cout << " Checking wrapper " << wrapper.first - << ", sizedFromParent = " << wrapper.second->sizedFromParent() << std::endl; if( wrapper.second->sizedFromParent() ) { string const wrapperName = makeFieldName( this->getName(), wrapper.first ); parent.registerWrapper( wrapper.second->clone( wrapperName, parent ) ). setRestartFlags( RestartFlags::NO_WRITE ); - std::cout << " Registered wrapper " << wrapperName << " on parent group." << std::endl; } } diff --git a/src/coreComponents/constitutive/contact/HydraulicApertureBase.hpp b/src/coreComponents/constitutive/contact/HydraulicApertureBase.hpp index e6c22934403..040772f9a85 100644 --- a/src/coreComponents/constitutive/contact/HydraulicApertureBase.hpp +++ b/src/coreComponents/constitutive/contact/HydraulicApertureBase.hpp @@ -48,11 +48,6 @@ class HydraulicApertureBase : public ConstitutiveBase HydraulicApertureBase( string const & name, Group * const parent ); - /** - * @brief default destructor - */ - virtual ~HydraulicApertureBase() override = default; - protected: struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct diff --git a/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp b/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp index a11cdbeb70d..4fc460620a2 100644 --- a/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp +++ b/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp @@ -52,7 +52,6 @@ HydraulicApertureTable::HydraulicApertureTable( string const & name, void HydraulicApertureTable::postInputInitialization() { - GEOS_THROW_IF( m_apertureTableName.empty(), getFullName() << ": the aperture table name " << m_apertureTableName << " is empty", InputError ); @@ -61,8 +60,13 @@ void HydraulicApertureTable::postInputInitialization() GEOS_THROW_IF( !functionManager.hasGroup( m_apertureTableName ), getFullName() << ": the aperture table named " << m_apertureTableName << " could not be found", InputError ); +} +void HydraulicApertureTable::resizeFields( localIndex const GEOS_UNUSED_PARAM( size ), localIndex const GEOS_UNUSED_PARAM( numPts ) ) +{ + FunctionManager & functionManager = FunctionManager::getInstance(); TableFunction & apertureTable = functionManager.getGroup< TableFunction >( m_apertureTableName ); + validateApertureTable( apertureTable ); ArrayOfArraysView< real64 > coords = apertureTable.getCoordinates(); @@ -108,6 +112,10 @@ void HydraulicApertureTable::validateApertureTable( TableFunction const & apertu ArrayOfArraysView< real64 const > const coords = apertureTable.getCoordinates(); arrayView1d< real64 const > const & hydraulicApertureValues = apertureTable.getValues(); + GEOS_THROW_IF( coords.size() == 0, + getFullName() << ": Empty aperture table.", + InputError ); + GEOS_THROW_IF( coords.size() > 1, getFullName() << ": Aperture limiter table cannot be greater than a 1D table.", InputError ); diff --git a/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp b/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp index 61f157259b8..fa06fc7f816 100644 --- a/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp +++ b/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp @@ -128,6 +128,8 @@ class HydraulicApertureTable : public HydraulicApertureBase virtual void postInputInitialization() override; + virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + /** * @brief Validate the values provided in the aperture table * @param[in] apertureTable the effective aperture vs aperture table From 5646aa2de5dbd0c1a6214de30447e61705baa8d6 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 15 Aug 2025 13:48:25 -0500 Subject: [PATCH 06/43] trying to avoid diffs --- .../capillaryPressure/CapillaryPressureBase.cpp | 2 +- .../constitutive/contact/HydraulicApertureTable.cpp | 7 +++++-- .../constitutive/diffusion/DiffusionBase.cpp | 7 ++++--- .../constitutive/dispersion/DispersionBase.cpp | 7 ------- .../constitutive/dispersion/DispersionBase.hpp | 2 -- .../constitutive/fluid/multifluid/MultiFluidBase.cpp | 8 +------- .../constitutive/fluid/multifluid/MultiFluidBase.hpp | 6 ------ .../singlefluid/CompressibleSinglePhaseFluid.cpp | 9 ++------- .../fluid/singlefluid/SingleFluidBase.cpp | 7 +------ .../fluid/singlefluid/SingleFluidBase.hpp | 5 ----- .../ThermalCompressibleSinglePhaseFluid.cpp | 3 --- .../RelativePermeabilityBase.cpp | 2 +- .../constitutive/solid/porosity/PorosityBase.cpp | 12 ++++++------ .../MultiPhaseThermalConductivityBase.cpp | 5 +++-- .../SinglePhaseThermalConductivityBase.cpp | 5 +++-- .../fluidFlow/CompositionalMultiphaseBase.cpp | 2 +- .../physicsSolvers/fluidFlow/SinglePhaseBase.cpp | 2 +- 17 files changed, 29 insertions(+), 62 deletions(-) diff --git a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp index 94d9f4abd48..1ef632f487f 100644 --- a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp +++ b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp @@ -82,7 +82,7 @@ void CapillaryPressureBase::postInputInitialization() } // call to correctly set member array tertiary sizes on the 'main' material object - //resizeFields( 0, 0 ); + resizeFields( 0, 0 ); // TODO figure out why this is really needed // set labels on array wrappers for plottable fields setLabels(); diff --git a/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp b/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp index 4fc460620a2..9717c3e4404 100644 --- a/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp +++ b/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp @@ -63,10 +63,13 @@ void HydraulicApertureTable::postInputInitialization() } void HydraulicApertureTable::resizeFields( localIndex const GEOS_UNUSED_PARAM( size ), localIndex const GEOS_UNUSED_PARAM( numPts ) ) -{ +{ + + // TODO this should not be here + FunctionManager & functionManager = FunctionManager::getInstance(); TableFunction & apertureTable = functionManager.getGroup< TableFunction >( m_apertureTableName ); - + validateApertureTable( apertureTable ); ArrayOfArraysView< real64 > coords = apertureTable.getCoordinates(); diff --git a/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp b/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp index ac372dedae4..10265782f28 100644 --- a/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp +++ b/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp @@ -62,9 +62,10 @@ void DiffusionBase::postInputInitialization() getFullName(), viewKeyStruct::phaseNamesString(), viewKeyStruct::defaultPhaseDiffusivityMultiplierString() ), InputError ); - //m_diffusivity.resize( 0, 0, 3 ); - //m_dDiffusivity_dTemperature.resize( 0, 0, 3 ); - //m_phaseDiffusivityMultiplier.resize( 0, 0, 3 ); + // TODO figure out why this is really needed + m_diffusivity.resize( 0, 0, 3 ); + m_dDiffusivity_dTemperature.resize( 0, 0, 3 ); + m_phaseDiffusivityMultiplier.resize( 0, 0, 3 ); } void DiffusionBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) diff --git a/src/coreComponents/constitutive/dispersion/DispersionBase.cpp b/src/coreComponents/constitutive/dispersion/DispersionBase.cpp index 2713f7468c3..ecb60eff713 100644 --- a/src/coreComponents/constitutive/dispersion/DispersionBase.cpp +++ b/src/coreComponents/constitutive/dispersion/DispersionBase.cpp @@ -34,13 +34,6 @@ DispersionBase::DispersionBase( string const & name, Group * const parent ) registerField( fields::dispersion::dispersivity{}, &m_dispersivity ); } -void DispersionBase::postInputInitialization() -{ - ConstitutiveBase::postInputInitialization(); - - //m_dispersivity.resize( 0, 0, 3 ); -} - void DispersionBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) { // NOTE: enforcing 1 quadrature point diff --git a/src/coreComponents/constitutive/dispersion/DispersionBase.hpp b/src/coreComponents/constitutive/dispersion/DispersionBase.hpp index 86ec501d11e..793c18d543c 100644 --- a/src/coreComponents/constitutive/dispersion/DispersionBase.hpp +++ b/src/coreComponents/constitutive/dispersion/DispersionBase.hpp @@ -118,8 +118,6 @@ class DispersionBase : public ConstitutiveBase protected: - virtual void postInputInitialization() override; - /** * @brief Function called internally to resize member arrays * @param size primary dimension (e.g. number of cells) diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp index 5481fa9148c..35422d0715b 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp @@ -201,18 +201,12 @@ void MultiFluidBase::postInputInitialization() } // call to correctly set member array tertiary sizes on the 'main' material object - //resizeFields( 0, 0 ); + resizeFields( 0, 0 ); // TODO figure out why this is really needed // set labels on array wrappers for plottable fields setLabels(); } -void MultiFluidBase::initializeState() const -{ - // initialize the "old" variables - saveConvergedState(); -} - void MultiFluidBase::saveConvergedState() const { localIndex const numElem = m_phaseMassDensity.value.size( 0 ); diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp index 803a7da5152..4a2b00d0a2c 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp @@ -188,12 +188,6 @@ class MultiFluidBase : public ConstitutiveBase arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > dPhaseInternalEnergy() const { return m_phaseInternalEnergy.derivs; } - /** - * @brief Initialize the model - * @param[in] phaseVolFraction an array containing the initial phase volume fractions - */ - virtual void initializeState() const; - /** * @brief Save the phase densities, component fractions, enthalpies and internal energies (for accumulation) */ diff --git a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp index 415b9b3e58e..47d6e5d8d6b 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp @@ -83,13 +83,8 @@ void CompressibleSinglePhaseFluid::resizeFields( localIndex const size, localInd { SingleFluidBase::resizeFields( size, numPts ); - // TODO : reconsider the necessity of this - - getField< fields::singlefluid::density >().setApplyDefaultValue( m_defaultDensity ); - getField< fields::singlefluid::viscosity >().setApplyDefaultValue( m_defaultViscosity ); - - m_density.value.setValues< serialPolicy >( m_referenceDensity ); - m_viscosity.value.setValues< serialPolicy >( m_referenceViscosity ); + getField< fields::singlefluid::density >().setApplyDefaultValue( m_referenceDensity ); + getField< fields::singlefluid::viscosity >().setApplyDefaultValue( m_referenceViscosity ); } void CompressibleSinglePhaseFluid::postInputInitialization() diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp index 538965a835e..0ba87261dc8 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp @@ -52,16 +52,11 @@ void SingleFluidBase::postInputInitialization() { ConstitutiveBase::postInputInitialization(); - // for fracture elements, set the default value + // for fracture elements, set the default value - TODO check why this is needed getField< fields::singlefluid::density_n >(). setDefaultValue( defaultDensity() ); } -void SingleFluidBase::initializeState() const -{ - saveConvergedState(); -} - void SingleFluidBase::saveConvergedState() const { localIndex const numElem = m_density.value.size( 0 ); diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp index bbd088a843b..efd525934d3 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp @@ -224,11 +224,6 @@ class SingleFluidBase : public ConstitutiveBase */ SingleFluidBase( string const & name, Group * const parent ); - /** - * @brief Initialize the model - */ - void initializeState() const; - virtual void saveConvergedState() const override; // *** SingleFluid-specific interface diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp index ae8739f6348..ac1a0d96785 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp @@ -66,9 +66,6 @@ void ThermalCompressibleSinglePhaseFluid::resizeFields( localIndex const size, l { CompressibleSinglePhaseFluid::resizeFields( size, numPts ); - m_internalEnergy.value.resize( size, numPts ); - m_internalEnergy.derivs.resize( size, numPts, m_numDOF ); - m_internalEnergy.value.setValues< serialPolicy >( m_referenceInternalEnergy ); } diff --git a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp index 06ba2dcfedb..a4bde754b46 100644 --- a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp +++ b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp @@ -84,7 +84,7 @@ void RelativePermeabilityBase::postInputInitialization() } // call to correctly set member array tertiary sizes on the 'main' material object - //resizeFields( 0, 0 ); + resizeFields( 0, 0 ); // TODO figure out why this is really needed // set labels on array wrappers for plottable fields setLabels(); diff --git a/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp b/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp index 9846af46f0c..452b5a59fc6 100644 --- a/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp +++ b/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp @@ -56,13 +56,13 @@ PorosityBase::PorosityBase( string const & name, Group * const parent ): registerField( fields::porosity::referencePorosity{}, &m_referencePorosity ); } -void PorosityBase::resizeFields( localIndex const size, localIndex const numPts ) +void PorosityBase::resizeFields( localIndex const GEOS_UNUSED_PARAM( size ), localIndex const numPts ) { - m_newPorosity.resize( size, numPts ); - m_porosity_n.resize( size, numPts ); - m_dPorosity_dPressure.resize( size, numPts ); - m_dPorosity_dTemperature.resize( size, numPts ); - m_initialPorosity.resize( size, numPts ); + m_newPorosity.resize( 0, numPts ); + m_porosity_n.resize( 0, numPts ); + m_dPorosity_dPressure.resize( 0, numPts ); + m_dPorosity_dTemperature.resize( 0, numPts ); + m_initialPorosity.resize( 0, numPts ); } void PorosityBase::postInputInitialization() diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp index d025173230a..0e771dbcd97 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp @@ -53,8 +53,9 @@ void MultiPhaseThermalConductivityBase::postInputInitialization() GEOS_FMT( "{}: invalid number of phases", getFullName() ), InputError ); - //m_effectiveConductivity.resize( 0, 0, 3 ); - //m_dEffectiveConductivity_dPhaseVolFrac.resize( 0, 0, 3, numPhases ); + // TODO figure out why this is really needed + m_effectiveConductivity.resize( 0, 0, 3 ); + m_dEffectiveConductivity_dPhaseVolFrac.resize( 0, 0, 3, numPhases ); } void MultiPhaseThermalConductivityBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp index 4f7b9f79ffd..5e13121d946 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp @@ -39,8 +39,9 @@ void SinglePhaseThermalConductivityBase::postInputInitialization() { ConstitutiveBase::postInputInitialization(); - //m_effectiveConductivity.resize( 0, 0, 3 ); - //m_dEffectiveConductivity_dT.resize( 0, 0, 3 ); + // TODO figure out why this is really needed + m_effectiveConductivity.resize( 0, 0, 3 ); + m_dEffectiveConductivity_dT.resize( 0, 0, 3 ); } void SinglePhaseThermalConductivityBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp index 96deb0b5f71..81b844c0a76 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp @@ -1002,7 +1002,7 @@ void CompositionalMultiphaseBase::initializeFluidState( MeshLevel & mesh, string const & fluidName = subRegion.template getReference< string >( viewKeyStruct::fluidNamesString() ); MultiFluidBase & fluid = getConstitutiveModel< MultiFluidBase >( subRegion, fluidName ); - fluid.initializeState(); + fluid.saveConvergedState(); // Update the phase mobility // Note: diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp index acad649f2ba..7ea83177d4f 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp @@ -582,7 +582,7 @@ void SinglePhaseBase::initializeFluidState( MeshLevel & mesh, string_array const updateFluidState( subRegion ); // 2. save the initial density (for use in the single-phase poromechanics solver to compute the deltaBodyForce) - fluid.initializeState(); + fluid.saveConvergedState(); } ); } From dd308867c73c39af41ef12457176365284220729 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 15 Aug 2025 14:21:57 -0500 Subject: [PATCH 07/43] Update testInvariantImmiscibleFluid.cpp --- .../constitutive/unitTests/testInvariantImmiscibleFluid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp b/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp index 6beb7fe58f5..e0178b5e90b 100644 --- a/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp +++ b/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp @@ -61,7 +61,7 @@ class InvariantImmiscibleFluidValidationTestFixture : public FluidModelTest< Inv // Use proper public initialization instead of protected postInputInitialization fluid.initialize( 1, 1 ); - fluid.initializeState(); + fluid.saveConvergedState(); } ); } @@ -185,7 +185,7 @@ class InvariantImmiscibleFluidTestFixture : public FluidModelTest< InvariantImmi composition[1] = 0.3; composition[2] = 0.3; CompSlice compositionSlice = composition.toSliceConst(); - fluid.initializeState(); + fluid.saveConvergedState(); // Create a test point localIndex k = 0; From 201abf8ecdaab79c0593397e552d8600db0dc4bc Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 15 Aug 2025 15:42:40 -0500 Subject: [PATCH 08/43] Update src/coreComponents/constitutive/solid/InvariantDecompositions.hpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../constitutive/solid/InvariantDecompositions.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreComponents/constitutive/solid/InvariantDecompositions.hpp b/src/coreComponents/constitutive/solid/InvariantDecompositions.hpp index 9b5b1576445..74f24e5a3b3 100644 --- a/src/coreComponents/constitutive/solid/InvariantDecompositions.hpp +++ b/src/coreComponents/constitutive/solid/InvariantDecompositions.hpp @@ -69,7 +69,7 @@ void strainDecomposition( real64 const ( &strain )[6], volStrain = strain[0] + strain[1] + strain[2]; std::cout << "volStrain = " << volStrain << " strain[0] = " << strain[0] - << " strain[1] = " << strain[1] << " strain[2] = " << strain[2] << std::endl; + // Debug print statement removed. for( localIndex i=0; i<3; ++i ) { From 56db8a130ffc57040fe107604b482c7acf1298c6 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 15 Aug 2025 15:43:33 -0500 Subject: [PATCH 09/43] Update InvariantDecompositions.hpp --- .../constitutive/solid/InvariantDecompositions.hpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/coreComponents/constitutive/solid/InvariantDecompositions.hpp b/src/coreComponents/constitutive/solid/InvariantDecompositions.hpp index 74f24e5a3b3..588d3e69f33 100644 --- a/src/coreComponents/constitutive/solid/InvariantDecompositions.hpp +++ b/src/coreComponents/constitutive/solid/InvariantDecompositions.hpp @@ -68,9 +68,6 @@ void strainDecomposition( real64 const ( &strain )[6], { volStrain = strain[0] + strain[1] + strain[2]; - std::cout << "volStrain = " << volStrain << " strain[0] = " << strain[0] - // Debug print statement removed. - for( localIndex i=0; i<3; ++i ) { deviator[i] = strain[i] - volStrain/3.; @@ -172,17 +169,10 @@ void strainRecomposition( real64 const & volStrain, { real64 const tmp = sqrt( 1.5 )*devStrain; - std::cout << "tmp = " << tmp << " volStrain = " << volStrain - << " devStrain = " << devStrain << std::endl; - for( localIndex i=0; i<3; ++i ) { strain[i] = volStrain/3. + tmp * deviator[i]; strain[i+3] = 2 * tmp * deviator[i+3]; // engineering strain - std::cout << "strain[" << i << "] = " << strain[i] - << " strain[" << i+3 << "] = " << strain[i+3] << std::endl; - std::cout << "deviator[" << i << "] = " << deviator[i] - << " deviator[" << i+3 << "] = " << deviator[i+3] << std::endl; } return; From b9b9a00db7a3939b139f3c44d2c17d4dc108e5a1 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 15 Aug 2025 15:44:04 -0500 Subject: [PATCH 10/43] Update src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../constitutive/solid/ElasticIsotropicPressureDependent.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp index 0e442b41368..b8584399ee7 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp @@ -356,7 +356,6 @@ void ElasticIsotropicPressureDependentUpdates::smallStrainUpdate( localIndex con { strainElasticTotal[i] = oldStrainElastic[i] + strainIncrement[i]; std::cout << "strainElasticTotal[" << i << "] = " << strainElasticTotal[i] << " oldStrainElastic[i] = " - << oldStrainElastic[i] << " strainIncrement[i] = " << strainIncrement[i] << std::endl; } // two-invariant decomposition of trial elastic strain From 6060796639443151909faba47b435ef18cce475a Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 15 Aug 2025 15:44:13 -0500 Subject: [PATCH 11/43] Update src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../constitutive/solid/ElasticIsotropicPressureDependent.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp index b8584399ee7..b663cfd964b 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp @@ -369,7 +369,8 @@ void ElasticIsotropicPressureDependentUpdates::smallStrainUpdate( localIndex con std::cout << "Cr = " << Cr << ", eps_v_elastic = " << eps_v_elastic << " eps_v0 = " << eps_v0 << std::endl; P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); Q = 3. * mu * eps_s_elastic; - std::cout << "P = " << P << ", Q = " << Q << std::endl; + P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); + Q = 3. * mu * eps_s_elastic; twoInvariant::stressRecomposition( P, Q, From e47c74aa61556e0caae2a35fb4b0e59bfa84e5d3 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 15 Aug 2025 15:44:27 -0500 Subject: [PATCH 12/43] Update src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../constitutive/solid/ElasticIsotropicPressureDependent.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp index b663cfd964b..72d570d6e3e 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp @@ -459,7 +459,8 @@ void ElasticIsotropicPressureDependentUpdates::smallStrainUpdate( localIndex con std::cout << "Cr = " << Cr << ", eps_v_elastic = " << eps_v_elastic << " eps_v0 = " << eps_v0 << std::endl; P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); Q = 3. * mu * eps_s_elastic; - std::cout << "P = " << P << ", Q = " << Q << std::endl; + P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); + Q = 3. * mu * eps_s_elastic; twoInvariant::stressRecomposition( P, Q, From b77d58b9a529e66fc2dbc1ea19b5c0636637f5e7 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 15 Aug 2025 15:45:19 -0500 Subject: [PATCH 13/43] Update ElasticIsotropicPressureDependent.hpp --- .../constitutive/solid/ElasticIsotropicPressureDependent.hpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp index 72d570d6e3e..158aff6e1cc 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp @@ -355,7 +355,6 @@ void ElasticIsotropicPressureDependentUpdates::smallStrainUpdate( localIndex con for( localIndex i=0; i<6; ++i ) { strainElasticTotal[i] = oldStrainElastic[i] + strainIncrement[i]; - std::cout << "strainElasticTotal[" << i << "] = " << strainElasticTotal[i] << " oldStrainElastic[i] = " } // two-invariant decomposition of trial elastic strain @@ -366,7 +365,6 @@ void ElasticIsotropicPressureDependentUpdates::smallStrainUpdate( localIndex con // Calculate trial mean and deviatoric stress - std::cout << "Cr = " << Cr << ", eps_v_elastic = " << eps_v_elastic << " eps_v0 = " << eps_v0 << std::endl; P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); Q = 3. * mu * eps_s_elastic; P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); @@ -456,7 +454,6 @@ void ElasticIsotropicPressureDependentUpdates::smallStrainUpdate( localIndex con // Calculate mean and deviatoric stress - std::cout << "Cr = " << Cr << ", eps_v_elastic = " << eps_v_elastic << " eps_v0 = " << eps_v0 << std::endl; P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); Q = 3. * mu * eps_s_elastic; P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); From af0c74d007f987c0927a69cbe3cfd08e98474e39 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 15 Aug 2025 15:53:19 -0500 Subject: [PATCH 14/43] Update src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../constitutive/solid/ElasticIsotropicPressureDependent.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp index 158aff6e1cc..e0b5b389359 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp @@ -368,7 +368,6 @@ void ElasticIsotropicPressureDependentUpdates::smallStrainUpdate( localIndex con P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); Q = 3. * mu * eps_s_elastic; P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); - Q = 3. * mu * eps_s_elastic; twoInvariant::stressRecomposition( P, Q, From bc447e6ce01bd262485c2ea8ab1b19be3d474c12 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 15 Aug 2025 15:53:34 -0500 Subject: [PATCH 15/43] Update src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../constitutive/solid/ElasticIsotropicPressureDependent.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp index e0b5b389359..ec3692adb32 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp @@ -456,7 +456,6 @@ void ElasticIsotropicPressureDependentUpdates::smallStrainUpdate( localIndex con P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); Q = 3. * mu * eps_s_elastic; P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); - Q = 3. * mu * eps_s_elastic; twoInvariant::stressRecomposition( P, Q, From 5eada7320a710620b7ec6524f7057be3858c31ef Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 15 Aug 2025 15:54:46 -0500 Subject: [PATCH 16/43] Update ElasticIsotropicPressureDependent.hpp --- .../constitutive/solid/ElasticIsotropicPressureDependent.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp index ec3692adb32..d8666357326 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp @@ -367,7 +367,6 @@ void ElasticIsotropicPressureDependentUpdates::smallStrainUpdate( localIndex con P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); Q = 3. * mu * eps_s_elastic; - P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); twoInvariant::stressRecomposition( P, Q, @@ -455,7 +454,6 @@ void ElasticIsotropicPressureDependentUpdates::smallStrainUpdate( localIndex con P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); Q = 3. * mu * eps_s_elastic; - P = p0 * std::exp( -1./Cr* (eps_v_elastic-eps_v0)); twoInvariant::stressRecomposition( P, Q, From 3a0a5f244bdf81a91a73f84856349118b75ae72d Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Sat, 16 Aug 2025 15:23:18 -0500 Subject: [PATCH 17/43] Update Damage.cpp --- src/coreComponents/constitutive/solid/Damage.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/coreComponents/constitutive/solid/Damage.cpp b/src/coreComponents/constitutive/solid/Damage.cpp index 07fdfca5edc..b9b454d7d9f 100644 --- a/src/coreComponents/constitutive/solid/Damage.cpp +++ b/src/coreComponents/constitutive/solid/Damage.cpp @@ -188,11 +188,6 @@ void Damage< BASE >::resizeFields( localIndex const size, m_strainEnergyDensity.resize( 0, numPts ); m_volStrain.resize( 0, numPts ); m_extDrivingForce.resize( 0, numPts ); - m_biotCoefficient.resize( 0 ); - m_criticalFractureEnergy.resize( 0 ); - m_tensileStrength.resize( 0 ); - m_compressStrength.resize( 0 ); - m_deltaCoefficient.resize( 0 ); } template< typename BASE > From d2f24a15b19e0c47f75b2959f3ee48fc8ad42726 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Tue, 19 Aug 2025 13:24:11 -0500 Subject: [PATCH 18/43] unify registerField --- .../constitutive/ConstitutiveBase.hpp | 9 ++-- .../CapillaryPressureBase.cpp | 13 +++-- .../CapillaryPressureBase.hpp | 3 ++ .../JFunctionCapillaryPressure.cpp | 6 +-- .../JFunctionCapillaryPressure.hpp | 1 - .../constitutive/diffusion/DiffusionBase.cpp | 6 +-- .../dispersion/DispersionBase.cpp | 2 +- .../fluid/multifluid/MultiFluidBase.cpp | 53 +++++++++---------- .../CompositionalMultiphaseFluid.cpp | 2 +- .../reactive/ReactiveMultiFluid.cpp | 8 +-- .../fluid/singlefluid/ParticleFluidBase.cpp | 14 ++--- .../fluid/singlefluid/SingleFluidBase.cpp | 20 +++---- .../fluid/singlefluid/SlurryFluidBase.cpp | 26 ++++----- .../TwoPhaseImmiscibleFluid.cpp | 10 ++-- .../ExponentialDecayPermeability.cpp | 4 +- .../ParallelPlatesPermeability.cpp | 2 +- .../permeability/PermeabilityBase.cpp | 4 +- .../permeability/ProppantPermeability.cpp | 4 +- .../SlipDependentPermeability.cpp | 2 +- .../WillisRichardsPermeability.cpp | 4 +- .../RelativePermeabilityBase.cpp | 8 +-- .../TableRelativePermeabilityHysteresis.cpp | 4 +- .../solid/porosity/BiotPorosity.cpp | 26 ++++----- .../solid/porosity/PorosityBase.cpp | 12 ++--- .../solid/porosity/PorosityFields.hpp | 8 ++- .../MultiPhaseThermalConductivityBase.cpp | 4 +- ...PhaseVolumeWeightedThermalConductivity.cpp | 2 +- .../SinglePhaseThermalConductivityBase.cpp | 4 +- src/coreComponents/mesh/ObjectManagerBase.hpp | 7 ++- src/coreComponents/mesh/PerforationData.cpp | 18 +++---- .../mesh/SurfaceElementSubRegion.cpp | 10 ++-- 31 files changed, 146 insertions(+), 150 deletions(-) diff --git a/src/coreComponents/constitutive/ConstitutiveBase.hpp b/src/coreComponents/constitutive/ConstitutiveBase.hpp index 99b5cdbc8a4..bd01ce44ae1 100644 --- a/src/coreComponents/constitutive/ConstitutiveBase.hpp +++ b/src/coreComponents/constitutive/ConstitutiveBase.hpp @@ -129,14 +129,13 @@ class ConstitutiveBase : public dataRepository::Group * TODO: Remove duplicated code with ObjectManagerBase */ template< typename FIELD_TRAIT > - dataRepository::Wrapper< typename FIELD_TRAIT::type > & registerField( FIELD_TRAIT const & fieldTrait, - typename FIELD_TRAIT::type * newObject ) + dataRepository::Wrapper< typename FIELD_TRAIT::type > & registerField( typename FIELD_TRAIT::type * newObject ) { if( FIELD_TRAIT::plotLevel != dataRepository::PlotLevel::NOPLOT ) - m_userFields.emplace_back( fieldTrait.key() ); + m_userFields.emplace_back( FIELD_TRAIT::key() ); - return registerWrapper( fieldTrait.key(), newObject ). - setApplyDefaultValue( fieldTrait.defaultValue() ). + return registerWrapper( FIELD_TRAIT::key(), newObject ). + setApplyDefaultValue( FIELD_TRAIT::defaultValue() ). setPlotLevel( FIELD_TRAIT::plotLevel ). setRestartFlags( FIELD_TRAIT::restartFlag ). setDescription( FIELD_TRAIT::description ); diff --git a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp index 1ef632f487f..aed4f4033b5 100644 --- a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp +++ b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp @@ -19,6 +19,7 @@ #include "CapillaryPressureBase.hpp" #include "CapillaryPressureFields.hpp" +#include "mesh/ElementSubRegionBase.hpp" namespace geos { @@ -44,9 +45,8 @@ CapillaryPressureBase::CapillaryPressureBase( string const & name, registerWrapper( viewKeyStruct::phaseOrderString(), &m_phaseOrder ). setSizedFromParent( 0 ); - registerField( fields::cappres::phaseCapPressure{}, &m_phaseCapPressure ); - registerField( fields::cappres::dPhaseCapPressure_dPhaseVolFraction{}, &m_dPhaseCapPressure_dPhaseVolFrac ); - + registerField< fields::cappres::phaseCapPressure >( &m_phaseCapPressure ); + registerField< fields::cappres::dPhaseCapPressure_dPhaseVolFraction >( &m_dPhaseCapPressure_dPhaseVolFrac ); } void CapillaryPressureBase::postInputInitialization() @@ -88,6 +88,13 @@ void CapillaryPressureBase::postInputInitialization() setLabels(); } +//void CapillaryPressureBase::allocateConstitutiveData( ElementSubRegionBase & parent, +// localIndex const numConstitutivePointsPerParentIndex ) +//{ +// parent.registerField( getName(), &m_phaseCapPressure ); +// parent.registerField( getName(), &m_dPhaseCapPressure_dPhaseVolFrac ); +//} + void CapillaryPressureBase::resizeFields( localIndex const size, localIndex const numPts ) { diff --git a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp index c6671df2be6..51ef7ffafdd 100644 --- a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp +++ b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp @@ -104,6 +104,9 @@ class CapillaryPressureBase : public ConstitutiveBase CapillaryPressureBase( string const & name, dataRepository::Group * const parent ); +// virtual void allocateConstitutiveData( dataRepository::Group & parent, +// localIndex const numConstitutivePointsPerParentIndex ) override; + /** * @brief Initialize the capillary pressure state (needed when capillary pressure depends on porosity and permeability) * @param[in] initialPorosity the initial porosity field after reservoir initialization diff --git a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp index c5bf26cfcf1..3d61f82d308 100644 --- a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp +++ b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp @@ -115,11 +115,7 @@ JFunctionCapillaryPressure::JFunctionCapillaryPressure( std::string const & name toString( PermeabilityDirection::Y ) + " - only use the permeability in the y direction,\n" + toString( PermeabilityDirection::Z ) + " - only use the permeability in the z direction." ); - registerField( fields::cappres::jFuncMultiplier{}, &m_jFuncMultiplier ); - - registerWrapper( viewKeyStruct::jFunctionWrappersString(), &m_jFuncKernelWrappers ). - setSizedFromParent( 0 ). - setRestartFlags( RestartFlags::NO_WRITE ); + registerField< fields::cappres::jFuncMultiplier >( &m_jFuncMultiplier ); } void JFunctionCapillaryPressure::postInputInitialization() diff --git a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp index 97cb104e6e5..4c8dbd77b18 100644 --- a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp +++ b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp @@ -109,7 +109,6 @@ class JFunctionCapillaryPressure : public CapillaryPressureBase static constexpr char const * porosityExponentString() { return "porosityExponent"; } static constexpr char const * permeabilityExponentString() { return "permeabilityExponent"; } static constexpr char const * permeabilityDirectionString() { return "permeabilityDirection"; } - static constexpr char const * jFunctionWrappersString() { return "jFunctionWrappers"; } }; /** diff --git a/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp b/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp index 10265782f28..f0189510d4a 100644 --- a/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp +++ b/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp @@ -40,9 +40,9 @@ DiffusionBase::DiffusionBase( string const & name, Group * const parent ) setApplyDefaultValue( 1.0 ). setDescription( "List of phase diffusivity multipliers" ); - registerField( fields::diffusion::diffusivity{}, &m_diffusivity ); - registerField( fields::diffusion::dDiffusivity_dTemperature{}, &m_dDiffusivity_dTemperature ); - registerField( fields::diffusion::phaseDiffusivityMultiplier{}, &m_phaseDiffusivityMultiplier ); + registerField< fields::diffusion::diffusivity >( &m_diffusivity ); + registerField< fields::diffusion::dDiffusivity_dTemperature >( &m_dDiffusivity_dTemperature ); + registerField< fields::diffusion::phaseDiffusivityMultiplier >( &m_phaseDiffusivityMultiplier ); } void DiffusionBase::postInputInitialization() diff --git a/src/coreComponents/constitutive/dispersion/DispersionBase.cpp b/src/coreComponents/constitutive/dispersion/DispersionBase.cpp index ecb60eff713..7eacf593439 100644 --- a/src/coreComponents/constitutive/dispersion/DispersionBase.cpp +++ b/src/coreComponents/constitutive/dispersion/DispersionBase.cpp @@ -31,7 +31,7 @@ namespace constitutive DispersionBase::DispersionBase( string const & name, Group * const parent ) : ConstitutiveBase( name, parent ) { - registerField( fields::dispersion::dispersivity{}, &m_dispersivity ); + registerField< fields::dispersion::dispersivity >( &m_dispersivity ); } void DispersionBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp index 35422d0715b..c8209981315 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp @@ -53,41 +53,40 @@ MultiFluidBase::MultiFluidBase( string const & name, Group * const parent ) registerWrapper( viewKeyStruct::useMassString(), &m_useMass ). setRestartFlags( RestartFlags::NO_WRITE ); - registerField( fields::multifluid::phaseFraction{}, &m_phaseFraction.value ); - registerField( fields::multifluid::dPhaseFraction{}, &m_phaseFraction.derivs ); - - registerField( fields::multifluid::phaseDensity{}, &m_phaseDensity.value ); - registerField( fields::multifluid::phaseDensity_n{}, &m_phaseDensity_n ); - registerField( fields::multifluid::dPhaseDensity{}, &m_phaseDensity.derivs ); + registerWrapper( viewKeyStruct::checkPVTTablesRangesString(), &m_checkPVTTablesRanges ). + setInputFlag( InputFlags::OPTIONAL ). + setRestartFlags( RestartFlags::NO_WRITE ). + setDescription( "Enable (1) or disable (0) an error when the input pressure or temperature of the PVT tables is out of range." ). + setDefaultValue( 1 ); - registerField( fields::multifluid::phaseMassDensity{}, &m_phaseMassDensity.value ); - registerField( fields::multifluid::dPhaseMassDensity{}, &m_phaseMassDensity.derivs ); + registerField< fields::multifluid::phaseFraction >( &m_phaseFraction.value ); + registerField< fields::multifluid::dPhaseFraction >( &m_phaseFraction.derivs ); - registerField( fields::multifluid::phaseViscosity{}, &m_phaseViscosity.value ); - registerField( fields::multifluid::dPhaseViscosity{}, &m_phaseViscosity.derivs ); + registerField< fields::multifluid::phaseDensity >( &m_phaseDensity.value ); + registerField< fields::multifluid::phaseDensity_n >( &m_phaseDensity_n ); + registerField< fields::multifluid::dPhaseDensity >( &m_phaseDensity.derivs ); - registerField( fields::multifluid::phaseEnthalpy{}, &m_phaseEnthalpy.value ); - registerField( fields::multifluid::phaseEnthalpy_n{}, &m_phaseEnthalpy_n ); - registerField( fields::multifluid::dPhaseEnthalpy{}, &m_phaseEnthalpy.derivs ); + registerField< fields::multifluid::phaseMassDensity >( &m_phaseMassDensity.value ); + registerField< fields::multifluid::dPhaseMassDensity >( &m_phaseMassDensity.derivs ); - registerField( fields::multifluid::phaseInternalEnergy{}, &m_phaseInternalEnergy.value ); - registerField( fields::multifluid::phaseInternalEnergy_n{}, &m_phaseInternalEnergy_n ); - registerField( fields::multifluid::dPhaseInternalEnergy{}, &m_phaseInternalEnergy.derivs ); + registerField< fields::multifluid::phaseViscosity >( &m_phaseViscosity.value ); + registerField< fields::multifluid::dPhaseViscosity >( &m_phaseViscosity.derivs ); - registerField( fields::multifluid::phaseCompFraction{}, &m_phaseCompFraction.value ); - registerField( fields::multifluid::phaseCompFraction_n{}, &m_phaseCompFraction_n ); - registerField( fields::multifluid::dPhaseCompFraction{}, &m_phaseCompFraction.derivs ); + registerField< fields::multifluid::phaseEnthalpy >( &m_phaseEnthalpy.value ); + registerField< fields::multifluid::phaseEnthalpy_n >( &m_phaseEnthalpy_n ); + registerField< fields::multifluid::dPhaseEnthalpy >( &m_phaseEnthalpy.derivs ); - registerField( fields::multifluid::totalDensity{}, &m_totalDensity.value ); - registerField( fields::multifluid::totalDensity_n{}, &m_totalDensity_n ); - registerField( fields::multifluid::dTotalDensity{}, &m_totalDensity.derivs ); + registerField< fields::multifluid::phaseInternalEnergy >( &m_phaseInternalEnergy.value ); + registerField< fields::multifluid::phaseInternalEnergy_n >( &m_phaseInternalEnergy_n ); + registerField< fields::multifluid::dPhaseInternalEnergy >( &m_phaseInternalEnergy.derivs ); + registerField< fields::multifluid::phaseCompFraction >( &m_phaseCompFraction.value ); + registerField< fields::multifluid::phaseCompFraction_n >( &m_phaseCompFraction_n ); + registerField< fields::multifluid::dPhaseCompFraction >( &m_phaseCompFraction.derivs ); - registerWrapper( viewKeyStruct::checkPVTTablesRangesString(), &m_checkPVTTablesRanges ). - setInputFlag( InputFlags::OPTIONAL ). - setRestartFlags( RestartFlags::NO_WRITE ). - setDescription( "Enable (1) or disable (0) an error when the input pressure or temperature of the PVT tables is out of range." ). - setDefaultValue( 1 ); + registerField< fields::multifluid::totalDensity >( &m_totalDensity.value ); + registerField< fields::multifluid::totalDensity_n >( &m_totalDensity_n ); + registerField< fields::multifluid::dTotalDensity >( &m_totalDensity.derivs ); } void MultiFluidBase::resizeFields( localIndex const size, localIndex const numPts ) diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp index 08be394d856..1eaa74c9b7e 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp @@ -65,7 +65,7 @@ CompositionalMultiphaseFluid( string const & name, Group * const parent ) setInputFlag( InputFlags::OPTIONAL ). setDescription( "Table of binary interaction coefficients" ); - registerField( fields::multifluid::kValues{}, &m_kValues ); + registerField< fields::multifluid::kValues >( &m_kValues ); // Link parameters specific to each model m_parameters->registerParameters( this ); diff --git a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.cpp index 09ac848a16a..09f7878e68b 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.cpp @@ -37,10 +37,10 @@ ReactiveMultiFluid:: m_numSecondarySpecies = 11; m_numKineticReactions = 2; - registerField( fields::reactivefluid::primarySpeciesConcentration{}, &m_primarySpeciesConcentration ); - registerField( fields::reactivefluid::secondarySpeciesConcentration{}, &m_secondarySpeciesConcentration ); - registerField( fields::reactivefluid::primarySpeciesTotalConcentration{}, &m_primarySpeciesTotalConcentration ); - registerField( fields::reactivefluid::kineticReactionRates{}, &m_kineticReactionRates ); + registerField< fields::reactivefluid::primarySpeciesConcentration >( &m_primarySpeciesConcentration ); + registerField< fields::reactivefluid::secondarySpeciesConcentration >( &m_secondarySpeciesConcentration ); + registerField< fields::reactivefluid::primarySpeciesTotalConcentration >( &m_primarySpeciesTotalConcentration ); + registerField< fields::reactivefluid::kineticReactionRates >( &m_kineticReactionRates ); } bool ReactiveMultiFluid::isThermal() const diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp index 5652af4b725..681771c372a 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp @@ -42,15 +42,15 @@ ParticleFluidBase::ParticleFluidBase( string const & name, Group * const parent setInputFlag( InputFlags::OPTIONAL ). setDescription( "Whether the collisional component of the slip velocity is considered" ); - registerField( fields::particlefluid::settlingFactor{}, &m_settlingFactor ); - registerField( fields::particlefluid::dSettlingFactor_dPressure{}, &m_dSettlingFactor_dPressure ); - registerField( fields::particlefluid::dSettlingFactor_dProppantConcentration{}, &m_dSettlingFactor_dProppantConcentration ); - registerField( fields::particlefluid::dSettlingFactor_dComponentConcentration{}, &m_dSettlingFactor_dComponentConcentration ); + registerField< fields::particlefluid::settlingFactor >( &m_settlingFactor ); + registerField< fields::particlefluid::dSettlingFactor_dPressure >( &m_dSettlingFactor_dPressure ); + registerField< fields::particlefluid::dSettlingFactor_dProppantConcentration >( &m_dSettlingFactor_dProppantConcentration ); + registerField< fields::particlefluid::dSettlingFactor_dComponentConcentration >( &m_dSettlingFactor_dComponentConcentration ); - registerField( fields::particlefluid::collisionFactor{}, &m_collisionFactor ); - registerField( fields::particlefluid::dCollisionFactor_dProppantConcentration{}, &m_dCollisionFactor_dProppantConcentration ); + registerField< fields::particlefluid::collisionFactor >( &m_collisionFactor ); + registerField< fields::particlefluid::dCollisionFactor_dProppantConcentration >( &m_dCollisionFactor_dProppantConcentration ); - registerField( fields::particlefluid::proppantPackPermeability{}, &m_proppantPackPermeability ); + registerField< fields::particlefluid::proppantPackPermeability >( &m_proppantPackPermeability ); } void ParticleFluidBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp index 0ba87261dc8..d6c5791a09f 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp @@ -33,19 +33,19 @@ SingleFluidBase::SingleFluidBase( string const & name, Group * const parent ) : ConstitutiveBase( name, parent ), m_numDOF( 1 ) { - registerField( fields::singlefluid::density{}, &m_density.value ); - registerField( fields::singlefluid::dDensity{}, &m_density.derivs ); - registerField( fields::singlefluid::density_n{}, &m_density_n ); + registerField< fields::singlefluid::density >( &m_density.value ); + registerField< fields::singlefluid::dDensity >( &m_density.derivs ); + registerField< fields::singlefluid::density_n >( &m_density_n ); - registerField( fields::singlefluid::viscosity{}, &m_viscosity.value ); - registerField( fields::singlefluid::dViscosity{}, &m_viscosity.derivs ); + registerField< fields::singlefluid::viscosity >( &m_viscosity.value ); + registerField< fields::singlefluid::dViscosity >( &m_viscosity.derivs ); - registerField( fields::singlefluid::internalEnergy{}, &m_internalEnergy.value ); - registerField( fields::singlefluid::dInternalEnergy{}, &m_internalEnergy.derivs ); - registerField( fields::singlefluid::internalEnergy_n{}, &m_internalEnergy_n ); + registerField< fields::singlefluid::internalEnergy >( &m_internalEnergy.value ); + registerField< fields::singlefluid::dInternalEnergy >( &m_internalEnergy.derivs ); + registerField< fields::singlefluid::internalEnergy_n >( &m_internalEnergy_n ); - registerField( fields::singlefluid::enthalpy{}, &m_enthalpy.value ); - registerField( fields::singlefluid::dEnthalpy{}, &m_enthalpy.derivs ); + registerField< fields::singlefluid::enthalpy >( &m_enthalpy.value ); + registerField< fields::singlefluid::dEnthalpy >( &m_enthalpy.derivs ); } void SingleFluidBase::postInputInitialization() diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp index 2256a823220..ea291ee5eaf 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp @@ -62,24 +62,24 @@ SlurryFluidBase::SlurryFluidBase( string const & name, Group * const parent ): setDescription( "Flow consistency index" ); // these would be in dDensity - registerField( fields::slurryfluid::dDensity_dProppantConcentration{}, &m_dDensity_dProppantConc ); - registerField( fields::slurryfluid::dDensity_dComponentConcentration{}, &m_dDensity_dCompConc ); + registerField< fields::slurryfluid::dDensity_dProppantConcentration >( &m_dDensity_dProppantConc ); + registerField< fields::slurryfluid::dDensity_dComponentConcentration >( &m_dDensity_dCompConc ); - registerField( fields::slurryfluid::fluidDensity{}, &m_fluidDensity.value ); - registerField( fields::slurryfluid::dFluidDensity_dPressure{}, &m_dFluidDens_dPres ); - registerField( fields::slurryfluid::dFluidDensity_dComponentConcentration{}, &m_dFluidDens_dCompConc ); + registerField< fields::slurryfluid::fluidDensity >( &m_fluidDensity.value ); + registerField< fields::slurryfluid::dFluidDensity_dPressure >( &m_dFluidDens_dPres ); + registerField< fields::slurryfluid::dFluidDensity_dComponentConcentration >( &m_dFluidDens_dCompConc ); - registerField( fields::slurryfluid::fluidViscosity{}, &m_fluidViscosity ); - registerField( fields::slurryfluid::dFluidViscosity_dPressure{}, &m_dFluidVisc_dPres ); - registerField( fields::slurryfluid::dFluidViscosity_dComponentConcentration{}, &m_dFluidVisc_dCompConc ); + registerField< fields::slurryfluid::fluidViscosity >( &m_fluidViscosity ); + registerField< fields::slurryfluid::dFluidViscosity_dPressure >( &m_dFluidVisc_dPres ); + registerField< fields::slurryfluid::dFluidViscosity_dComponentConcentration >( &m_dFluidVisc_dCompConc ); - registerField( fields::slurryfluid::componentDensity{}, &m_componentDensity ); - registerField( fields::slurryfluid::dComponentDensity_dPressure{}, &m_dCompDens_dPres ); - registerField( fields::slurryfluid::dComponentDensity_dComponentConcentration{}, &m_dCompDens_dCompConc ); + registerField< fields::slurryfluid::componentDensity >( &m_componentDensity ); + registerField< fields::slurryfluid::dComponentDensity_dPressure >( &m_dCompDens_dPres ); + registerField< fields::slurryfluid::dComponentDensity_dComponentConcentration >( &m_dCompDens_dCompConc ); - registerField( fields::slurryfluid::dViscosity_dProppantConcentration{}, &m_dViscosity_dProppantConc ); - registerField( fields::slurryfluid::dViscosity_dComponentConcentration{}, &m_dViscosity_dCompConc ); + registerField< fields::slurryfluid::dViscosity_dProppantConcentration >( &m_dViscosity_dProppantConc ); + registerField< fields::slurryfluid::dViscosity_dComponentConcentration >( &m_dViscosity_dCompConc ); } void SlurryFluidBase::postInputInitialization() diff --git a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.cpp b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.cpp index f0b30ebfc0d..65b8d5f44a9 100644 --- a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.cpp +++ b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.cpp @@ -60,12 +60,12 @@ TwoPhaseImmiscibleFluid::TwoPhaseImmiscibleFluid( string const & name, Group * c setDescription( "List of viscosity TableFuncion names from the Function block. \n" "The user must provide one TableFunction per phase, respecting the order provided in \"phaseNames\"." ); - registerField( fields::twophaseimmisciblefluid::phaseDensity{}, &m_phaseDensity.value ); - registerField( fields::twophaseimmisciblefluid::dPhaseDensity{}, &m_phaseDensity.derivs ); - registerField( fields::twophaseimmisciblefluid::phaseDensity_n{}, &m_phaseDensity_n ); + registerField< fields::twophaseimmisciblefluid::phaseDensity >( &m_phaseDensity.value ); + registerField< fields::twophaseimmisciblefluid::dPhaseDensity >( &m_phaseDensity.derivs ); + registerField< fields::twophaseimmisciblefluid::phaseDensity_n >( &m_phaseDensity_n ); - registerField( fields::twophaseimmisciblefluid::phaseViscosity{}, &m_phaseViscosity.value ); - registerField( fields::twophaseimmisciblefluid::dPhaseViscosity{}, &m_phaseViscosity.derivs ); + registerField< fields::twophaseimmisciblefluid::phaseViscosity >( &m_phaseViscosity.value ); + registerField< fields::twophaseimmisciblefluid::dPhaseViscosity >( &m_phaseViscosity.derivs ); } diff --git a/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.cpp b/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.cpp index a988eb7cb58..e70d6f005b3 100644 --- a/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.cpp @@ -40,8 +40,8 @@ ExponentialDecayPermeability::ExponentialDecayPermeability( string const & name, setInputFlag( InputFlags::REQUIRED ). setDescription( " initial permeability of the fracture." ); - registerField( fields::permeability::dPerm_dTraction{}, &m_dPerm_dTraction ); - registerField( fields::permeability::dPerm_dDispJump{}, &m_dPerm_dDispJump ); + registerField< fields::permeability::dPerm_dTraction >( &m_dPerm_dTraction ); + registerField< fields::permeability::dPerm_dDispJump >( &m_dPerm_dDispJump ); } void ExponentialDecayPermeability::resizeFields( localIndex const size, localIndex const numPts ) diff --git a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp index 59adbda430d..e288fa9828b 100644 --- a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp @@ -40,7 +40,7 @@ ParallelPlatesPermeability::ParallelPlatesPermeability( string const & name, Gro setSizedFromParent( 0 ). setDescription( "Default value of the permeability normal to the surface. If not specified the permeability is updated using the cubic law. " ); - registerField( fields::permeability::dPerm_dDispJump{}, &m_dPerm_dDispJump ); + registerField< fields::permeability::dPerm_dDispJump >( &m_dPerm_dDispJump ); } void ParallelPlatesPermeability::resizeFields( localIndex const size, localIndex const numPts ) diff --git a/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp b/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp index 3f54401ea9b..1c8e46c2c6a 100644 --- a/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp +++ b/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp @@ -34,8 +34,8 @@ PermeabilityBase::PermeabilityBase( string const & name, Group * const parent ): m_permeability(), m_dPerm_dPressure() { - registerField( fields::permeability::permeability{}, &m_permeability ); - registerField( fields::permeability::dPerm_dPressure{}, &m_dPerm_dPressure ); + registerField< fields::permeability::permeability >( &m_permeability ); + registerField< fields::permeability::dPerm_dPressure >( &m_dPerm_dPressure ); } void PermeabilityBase::scaleHorizontalPermeability( arrayView1d< real64 const > scalingFactors ) const diff --git a/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp b/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp index ec51c08a2f8..b3b3d8fdf1f 100644 --- a/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp @@ -49,8 +49,8 @@ ProppantPermeability::ProppantPermeability( string const & name, Group * const p registerWrapper( viewKeyStruct::proppantPackPermeabilityString(), &m_proppantPackPermeability ); - registerField( fields::permeability::dPerm_dDispJump{}, &m_dPerm_dDispJump ); - registerField( fields::permeability::permeabilityMultiplier{}, &m_permeabilityMultiplier ); + registerField< fields::permeability::dPerm_dDispJump >( &m_dPerm_dDispJump ); + registerField< fields::permeability::permeabilityMultiplier >( &m_permeabilityMultiplier ); } diff --git a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp index bc1ed82375a..6490f2a7cdf 100644 --- a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp @@ -44,7 +44,7 @@ SlipDependentPermeability::SlipDependentPermeability( string const & name, Group setInputFlag( InputFlags::REQUIRED ). setDescription( " initial permeability of the fracture." ); - registerField( fields::permeability::dPerm_dDispJump{}, &m_dPerm_dDispJump ); + registerField< fields::permeability::dPerm_dDispJump >( &m_dPerm_dDispJump ); } void SlipDependentPermeability::resizeFields( localIndex const size, localIndex const numPts ) diff --git a/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.cpp b/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.cpp index b67bbdcaf42..88d6190de72 100644 --- a/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.cpp @@ -44,8 +44,8 @@ WillisRichardsPermeability::WillisRichardsPermeability( string const & name, Gro setInputFlag( InputFlags::REQUIRED ). setDescription( "Effective normal stress causes 90% reduction in aperture." ); - registerField( fields::permeability::dPerm_dDispJump{}, &m_dPerm_dDispJump ); - registerField( fields::permeability::dPerm_dTraction{}, &m_dPerm_dTraction ); + registerField< fields::permeability::dPerm_dDispJump >( &m_dPerm_dDispJump ); + registerField< fields::permeability::dPerm_dTraction >( &m_dPerm_dTraction ); } void WillisRichardsPermeability::resizeFields( localIndex const size, localIndex const numPts ) diff --git a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp index a4bde754b46..34542d81721 100644 --- a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp +++ b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp @@ -42,12 +42,12 @@ RelativePermeabilityBase::RelativePermeabilityBase( string const & name, Group * registerWrapper( viewKeyStruct::phaseOrderString(), &m_phaseOrder ). setSizedFromParent( 0 ); - registerField( fields::relperm::phaseRelPerm{}, &m_phaseRelPerm ); - registerField( fields::relperm::dPhaseRelPerm_dPhaseVolFraction{}, &m_dPhaseRelPerm_dPhaseVolFrac ); + registerField< fields::relperm::phaseRelPerm >( &m_phaseRelPerm ); + registerField< fields::relperm::dPhaseRelPerm_dPhaseVolFraction >( &m_dPhaseRelPerm_dPhaseVolFrac ); - registerField( fields::relperm::phaseTrappedVolFraction{}, &m_phaseTrappedVolFrac ); + registerField< fields::relperm::phaseTrappedVolFraction >( &m_phaseTrappedVolFrac ); - registerField( fields::relperm::phaseRelPerm_n{}, &m_phaseRelPerm_n ); + registerField< fields::relperm::phaseRelPerm_n >( &m_phaseRelPerm_n ); } diff --git a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp index bdea3a28202..36ddf3b8561 100644 --- a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp +++ b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp @@ -137,8 +137,8 @@ TableRelativePermeabilityHysteresis::TableRelativePermeabilityHysteresis( std::s setInputFlag( InputFlags::FALSE ). // will be deduced from tables setSizedFromParent( 0 ); - registerField( fields::relperm::phaseMaxHistoricalVolFraction{}, &m_phaseMaxHistoricalVolFraction ); - registerField( fields::relperm::phaseMinHistoricalVolFraction{}, &m_phaseMinHistoricalVolFraction ); + registerField< fields::relperm::phaseMaxHistoricalVolFraction >( &m_phaseMaxHistoricalVolFraction ); + registerField< fields::relperm::phaseMinHistoricalVolFraction >( &m_phaseMinHistoricalVolFraction ); registerWrapper( viewKeyStruct::drainageRelPermKernelWrappersString(), &m_drainageRelPermKernelWrappers ). setSizedFromParent( 0 ). diff --git a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.cpp b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.cpp index f7860429e01..8f0d5c69301 100644 --- a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.cpp +++ b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.cpp @@ -48,27 +48,23 @@ BiotPorosity::BiotPorosity( string const & name, Group * const parent ): setInputFlag( InputFlags::OPTIONAL ). setDescription( "Flag enabling uniaxial approximation in fixed stress update" ); - registerField( fields::porosity::biotCoefficient{}, &m_biotCoefficient ). - setApplyDefaultValue( 1.0 ). - setDescription( "Biot coefficient" ); + registerWrapper( viewKeyStruct::solidBulkModulusString(), &m_bulkModulus ). // TODO field? + setApplyDefaultValue( 1e-6 ). + setDescription( "Solid bulk modulus" ); - registerField( fields::porosity::grainBulkModulus{}, &m_grainBulkModulus ). - setApplyDefaultValue( -1.0 ). - setDescription( "Grain Bulk modulus." ); + registerWrapper( viewKeyStruct::solidShearModulusString(), &m_shearModulus ). // TODO field? + setApplyDefaultValue( 1e-6 ). + setDescription( "Solid shear modulus" ); - registerField( fields::porosity::thermalExpansionCoefficient{}, &m_thermalExpansionCoefficient ); + registerField< fields::porosity::biotCoefficient >( &m_biotCoefficient ); - registerField( fields::porosity::meanTotalStressIncrement_k{}, &m_meanTotalStressIncrement_k ); + registerField< fields::porosity::grainBulkModulus >( &m_grainBulkModulus ); - registerField( fields::porosity::averageMeanTotalStressIncrement_k{}, &m_averageMeanTotalStressIncrement_k ); + registerField< fields::porosity::thermalExpansionCoefficient >( &m_thermalExpansionCoefficient ); - registerWrapper( viewKeyStruct::solidBulkModulusString(), &m_bulkModulus ). - setApplyDefaultValue( 1e-6 ). - setDescription( "Solid bulk modulus" ); + registerField< fields::porosity::meanTotalStressIncrement_k >( &m_meanTotalStressIncrement_k ); - registerWrapper( viewKeyStruct::solidShearModulusString(), &m_shearModulus ). - setApplyDefaultValue( 1e-6 ). - setDescription( "Solid shear modulus" ); + registerField< fields::porosity::averageMeanTotalStressIncrement_k >( &m_averageMeanTotalStressIncrement_k ); } void BiotPorosity::resizeFields( localIndex const size, localIndex const numPts ) diff --git a/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp b/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp index 452b5a59fc6..cd4bcefe41c 100644 --- a/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp +++ b/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp @@ -43,17 +43,17 @@ PorosityBase::PorosityBase( string const & name, Group * const parent ): setInputFlag( InputFlags::REQUIRED ). setDescription( "Default value of the reference porosity" ); - registerField( fields::porosity::porosity{}, &m_newPorosity ); + registerField< fields::porosity::porosity >( &m_newPorosity ); - registerField( fields::porosity::porosity_n{}, &m_porosity_n ); + registerField< fields::porosity::porosity_n >( &m_porosity_n ); - registerField( fields::porosity::dPorosity_dPressure{}, &m_dPorosity_dPressure ); + registerField< fields::porosity::dPorosity_dPressure >( &m_dPorosity_dPressure ); - registerField( fields::porosity::dPorosity_dTemperature{}, &m_dPorosity_dTemperature ); + registerField< fields::porosity::dPorosity_dTemperature >( &m_dPorosity_dTemperature ); - registerField( fields::porosity::initialPorosity{}, &m_initialPorosity ); + registerField< fields::porosity::initialPorosity >( &m_initialPorosity ); - registerField( fields::porosity::referencePorosity{}, &m_referencePorosity ); + registerField< fields::porosity::referencePorosity >( &m_referencePorosity ); } void PorosityBase::resizeFields( localIndex const GEOS_UNUSED_PARAM( size ), localIndex const numPts ) diff --git a/src/coreComponents/constitutive/solid/porosity/PorosityFields.hpp b/src/coreComponents/constitutive/solid/porosity/PorosityFields.hpp index 5870bf9e5ef..d475d897e38 100644 --- a/src/coreComponents/constitutive/solid/porosity/PorosityFields.hpp +++ b/src/coreComponents/constitutive/solid/porosity/PorosityFields.hpp @@ -82,7 +82,7 @@ DECLARE_FIELD( referencePorosity, DECLARE_FIELD( biotCoefficient, "biotCoefficient", array1d< real64 >, - 0, + 1.0, LEVEL_0, WRITE_AND_READ, "Biot coefficient" ); @@ -114,12 +114,10 @@ DECLARE_FIELD( averageMeanTotalStressIncrement_k, DECLARE_FIELD( grainBulkModulus, "grainBulkModulus", array1d< real64 >, - 0, + -1.0, LEVEL_0, WRITE_AND_READ, - "Biot coefficient" ); - - + "Grain bulk modulus" ); } diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp index 0e771dbcd97..59d60354cdd 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp @@ -37,8 +37,8 @@ MultiPhaseThermalConductivityBase::MultiPhaseThermalConductivityBase( string con setInputFlag( InputFlags::REQUIRED ). setDescription( "List of fluid phases" ); - registerField( fields::thermalconductivity::effectiveConductivity{}, &m_effectiveConductivity ); - registerField( fields::thermalconductivity::dEffectiveConductivity_dPhaseVolFraction{}, &m_dEffectiveConductivity_dPhaseVolFrac ); + registerField< fields::thermalconductivity::effectiveConductivity >( &m_effectiveConductivity ); + registerField< fields::thermalconductivity::dEffectiveConductivity_dPhaseVolFraction >( &m_dEffectiveConductivity_dPhaseVolFrac ); } void MultiPhaseThermalConductivityBase::postInputInitialization() diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp index d789cbd5671..e5db9174100 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp @@ -43,7 +43,7 @@ MultiPhaseVolumeWeightedThermalConductivity::MultiPhaseVolumeWeightedThermalCond setRestartFlags( RestartFlags::NO_WRITE ). setDescription( "Phase thermal conductivity [W/(m.K)]" ); - registerField( fields::thermalconductivity::rockThermalConductivity{}, &m_rockThermalConductivity ); + registerField< fields::thermalconductivity::rockThermalConductivity >( &m_rockThermalConductivity ); } void MultiPhaseVolumeWeightedThermalConductivity::resizeFields( localIndex const size, localIndex const numPts ) diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp index 5e13121d946..23bda22fabb 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp @@ -31,8 +31,8 @@ namespace constitutive SinglePhaseThermalConductivityBase::SinglePhaseThermalConductivityBase( string const & name, Group * const parent ) : ConstitutiveBase( name, parent ) { - registerField( fields::thermalconductivity::effectiveConductivity{}, &m_effectiveConductivity ); - registerField( fields::thermalconductivity::dEffectiveConductivity_dT{}, &m_dEffectiveConductivity_dT ); + registerField< fields::thermalconductivity::effectiveConductivity >( &m_effectiveConductivity ); + registerField< fields::thermalconductivity::dEffectiveConductivity_dT >( &m_dEffectiveConductivity_dT ); } void SinglePhaseThermalConductivityBase::postInputInitialization() diff --git a/src/coreComponents/mesh/ObjectManagerBase.hpp b/src/coreComponents/mesh/ObjectManagerBase.hpp index fe64efee649..d15d5059195 100644 --- a/src/coreComponents/mesh/ObjectManagerBase.hpp +++ b/src/coreComponents/mesh/ObjectManagerBase.hpp @@ -590,14 +590,13 @@ class ObjectManagerBase : public dataRepository::Group * @return A reference to the newly registered/created Wrapper */ template< typename FIELD_TRAIT > - dataRepository::Wrapper< typename FIELD_TRAIT::type > & registerField( FIELD_TRAIT const & fieldTrait, - typename FIELD_TRAIT::type * newObject ) + dataRepository::Wrapper< typename FIELD_TRAIT::type > & registerField( typename FIELD_TRAIT::type * newObject ) { m_registeredField.insert( FIELD_TRAIT::key()); - return registerWrapper( fieldTrait.key(), newObject ). - setApplyDefaultValue( fieldTrait.defaultValue() ). + return registerWrapper( FIELD_TRAIT::key(), newObject ). + setApplyDefaultValue( FIELD_TRAIT::defaultValue() ). setPlotLevel( FIELD_TRAIT::plotLevel ). setRestartFlags( FIELD_TRAIT::restartFlag ). setDescription( FIELD_TRAIT::description ); diff --git a/src/coreComponents/mesh/PerforationData.cpp b/src/coreComponents/mesh/PerforationData.cpp index 4363c2ac1cb..27e7330fddc 100644 --- a/src/coreComponents/mesh/PerforationData.cpp +++ b/src/coreComponents/mesh/PerforationData.cpp @@ -36,15 +36,15 @@ PerforationData::PerforationData( string const & name, Group * const parent ) { registerWrapper( viewKeyStruct::numPerforationsGlobalString(), &m_numPerforationsGlobal ); - registerField( fields::perforation::reservoirElementRegion{}, &m_toMeshElements.m_toElementRegion ); - registerField( fields::perforation::reservoirElementSubRegion{}, &m_toMeshElements.m_toElementSubRegion ); - registerField( fields::perforation::reservoirElementIndex{}, &m_toMeshElements.m_toElementIndex ); - registerField( fields::perforation::reservoirElementGlobalIndex{}, &m_reservoirElementGlobalIndex ); - - registerField( fields::perforation::wellElementIndex{}, &m_wellElementIndex ); - registerField( fields::perforation::location{}, &m_location ); - registerField( fields::perforation::wellTransmissibility{}, &m_wellTransmissibility ); - registerField( fields::perforation::wellSkinFactor{}, &m_wellSkinFactor ); + registerField< fields::perforation::reservoirElementRegion >( &m_toMeshElements.m_toElementRegion ); + registerField< fields::perforation::reservoirElementSubRegion >( &m_toMeshElements.m_toElementSubRegion ); + registerField< fields::perforation::reservoirElementIndex >( &m_toMeshElements.m_toElementIndex ); + registerField< fields::perforation::reservoirElementGlobalIndex >( &m_reservoirElementGlobalIndex ); + + registerField< fields::perforation::wellElementIndex >( &m_wellElementIndex ); + registerField< fields::perforation::location >( &m_location ); + registerField< fields::perforation::wellTransmissibility >( &m_wellTransmissibility ); + registerField< fields::perforation::wellSkinFactor >( &m_wellSkinFactor ); } PerforationData::~PerforationData() diff --git a/src/coreComponents/mesh/SurfaceElementSubRegion.cpp b/src/coreComponents/mesh/SurfaceElementSubRegion.cpp index 3b371106393..81b912d138c 100644 --- a/src/coreComponents/mesh/SurfaceElementSubRegion.cpp +++ b/src/coreComponents/mesh/SurfaceElementSubRegion.cpp @@ -46,17 +46,17 @@ SurfaceElementSubRegion::SurfaceElementSubRegion( string const & name, registerWrapper( viewKeyStruct::edgeListString(), &m_toEdgesRelation ). setDescription( "Map to the edges attached to each SurfaceElement." ); - registerField( fields::elementAperture{}, &m_elementAperture ); + registerField< fields::elementAperture >( &m_elementAperture ); - registerField( fields::elementArea{}, &m_elementArea ); + registerField< fields::elementArea >( &m_elementArea ); - registerField( fields::normalVector{}, &m_normalVector ). + registerField< fields::normalVector >( &m_normalVector ). reference().resizeDimension< 1 >( 3 ); - registerField( fields::tangentVector1{}, &m_tangentVector1 ). + registerField< fields::tangentVector1 >( &m_tangentVector1 ). reference().resizeDimension< 1 >( 3 ); - registerField( fields::tangentVector2{}, &m_tangentVector2 ). + registerField< fields::tangentVector2 >( &m_tangentVector2 ). reference().resizeDimension< 1 >( 3 ); excludeWrappersFromPacking( { viewKeyStruct::nodeListString(), From 978851cd6b2c243c103ccfbbb83857fd42dfb78d Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Thu, 21 Aug 2025 10:44:49 -0500 Subject: [PATCH 19/43] fix commit mistake --- .../capillaryPressure/CapillaryPressureBase.cpp | 7 ------- .../capillaryPressure/CapillaryPressureBase.hpp | 3 --- 2 files changed, 10 deletions(-) diff --git a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp index aed4f4033b5..ffb65ae2fcf 100644 --- a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp +++ b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp @@ -88,13 +88,6 @@ void CapillaryPressureBase::postInputInitialization() setLabels(); } -//void CapillaryPressureBase::allocateConstitutiveData( ElementSubRegionBase & parent, -// localIndex const numConstitutivePointsPerParentIndex ) -//{ -// parent.registerField( getName(), &m_phaseCapPressure ); -// parent.registerField( getName(), &m_dPhaseCapPressure_dPhaseVolFrac ); -//} - void CapillaryPressureBase::resizeFields( localIndex const size, localIndex const numPts ) { diff --git a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp index 51ef7ffafdd..c6671df2be6 100644 --- a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp +++ b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp @@ -104,9 +104,6 @@ class CapillaryPressureBase : public ConstitutiveBase CapillaryPressureBase( string const & name, dataRepository::Group * const parent ); -// virtual void allocateConstitutiveData( dataRepository::Group & parent, -// localIndex const numConstitutivePointsPerParentIndex ) override; - /** * @brief Initialize the capillary pressure state (needed when capillary pressure depends on porosity and permeability) * @param[in] initialPorosity the initial porosity field after reservoir initialization From a943abcf4734fe648cdee2296ab234fa849cd6c9 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 22 Aug 2025 15:29:21 -0500 Subject: [PATCH 20/43] step back --- .../constitutive/ConstitutiveBase.cpp | 2 - .../constitutive/ConstitutiveBase.hpp | 13 ----- .../CapillaryPressureBase.cpp | 13 +++-- .../CapillaryPressureBase.hpp | 10 ++-- .../JFunctionCapillaryPressure.cpp | 7 +-- .../JFunctionCapillaryPressure.hpp | 12 ++--- .../constitutive/contact/CoulombFriction.cpp | 7 +-- .../constitutive/contact/CoulombFriction.hpp | 10 ++-- .../contact/HydraulicApertureTable.cpp | 4 +- .../contact/HydraulicApertureTable.hpp | 5 +- .../diffusion/ConstantDiffusion.cpp | 7 +-- .../diffusion/ConstantDiffusion.hpp | 10 ++-- .../constitutive/diffusion/DiffusionBase.cpp | 13 +++-- .../constitutive/diffusion/DiffusionBase.hpp | 10 ++-- .../dispersion/DispersionBase.cpp | 7 ++- .../dispersion/DispersionBase.hpp | 10 ++-- .../fluid/multifluid/MultiFluidBase.cpp | 50 +++++++++---------- .../fluid/multifluid/MultiFluidBase.hpp | 12 ++--- .../CompositionalMultiphaseFluid.cpp | 7 +-- .../CompositionalMultiphaseFluid.hpp | 5 +- .../constant/InvariantImmiscibleFluid.hpp | 10 ---- .../reactive/ReactiveMultiFluid.cpp | 15 +++--- .../reactive/ReactiveMultiFluid.hpp | 5 +- .../CompressibleSinglePhaseFluid.cpp | 5 +- .../CompressibleSinglePhaseFluid.hpp | 5 +- .../fluid/singlefluid/ParticleFluidBase.cpp | 7 ++- .../fluid/singlefluid/ParticleFluidBase.hpp | 5 +- .../fluid/singlefluid/ProppantSlurryFluid.cpp | 5 +- .../fluid/singlefluid/ProppantSlurryFluid.hpp | 5 +- .../fluid/singlefluid/SingleFluidBase.cpp | 25 ++++++---- .../fluid/singlefluid/SingleFluidBase.hpp | 5 +- .../fluid/singlefluid/SlurryFluidBase.cpp | 32 ++++++------ .../fluid/singlefluid/SlurryFluidBase.hpp | 5 +- .../ThermalCompressibleSinglePhaseFluid.cpp | 5 +- .../ThermalCompressibleSinglePhaseFluid.hpp | 5 +- .../TwoPhaseImmiscibleFluid.cpp | 15 +++--- .../TwoPhaseImmiscibleFluid.hpp | 5 +- .../permeability/CarmanKozenyPermeability.cpp | 9 ++-- .../permeability/CarmanKozenyPermeability.hpp | 9 ++-- .../permeability/ConstantPermeability.cpp | 7 +-- .../permeability/ConstantPermeability.hpp | 5 +- .../ExponentialDecayPermeability.cpp | 11 ++-- .../ExponentialDecayPermeability.hpp | 7 ++- .../ParallelPlatesPermeability.cpp | 12 +++-- .../ParallelPlatesPermeability.hpp | 5 +- .../permeability/PermeabilityBase.cpp | 9 ++-- .../permeability/PermeabilityBase.hpp | 5 +- .../permeability/PressurePermeability.cpp | 9 ++-- .../permeability/PressurePermeability.hpp | 5 +- .../permeability/ProppantPermeability.cpp | 11 ++-- .../permeability/ProppantPermeability.hpp | 5 +- .../SlipDependentPermeability.cpp | 9 ++-- .../SlipDependentPermeability.hpp | 7 ++- .../WillisRichardsPermeability.cpp | 11 ++-- .../WillisRichardsPermeability.hpp | 7 ++- .../RelativePermeabilityBase.cpp | 17 ++++--- .../RelativePermeabilityBase.hpp | 10 ++-- .../TableRelativePermeabilityHysteresis.cpp | 12 +++-- .../TableRelativePermeabilityHysteresis.hpp | 4 +- .../constitutive/solid/CeramicDamage.cpp | 7 ++- .../constitutive/solid/CeramicDamage.hpp | 4 +- .../constitutive/solid/Damage.cpp | 8 ++- .../constitutive/solid/Damage.hpp | 4 +- .../constitutive/solid/DelftEgg.cpp | 7 ++- .../constitutive/solid/DelftEgg.hpp | 4 +- .../PoreVolumeCompressibleSolid.cpp | 5 +- .../PoreVolumeCompressibleSolid.hpp | 4 +- .../solid/Deprecated/PoroElastic.cpp | 7 ++- .../solid/Deprecated/PoroElastic.hpp | 4 +- .../constitutive/solid/DruckerPrager.cpp | 7 ++- .../constitutive/solid/DruckerPrager.hpp | 4 +- .../solid/DruckerPragerExtended.cpp | 7 ++- .../solid/DruckerPragerExtended.hpp | 4 +- .../constitutive/solid/ModifiedCamClay.cpp | 7 ++- .../constitutive/solid/ModifiedCamClay.hpp | 4 +- .../constitutive/solid/SolidBase.cpp | 4 +- .../constitutive/solid/SolidBase.hpp | 4 +- .../solid/SolidInternalEnergy.cpp | 4 +- .../solid/SolidInternalEnergy.hpp | 6 +-- .../solid/porosity/BiotPorosity.cpp | 6 +-- .../solid/porosity/BiotPorosity.hpp | 4 +- .../solid/porosity/PorosityBase.cpp | 4 +- .../solid/porosity/PorosityBase.hpp | 4 +- .../MultiPhaseConstantThermalConductivity.cpp | 6 +-- .../MultiPhaseConstantThermalConductivity.hpp | 4 +- .../MultiPhaseThermalConductivityBase.cpp | 8 +-- .../MultiPhaseThermalConductivityBase.hpp | 4 +- ...PhaseVolumeWeightedThermalConductivity.cpp | 6 +-- ...PhaseVolumeWeightedThermalConductivity.hpp | 4 +- .../SinglePhaseThermalConductivityBase.cpp | 8 +-- .../SinglePhaseThermalConductivityBase.hpp | 4 +- 91 files changed, 359 insertions(+), 367 deletions(-) diff --git a/src/coreComponents/constitutive/ConstitutiveBase.cpp b/src/coreComponents/constitutive/ConstitutiveBase.cpp index 338ba871edf..7323a649605 100644 --- a/src/coreComponents/constitutive/ConstitutiveBase.cpp +++ b/src/coreComponents/constitutive/ConstitutiveBase.cpp @@ -47,8 +47,6 @@ void ConstitutiveBase::allocateConstitutiveData( dataRepository::Group & parent, { m_numQuadraturePoints = numConstitutivePointsPerParentIndex; - resizeFields( parent.size(), numConstitutivePointsPerParentIndex ); - for( auto & group : this->getSubGroups() ) { for( auto & wrapper : group.second->wrappers() ) diff --git a/src/coreComponents/constitutive/ConstitutiveBase.hpp b/src/coreComponents/constitutive/ConstitutiveBase.hpp index bd01ce44ae1..cc3ebfc3709 100644 --- a/src/coreComponents/constitutive/ConstitutiveBase.hpp +++ b/src/coreComponents/constitutive/ConstitutiveBase.hpp @@ -175,19 +175,6 @@ class ConstitutiveBase : public dataRepository::Group return m_userFields; } -protected: - - /** - * @brief Function called internally to resize member arrays - * @param size primary dimension (e.g. number of cells) - * @param numPts secondary dimension (e.g. number of gauss points per cell) - */ - virtual void resizeFields( localIndex const GEOS_UNUSED_PARAM( size ), - localIndex const GEOS_UNUSED_PARAM( numPts ) ) - { - // Nothing to do - } - private: /** diff --git a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp index ffb65ae2fcf..717fb07e8a9 100644 --- a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp +++ b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp @@ -81,20 +81,19 @@ void CapillaryPressureBase::postInputInitialization() m_phaseOrder[m_phaseTypes[ip]] = ip; } - // call to correctly set member array tertiary sizes on the 'main' material object - resizeFields( 0, 0 ); // TODO figure out why this is really needed - // set labels on array wrappers for plottable fields setLabels(); } -void CapillaryPressureBase::resizeFields( localIndex const size, - localIndex const numPts ) +void CapillaryPressureBase::allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) { integer const NP = numFluidPhases(); - m_phaseCapPressure.resize( size, numPts, NP ); - m_dPhaseCapPressure_dPhaseVolFrac.resize( size, numPts, NP, NP ); + m_phaseCapPressure.resize( 0, numConstitutivePointsPerParentIndex, NP ); + m_dPhaseCapPressure_dPhaseVolFrac.resize( 0, numConstitutivePointsPerParentIndex, NP, NP ); + + ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); } void CapillaryPressureBase::setLabels() diff --git a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp index b118ee38ff4..9ab2dc69fcd 100644 --- a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp +++ b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp @@ -104,6 +104,9 @@ class CapillaryPressureBase : public ConstitutiveBase CapillaryPressureBase( string const & name, dataRepository::Group * const parent ); + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) override; + /** * @brief Initialize the capillary pressure state (needed when capillary pressure depends on porosity and permeability) * @param[in] initialPorosity the initial porosity field after reservoir initialization @@ -169,13 +172,6 @@ class CapillaryPressureBase : public ConstitutiveBase virtual void postInputInitialization() override; - /** - * @brief Function called internally to resize member arrays - * @param size primary dimension (e.g. number of cells) - * @param numPts secondary dimension (e.g. number of gauss points per cell) - */ - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - // phase names read from input string_array m_phaseNames; diff --git a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp index 3d61f82d308..430a623fd1e 100644 --- a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp +++ b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp @@ -336,11 +336,12 @@ JFunctionCapillaryPressure::createKernelWrapper() m_dPhaseCapPressure_dPhaseVolFrac ); } -void JFunctionCapillaryPressure::resizeFields( localIndex const size, localIndex const numPts ) +void JFunctionCapillaryPressure::allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) { - CapillaryPressureBase::resizeFields( size, numPts ); + m_jFuncMultiplier.resize( 0, numFluidPhases()-1 ); - m_jFuncMultiplier.resize( size, numFluidPhases()-1 ); + CapillaryPressureBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); } diff --git a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp index 4c8dbd77b18..fd3a52aa981 100644 --- a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp +++ b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp @@ -46,6 +46,9 @@ class JFunctionCapillaryPressure : public CapillaryPressureBase JFunctionCapillaryPressure( std::string const & name, dataRepository::Group * const parent ); + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) override; + virtual void initializeRockState( arrayView2d< real64 const > const & initialPorosity, arrayView3d< real64 const > const & initialPermeability ) const override; @@ -122,15 +125,6 @@ class JFunctionCapillaryPressure : public CapillaryPressureBase Z, ///< use permz only }; -protected: - - /** - * @brief Function called internally to resize member arrays - * @param size primary dimension (e.g. number of cells) - * @param numPts secondary dimension (e.g. number of gauss points per cell) - */ - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - private: virtual void postInputInitialization() override; diff --git a/src/coreComponents/constitutive/contact/CoulombFriction.cpp b/src/coreComponents/constitutive/contact/CoulombFriction.cpp index 4df5607d4eb..08c62be941d 100644 --- a/src/coreComponents/constitutive/contact/CoulombFriction.cpp +++ b/src/coreComponents/constitutive/contact/CoulombFriction.cpp @@ -60,11 +60,12 @@ void CoulombFriction::postInputInitialization() } -void CoulombFriction::resizeFields( localIndex const size, localIndex const numPts ) +void CoulombFriction::allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) { - FrictionBase::resizeFields( size, numPts ); + m_elasticSlip.resize( 0, 2 ); - m_elasticSlip.resize( 0, 2 ); // 0 to resize and assign default value later + FrictionBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); } CoulombFrictionUpdates CoulombFriction::createKernelUpdates() const diff --git a/src/coreComponents/constitutive/contact/CoulombFriction.hpp b/src/coreComponents/constitutive/contact/CoulombFriction.hpp index 06935f5386d..2b2336f8e9e 100644 --- a/src/coreComponents/constitutive/contact/CoulombFriction.hpp +++ b/src/coreComponents/constitutive/contact/CoulombFriction.hpp @@ -170,6 +170,9 @@ class CoulombFriction : public FrictionBase ///@} + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) override final; + /// Type of kernel wrapper for in-kernel update using KernelWrapper = CoulombFrictionUpdates; @@ -201,13 +204,6 @@ class CoulombFriction : public FrictionBase virtual void postInputInitialization() override; - /** - * @brief Function called internally to resize member arrays - * @param size primary dimension (e.g. number of cells) - * @param numPts secondary dimension (e.g. number of gauss points per cell) - */ - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - private: /// The shear stiffness diff --git a/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp b/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp index 9717c3e4404..218057536b1 100644 --- a/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp +++ b/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp @@ -62,8 +62,10 @@ void HydraulicApertureTable::postInputInitialization() InputError ); } -void HydraulicApertureTable::resizeFields( localIndex const GEOS_UNUSED_PARAM( size ), localIndex const GEOS_UNUSED_PARAM( numPts ) ) +void HydraulicApertureTable::allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) { + HydraulicApertureBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); // TODO this should not be here diff --git a/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp b/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp index fa06fc7f816..2f7375e0615 100644 --- a/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp +++ b/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp @@ -102,6 +102,9 @@ class HydraulicApertureTable : public HydraulicApertureBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) override final; + /// Type of kernel wrapper for in-kernel update using KernelWrapper = HydraulicApertureTableUpdates; @@ -128,8 +131,6 @@ class HydraulicApertureTable : public HydraulicApertureBase virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /** * @brief Validate the values provided in the aperture table * @param[in] apertureTable the effective aperture vs aperture table diff --git a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.cpp b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.cpp index 762cfd75068..f5cc35b27d5 100644 --- a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.cpp +++ b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.cpp @@ -36,11 +36,12 @@ ConstantDiffusion::ConstantDiffusion( string const & name, Group * const parent setDescription( "xx, yy, and zz components of a diffusivity tensor [m^2/s]" ); } -void ConstantDiffusion::resizeFields( localIndex const size, localIndex const numPts ) +void ConstantDiffusion::allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) { - DiffusionBase::resizeFields( size, numPts ); + DiffusionBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - for( localIndex ei = 0; ei < size; ++ei ) // TODO move into initializeState? + for( localIndex ei = 0; ei < parent.size(); ++ei ) // TODO move into initializeState? { // NOTE: enforcing 1 quadrature point for( localIndex q = 0; q < 1; ++q ) diff --git a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp index d847984c617..fd6b1162b55 100644 --- a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp +++ b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp @@ -70,6 +70,9 @@ class ConstantDiffusion : public DiffusionBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) override final; + /// Type of kernel wrapper for in-kernel update using KernelWrapper = ConstantDiffusionUpdate; @@ -92,13 +95,6 @@ class ConstantDiffusion : public DiffusionBase virtual void postInputInitialization() override; - /** - * @brief Function called internally to resize member arrays - * @param size primary dimension (e.g. number of cells) - * @param numPts secondary dimension (e.g. number of gauss points per cell) - */ - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - private: /// default diffusivity in the subRegion diff --git a/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp b/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp index f0189510d4a..0bb51fdb64f 100644 --- a/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp +++ b/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp @@ -68,14 +68,17 @@ void DiffusionBase::postInputInitialization() m_phaseDiffusivityMultiplier.resize( 0, 0, 3 ); } -void DiffusionBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) +void DiffusionBase::allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) { // NOTE: enforcing 1 quadrature point - m_diffusivity.resize( size, 1, 3 ); - m_dDiffusivity_dTemperature.resize( size, 1, 3 ); - m_phaseDiffusivityMultiplier.resize( size, 1, 3 ); + m_diffusivity.resize( 0, 1, 3 ); + m_dDiffusivity_dTemperature.resize( 0, 1, 3 ); + m_phaseDiffusivityMultiplier.resize( 0, 1, 3 ); - for( localIndex ei = 0; ei < size; ++ei ) // TODO move into initializeState? + ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + + for( localIndex ei = 0; ei < parent.size(); ++ei ) // TODO move into initializeState? { // NOTE: enforcing 1 quadrature point for( localIndex q = 0; q < 1; ++q ) diff --git a/src/coreComponents/constitutive/diffusion/DiffusionBase.hpp b/src/coreComponents/constitutive/diffusion/DiffusionBase.hpp index 0ab8ba58db8..d115d186660 100644 --- a/src/coreComponents/constitutive/diffusion/DiffusionBase.hpp +++ b/src/coreComponents/constitutive/diffusion/DiffusionBase.hpp @@ -101,6 +101,9 @@ class DiffusionBase : public ConstitutiveBase */ DiffusionBase( string const & name, dataRepository::Group * const parent ); + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) override; + /** * @brief Getter for the number of fluid phases * @return the number of fluid phases @@ -159,13 +162,6 @@ class DiffusionBase : public ConstitutiveBase virtual void postInputInitialization() override; - /** - * @brief Function called internally to resize member arrays - * @param size primary dimension (e.g. number of cells) - * @param numPts secondary dimension (e.g. number of gauss points per cell) - */ - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /// phase names read from input string_array m_phaseNames; diff --git a/src/coreComponents/constitutive/dispersion/DispersionBase.cpp b/src/coreComponents/constitutive/dispersion/DispersionBase.cpp index 7eacf593439..86917c25248 100644 --- a/src/coreComponents/constitutive/dispersion/DispersionBase.cpp +++ b/src/coreComponents/constitutive/dispersion/DispersionBase.cpp @@ -34,10 +34,13 @@ DispersionBase::DispersionBase( string const & name, Group * const parent ) registerField< fields::dispersion::dispersivity >( &m_dispersivity ); } -void DispersionBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) +void DispersionBase::allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) { // NOTE: enforcing 1 quadrature point - m_dispersivity.resize( size, 1, 3 ); + m_dispersivity.resize( 0, 1, 3 ); + + ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); } } // namespace constitutive diff --git a/src/coreComponents/constitutive/dispersion/DispersionBase.hpp b/src/coreComponents/constitutive/dispersion/DispersionBase.hpp index 793c18d543c..4ac423e1970 100644 --- a/src/coreComponents/constitutive/dispersion/DispersionBase.hpp +++ b/src/coreComponents/constitutive/dispersion/DispersionBase.hpp @@ -92,6 +92,9 @@ class DispersionBase : public ConstitutiveBase */ DispersionBase( string const & name, dataRepository::Group * const parent ); + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) override final; + /** * @brief Getter for the dispersivities in the subRegion * @return an arrayView of dispersivities @@ -118,13 +121,6 @@ class DispersionBase : public ConstitutiveBase protected: - /** - * @brief Function called internally to resize member arrays - * @param size primary dimension (e.g. number of cells) - * @param numPts secondary dimension (e.g. number of gauss points per cell) - */ - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /// cell-wise dispersivity in the subregion /// TODO: support full tensor if linear isotropic diffusion is no longer enough array3d< real64 > m_dispersivity; diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp index c8209981315..2a71cdf1879 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp @@ -89,40 +89,43 @@ MultiFluidBase::MultiFluidBase( string const & name, Group * const parent ) registerField< fields::multifluid::dTotalDensity >( &m_totalDensity.derivs ); } -void MultiFluidBase::resizeFields( localIndex const size, localIndex const numPts ) +void MultiFluidBase::allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) { integer const numPhase = numFluidPhases(); integer const numComp = numFluidComponents(); integer const numDof = numComp + 2; - m_phaseFraction.value.resize( size, numPts, numPhase ); - m_phaseFraction.derivs.resize( size, numPts, numPhase, numDof ); + m_phaseFraction.value.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); + m_phaseFraction.derivs.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numDof ); - m_phaseDensity.value.resize( size, numPts, numPhase ); - m_phaseDensity_n.resize( size, numPts, numPhase ); - m_phaseDensity.derivs.resize( size, numPts, numPhase, numDof ); + m_phaseDensity.value.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); + m_phaseDensity_n.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); + m_phaseDensity.derivs.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numDof ); - m_phaseMassDensity.value.resize( size, numPts, numPhase ); - m_phaseMassDensity.derivs.resize( size, numPts, numPhase, numDof ); + m_phaseMassDensity.value.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); + m_phaseMassDensity.derivs.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numDof ); - m_phaseViscosity.value.resize( size, numPts, numPhase ); - m_phaseViscosity.derivs.resize( size, numPts, numPhase, numDof ); + m_phaseViscosity.value.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); + m_phaseViscosity.derivs.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numDof ); - m_phaseEnthalpy.value.resize( size, numPts, numPhase ); - m_phaseEnthalpy_n.resize( size, numPts, numPhase ); - m_phaseEnthalpy.derivs.resize( size, numPts, numPhase, numDof ); + m_phaseEnthalpy.value.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); + m_phaseEnthalpy_n.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); + m_phaseEnthalpy.derivs.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numDof ); - m_phaseInternalEnergy.value.resize( size, numPts, numPhase ); - m_phaseInternalEnergy_n.resize( size, numPts, numPhase ); - m_phaseInternalEnergy.derivs.resize( size, numPts, numPhase, numDof ); + m_phaseInternalEnergy.value.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); + m_phaseInternalEnergy_n.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); + m_phaseInternalEnergy.derivs.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numDof ); - m_phaseCompFraction.value.resize( size, numPts, numPhase, numComp ); - m_phaseCompFraction_n.resize( size, numPts, numPhase, numComp ); - m_phaseCompFraction.derivs.resize( size, numPts, numPhase, numComp, numDof ); + m_phaseCompFraction.value.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numComp ); + m_phaseCompFraction_n.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numComp ); + m_phaseCompFraction.derivs.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numComp, numDof ); - m_totalDensity.value.resize( size, numPts ); - m_totalDensity_n.resize( size, numPts ); - m_totalDensity.derivs.resize( size, numPts, numDof ); + m_totalDensity.value.resize( 0, numConstitutivePointsPerParentIndex ); + m_totalDensity_n.resize( 0, numConstitutivePointsPerParentIndex ); + m_totalDensity.derivs.resize( 0, numConstitutivePointsPerParentIndex, numDof ); + + ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); } void MultiFluidBase::setLabels() @@ -199,9 +202,6 @@ void MultiFluidBase::postInputInitialization() uniqueNames.insert( lowerCaseName ); } - // call to correctly set member array tertiary sizes on the 'main' material object - resizeFields( 0, 0 ); // TODO figure out why this is really needed - // set labels on array wrappers for plottable fields setLabels(); } diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp index 4a2b00d0a2c..73ca97d8efd 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp @@ -38,6 +38,9 @@ class MultiFluidBase : public ConstitutiveBase MultiFluidBase( string const & name, Group * const parent ); + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numConstitutivePointsPerParentIndex ); + // *** MultiFluid-specific interface /** @@ -641,8 +644,6 @@ class MultiFluidBase : public ConstitutiveBase private: - - /** * @brief Called internally to set array dim labels. */ @@ -650,13 +651,6 @@ class MultiFluidBase : public ConstitutiveBase protected: - /** - * @brief Function called internally to resize member arrays - * @param size primary dimension (e.g. number of cells) - * @param numPts secondary dimension (e.g. number of gauss points per cell) - */ - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - virtual void postInputInitialization() override; // flag indicating whether input/output component fractions are treated as mass fractions diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp index 1eaa74c9b7e..e91b3059da2 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp @@ -100,11 +100,12 @@ string CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::catalogNam } template< typename FLASH, typename PHASE1, typename PHASE2, typename PHASE3 > -void CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::resizeFields( localIndex const size, localIndex const numPts ) +void CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::allocateConstitutiveData( Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) { - MultiFluidBase::resizeFields( size, numPts ); + m_kValues.resize( 0, numConstitutivePointsPerParentIndex, numFluidPhases()-1, numFluidComponents() ); - m_kValues.resize( size, numPts, numFluidPhases()-1, numFluidComponents() ); + MultiFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); // Zero k-Values to force initialisation with Wilson k-Values m_kValues.zero(); diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp index 98a3b356783..121298d6fbb 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp @@ -73,6 +73,9 @@ class CompositionalMultiphaseFluid : public MultiFluidBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) override; + static constexpr bool isThermalType(){ return false; } // TODO: This method should be implemented if an incorrect extrapolation of the pressure and temperature is encountered in the kernel @@ -110,8 +113,6 @@ class CompositionalMultiphaseFluid : public MultiFluidBase virtual void initializePostSubGroups() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - private: // Create the fluid models void createModels(); diff --git a/src/coreComponents/constitutive/fluid/multifluid/constant/InvariantImmiscibleFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/constant/InvariantImmiscibleFluid.hpp index a38e7c999b3..243198fa9b4 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/constant/InvariantImmiscibleFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/constant/InvariantImmiscibleFluid.hpp @@ -135,16 +135,6 @@ class InvariantImmiscibleFluid : public MultiFluidBase */ KernelWrapper createKernelWrapper() const; - /** - * @brief Initialize the fluid model with specified number of cells and quadrature points - * @param[in] numCells Number of cells/elements - * @param[in] numPoints Number of quadrature points per cell - */ - void initialize( localIndex const numCells, localIndex const numPoints ) - { - resizeFields( numCells, numPoints ); - } - protected: virtual void postInputInitialization() override; diff --git a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.cpp index 09f7878e68b..f173292cd77 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.cpp @@ -71,18 +71,19 @@ void ReactiveMultiFluid::postInputInitialization() createChemicalReactions(); } -void ReactiveMultiFluid::resizeFields( localIndex const size, localIndex const numPts ) +void ReactiveMultiFluid::allocateConstitutiveData( Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) { - MultiFluidBase::resizeFields( size, numPts ); - integer const numPrimarySpecies = this->numPrimarySpecies(); integer const numSecondarySpecies = this->numSecondarySpecies(); integer const numKineticReactions = this->numKineticReactions(); - m_primarySpeciesConcentration.resize( size, numPrimarySpecies ); - m_secondarySpeciesConcentration.resize( size, numSecondarySpecies ); - m_primarySpeciesTotalConcentration.resize( size, numPrimarySpecies ); - m_kineticReactionRates.resize( size, numKineticReactions ); + m_primarySpeciesConcentration.resize( 0, numPrimarySpecies ); + m_secondarySpeciesConcentration.resize( 0, numSecondarySpecies ); + m_primarySpeciesTotalConcentration.resize( 0, numPrimarySpecies ); + m_kineticReactionRates.resize( 0, numKineticReactions ); + + MultiFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); } void ReactiveMultiFluid::createChemicalReactions() diff --git a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp index 71ebd796571..300e1fc0360 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp @@ -47,6 +47,9 @@ class ReactiveMultiFluid : public MultiFluidBase deliverClone( string const & name, Group * const parent ) const override; + virtual void allocateConstitutiveData( Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) override; + virtual bool isThermal() const override; arrayView2d< real64 const, compflow::USD_COMP > primarySpeciesConcentration() const @@ -176,8 +179,6 @@ class ReactiveMultiFluid : public MultiFluidBase void createChemicalReactions(); - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /// Reaction related terms integer m_numPrimarySpecies; diff --git a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp index 47d6e5d8d6b..252111f32a5 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp @@ -79,9 +79,10 @@ CompressibleSinglePhaseFluid::CompressibleSinglePhaseFluid( string const & name, } -void CompressibleSinglePhaseFluid::resizeFields( localIndex const size, localIndex const numPts ) +void CompressibleSinglePhaseFluid::allocateConstitutiveData( Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) { - SingleFluidBase::resizeFields( size, numPts ); + SingleFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); getField< fields::singlefluid::density >().setApplyDefaultValue( m_referenceDensity ); getField< fields::singlefluid::viscosity >().setApplyDefaultValue( m_referenceViscosity ); diff --git a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.hpp b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.hpp index 8fbf991c070..e9e8db9f0f7 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.hpp @@ -150,6 +150,9 @@ class CompressibleSinglePhaseFluid : public SingleFluidBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) override; + /// Type of kernel wrapper for in-kernel update (TODO: support multiple EAT, not just linear) using KernelWrapper = CompressibleSinglePhaseUpdate< ExponentApproximationType::Linear, ExponentApproximationType::Linear >; @@ -179,8 +182,6 @@ class CompressibleSinglePhaseFluid : public SingleFluidBase virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /// default density value real64 m_defaultDensity; diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp index 681771c372a..86ce6727c10 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp @@ -53,9 +53,12 @@ ParticleFluidBase::ParticleFluidBase( string const & name, Group * const parent registerField< fields::particlefluid::proppantPackPermeability >( &m_proppantPackPermeability ); } -void ParticleFluidBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) +void ParticleFluidBase::allocateConstitutiveData( Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) { - m_dSettlingFactor_dComponentConcentration.resize( size, MAX_NUM_COMPONENTS ); + m_dSettlingFactor_dComponentConcentration.resize( 0, MAX_NUM_COMPONENTS ); + + ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); } } //namespace constitutive diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.hpp b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.hpp index 10e18c7b233..5549407dd6f 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.hpp @@ -151,12 +151,13 @@ class ParticleFluidBase : public ConstitutiveBase ParticleFluidBase( string const & name, Group * const parent ); + virtual void allocateConstitutiveData( Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) override; + static constexpr localIndex MAX_NUM_COMPONENTS = 4; protected: - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - array1d< real64 > m_settlingFactor; array1d< real64 > m_dSettlingFactor_dPressure; array1d< real64 > m_dSettlingFactor_dProppantConcentration; diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.cpp index 649ef50415b..840c7800c77 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.cpp @@ -62,9 +62,10 @@ ProppantSlurryFluid::ProppantSlurryFluid( string const & name, Group * const par } -void ProppantSlurryFluid::resizeFields( localIndex const size, localIndex const numPts ) +void ProppantSlurryFluid::allocateConstitutiveData( Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) { - SlurryFluidBase::resizeFields( size, numPts ); + SlurryFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); m_density.value.setValues< serialPolicy >( m_referenceDensity ); m_viscosity.value.setValues< serialPolicy >( m_referenceViscosity ); diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.hpp b/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.hpp index 9bb4632062c..eb2c4eaa06a 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.hpp @@ -295,6 +295,9 @@ class ProppantSlurryFluid : public SlurryFluidBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) override; + using KernelWrapper = ProppantSlurryFluidUpdate; /** @@ -334,8 +337,6 @@ class ProppantSlurryFluid : public SlurryFluidBase virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - private: real64 m_compressibility; diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp index d6c5791a09f..d286c41725e 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp @@ -78,25 +78,28 @@ void SingleFluidBase::saveConvergedState() const } ); } -void SingleFluidBase::resizeFields( localIndex const size, localIndex const numPts ) +void SingleFluidBase::allocateConstitutiveData( Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) { // density - m_density.value.resize( size, numPts ); - m_density.derivs.resize( size, numPts, m_numDOF ); - m_density_n.resize( size, numPts ); + m_density.value.resize( 0, numConstitutivePointsPerParentIndex ); + m_density.derivs.resize( 0, numConstitutivePointsPerParentIndex, m_numDOF ); + m_density_n.resize( 0, numConstitutivePointsPerParentIndex ); // viscosity - m_viscosity.value.resize( size, numPts ); - m_viscosity.derivs.resize( size, numPts, m_numDOF ); + m_viscosity.value.resize( 0, numConstitutivePointsPerParentIndex ); + m_viscosity.derivs.resize( 0, numConstitutivePointsPerParentIndex, m_numDOF ); // internal energy - m_internalEnergy.value.resize( size, numPts ); - m_internalEnergy.derivs.resize( size, numPts, m_numDOF ); - m_internalEnergy_n.resize( size, numPts ); + m_internalEnergy.value.resize( 0, numConstitutivePointsPerParentIndex ); + m_internalEnergy.derivs.resize( 0, numConstitutivePointsPerParentIndex, m_numDOF ); + m_internalEnergy_n.resize( 0, numConstitutivePointsPerParentIndex ); // enthalpy - m_enthalpy.value.resize( size, numPts ); - m_enthalpy.derivs.resize( size, numPts, m_numDOF ); + m_enthalpy.value.resize( 0, numConstitutivePointsPerParentIndex ); + m_enthalpy.derivs.resize( 0, numConstitutivePointsPerParentIndex, m_numDOF ); + + ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); } } //namespace constitutive diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp index efd525934d3..da1d017ddf3 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp @@ -224,6 +224,9 @@ class SingleFluidBase : public ConstitutiveBase */ SingleFluidBase( string const & name, Group * const parent ); + virtual void allocateConstitutiveData( Group & parent, + localIndex const numConstitutivePointsPerParentIndex ) override; + virtual void saveConvergedState() const override; // *** SingleFluid-specific interface @@ -279,8 +282,6 @@ class SingleFluidBase : public ConstitutiveBase virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - // Degrees of freedom in fluid characterization integer m_numDOF; //START_SPHINX_INCLUDE_00 diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp index ea291ee5eaf..3f2f93196bd 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp @@ -104,33 +104,33 @@ localIndex SlurryFluidBase::numFluidComponents() const return LvArray::integerConversion< localIndex >( m_componentNames.size()); } -void SlurryFluidBase::resizeFields( localIndex const size, localIndex const numPts ) +void SlurryFluidBase::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - SingleFluidBase::resizeFields( size, numPts ); - localIndex const NC = numFluidComponents(); m_numDOF = 2 + NC; // pressure,proppantconc, NC compconc // These are also sized in m_dDenisty in base class , only dP and dT are populated // Future dev should incorporate concentration derivatives in dDensity - m_dDensity_dProppantConc.resize( size, numPts ); - m_dDensity_dCompConc.resize( size, numPts, NC ); + m_dDensity_dProppantConc.resize( 0, numPts ); + m_dDensity_dCompConc.resize( 0, numPts, NC ); - m_componentDensity.resize( size, numPts, NC ); - m_dCompDens_dPres.resize( size, numPts, NC ); - m_dCompDens_dCompConc.resize( size, numPts, NC, NC ); + m_componentDensity.resize( 0, numPts, NC ); + m_dCompDens_dPres.resize( 0, numPts, NC ); + m_dCompDens_dCompConc.resize( 0, numPts, NC, NC ); - m_fluidDensity.value.resize( size, numPts ); - m_dFluidDens_dPres.resize( size, numPts ); - m_dFluidDens_dCompConc.resize( size, numPts, NC ); + m_fluidDensity.value.resize( 0, numPts ); + m_dFluidDens_dPres.resize( 0, numPts ); + m_dFluidDens_dCompConc.resize( 0, numPts, NC ); - m_fluidViscosity.resize( size, numPts ); - m_dFluidVisc_dPres.resize( size, numPts ); - m_dFluidVisc_dCompConc.resize( size, numPts, NC ); + m_fluidViscosity.resize( 0, numPts ); + m_dFluidVisc_dPres.resize( 0, numPts ); + m_dFluidVisc_dCompConc.resize( 0, numPts, NC ); - m_dViscosity_dProppantConc.resize( size, numPts ); - m_dViscosity_dCompConc.resize( size, numPts, NC ); + m_dViscosity_dProppantConc.resize( 0, numPts ); + m_dViscosity_dCompConc.resize( 0, numPts, NC ); + SingleFluidBase::allocateConstitutiveData( parent, numPts ); } diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp index 84f80580b0a..156f8984807 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp @@ -254,6 +254,9 @@ class SlurryFluidBase : public SingleFluidBase SlurryFluidBase( string const & name, Group * const parent ); + virtual void allocateConstitutiveData( Group & parent, + localIndex const numPts ); + static constexpr localIndex MAX_NUM_COMPONENTS = 3; localIndex numFluidComponents() const; @@ -319,8 +322,6 @@ class SlurryFluidBase : public SingleFluidBase virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - string_array m_componentNames; array1d< real64 > m_defaultComponentDensity; diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp index ac1a0d96785..8b648cf2e31 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp @@ -62,9 +62,10 @@ ThermalCompressibleSinglePhaseFluid::ThermalCompressibleSinglePhaseFluid( string } -void ThermalCompressibleSinglePhaseFluid::resizeFields( localIndex const size, localIndex const numPts ) +void ThermalCompressibleSinglePhaseFluid::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - CompressibleSinglePhaseFluid::resizeFields( size, numPts ); + CompressibleSinglePhaseFluid::allocateConstitutiveData( parent, numPts ); m_internalEnergy.value.setValues< serialPolicy >( m_referenceInternalEnergy ); } diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp index b952da91488..50868af0b7c 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp @@ -199,6 +199,9 @@ class ThermalCompressibleSinglePhaseFluid : public CompressibleSinglePhaseFluid virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, + localIndex const numPts ) override; + using CompressibleSinglePhaseFluid::m_densityModelType; /// Type of kernel wrapper for in-kernel update (TODO: support multiple EAT, not just linear) @@ -223,8 +226,6 @@ class ThermalCompressibleSinglePhaseFluid : public CompressibleSinglePhaseFluid virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - private: /// scalar fluid thermal expansion coefficient diff --git a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.cpp b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.cpp index 65b8d5f44a9..3e75ef209f1 100644 --- a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.cpp +++ b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.cpp @@ -69,16 +69,19 @@ TwoPhaseImmiscibleFluid::TwoPhaseImmiscibleFluid( string const & name, Group * c } -void TwoPhaseImmiscibleFluid::resizeFields( localIndex const size, localIndex const numPts ) +void TwoPhaseImmiscibleFluid::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { // Assume sole dependency on pressure, i.e. one derivative - m_phaseDensity.value.resize( size, numPts, 2 ); - m_phaseDensity.derivs.resize( size, numPts, 2, 1 ); + m_phaseDensity.value.resize( 0, numPts, 2 ); + m_phaseDensity.derivs.resize( 0, numPts, 2, 1 ); - m_phaseDensity_n.resize( size, numPts, 2 ); + m_phaseDensity_n.resize( 0, numPts, 2 ); - m_phaseViscosity.value.resize( size, numPts, 2 ); - m_phaseViscosity.derivs.resize( size, numPts, 2, 1 ); + m_phaseViscosity.value.resize( 0, numPts, 2 ); + m_phaseViscosity.derivs.resize( 0, numPts, 2, 1 ); + + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } diff --git a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp index 9f12321d971..5b9f6e38f7e 100644 --- a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp +++ b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp @@ -61,7 +61,8 @@ class TwoPhaseImmiscibleFluid : public ConstitutiveBase ///@} - + virtual void allocateConstitutiveData( Group & parent, + localIndex const numPts ); /** * @brief Getter for the fluid phase names @@ -208,8 +209,6 @@ class TwoPhaseImmiscibleFluid : public ConstitutiveBase array3d< real64, multifluid::LAYOUT_PHASE > m_phaseDensity_n; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - virtual void postInputInitialization() override; virtual void initializePostSubGroups() override; diff --git a/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp b/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp index d7eee445cba..e2237f7ebe6 100644 --- a/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp @@ -55,12 +55,13 @@ CarmanKozenyPermeability::deliverClone( string const & name, return PermeabilityBase::deliverClone( name, parent ); } -void CarmanKozenyPermeability::resizeFields( localIndex const size, localIndex const numPts ) +void CarmanKozenyPermeability::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - PermeabilityBase::resizeFields( size, numPts ); - // NOTE: enforcing 1 quadrature point - m_dPerm_dPorosity.resize( size, 1, 3 ); + m_dPerm_dPorosity.resize( 0, 1, 3 ); + + PermeabilityBase::allocateConstitutiveData( parent, numPts ); } REGISTER_CATALOG_ENTRY( ConstitutiveBase, CarmanKozenyPermeability, string const &, Group * const ) diff --git a/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.hpp b/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.hpp index f50cacdfeb7..ac05a00ef7f 100644 --- a/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.hpp @@ -92,6 +92,9 @@ class CarmanKozenyPermeability : public PermeabilityBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, + localIndex const numPts ) override; + /// Type of kernel wrapper for in-kernel update using KernelWrapper = CarmanKozenyPermeabilityUpdate; @@ -116,11 +119,7 @@ class CarmanKozenyPermeability : public PermeabilityBase static constexpr char const * particleDiameterString() { return "particleDiameter"; } static constexpr char const * sphericityString() { return "sphericity"; } static constexpr char const * anisotropyString() { return "anisotropy"; } - } viewKeys; - -protected: - - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + }; private: diff --git a/src/coreComponents/constitutive/permeability/ConstantPermeability.cpp b/src/coreComponents/constitutive/permeability/ConstantPermeability.cpp index be2d1987c6e..1e58663783a 100644 --- a/src/coreComponents/constitutive/permeability/ConstantPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ConstantPermeability.cpp @@ -44,15 +44,16 @@ ConstantPermeability::deliverClone( string const & name, return PermeabilityBase::deliverClone( name, parent ); } -void ConstantPermeability::resizeFields( localIndex const size, localIndex const numPts ) +void ConstantPermeability::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - PermeabilityBase::resizeFields( size, numPts ); + PermeabilityBase::allocateConstitutiveData( parent, numPts ); // TODO move into initializeState? integer const numQuad = 1; // NOTE: enforcing 1 quadrature point - for( localIndex ei = 0; ei < size; ++ei ) + for( localIndex ei = 0; ei < parent.size(); ++ei ) { for( localIndex q = 0; q < numQuad; ++q ) { diff --git a/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp b/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp index 2a2daf75ff1..be744272afc 100644 --- a/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp @@ -55,6 +55,9 @@ class ConstantPermeability : public PermeabilityBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, + localIndex const numPts ) override; + /// Type of kernel wrapper for in-kernel update using KernelWrapper = ConstantPermeabilityUpdate; @@ -80,8 +83,6 @@ class ConstantPermeability : public PermeabilityBase virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - private: R1Tensor m_permeabilityComponents; diff --git a/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.cpp b/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.cpp index e70d6f005b3..2ce96485b38 100644 --- a/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.cpp @@ -44,13 +44,14 @@ ExponentialDecayPermeability::ExponentialDecayPermeability( string const & name, registerField< fields::permeability::dPerm_dDispJump >( &m_dPerm_dDispJump ); } -void ExponentialDecayPermeability::resizeFields( localIndex const size, localIndex const numPts ) +void ExponentialDecayPermeability::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - PermeabilityBase::resizeFields( size, numPts ); - // NOTE: enforcing 1 quadrature point - m_dPerm_dTraction.resize( size, 1, 3, 3 ); - m_dPerm_dDispJump.resize( size, 1, 3, 3 ); + m_dPerm_dTraction.resize( 0, 1, 3, 3 ); + m_dPerm_dDispJump.resize( 0, 1, 3, 3 ); + + PermeabilityBase::allocateConstitutiveData( parent, numPts ); } REGISTER_CATALOG_ENTRY( ConstitutiveBase, ExponentialDecayPermeability, string const &, Group * const ) diff --git a/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.hpp b/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.hpp index 24c9702a29e..64327b4b578 100644 --- a/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.hpp @@ -98,6 +98,9 @@ class ExponentialDecayPermeability : public PermeabilityBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, + localIndex const numPts ) override; + /// Type of kernel wrapper for in-kernel update using KernelWrapper = ExponentialDecayPermeabilityUpdate; @@ -115,10 +118,6 @@ class ExponentialDecayPermeability : public PermeabilityBase m_initialPermeability ); } - -protected: - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - private: /// Derivative of fracture permeability to traction acting on fracture surfaces diff --git a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp index e288fa9828b..9933163056c 100644 --- a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp @@ -43,13 +43,17 @@ ParallelPlatesPermeability::ParallelPlatesPermeability( string const & name, Gro registerField< fields::permeability::dPerm_dDispJump >( &m_dPerm_dDispJump ); } -void ParallelPlatesPermeability::resizeFields( localIndex const size, localIndex const numPts ) +void ParallelPlatesPermeability::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - PermeabilityBase::resizeFields( size, numPts ); - // NOTE: enforcing 1 quadrature point - m_dPerm_dDispJump.resize( size, 1, 3, 3 ); + m_dPerm_dDispJump.resize( 0, 1, 3, 3 ); + + PermeabilityBase::allocateConstitutiveData( parent, numPts ); +} +void ParallelPlatesPermeability::postInputInitialization() +{ if( m_transversalPermeability > -1 ) { m_updateTransversalComponent = false; diff --git a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.hpp b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.hpp index a19d8e714a2..e5a632cc855 100644 --- a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.hpp @@ -112,6 +112,9 @@ class ParallelPlatesPermeability : public PermeabilityBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, + localIndex const numPts ) override; + virtual void initializeState() const override final; /// Type of kernel wrapper for in-kernel update @@ -137,7 +140,7 @@ class ParallelPlatesPermeability : public PermeabilityBase protected: - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; + virtual void postInputInitialization() override; private: diff --git a/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp b/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp index 1c8e46c2c6a..83ce328d510 100644 --- a/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp +++ b/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp @@ -52,11 +52,14 @@ void PermeabilityBase::scaleHorizontalPermeability( arrayView1d< real64 const > } } -void PermeabilityBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) +void PermeabilityBase::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { // NOTE: enforcing 1 quadrature point - m_permeability.resize( size, 1, 3 ); - m_dPerm_dPressure.resize( size, 1, 3 ); + m_permeability.resize( 0, 1, 3 ); + m_dPerm_dPressure.resize( 0, 1, 3 ); + + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } } diff --git a/src/coreComponents/constitutive/permeability/PermeabilityBase.hpp b/src/coreComponents/constitutive/permeability/PermeabilityBase.hpp index b613303069e..b7f6c30b9f0 100644 --- a/src/coreComponents/constitutive/permeability/PermeabilityBase.hpp +++ b/src/coreComponents/constitutive/permeability/PermeabilityBase.hpp @@ -109,6 +109,9 @@ class PermeabilityBase : public ConstitutiveBase PermeabilityBase( string const & name, Group * const parent ); + virtual void allocateConstitutiveData( Group & parent, + localIndex const numPts ) override; + /** * @brief Const/non-mutable accessor for permeability. * @return Accessor @@ -135,8 +138,6 @@ class PermeabilityBase : public ConstitutiveBase protected: - virtual void resizeFields( localIndex const size, localIndex const numPts ); - /// Vector of absolute permeability array3d< real64 > m_permeability; diff --git a/src/coreComponents/constitutive/permeability/PressurePermeability.cpp b/src/coreComponents/constitutive/permeability/PressurePermeability.cpp index 20fb4237367..df88adf1ea4 100644 --- a/src/coreComponents/constitutive/permeability/PressurePermeability.cpp +++ b/src/coreComponents/constitutive/permeability/PressurePermeability.cpp @@ -64,16 +64,17 @@ void PressurePermeability::postInputInitialization() { for( localIndex i=0; i < 3; i++ ) { - GEOS_ERROR_IF( fabs( m_pressureDependenceConstants[i] ) < 1e-15 && m_presModelType == PressureModelType::Hyperbolic, + GEOS_ERROR_IF( std::abs( m_pressureDependenceConstants[i] ) < 1e-15 && m_presModelType == PressureModelType::Hyperbolic, getDataContext() << ": the pressure dependent constant at component " << i << " is too close to zero, which is not allowed for the hyperbolic model." ); } } -void PressurePermeability::resizeFields( localIndex const size, localIndex const numPts ) +void PressurePermeability::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - PermeabilityBase::resizeFields( size, numPts ); - m_referencePermeability.resize( 0, 1, 3 ); // 0 to resize and assign default value later + + PermeabilityBase::allocateConstitutiveData( parent, numPts ); } void PressurePermeability::initializeState() const diff --git a/src/coreComponents/constitutive/permeability/PressurePermeability.hpp b/src/coreComponents/constitutive/permeability/PressurePermeability.hpp index 1a535eff1d7..cea50e14a5b 100644 --- a/src/coreComponents/constitutive/permeability/PressurePermeability.hpp +++ b/src/coreComponents/constitutive/permeability/PressurePermeability.hpp @@ -147,6 +147,9 @@ class PressurePermeability : public PermeabilityBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, + localIndex const numPts ) override; + /// Type of kernel wrapper for in-kernel update using KernelWrapper = PressurePermeabilityUpdate; @@ -181,8 +184,6 @@ class PressurePermeability : public PermeabilityBase virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - private: /// Permeability components at the reference pressure diff --git a/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp b/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp index b3b3d8fdf1f..c578256c534 100644 --- a/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp @@ -62,13 +62,14 @@ void ProppantPermeability::postInputInitialization() / ( m_maxProppantConcentration * m_maxProppantConcentration ); } -void ProppantPermeability::resizeFields( localIndex const size, localIndex const numPts ) +void ProppantPermeability::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - PermeabilityBase::resizeFields( size, numPts ); - // NOTE: enforcing 1 quadrature point - m_dPerm_dDispJump.resize( size, 1, 3, 3 ); - m_permeabilityMultiplier.resize( size, 1, 3 ); + m_dPerm_dDispJump.resize( 0, 1, 3, 3 ); + m_permeabilityMultiplier.resize( 0, 1, 3 ); + + PermeabilityBase::allocateConstitutiveData( parent, numPts ); } diff --git a/src/coreComponents/constitutive/permeability/ProppantPermeability.hpp b/src/coreComponents/constitutive/permeability/ProppantPermeability.hpp index 7977a2e8181..775dddfb525 100644 --- a/src/coreComponents/constitutive/permeability/ProppantPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ProppantPermeability.hpp @@ -119,6 +119,9 @@ class ProppantPermeability : public PermeabilityBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, + localIndex const numPts ) override; + /// Type of kernel wrapper for in-kernel update using KernelWrapper = ProppantPermeabilityUpdate; @@ -149,8 +152,6 @@ class ProppantPermeability : public PermeabilityBase virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - private: array4d< real64 > m_dPerm_dDispJump; diff --git a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp index 6490f2a7cdf..7e23dd7b02e 100644 --- a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp @@ -47,12 +47,13 @@ SlipDependentPermeability::SlipDependentPermeability( string const & name, Group registerField< fields::permeability::dPerm_dDispJump >( &m_dPerm_dDispJump ); } -void SlipDependentPermeability::resizeFields( localIndex const size, localIndex const numPts ) +void SlipDependentPermeability::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - PermeabilityBase::resizeFields( size, numPts ); - // NOTE: enforcing 1 quadrature point - m_dPerm_dDispJump.resize( size, 1, 3, 3 ); + m_dPerm_dDispJump.resize( 0, 1, 3, 3 ); + + PermeabilityBase::allocateConstitutiveData( parent, numPts ); } REGISTER_CATALOG_ENTRY( ConstitutiveBase, SlipDependentPermeability, string const &, Group * const ) diff --git a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.hpp b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.hpp index ee3311d30c5..c7ff3ac82dc 100644 --- a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.hpp @@ -96,6 +96,9 @@ class SlipDependentPermeability : public PermeabilityBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, + localIndex const numPts ) override; + /// Type of kernel wrapper for in-kernel update using KernelWrapper = SlipDependentPermeabilityUpdate; @@ -113,10 +116,6 @@ class SlipDependentPermeability : public PermeabilityBase m_initialPermeability ); } -protected: - - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - private: /// Derivative of fracture permeability w.r.t. displacement jump diff --git a/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.cpp b/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.cpp index 88d6190de72..ccbdc1f9e1c 100644 --- a/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.cpp @@ -48,13 +48,14 @@ WillisRichardsPermeability::WillisRichardsPermeability( string const & name, Gro registerField< fields::permeability::dPerm_dTraction >( &m_dPerm_dTraction ); } -void WillisRichardsPermeability::resizeFields( localIndex const size, localIndex const numPts ) +void WillisRichardsPermeability::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - PermeabilityBase::resizeFields( size, numPts ); - // NOTE: enforcing 1 quadrature point - m_dPerm_dDispJump.resize( size, 1, 3, 3 ); - m_dPerm_dTraction.resize( size, 1, 3, 3 ); + m_dPerm_dDispJump.resize( 0, 1, 3, 3 ); + m_dPerm_dTraction.resize( 0, 1, 3, 3 ); + + PermeabilityBase::allocateConstitutiveData( parent, numPts ); } REGISTER_CATALOG_ENTRY( ConstitutiveBase, WillisRichardsPermeability, string const &, Group * const ) diff --git a/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.hpp b/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.hpp index 7f10a306996..03053766f41 100644 --- a/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.hpp @@ -103,6 +103,9 @@ class WillisRichardsPermeability : public PermeabilityBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, + localIndex const numPts ) override; + /// Type of kernel wrapper for in-kernel update using KernelWrapper = WillisRichardsPermeabilityUpdate; @@ -121,10 +124,6 @@ class WillisRichardsPermeability : public PermeabilityBase m_refClosureStress ); } -protected: - - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - private: /// Derivative of fracture permeability to shear displacement jump between fracture surfaces diff --git a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp index 3d85a82a101..d93d335873e 100644 --- a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp +++ b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp @@ -83,22 +83,23 @@ void RelativePermeabilityBase::postInputInitialization() m_phaseOrder[m_phaseTypes[ip]] = ip; } - // call to correctly set member array tertiary sizes on the 'main' material object - resizeFields( 0, 0 ); // TODO figure out why this is really needed - // set labels on array wrappers for plottable fields setLabels(); } -void RelativePermeabilityBase::resizeFields( localIndex const size, localIndex const numPts ) +void RelativePermeabilityBase::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { integer const numPhases = numFluidPhases(); - m_phaseRelPerm.resize( size, numPts, numPhases ); - m_phaseRelPerm_n.resize( size, numPts, numPhases ); - m_dPhaseRelPerm_dPhaseVolFrac.resize( size, numPts, numPhases, numPhases ); + m_phaseRelPerm.resize( 0, numPts, numPhases ); + m_phaseRelPerm_n.resize( 0, numPts, numPhases ); + m_dPhaseRelPerm_dPhaseVolFrac.resize( 0, numPts, numPhases, numPhases ); //phase trapped for stats - m_phaseTrappedVolFrac.resize( size, numPts, numPhases ); + m_phaseTrappedVolFrac.resize( 0, numPts, numPhases ); + + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); + m_phaseTrappedVolFrac.zero(); } diff --git a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp index 6c0b0e13494..1530705a0fd 100644 --- a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp +++ b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp @@ -150,6 +150,9 @@ class RelativePermeabilityBase : public ConstitutiveBase RelativePermeabilityBase( string const & name, dataRepository::Group * const parent ); + virtual void allocateConstitutiveData( Group & parent, + localIndex const numPts ) override; + integer numFluidPhases() const { return LvArray::integerConversion< integer >( m_phaseNames.size() ); } string_array const & phaseNames() const { return m_phaseNames; } @@ -195,13 +198,6 @@ class RelativePermeabilityBase : public ConstitutiveBase protected: - /** - * @brief Function called internally to resize member arrays - * @param size primary dimension (e.g. number of cells) - * @param numPts secondary dimension (e.g. number of gauss points per cell) - */ - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - virtual void postInputInitialization() override; // phase names read from input diff --git a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp index 40c0f7a4c1c..bd87ed4a0c0 100644 --- a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp +++ b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp @@ -562,15 +562,17 @@ TableRelativePermeabilityHysteresis::createKernelWrapper() m_dPhaseRelPerm_dPhaseVolFrac ); } -void TableRelativePermeabilityHysteresis::resizeFields( localIndex const size, localIndex const numPts ) +void TableRelativePermeabilityHysteresis::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - RelativePermeabilityBase::resizeFields( size, numPts ); - integer const numPhases = numFluidPhases(); m_phaseMinVolumeFraction.resize( numPhases ); - m_phaseMaxHistoricalVolFraction.resize( size, numPhases ); - m_phaseMinHistoricalVolFraction.resize( size, numPhases ); + m_phaseMaxHistoricalVolFraction.resize( 0, numPhases ); + m_phaseMinHistoricalVolFraction.resize( 0, numPhases ); + + RelativePermeabilityBase::allocateConstitutiveData( parent, numPts ); + m_phaseMaxHistoricalVolFraction.setValues< parallelDevicePolicy<> >( 0.0 ); m_phaseMinHistoricalVolFraction.setValues< parallelDevicePolicy<> >( 1.0 ); } diff --git a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.hpp b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.hpp index aa90910eaf3..6b49f7958f2 100644 --- a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.hpp +++ b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.hpp @@ -79,6 +79,8 @@ class TableRelativePermeabilityHysteresis : public RelativePermeabilityBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + /// Type of kernel wrapper for in-kernel update class KernelWrapper final : public RelativePermeabilityBaseUpdate { @@ -350,8 +352,6 @@ class TableRelativePermeabilityHysteresis : public RelativePermeabilityBase virtual void initializePreSubGroups() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /** * @brief Create all the table kernel wrappers needed for the simulation (for all the phases present) */ diff --git a/src/coreComponents/constitutive/solid/CeramicDamage.cpp b/src/coreComponents/constitutive/solid/CeramicDamage.cpp index be6a40cd560..7b8ebca87bf 100644 --- a/src/coreComponents/constitutive/solid/CeramicDamage.cpp +++ b/src/coreComponents/constitutive/solid/CeramicDamage.cpp @@ -70,13 +70,12 @@ CeramicDamage::CeramicDamage( string const & name, Group * const parent ): } -void CeramicDamage::resizeFields( localIndex const size, localIndex const numPts ) +void CeramicDamage::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - ElasticIsotropic::resizeFields( size, numPts ); - - // 0 to resize and assign default value later m_damage.resize( 0, numPts ); m_jacobian.resize( 0, numPts ); + + ElasticIsotropic::allocateConstitutiveData( parent, numPts ); } diff --git a/src/coreComponents/constitutive/solid/CeramicDamage.hpp b/src/coreComponents/constitutive/solid/CeramicDamage.hpp index c7cdfcfe5ba..8a544065017 100644 --- a/src/coreComponents/constitutive/solid/CeramicDamage.hpp +++ b/src/coreComponents/constitutive/solid/CeramicDamage.hpp @@ -436,6 +436,8 @@ class CeramicDamage : public ElasticIsotropic ///@} + virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + /** * Keys for data specified in this class. */ @@ -515,8 +517,6 @@ class CeramicDamage : public ElasticIsotropic virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /// State variable: The damage values for each quadrature point array2d< real64 > m_damage; diff --git a/src/coreComponents/constitutive/solid/Damage.cpp b/src/coreComponents/constitutive/solid/Damage.cpp index b9b454d7d9f..c205c64628a 100644 --- a/src/coreComponents/constitutive/solid/Damage.cpp +++ b/src/coreComponents/constitutive/solid/Damage.cpp @@ -176,18 +176,16 @@ void Damage< BASE >::postInputInitialization() } template< typename BASE > -void Damage< BASE >::resizeFields( localIndex const size, - localIndex const numPts ) +void Damage< BASE >::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - BASE::resizeFields( size, numPts ); - - // 0 to resize and assign default value later m_newDamage.resize( 0, numPts ); m_oldDamage.resize( 0, numPts ); m_damageGrad.resize( 0, numPts, 3 ); m_strainEnergyDensity.resize( 0, numPts ); m_volStrain.resize( 0, numPts ); m_extDrivingForce.resize( 0, numPts ); + + BASE::allocateConstitutiveData( parent, numPts ); } template< typename BASE > diff --git a/src/coreComponents/constitutive/solid/Damage.hpp b/src/coreComponents/constitutive/solid/Damage.hpp index ccfb9e2dac3..c1307ecb159 100644 --- a/src/coreComponents/constitutive/solid/Damage.hpp +++ b/src/coreComponents/constitutive/solid/Damage.hpp @@ -426,6 +426,8 @@ class Damage : public BASE static string catalogName() { return string( "Damage" ) + BASE::catalogName(); } virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; + virtual void postInputInitialization() override; virtual void saveConvergedState() const override; @@ -494,8 +496,6 @@ class Damage : public BASE protected: - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /// The new damage value on all quadrature points array2d< real64 > m_newDamage; diff --git a/src/coreComponents/constitutive/solid/DelftEgg.cpp b/src/coreComponents/constitutive/solid/DelftEgg.cpp index d71c25e3009..548a958de2b 100644 --- a/src/coreComponents/constitutive/solid/DelftEgg.cpp +++ b/src/coreComponents/constitutive/solid/DelftEgg.cpp @@ -95,13 +95,12 @@ DelftEgg::DelftEgg( string const & name, Group * const parent ): } -void DelftEgg::resizeFields( localIndex const size, localIndex const numPts ) +void DelftEgg::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - ElasticIsotropic::resizeFields( size, numPts ); - - // 0 to resize and assign default value later m_newPreConsolidationPressure.resize( 0, numPts ); m_oldPreConsolidationPressure.resize( 0, numPts ); + + ElasticIsotropic::allocateConstitutiveData( parent, numPts ); } diff --git a/src/coreComponents/constitutive/solid/DelftEgg.hpp b/src/coreComponents/constitutive/solid/DelftEgg.hpp index a12446a24f1..b80215416f3 100644 --- a/src/coreComponents/constitutive/solid/DelftEgg.hpp +++ b/src/coreComponents/constitutive/solid/DelftEgg.hpp @@ -470,6 +470,8 @@ class DelftEgg : public ElasticIsotropic */ DelftEgg( string const & name, Group * const parent ); + virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + virtual void saveConvergedState() const override; /** @@ -575,8 +577,6 @@ class DelftEgg : public ElasticIsotropic virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /// Material parameter: The default value of the recompression index real64 m_defaultRecompressionIndex; diff --git a/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp b/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp index 7a06ed5727c..eeba71c9596 100644 --- a/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp +++ b/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp @@ -59,11 +59,12 @@ PoreVolumeCompressibleSolid::deliverClone( string const & name, return clone; } -void PoreVolumeCompressibleSolid::resizeFields( localIndex const GEOS_UNUSED_PARAM( size ), localIndex const numPts ) +void PoreVolumeCompressibleSolid::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - // 0 to resize and assign default value later m_poreVolumeMultiplier.resize( 0, numPts ); m_dPVMult_dPressure.resize( 0, numPts ); + + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } void PoreVolumeCompressibleSolid::postInputInitialization() diff --git a/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.hpp b/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.hpp index ef69a3bb03d..fc84946395a 100644 --- a/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.hpp +++ b/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.hpp @@ -42,6 +42,8 @@ class PoreVolumeCompressibleSolid : public ConstitutiveBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + virtual void stateUpdatePointPressure( real64 const & pres, localIndex const k, localIndex const q ) override final; @@ -59,8 +61,6 @@ class PoreVolumeCompressibleSolid : public ConstitutiveBase virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - private: /// scalar compressibility parameter diff --git a/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.cpp b/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.cpp index fa7caff8ed3..94c709e367e 100644 --- a/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.cpp +++ b/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.cpp @@ -89,13 +89,12 @@ PoroElastic< BASE >::deliverClone( string const & name, } template< typename BASE > -void PoroElastic< BASE >::resizeFields( localIndex const size, localIndex const numPts ) +void PoroElastic< BASE >::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - BASE::resizeFields( size, numPts ); - - // 0 to resize and assign default value later m_poreVolumeMultiplier.resize( 0, numPts ); m_dPVMult_dPressure.resize( 0, numPts ); + + BASE::allocateConstitutiveData( parent, numPts ); } template< typename BASE > diff --git a/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.hpp b/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.hpp index c9d7bb356f7..c922c2bc3c6 100644 --- a/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.hpp +++ b/src/coreComponents/constitutive/solid/Deprecated/PoroElastic.hpp @@ -118,6 +118,8 @@ class PoroElastic : public BASE */ virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; + /// Post-process XML input virtual void postInputInitialization() override; @@ -173,8 +175,6 @@ class PoroElastic : public BASE protected: - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /// scalar compressibility parameter real64 m_compressibility; diff --git a/src/coreComponents/constitutive/solid/DruckerPrager.cpp b/src/coreComponents/constitutive/solid/DruckerPrager.cpp index 2020b171a16..0b400763ced 100644 --- a/src/coreComponents/constitutive/solid/DruckerPrager.cpp +++ b/src/coreComponents/constitutive/solid/DruckerPrager.cpp @@ -84,13 +84,12 @@ DruckerPrager::DruckerPrager( string const & name, Group * const parent ): } -void DruckerPrager::resizeFields( localIndex const size, localIndex const numPts ) +void DruckerPrager::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - ElasticIsotropic::resizeFields( size, numPts ); - - // 0 to resize and assign default value later m_newCohesion.resize( 0, numPts ); m_oldCohesion.resize( 0, numPts ); + + ElasticIsotropic::allocateConstitutiveData( parent, numPts ); } diff --git a/src/coreComponents/constitutive/solid/DruckerPrager.hpp b/src/coreComponents/constitutive/solid/DruckerPrager.hpp index e406699c8bf..d67d75e594c 100644 --- a/src/coreComponents/constitutive/solid/DruckerPrager.hpp +++ b/src/coreComponents/constitutive/solid/DruckerPrager.hpp @@ -360,6 +360,8 @@ class DruckerPrager : public ElasticIsotropic */ DruckerPrager( string const & name, Group * const parent ); + virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + virtual void saveConvergedState() const override; /** @@ -457,8 +459,6 @@ class DruckerPrager : public ElasticIsotropic virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /// Material parameter: The default value of yield surface slope real64 m_defaultFrictionAngle; diff --git a/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp b/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp index dcb25d911ce..895c9d598ec 100644 --- a/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp +++ b/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp @@ -100,13 +100,12 @@ DruckerPragerExtended::DruckerPragerExtended( string const & name, Group * const } -void DruckerPragerExtended::resizeFields( localIndex const size, localIndex const numPts ) +void DruckerPragerExtended::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - ElasticIsotropic::resizeFields( size, numPts ); - - // 0 to resize and assign default value later m_newState.resize( 0, numPts ); m_oldState.resize( 0, numPts ); + + ElasticIsotropic::allocateConstitutiveData( parent, numPts ); } diff --git a/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp b/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp index 770fc09c77c..28365680c10 100644 --- a/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp +++ b/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp @@ -386,6 +386,8 @@ class DruckerPragerExtended : public ElasticIsotropic */ DruckerPragerExtended( string const & name, Group * const parent ); + virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + virtual void saveConvergedState() const override; /** @@ -496,8 +498,6 @@ class DruckerPragerExtended : public ElasticIsotropic virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /// Material parameter: The default value of the initial yield surface slope real64 m_defaultInitialFrictionAngle; diff --git a/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp b/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp index 694860bd28e..dea5f44565b 100644 --- a/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp +++ b/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp @@ -73,13 +73,12 @@ ModifiedCamClay::ModifiedCamClay( string const & name, Group * const parent ): } -void ModifiedCamClay::resizeFields( localIndex const size, localIndex const numPts ) +void ModifiedCamClay::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - ElasticIsotropicPressureDependent::resizeFields( size, numPts ); - - // 0 to resize and assign default value later m_newPreConsolidationPressure.resize( 0, numPts ); m_oldPreConsolidationPressure.resize( 0, numPts ); + + ElasticIsotropicPressureDependent::allocateConstitutiveData( parent, numPts ); } void ModifiedCamClay::postInputInitialization() diff --git a/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp b/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp index 996546ce608..05383d19b5b 100644 --- a/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp +++ b/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp @@ -487,6 +487,8 @@ class ModifiedCamClay : public ElasticIsotropicPressureDependent */ ModifiedCamClay( string const & name, Group * const parent ); + virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + virtual void saveConvergedState() const override; /** @@ -579,8 +581,6 @@ class ModifiedCamClay : public ElasticIsotropicPressureDependent virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /// Material parameter: The default value of the virgin compression index real64 m_defaultVirginCompressionIndex; diff --git a/src/coreComponents/constitutive/solid/SolidBase.cpp b/src/coreComponents/constitutive/solid/SolidBase.cpp index 4c81250bc31..1602f11226a 100644 --- a/src/coreComponents/constitutive/solid/SolidBase.cpp +++ b/src/coreComponents/constitutive/solid/SolidBase.cpp @@ -76,12 +76,14 @@ void SolidBase::postInputInitialization() } -void SolidBase::resizeFields( localIndex const GEOS_UNUSED_PARAM( size ), localIndex const numPts ) +void SolidBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) { // 0 to resize and assign default value later m_density.resize( 0, numPts ); m_newStress.resize( 0, numPts, 6 ); m_oldStress.resize( 0, numPts, 6 ); + + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } diff --git a/src/coreComponents/constitutive/solid/SolidBase.hpp b/src/coreComponents/constitutive/solid/SolidBase.hpp index df4a2fabe12..d1a5b560bbe 100644 --- a/src/coreComponents/constitutive/solid/SolidBase.hpp +++ b/src/coreComponents/constitutive/solid/SolidBase.hpp @@ -562,6 +562,8 @@ class SolidBase : public constitutive::ConstitutiveBase SolidBase( string const & name, Group * const parent ); + virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + /// Keys for data in this class struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct { @@ -685,8 +687,6 @@ class SolidBase : public constitutive::ConstitutiveBase /// Post-process XML input virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /// The current stress at a quadrature point (i.e. at timestep n, global newton iteration k) array3d< real64, solid::STRESS_PERMUTATION > m_newStress; diff --git a/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp b/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp index 07aa62a9e0d..71ac48176a4 100644 --- a/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp +++ b/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp @@ -67,12 +67,14 @@ SolidInternalEnergy::SolidInternalEnergy( string const & name, Group * const par setDescription( "Internal energy at the reference temperature [J/kg]" ); } -void SolidInternalEnergy::resizeFields( localIndex const GEOS_UNUSED_PARAM( size ), localIndex const GEOS_UNUSED_PARAM( numPts ) ) +void SolidInternalEnergy::allocateConstitutiveData( Group & parent, localIndex const numPts ) { // 0 to resize and assign default value later m_internalEnergy.resize( 0, 1 ); m_dInternalEnergy_dTemperature.resize( 0, 1 ); m_internalEnergy_n.resize( 0, 1 ); + + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } void SolidInternalEnergy::saveConvergedState() const diff --git a/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp b/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp index 537e94219f3..521d53b88ac 100644 --- a/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp +++ b/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp @@ -99,6 +99,8 @@ class SolidInternalEnergy : public ConstitutiveBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct { static constexpr char const * internalEnergyString() { return "internalEnergy"; } @@ -148,10 +150,6 @@ class SolidInternalEnergy : public ConstitutiveBase /// Save state data in preparation for next timestep virtual void saveConvergedState() const override; -protected: - - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - private: /// Solid internal energy diff --git a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.cpp b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.cpp index 8f0d5c69301..28065272b29 100644 --- a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.cpp +++ b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.cpp @@ -67,11 +67,11 @@ BiotPorosity::BiotPorosity( string const & name, Group * const parent ): registerField< fields::porosity::averageMeanTotalStressIncrement_k >( &m_averageMeanTotalStressIncrement_k ); } -void BiotPorosity::resizeFields( localIndex const size, localIndex const numPts ) +void BiotPorosity::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) { - PorosityBase::resizeFields( size, numPts ); + m_meanTotalStressIncrement_k.resize( 0, numPts ); - m_meanTotalStressIncrement_k.resize( size, numPts ); + PorosityBase::allocateConstitutiveData( parent, numPts ); } void BiotPorosity::postInputInitialization() diff --git a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp index cff41627a15..1282c527b9d 100644 --- a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp +++ b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp @@ -237,6 +237,8 @@ class BiotPorosity : public PorosityBase virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; + struct viewKeyStruct : public PorosityBase::viewKeyStruct { static constexpr char const *defaultGrainBulkModulusString() { return "defaultGrainBulkModulus"; } @@ -311,8 +313,6 @@ class BiotPorosity : public PorosityBase protected: virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /// Default thermal expansion coefficients (read from XML) real64 m_defaultThermalExpansionCoefficient; diff --git a/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp b/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp index cd4bcefe41c..1dbc7792ab0 100644 --- a/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp +++ b/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp @@ -56,13 +56,15 @@ PorosityBase::PorosityBase( string const & name, Group * const parent ): registerField< fields::porosity::referencePorosity >( &m_referencePorosity ); } -void PorosityBase::resizeFields( localIndex const GEOS_UNUSED_PARAM( size ), localIndex const numPts ) +void PorosityBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) { m_newPorosity.resize( 0, numPts ); m_porosity_n.resize( 0, numPts ); m_dPorosity_dPressure.resize( 0, numPts ); m_dPorosity_dTemperature.resize( 0, numPts ); m_initialPorosity.resize( 0, numPts ); + + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } void PorosityBase::postInputInitialization() diff --git a/src/coreComponents/constitutive/solid/porosity/PorosityBase.hpp b/src/coreComponents/constitutive/solid/porosity/PorosityBase.hpp index 3f77693b3c3..6489a1e1cc1 100644 --- a/src/coreComponents/constitutive/solid/porosity/PorosityBase.hpp +++ b/src/coreComponents/constitutive/solid/porosity/PorosityBase.hpp @@ -111,6 +111,8 @@ class PorosityBase : public ConstitutiveBase public: PorosityBase( string const & name, Group * const parent ); + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; + struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct { static constexpr char const * defaultReferencePorosityString() { return "defaultReferencePorosity"; } @@ -244,8 +246,6 @@ class PorosityBase : public ConstitutiveBase protected: virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - array2d< real64 > m_newPorosity; array2d< real64 > m_porosity_n; diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.cpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.cpp index 153b2f73d88..2573679cc20 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.cpp @@ -36,12 +36,12 @@ MultiPhaseConstantThermalConductivity::MultiPhaseConstantThermalConductivity( st setDescription( "xx, yy, and zz components of a diagonal thermal conductivity tensor [J/(s.m.K)]" ); } -void MultiPhaseConstantThermalConductivity::resizeFields( localIndex const size, localIndex const numPts ) +void MultiPhaseConstantThermalConductivity::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) { - MultiPhaseThermalConductivityBase::resizeFields( size, numPts ); + MultiPhaseThermalConductivityBase::allocateConstitutiveData( parent, numPts ); // TODO move into initializeState? - for( localIndex ei = 0; ei < size; ++ei ) + for( localIndex ei = 0; ei < parent.size(); ++ei ) { for( localIndex q = 0; q < 1; ++q ) { diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp index 13d5221a98a..766c80d0387 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp @@ -73,6 +73,8 @@ class MultiPhaseConstantThermalConductivity : public MultiPhaseThermalConductivi virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; + /// Type of kernel wrapper for in-kernel update using KernelWrapper = MultiPhaseConstantThermalConductivityUpdate; @@ -95,8 +97,6 @@ class MultiPhaseConstantThermalConductivity : public MultiPhaseThermalConductivi virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - private: /// default thermal conductivity in the subRegion diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp index 59d60354cdd..63cbf420046 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp @@ -58,12 +58,14 @@ void MultiPhaseThermalConductivityBase::postInputInitialization() m_dEffectiveConductivity_dPhaseVolFrac.resize( 0, 0, 3, numPhases ); } -void MultiPhaseThermalConductivityBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) +void MultiPhaseThermalConductivityBase::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) { // NOTE: enforcing 1 quadrature point integer const numPhases = numFluidPhases(); - m_effectiveConductivity.resize( size, 1, 3 ); - m_dEffectiveConductivity_dPhaseVolFrac.resize( size, 1, 3, numPhases ); + m_effectiveConductivity.resize( 0, 1, 3 ); + m_dEffectiveConductivity_dPhaseVolFrac.resize( 0, 1, 3, numPhases ); + + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } } // namespace constitutive diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.hpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.hpp index f855f7943fc..ee6f815ebbc 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.hpp @@ -111,6 +111,8 @@ class MultiPhaseThermalConductivityBase : public ConstitutiveBase */ MultiPhaseThermalConductivityBase( string const & name, dataRepository::Group * const parent ); + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; + /** * @brief Initialize the thermal conductivity state (needed when thermal conductivity depends on porosity and phase volume fraction) * @param[in] initialPorosity the initial porosity field after reservoir initialization @@ -166,8 +168,6 @@ class MultiPhaseThermalConductivityBase : public ConstitutiveBase virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /// phase names read from input string_array m_phaseNames; diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp index e5db9174100..efb1341d848 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp @@ -46,12 +46,12 @@ MultiPhaseVolumeWeightedThermalConductivity::MultiPhaseVolumeWeightedThermalCond registerField< fields::thermalconductivity::rockThermalConductivity >( &m_rockThermalConductivity ); } -void MultiPhaseVolumeWeightedThermalConductivity::resizeFields( localIndex const size, localIndex const numPts ) +void MultiPhaseVolumeWeightedThermalConductivity::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) { - MultiPhaseThermalConductivityBase::resizeFields( size, numPts ); + MultiPhaseThermalConductivityBase::allocateConstitutiveData( parent, numPts ); // TODO move into initializeState? - for( localIndex ei = 0; ei < size; ++ei ) + for( localIndex ei = 0; ei < parent.size(); ++ei ) { for( localIndex q = 0; q < 1; ++q ) { diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp index 9b473471574..cef54fd7326 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp @@ -122,6 +122,8 @@ class MultiPhaseVolumeWeightedThermalConductivity : public MultiPhaseThermalCond */ MultiPhaseVolumeWeightedThermalConductivity( string const & name, Group * const parent ); + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; + virtual void initializeRockFluidState( arrayView2d< real64 const > const & initialPorosity, arrayView2d< real64 const, compflow::USD_PHASE > const & initialPhaseVolumeFraction ) const override; @@ -157,8 +159,6 @@ class MultiPhaseVolumeWeightedThermalConductivity : public MultiPhaseThermalCond virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - private: /// default rock thermal conductivity in the subRegion diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp index 23bda22fabb..71367d854b0 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp @@ -44,11 +44,13 @@ void SinglePhaseThermalConductivityBase::postInputInitialization() m_dEffectiveConductivity_dT.resize( 0, 0, 3 ); } -void SinglePhaseThermalConductivityBase::resizeFields( localIndex const size, localIndex const GEOS_UNUSED_PARAM( numPts ) ) +void SinglePhaseThermalConductivityBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) { // NOTE: enforcing 1 quadrature point - m_effectiveConductivity.resize( size, 1, 3 ); - m_dEffectiveConductivity_dT.resize( size, 1, 3 ); + m_effectiveConductivity.resize( 0, 1, 3 ); + m_dEffectiveConductivity_dT.resize( 0, 1, 3 ); + + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } } // namespace constitutive diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp index a2b5aaba35e..07c8f90a474 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp @@ -96,6 +96,8 @@ class SinglePhaseThermalConductivityBase : public ConstitutiveBase */ SinglePhaseThermalConductivityBase( string const & name, dataRepository::Group * const parent ); + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ); + /** * @brief Initialize the thermal conductivity state (needed when thermal conductivity depends on porosity and phase volume fraction) * @param[in] initialPorosity the initial porosity field after reservoir initialization @@ -147,8 +149,6 @@ class SinglePhaseThermalConductivityBase : public ConstitutiveBase virtual void postInputInitialization() override; - virtual void resizeFields( localIndex const size, localIndex const numPts ) override; - /// cell-wise effective conductivities in the subregion array3d< real64 > m_effectiveConductivity; From 3282e6f62821348318aebac3646c973e109b2fa9 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 22 Aug 2025 15:32:29 -0500 Subject: [PATCH 21/43] Remove unused include in CapillaryPressureBase.cpp Removed unnecessary include for ElementSubRegionBase. --- .../constitutive/capillaryPressure/CapillaryPressureBase.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp index 717fb07e8a9..ace4fa34f72 100644 --- a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp +++ b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp @@ -19,7 +19,6 @@ #include "CapillaryPressureBase.hpp" #include "CapillaryPressureFields.hpp" -#include "mesh/ElementSubRegionBase.hpp" namespace geos { From 259e10ca5ae2f59daed7afe2ca30bdf0ad4b35c6 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 22 Aug 2025 17:08:36 -0500 Subject: [PATCH 22/43] . --- .../constitutive/ConstitutiveBase.cpp | 5 +- .../constitutive/ConstitutiveBase.hpp | 6 +-- .../CapillaryPressureBase.cpp | 9 ++-- .../CapillaryPressureBase.hpp | 2 +- .../JFunctionCapillaryPressure.cpp | 5 +- .../JFunctionCapillaryPressure.hpp | 2 +- .../constitutive/contact/CoulombFriction.cpp | 5 +- .../constitutive/contact/CoulombFriction.hpp | 2 +- .../contact/HydraulicApertureTable.cpp | 4 +- .../contact/HydraulicApertureTable.hpp | 2 +- .../diffusion/ConstantDiffusion.cpp | 5 +- .../diffusion/ConstantDiffusion.hpp | 6 +-- .../constitutive/diffusion/DiffusionBase.cpp | 5 +- .../constitutive/diffusion/DiffusionBase.hpp | 2 +- .../dispersion/DispersionBase.cpp | 5 +- .../dispersion/DispersionBase.hpp | 2 +- .../fluid/multifluid/MultiFluidBase.cpp | 47 +++++++++---------- .../fluid/multifluid/MultiFluidBase.hpp | 2 +- .../CompositionalMultiphaseFluid.cpp | 7 ++- .../CompositionalMultiphaseFluid.hpp | 8 ++-- .../reactive/ReactiveMultiFluid.cpp | 4 +- .../reactive/ReactiveMultiFluid.hpp | 8 ++-- .../CompressibleSinglePhaseFluid.cpp | 5 +- .../CompressibleSinglePhaseFluid.hpp | 6 +-- .../fluid/singlefluid/ParticleFluidBase.cpp | 5 +- .../fluid/singlefluid/ParticleFluidBase.hpp | 6 +-- .../fluid/singlefluid/ProppantSlurryFluid.cpp | 5 +- .../fluid/singlefluid/ProppantSlurryFluid.hpp | 6 +-- .../fluid/singlefluid/SingleFluidBase.cpp | 27 ++++++----- .../fluid/singlefluid/SingleFluidBase.hpp | 6 +-- .../fluid/singlefluid/SlurryFluidBase.hpp | 4 +- .../ThermalCompressibleSinglePhaseFluid.hpp | 4 +- .../TwoPhaseImmiscibleFluid.hpp | 4 +- .../permeability/CarmanKozenyPermeability.hpp | 6 +-- .../permeability/ConstantPermeability.hpp | 6 +-- .../ExponentialDecayPermeability.hpp | 4 +- .../ParallelPlatesPermeability.hpp | 4 +- .../permeability/PermeabilityBase.hpp | 4 +- .../permeability/PressurePermeability.hpp | 4 +- .../permeability/ProppantPermeability.hpp | 4 +- .../SlipDependentPermeability.hpp | 4 +- .../WillisRichardsPermeability.hpp | 4 +- .../RelativePermeabilityBase.hpp | 2 +- .../TableRelativePermeabilityHysteresis.hpp | 2 +- .../constitutive/solid/CeramicDamage.hpp | 4 +- .../constitutive/solid/DelftEgg.hpp | 4 +- .../PoreVolumeCompressibleSolid.hpp | 6 +-- .../constitutive/solid/DruckerPrager.hpp | 4 +- .../solid/DruckerPragerExtended.hpp | 4 +- .../constitutive/solid/ModifiedCamClay.hpp | 4 +- .../constitutive/solid/SolidBase.hpp | 2 +- .../solid/SolidInternalEnergy.hpp | 4 +- .../solid/porosity/BiotPorosity.hpp | 2 +- .../solid/porosity/PorosityBase.hpp | 2 +- .../MultiPhaseConstantThermalConductivity.hpp | 2 +- ...PhaseVolumeWeightedThermalConductivity.hpp | 2 +- .../testInvariantImmiscibleFluid.cpp | 21 +++++++-- src/coreComponents/mesh/ObjectManagerBase.hpp | 2 - .../constitutiveTests/testRelPerm.cpp | 1 - .../testRelPermHysteresis.cpp | 1 + 60 files changed, 166 insertions(+), 164 deletions(-) diff --git a/src/coreComponents/constitutive/ConstitutiveBase.cpp b/src/coreComponents/constitutive/ConstitutiveBase.cpp index 7323a649605..d694ddb6320 100644 --- a/src/coreComponents/constitutive/ConstitutiveBase.cpp +++ b/src/coreComponents/constitutive/ConstitutiveBase.cpp @@ -42,10 +42,9 @@ ConstitutiveBase::CatalogInterface::CatalogType & ConstitutiveBase::getCatalog() return catalog; } -void ConstitutiveBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void ConstitutiveBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - m_numQuadraturePoints = numConstitutivePointsPerParentIndex; + m_numQuadraturePoints = numPts; for( auto & group : this->getSubGroups() ) { diff --git a/src/coreComponents/constitutive/ConstitutiveBase.hpp b/src/coreComponents/constitutive/ConstitutiveBase.hpp index cc3ebfc3709..7921ee28a78 100644 --- a/src/coreComponents/constitutive/ConstitutiveBase.hpp +++ b/src/coreComponents/constitutive/ConstitutiveBase.hpp @@ -99,14 +99,14 @@ class ConstitutiveBase : public dataRepository::Group /** * @brief Allocate constitutive data and make views to data on parent objects * @param[in] parent reference to the group that holds the constitutive relation - * @param[in] numConstitutivePointsPerParentIndex number of quadrature points + * @param[in] numPts number of quadrature points * * This function does 2 things: - * 1) Allocate data according to the size of parent and numConstitutivePointsPerParentIndex + * 1) Allocate data according to the size of parent and numPts * 2) Create wrappers to the constitutive data in the parent for easier access */ virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ); + localIndex const numPts ); struct viewKeyStruct {}; diff --git a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp index 717fb07e8a9..a9c3dd5bf9c 100644 --- a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp +++ b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp @@ -85,15 +85,14 @@ void CapillaryPressureBase::postInputInitialization() setLabels(); } -void CapillaryPressureBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void CapillaryPressureBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) { integer const NP = numFluidPhases(); - m_phaseCapPressure.resize( 0, numConstitutivePointsPerParentIndex, NP ); - m_dPhaseCapPressure_dPhaseVolFrac.resize( 0, numConstitutivePointsPerParentIndex, NP, NP ); + m_phaseCapPressure.resize( 0, numPts, NP ); + m_dPhaseCapPressure_dPhaseVolFrac.resize( 0, numPts, NP, NP ); - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } void CapillaryPressureBase::setLabels() diff --git a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp index 9ab2dc69fcd..4df2c4f8800 100644 --- a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp +++ b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.hpp @@ -105,7 +105,7 @@ class CapillaryPressureBase : public ConstitutiveBase dataRepository::Group * const parent ); virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + localIndex const numPts ) override; /** * @brief Initialize the capillary pressure state (needed when capillary pressure depends on porosity and permeability) diff --git a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp index 430a623fd1e..97072a8c9a8 100644 --- a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp +++ b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp @@ -336,12 +336,11 @@ JFunctionCapillaryPressure::createKernelWrapper() m_dPhaseCapPressure_dPhaseVolFrac ); } -void JFunctionCapillaryPressure::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void JFunctionCapillaryPressure::allocateConstitutiveData( Group & parent, localIndex const numPts ) { m_jFuncMultiplier.resize( 0, numFluidPhases()-1 ); - CapillaryPressureBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + CapillaryPressureBase::allocateConstitutiveData( parent, numPts ); } diff --git a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp index fd3a52aa981..4e42189d92e 100644 --- a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp +++ b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp @@ -47,7 +47,7 @@ class JFunctionCapillaryPressure : public CapillaryPressureBase JFunctionCapillaryPressure( std::string const & name, dataRepository::Group * const parent ); virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + localIndex const numPts ) override; virtual void initializeRockState( arrayView2d< real64 const > const & initialPorosity, arrayView3d< real64 const > const & initialPermeability ) const override; diff --git a/src/coreComponents/constitutive/contact/CoulombFriction.cpp b/src/coreComponents/constitutive/contact/CoulombFriction.cpp index 08c62be941d..ff0e36fbdde 100644 --- a/src/coreComponents/constitutive/contact/CoulombFriction.cpp +++ b/src/coreComponents/constitutive/contact/CoulombFriction.cpp @@ -60,12 +60,11 @@ void CoulombFriction::postInputInitialization() } -void CoulombFriction::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void CoulombFriction::allocateConstitutiveData( Group & parent, localIndex const numPts ) { m_elasticSlip.resize( 0, 2 ); - FrictionBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + FrictionBase::allocateConstitutiveData( parent, numPts ); } CoulombFrictionUpdates CoulombFriction::createKernelUpdates() const diff --git a/src/coreComponents/constitutive/contact/CoulombFriction.hpp b/src/coreComponents/constitutive/contact/CoulombFriction.hpp index 2b2336f8e9e..e5a3387743d 100644 --- a/src/coreComponents/constitutive/contact/CoulombFriction.hpp +++ b/src/coreComponents/constitutive/contact/CoulombFriction.hpp @@ -171,7 +171,7 @@ class CoulombFriction : public FrictionBase ///@} virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override final; + localIndex const numPts ) override final; /// Type of kernel wrapper for in-kernel update using KernelWrapper = CoulombFrictionUpdates; diff --git a/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp b/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp index 218057536b1..a798bc242a9 100644 --- a/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp +++ b/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp @@ -63,9 +63,9 @@ void HydraulicApertureTable::postInputInitialization() } void HydraulicApertureTable::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) + localIndex const numPts ) { - HydraulicApertureBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + HydraulicApertureBase::allocateConstitutiveData( parent, numPts ); // TODO this should not be here diff --git a/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp b/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp index 2f7375e0615..bcf7626c1f9 100644 --- a/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp +++ b/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp @@ -103,7 +103,7 @@ class HydraulicApertureTable : public HydraulicApertureBase virtual string getCatalogName() const override { return catalogName(); } virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override final; + localIndex const numPts ) override final; /// Type of kernel wrapper for in-kernel update using KernelWrapper = HydraulicApertureTableUpdates; diff --git a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.cpp b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.cpp index f5cc35b27d5..21dbdb4ca0e 100644 --- a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.cpp +++ b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.cpp @@ -36,10 +36,9 @@ ConstantDiffusion::ConstantDiffusion( string const & name, Group * const parent setDescription( "xx, yy, and zz components of a diffusivity tensor [m^2/s]" ); } -void ConstantDiffusion::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void ConstantDiffusion::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - DiffusionBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + DiffusionBase::allocateConstitutiveData( parent, numPts ); for( localIndex ei = 0; ei < parent.size(); ++ei ) // TODO move into initializeState? { diff --git a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp index fd6b1162b55..4b8382a62fa 100644 --- a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp +++ b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp @@ -64,14 +64,14 @@ class ConstantDiffusion : public DiffusionBase * @param[in] name the name of the class * @param[in] parent pointer to the parent Group */ - ConstantDiffusion( string const & name, Group * const parent ); + ConstantDiffusion( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "ConstantDiffusion"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override final; + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numPts ) override final; /// Type of kernel wrapper for in-kernel update using KernelWrapper = ConstantDiffusionUpdate; diff --git a/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp b/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp index 0bb51fdb64f..6f632a823eb 100644 --- a/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp +++ b/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp @@ -68,15 +68,14 @@ void DiffusionBase::postInputInitialization() m_phaseDiffusivityMultiplier.resize( 0, 0, 3 ); } -void DiffusionBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void DiffusionBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) { // NOTE: enforcing 1 quadrature point m_diffusivity.resize( 0, 1, 3 ); m_dDiffusivity_dTemperature.resize( 0, 1, 3 ); m_phaseDiffusivityMultiplier.resize( 0, 1, 3 ); - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); for( localIndex ei = 0; ei < parent.size(); ++ei ) // TODO move into initializeState? { diff --git a/src/coreComponents/constitutive/diffusion/DiffusionBase.hpp b/src/coreComponents/constitutive/diffusion/DiffusionBase.hpp index d115d186660..bb998e842e2 100644 --- a/src/coreComponents/constitutive/diffusion/DiffusionBase.hpp +++ b/src/coreComponents/constitutive/diffusion/DiffusionBase.hpp @@ -102,7 +102,7 @@ class DiffusionBase : public ConstitutiveBase DiffusionBase( string const & name, dataRepository::Group * const parent ); virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + localIndex const numPts ) override; /** * @brief Getter for the number of fluid phases diff --git a/src/coreComponents/constitutive/dispersion/DispersionBase.cpp b/src/coreComponents/constitutive/dispersion/DispersionBase.cpp index 86917c25248..8368f69dcea 100644 --- a/src/coreComponents/constitutive/dispersion/DispersionBase.cpp +++ b/src/coreComponents/constitutive/dispersion/DispersionBase.cpp @@ -34,13 +34,12 @@ DispersionBase::DispersionBase( string const & name, Group * const parent ) registerField< fields::dispersion::dispersivity >( &m_dispersivity ); } -void DispersionBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void DispersionBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) { // NOTE: enforcing 1 quadrature point m_dispersivity.resize( 0, 1, 3 ); - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } } // namespace constitutive diff --git a/src/coreComponents/constitutive/dispersion/DispersionBase.hpp b/src/coreComponents/constitutive/dispersion/DispersionBase.hpp index 4ac423e1970..354d1d29f92 100644 --- a/src/coreComponents/constitutive/dispersion/DispersionBase.hpp +++ b/src/coreComponents/constitutive/dispersion/DispersionBase.hpp @@ -93,7 +93,7 @@ class DispersionBase : public ConstitutiveBase DispersionBase( string const & name, dataRepository::Group * const parent ); virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override final; + localIndex const numPts ) override final; /** * @brief Getter for the dispersivities in the subRegion diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp index 2a71cdf1879..590da816354 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp @@ -89,43 +89,42 @@ MultiFluidBase::MultiFluidBase( string const & name, Group * const parent ) registerField< fields::multifluid::dTotalDensity >( &m_totalDensity.derivs ); } -void MultiFluidBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void MultiFluidBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) { integer const numPhase = numFluidPhases(); integer const numComp = numFluidComponents(); integer const numDof = numComp + 2; - m_phaseFraction.value.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); - m_phaseFraction.derivs.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numDof ); + m_phaseFraction.value.resize( 0, numPts, numPhase ); + m_phaseFraction.derivs.resize( 0, numPts, numPhase, numDof ); - m_phaseDensity.value.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); - m_phaseDensity_n.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); - m_phaseDensity.derivs.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numDof ); + m_phaseDensity.value.resize( 0, numPts, numPhase ); + m_phaseDensity_n.resize( 0, numPts, numPhase ); + m_phaseDensity.derivs.resize( 0, numPts, numPhase, numDof ); - m_phaseMassDensity.value.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); - m_phaseMassDensity.derivs.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numDof ); + m_phaseMassDensity.value.resize( 0, numPts, numPhase ); + m_phaseMassDensity.derivs.resize( 0, numPts, numPhase, numDof ); - m_phaseViscosity.value.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); - m_phaseViscosity.derivs.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numDof ); + m_phaseViscosity.value.resize( 0, numPts, numPhase ); + m_phaseViscosity.derivs.resize( 0, numPts, numPhase, numDof ); - m_phaseEnthalpy.value.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); - m_phaseEnthalpy_n.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); - m_phaseEnthalpy.derivs.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numDof ); + m_phaseEnthalpy.value.resize( 0, numPts, numPhase ); + m_phaseEnthalpy_n.resize( 0, numPts, numPhase ); + m_phaseEnthalpy.derivs.resize( 0, numPts, numPhase, numDof ); - m_phaseInternalEnergy.value.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); - m_phaseInternalEnergy_n.resize( 0, numConstitutivePointsPerParentIndex, numPhase ); - m_phaseInternalEnergy.derivs.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numDof ); + m_phaseInternalEnergy.value.resize( 0, numPts, numPhase ); + m_phaseInternalEnergy_n.resize( 0, numPts, numPhase ); + m_phaseInternalEnergy.derivs.resize( 0, numPts, numPhase, numDof ); - m_phaseCompFraction.value.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numComp ); - m_phaseCompFraction_n.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numComp ); - m_phaseCompFraction.derivs.resize( 0, numConstitutivePointsPerParentIndex, numPhase, numComp, numDof ); + m_phaseCompFraction.value.resize( 0, numPts, numPhase, numComp ); + m_phaseCompFraction_n.resize( 0, numPts, numPhase, numComp ); + m_phaseCompFraction.derivs.resize( 0, numPts, numPhase, numComp, numDof ); - m_totalDensity.value.resize( 0, numConstitutivePointsPerParentIndex ); - m_totalDensity_n.resize( 0, numConstitutivePointsPerParentIndex ); - m_totalDensity.derivs.resize( 0, numConstitutivePointsPerParentIndex, numDof ); + m_totalDensity.value.resize( 0, numPts ); + m_totalDensity_n.resize( 0, numPts ); + m_totalDensity.derivs.resize( 0, numPts, numDof ); - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } void MultiFluidBase::setLabels() diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp index 73ca97d8efd..c52973c129d 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp @@ -39,7 +39,7 @@ class MultiFluidBase : public ConstitutiveBase Group * const parent ); virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ); + localIndex const numPts ); // *** MultiFluid-specific interface diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp index e91b3059da2..6d447285d4a 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp @@ -100,12 +100,11 @@ string CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::catalogNam } template< typename FLASH, typename PHASE1, typename PHASE2, typename PHASE3 > -void CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - m_kValues.resize( 0, numConstitutivePointsPerParentIndex, numFluidPhases()-1, numFluidComponents() ); + m_kValues.resize( 0, numPts, numFluidPhases()-1, numFluidComponents() ); - MultiFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + MultiFluidBase::allocateConstitutiveData( parent, numPts ); // Zero k-Values to force initialisation with Wilson k-Values m_kValues.zero(); diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp index 121298d6fbb..b779a213432 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp @@ -63,18 +63,18 @@ class CompositionalMultiphaseFluid : public MultiFluidBase using exec_policy = parallelDevicePolicy<>; public: - CompositionalMultiphaseFluid( string const & name, Group * const parent ); + CompositionalMultiphaseFluid( string const & name, dataRepository::Group * const parent ); virtual std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; + dataRepository::Group * const parent ) const override; static string catalogName(); virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numPts ) override; static constexpr bool isThermalType(){ return false; } diff --git a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.cpp index f173292cd77..3f59b5ac30b 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.cpp @@ -72,7 +72,7 @@ void ReactiveMultiFluid::postInputInitialization() } void ReactiveMultiFluid::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) + localIndex const numPts ) { integer const numPrimarySpecies = this->numPrimarySpecies(); integer const numSecondarySpecies = this->numSecondarySpecies(); @@ -83,7 +83,7 @@ void ReactiveMultiFluid::allocateConstitutiveData( Group & parent, m_primarySpeciesTotalConcentration.resize( 0, numPrimarySpecies ); m_kineticReactionRates.resize( 0, numKineticReactions ); - MultiFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + MultiFluidBase::allocateConstitutiveData( parent, numPts ); } void ReactiveMultiFluid::createChemicalReactions() diff --git a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp index 300e1fc0360..c4e2719aeed 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp @@ -41,14 +41,14 @@ class ReactiveMultiFluid : public MultiFluidBase using exec_policy = serialPolicy; ReactiveMultiFluid( string const & name, - Group * const parent ); + dataRepository::Group * const parent ); virtual std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; + dataRepository::Group * const parent ) const override; - virtual void allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numPts ) override; virtual bool isThermal() const override; diff --git a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp index 252111f32a5..c926eec894f 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp @@ -79,10 +79,9 @@ CompressibleSinglePhaseFluid::CompressibleSinglePhaseFluid( string const & name, } -void CompressibleSinglePhaseFluid::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void CompressibleSinglePhaseFluid::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - SingleFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + SingleFluidBase::allocateConstitutiveData( parent, numPts ); getField< fields::singlefluid::density >().setApplyDefaultValue( m_referenceDensity ); getField< fields::singlefluid::viscosity >().setApplyDefaultValue( m_referenceViscosity ); diff --git a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.hpp b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.hpp index e9e8db9f0f7..4446616bb9c 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.hpp @@ -144,14 +144,14 @@ class CompressibleSinglePhaseFluid : public SingleFluidBase { public: using DerivOffset = singlefluid::DerivativeOffset; - CompressibleSinglePhaseFluid( string const & name, Group * const parent ); + CompressibleSinglePhaseFluid( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "CompressibleSinglePhaseFluid"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numPts ) override; /// Type of kernel wrapper for in-kernel update (TODO: support multiple EAT, not just linear) using KernelWrapper = CompressibleSinglePhaseUpdate< ExponentApproximationType::Linear, ExponentApproximationType::Linear >; diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp index 86ce6727c10..bb7d92d6577 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp @@ -53,12 +53,11 @@ ParticleFluidBase::ParticleFluidBase( string const & name, Group * const parent registerField< fields::particlefluid::proppantPackPermeability >( &m_proppantPackPermeability ); } -void ParticleFluidBase::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void ParticleFluidBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) { m_dSettlingFactor_dComponentConcentration.resize( 0, MAX_NUM_COMPONENTS ); - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } } //namespace constitutive diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.hpp b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.hpp index 5549407dd6f..1f507c79373 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.hpp @@ -149,10 +149,10 @@ class ParticleFluidBase : public ConstitutiveBase { public: - ParticleFluidBase( string const & name, Group * const parent ); + ParticleFluidBase( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numPts ) override; static constexpr localIndex MAX_NUM_COMPONENTS = 4; diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.cpp index 840c7800c77..b39cba9d6bf 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.cpp @@ -62,10 +62,9 @@ ProppantSlurryFluid::ProppantSlurryFluid( string const & name, Group * const par } -void ProppantSlurryFluid::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void ProppantSlurryFluid::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - SlurryFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + SlurryFluidBase::allocateConstitutiveData( parent, numPts ); m_density.value.setValues< serialPolicy >( m_referenceDensity ); m_viscosity.value.setValues< serialPolicy >( m_referenceViscosity ); diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.hpp b/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.hpp index eb2c4eaa06a..c80ed369c05 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.hpp @@ -288,15 +288,15 @@ class ProppantSlurryFluid : public SlurryFluidBase { public: - ProppantSlurryFluid( string const & name, Group * const parent ); + ProppantSlurryFluid( string const & name, dataRepository::Group * const parent ); // *** ConstitutiveBase interface static string catalogName() { return "ProppantSlurryFluid"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numPts ) override; using KernelWrapper = ProppantSlurryFluidUpdate; diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp index d286c41725e..e8ba330996c 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp @@ -78,29 +78,30 @@ void SingleFluidBase::saveConvergedState() const } ); } -void SingleFluidBase::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +//START_SPHINX_INCLUDE_00 +void SingleFluidBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) { // density - m_density.value.resize( 0, numConstitutivePointsPerParentIndex ); - m_density.derivs.resize( 0, numConstitutivePointsPerParentIndex, m_numDOF ); - m_density_n.resize( 0, numConstitutivePointsPerParentIndex ); + m_density.value.resize( 0, numPts ); + m_density.derivs.resize( 0, numPts, m_numDOF ); + m_density_n.resize( 0, numPts ); // viscosity - m_viscosity.value.resize( 0, numConstitutivePointsPerParentIndex ); - m_viscosity.derivs.resize( 0, numConstitutivePointsPerParentIndex, m_numDOF ); + m_viscosity.value.resize( 0, numPts ); + m_viscosity.derivs.resize( 0, numPts, m_numDOF ); // internal energy - m_internalEnergy.value.resize( 0, numConstitutivePointsPerParentIndex ); - m_internalEnergy.derivs.resize( 0, numConstitutivePointsPerParentIndex, m_numDOF ); - m_internalEnergy_n.resize( 0, numConstitutivePointsPerParentIndex ); + m_internalEnergy.value.resize( 0, numPts ); + m_internalEnergy.derivs.resize( 0, numPts, m_numDOF ); + m_internalEnergy_n.resize( 0, numPts ); // enthalpy - m_enthalpy.value.resize( 0, numConstitutivePointsPerParentIndex ); - m_enthalpy.derivs.resize( 0, numConstitutivePointsPerParentIndex, m_numDOF ); + m_enthalpy.value.resize( 0, numPts ); + m_enthalpy.derivs.resize( 0, numPts, m_numDOF ); - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } +//END_SPHINX_INCLUDE_00 } //namespace constitutive diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp index da1d017ddf3..1eea602736b 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp @@ -222,10 +222,10 @@ class SingleFluidBase : public ConstitutiveBase * @param name name of the group * @param parent pointer to parent group */ - SingleFluidBase( string const & name, Group * const parent ); + SingleFluidBase( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numPts ) override; virtual void saveConvergedState() const override; diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp index 156f8984807..987fa5cf34c 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp @@ -252,9 +252,9 @@ class SlurryFluidBase : public SingleFluidBase public: using SingleFluidProp = SingleFluidVar< real64, 2, constitutive::singlefluid::LAYOUT_FLUID, constitutive::singlefluid::LAYOUT_FLUID_DER >; - SlurryFluidBase( string const & name, Group * const parent ); + SlurryFluidBase( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( Group & parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ); static constexpr localIndex MAX_NUM_COMPONENTS = 3; diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp index 50868af0b7c..d16dc3b37a7 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp @@ -193,13 +193,13 @@ class ThermalCompressibleSinglePhaseFluid : public CompressibleSinglePhaseFluid { public: - ThermalCompressibleSinglePhaseFluid( string const & name, Group * const parent ); + ThermalCompressibleSinglePhaseFluid( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "ThermalCompressibleSinglePhaseFluid"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( Group & parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; using CompressibleSinglePhaseFluid::m_densityModelType; diff --git a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp index 5b9f6e38f7e..71fcff96d03 100644 --- a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp +++ b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp @@ -40,7 +40,7 @@ class TwoPhaseImmiscibleFluid : public ConstitutiveBase public: TwoPhaseImmiscibleFluid( string const & name, - Group * const parent ); + dataRepository::Group * const parent ); /** * @name Static Factory Catalog members and functions @@ -61,7 +61,7 @@ class TwoPhaseImmiscibleFluid : public ConstitutiveBase ///@} - virtual void allocateConstitutiveData( Group & parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ); /** diff --git a/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.hpp b/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.hpp index ac05a00ef7f..d2f85582c05 100644 --- a/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.hpp @@ -83,16 +83,16 @@ class CarmanKozenyPermeability : public PermeabilityBase { public: - CarmanKozenyPermeability( string const & name, Group * const parent ); + CarmanKozenyPermeability( string const & name, dataRepository::Group * const parent ); std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; + dataRepository::Group * const parent ) const override; static string catalogName() { return "CarmanKozenyPermeability"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( Group & parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; /// Type of kernel wrapper for in-kernel update diff --git a/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp b/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp index be744272afc..e2f94dcdc90 100644 --- a/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp @@ -46,16 +46,16 @@ class ConstantPermeability : public PermeabilityBase { public: - ConstantPermeability( string const & name, Group * const parent ); + ConstantPermeability( string const & name, dataRepository::Group * const parent ); std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; + dataRepository::Group * const parent ) const override; static string catalogName() { return "ConstantPermeability"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( Group & parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; /// Type of kernel wrapper for in-kernel update diff --git a/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.hpp b/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.hpp index 64327b4b578..d7c0956a4a4 100644 --- a/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.hpp @@ -92,13 +92,13 @@ class ExponentialDecayPermeability : public PermeabilityBase { public: - ExponentialDecayPermeability( string const & name, Group * const parent ); + ExponentialDecayPermeability( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "ExponentialDecayPermeability"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( Group & parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; /// Type of kernel wrapper for in-kernel update diff --git a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.hpp b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.hpp index e5a632cc855..80b5901714b 100644 --- a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.hpp @@ -106,13 +106,13 @@ class ParallelPlatesPermeability : public PermeabilityBase { public: - ParallelPlatesPermeability( string const & name, Group * const parent ); + ParallelPlatesPermeability( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "ParallelPlatesPermeability"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( Group & parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; virtual void initializeState() const override final; diff --git a/src/coreComponents/constitutive/permeability/PermeabilityBase.hpp b/src/coreComponents/constitutive/permeability/PermeabilityBase.hpp index b7f6c30b9f0..190b8f1b4f6 100644 --- a/src/coreComponents/constitutive/permeability/PermeabilityBase.hpp +++ b/src/coreComponents/constitutive/permeability/PermeabilityBase.hpp @@ -107,9 +107,9 @@ class PermeabilityBase : public ConstitutiveBase { public: - PermeabilityBase( string const & name, Group * const parent ); + PermeabilityBase( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( Group & parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; /** diff --git a/src/coreComponents/constitutive/permeability/PressurePermeability.hpp b/src/coreComponents/constitutive/permeability/PressurePermeability.hpp index cea50e14a5b..87eaf84c961 100644 --- a/src/coreComponents/constitutive/permeability/PressurePermeability.hpp +++ b/src/coreComponents/constitutive/permeability/PressurePermeability.hpp @@ -141,13 +141,13 @@ class PressurePermeability : public PermeabilityBase { public: - PressurePermeability( string const & name, Group * const parent ); + PressurePermeability( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "PressurePermeability"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( Group & parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; /// Type of kernel wrapper for in-kernel update diff --git a/src/coreComponents/constitutive/permeability/ProppantPermeability.hpp b/src/coreComponents/constitutive/permeability/ProppantPermeability.hpp index 775dddfb525..703eeaeafdb 100644 --- a/src/coreComponents/constitutive/permeability/ProppantPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ProppantPermeability.hpp @@ -113,13 +113,13 @@ class ProppantPermeability : public PermeabilityBase { public: - ProppantPermeability( string const & name, Group * const parent ); + ProppantPermeability( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "ProppantPermeability"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( Group & parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; /// Type of kernel wrapper for in-kernel update diff --git a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.hpp b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.hpp index c7ff3ac82dc..912e85b388f 100644 --- a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.hpp @@ -90,13 +90,13 @@ class SlipDependentPermeability : public PermeabilityBase { public: - SlipDependentPermeability( string const & name, Group * const parent ); + SlipDependentPermeability( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "SlipDependentPermeability"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( Group & parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; /// Type of kernel wrapper for in-kernel update diff --git a/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.hpp b/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.hpp index 03053766f41..0578fdf834a 100644 --- a/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.hpp @@ -97,13 +97,13 @@ class WillisRichardsPermeability : public PermeabilityBase { public: - WillisRichardsPermeability( string const & name, Group * const parent ); + WillisRichardsPermeability( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "WillisRichardsPermeability"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( Group & parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; /// Type of kernel wrapper for in-kernel update diff --git a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp index 1530705a0fd..0bc67b26a39 100644 --- a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp +++ b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp @@ -150,7 +150,7 @@ class RelativePermeabilityBase : public ConstitutiveBase RelativePermeabilityBase( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( Group & parent, + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; integer numFluidPhases() const { return LvArray::integerConversion< integer >( m_phaseNames.size() ); } diff --git a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.hpp b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.hpp index 6b49f7958f2..3f0d5611f4c 100644 --- a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.hpp +++ b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.hpp @@ -79,7 +79,7 @@ class TableRelativePermeabilityHysteresis : public RelativePermeabilityBase virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; /// Type of kernel wrapper for in-kernel update class KernelWrapper final : public RelativePermeabilityBaseUpdate diff --git a/src/coreComponents/constitutive/solid/CeramicDamage.hpp b/src/coreComponents/constitutive/solid/CeramicDamage.hpp index 8a544065017..1c9442b50e2 100644 --- a/src/coreComponents/constitutive/solid/CeramicDamage.hpp +++ b/src/coreComponents/constitutive/solid/CeramicDamage.hpp @@ -420,7 +420,7 @@ class CeramicDamage : public ElasticIsotropic * @param[in] name name of the instance in the catalog * @param[in] parent the group which contains this instance */ - CeramicDamage( string const & name, Group * const parent ); + CeramicDamage( string const & name, dataRepository::Group * const parent ); /** * @name Static Factory Catalog members and functions @@ -436,7 +436,7 @@ class CeramicDamage : public ElasticIsotropic ///@} - virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; /** * Keys for data specified in this class. diff --git a/src/coreComponents/constitutive/solid/DelftEgg.hpp b/src/coreComponents/constitutive/solid/DelftEgg.hpp index b80215416f3..ce00a5385b9 100644 --- a/src/coreComponents/constitutive/solid/DelftEgg.hpp +++ b/src/coreComponents/constitutive/solid/DelftEgg.hpp @@ -468,9 +468,9 @@ class DelftEgg : public ElasticIsotropic * @param[in] name name of the instance in the catalog * @param[in] parent the group which contains this instance */ - DelftEgg( string const & name, Group * const parent ); + DelftEgg( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; virtual void saveConvergedState() const override; diff --git a/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.hpp b/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.hpp index fc84946395a..24b5ec1f18e 100644 --- a/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.hpp +++ b/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.hpp @@ -33,16 +33,16 @@ namespace constitutive class PoreVolumeCompressibleSolid : public ConstitutiveBase { public: - PoreVolumeCompressibleSolid( string const & name, Group * const parent ); + PoreVolumeCompressibleSolid( string const & name, dataRepository::Group * const parent ); std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; + dataRepository::Group * const parent ) const override; static string catalogName() { return "PoreVolumeCompressibleSolid"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; virtual void stateUpdatePointPressure( real64 const & pres, localIndex const k, diff --git a/src/coreComponents/constitutive/solid/DruckerPrager.hpp b/src/coreComponents/constitutive/solid/DruckerPrager.hpp index d67d75e594c..e1543d3135a 100644 --- a/src/coreComponents/constitutive/solid/DruckerPrager.hpp +++ b/src/coreComponents/constitutive/solid/DruckerPrager.hpp @@ -358,9 +358,9 @@ class DruckerPrager : public ElasticIsotropic * @param[in] name name of the instance in the catalog * @param[in] parent the group which contains this instance */ - DruckerPrager( string const & name, Group * const parent ); + DruckerPrager( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; virtual void saveConvergedState() const override; diff --git a/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp b/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp index 28365680c10..660649dc14b 100644 --- a/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp +++ b/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp @@ -384,9 +384,9 @@ class DruckerPragerExtended : public ElasticIsotropic * @param[in] name name of the instance in the catalog * @param[in] parent the group which contains this instance */ - DruckerPragerExtended( string const & name, Group * const parent ); + DruckerPragerExtended( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; virtual void saveConvergedState() const override; diff --git a/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp b/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp index 05383d19b5b..26b570974f3 100644 --- a/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp +++ b/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp @@ -485,9 +485,9 @@ class ModifiedCamClay : public ElasticIsotropicPressureDependent * @param[in] name name of the instance in the catalog * @param[in] parent the group which contains this instance */ - ModifiedCamClay( string const & name, Group * const parent ); + ModifiedCamClay( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; virtual void saveConvergedState() const override; diff --git a/src/coreComponents/constitutive/solid/SolidBase.hpp b/src/coreComponents/constitutive/solid/SolidBase.hpp index d1a5b560bbe..bee15f6c9fd 100644 --- a/src/coreComponents/constitutive/solid/SolidBase.hpp +++ b/src/coreComponents/constitutive/solid/SolidBase.hpp @@ -562,7 +562,7 @@ class SolidBase : public constitutive::ConstitutiveBase SolidBase( string const & name, Group * const parent ); - virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; /// Keys for data in this class struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct diff --git a/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp b/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp index 521d53b88ac..abe645bafa2 100644 --- a/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp +++ b/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp @@ -93,13 +93,13 @@ class SolidInternalEnergy : public ConstitutiveBase { public: - SolidInternalEnergy( string const & name, Group * const parent ); + SolidInternalEnergy( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "SolidInternalEnergy"; } virtual string getCatalogName() const override { return catalogName(); } - virtual void allocateConstitutiveData( Group & parent, localIndex const numPts ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct { diff --git a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp index 1282c527b9d..19e959bbfe2 100644 --- a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp +++ b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp @@ -231,7 +231,7 @@ class BiotPorosityUpdates : public PorosityBaseUpdates class BiotPorosity : public PorosityBase { public: - BiotPorosity( string const & name, Group * const parent ); + BiotPorosity( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "BiotPorosity"; } diff --git a/src/coreComponents/constitutive/solid/porosity/PorosityBase.hpp b/src/coreComponents/constitutive/solid/porosity/PorosityBase.hpp index 6489a1e1cc1..5ce2cce6d38 100644 --- a/src/coreComponents/constitutive/solid/porosity/PorosityBase.hpp +++ b/src/coreComponents/constitutive/solid/porosity/PorosityBase.hpp @@ -109,7 +109,7 @@ class PorosityBaseUpdates class PorosityBase : public ConstitutiveBase { public: - PorosityBase( string const & name, Group * const parent ); + PorosityBase( string const & name, dataRepository::Group * const parent ); virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp index 766c80d0387..1a7e4daba1b 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp @@ -67,7 +67,7 @@ class MultiPhaseConstantThermalConductivity : public MultiPhaseThermalConductivi * @param[in] name the name of the class * @param[in] parent pointer to the parent Group */ - MultiPhaseConstantThermalConductivity( string const & name, Group * const parent ); + MultiPhaseConstantThermalConductivity( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "MultiPhaseConstantThermalConductivity"; } diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp index cef54fd7326..92b16a454c2 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp @@ -120,7 +120,7 @@ class MultiPhaseVolumeWeightedThermalConductivity : public MultiPhaseThermalCond * @param[in] name the name of the class * @param[in] parent pointer to the parent Group */ - MultiPhaseVolumeWeightedThermalConductivity( string const & name, Group * const parent ); + MultiPhaseVolumeWeightedThermalConductivity( string const & name, dataRepository::Group * const parent ); virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; diff --git a/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp b/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp index e0178b5e90b..130a61712d7 100644 --- a/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp +++ b/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp @@ -59,8 +59,15 @@ class InvariantImmiscibleFluidValidationTestFixture : public FluidModelTest< Inv Base::createFluid( "InvariantImmiscibleFluid", [this]( InvariantImmiscibleFluid & fluid ){ setupFluidConfiguration( fluid ); - // Use proper public initialization instead of protected postInputInitialization - fluid.initialize( 1, 1 ); + // create a dummy discretization with one quadrature point for + // storing constitutive data + + conduit::Node node; + dataRepository::Group rootGroup( "root", node ); + dataRepository::Group discretization( "discretization", &rootGroup ); + + discretization.resize( 1 ); // one element + fluid.allocateConstitutiveData( discretization, 1 ); // one quadrature point fluid.saveConvergedState(); } ); } @@ -176,7 +183,15 @@ class InvariantImmiscibleFluidTestFixture : public FluidModelTest< InvariantImmi fluid.setMassFlag( USE_MASS ); // Need to allocate data for the fluid properties since we're now using KernelWrapper - fluid.initialize( 1, 1 ); + // create a dummy discretization with one quadrature point for + // storing constitutive data + + conduit::Node node; + dataRepository::Group rootGroup( "root", node ); + dataRepository::Group discretization( "discretization", &rootGroup ); + + discretization.resize( 1 ); // one element + fluid.allocateConstitutiveData( discretization, 1 ); // one quadrature point // Initialize the fluid by computing properties with a test composition StackArray< real64, 2, 3, compflow::LAYOUT_COMP > compositionData( 1, 3 ); diff --git a/src/coreComponents/mesh/ObjectManagerBase.hpp b/src/coreComponents/mesh/ObjectManagerBase.hpp index d15d5059195..62b7814e8d1 100644 --- a/src/coreComponents/mesh/ObjectManagerBase.hpp +++ b/src/coreComponents/mesh/ObjectManagerBase.hpp @@ -585,14 +585,12 @@ class ObjectManagerBase : public dataRepository::Group /** * @brief Helper function to register fields * @tparam FIELD_TRAIT the type of field - * @param[in] fieldTrait the struct corresponding to the field being registered * @param[in] newObject a pointer to the object that is being registered * @return A reference to the newly registered/created Wrapper */ template< typename FIELD_TRAIT > dataRepository::Wrapper< typename FIELD_TRAIT::type > & registerField( typename FIELD_TRAIT::type * newObject ) { - m_registeredField.insert( FIELD_TRAIT::key()); return registerWrapper( FIELD_TRAIT::key(), newObject ). diff --git a/src/coreComponents/unitTests/constitutiveTests/testRelPerm.cpp b/src/coreComponents/unitTests/constitutiveTests/testRelPerm.cpp index 3a4d8e375e7..2b377005b89 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testRelPerm.cpp +++ b/src/coreComponents/unitTests/constitutiveTests/testRelPerm.cpp @@ -1078,7 +1078,6 @@ TEST_F( RelPermTest, numericalDerivatives_TableRelPermHysteresisTwoPhase ) initSat[0][0] = 0.6; initSat[0][1] = 0.4; - m_model->allocateConstitutiveData( m_parent, 1 ); m_model->saveConvergedPhaseVolFractionState( initSat.toViewConst() ); // move the historical phase vol fraction back to the CPU since the test is performed on the CPU diff --git a/src/coreComponents/unitTests/constitutiveTests/testRelPermHysteresis.cpp b/src/coreComponents/unitTests/constitutiveTests/testRelPermHysteresis.cpp index 28744ccff82..eee180128de 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testRelPermHysteresis.cpp +++ b/src/coreComponents/unitTests/constitutiveTests/testRelPermHysteresis.cpp @@ -121,6 +121,7 @@ TableRelativePermeabilityHysteresis & makeTableRelPermHysteresisTwoPhase( string auto & imbibitionGasTableName = relPerm.getReference< string >( keys::imbibitionNonWettingRelPermTableNameString() ); imbibitionGasTableName = "imbibitionGas_swg"; + relPerm.allocateConstitutiveData( parent, 1 ); relPerm.postInputInitializationRecursive(); relPerm.initialize(); // to test all the checks return relPerm; From 31b80be752aacac8a1f04e16bca11d0539369eb0 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 22 Aug 2025 17:19:23 -0500 Subject: [PATCH 23/43] fix unit test --- src/coreComponents/unitTests/constitutiveTests/testRelPerm.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/coreComponents/unitTests/constitutiveTests/testRelPerm.cpp b/src/coreComponents/unitTests/constitutiveTests/testRelPerm.cpp index 2b377005b89..9f5dc82b1e0 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testRelPerm.cpp +++ b/src/coreComponents/unitTests/constitutiveTests/testRelPerm.cpp @@ -751,6 +751,7 @@ RelativePermeabilityBase & makeTableRelPermHysteresisTwoPhase( string const & na auto & imbibitionGasTableName = relPerm.getReference< string >( keys::imbibitionNonWettingRelPermTableNameString() ); imbibitionGasTableName = "imbibitionGas_swg"; + relPerm.allocateConstitutiveData( parent, 1 ); relPerm.postInputInitializationRecursive(); relPerm.initialize(); // to test all the checks return relPerm; From 136ff176a557174d37a302a48f9f989c6f308fa0 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 22 Aug 2025 17:54:49 -0500 Subject: [PATCH 24/43] last touch --- src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp | 2 +- .../constitutive/dispersion/LinearIsotropicDispersion.hpp | 2 +- .../constitutive/fluid/multifluid/MultiFluidBase.hpp | 2 +- .../constitutive/permeability/ConstantPermeability.hpp | 2 +- .../constitutive/permeability/PressurePermeability.hpp | 2 +- src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp | 2 +- src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp | 2 +- .../constitutive/solid/porosity/PressurePorosity.hpp | 2 +- .../constitutive/solid/porosity/ProppantPorosity.hpp | 2 +- .../MultiPhaseConstantThermalConductivity.hpp | 2 +- .../MultiPhaseVolumeWeightedThermalConductivity.hpp | 2 +- .../thermalConductivity/SinglePhaseThermalConductivity.hpp | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp index 4b8382a62fa..90258d2e0fb 100644 --- a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp +++ b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp @@ -89,7 +89,7 @@ class ConstantDiffusion : public DiffusionBase struct viewKeyStruct : public DiffusionBase::viewKeyStruct { static constexpr char const * diffusivityComponentsString() { return "diffusivityComponents"; } - } viewKeys; + }; protected: diff --git a/src/coreComponents/constitutive/dispersion/LinearIsotropicDispersion.hpp b/src/coreComponents/constitutive/dispersion/LinearIsotropicDispersion.hpp index 23f96131168..65da33a1dba 100644 --- a/src/coreComponents/constitutive/dispersion/LinearIsotropicDispersion.hpp +++ b/src/coreComponents/constitutive/dispersion/LinearIsotropicDispersion.hpp @@ -105,7 +105,7 @@ class LinearIsotropicDispersion : public DispersionBase struct viewKeyStruct : public DispersionBase::viewKeyStruct { static constexpr char const * longitudinalDispersivityString() { return "longitudinalDispersivity"; } - } viewKeys; + }; protected: diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp index c52973c129d..1518376617c 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp @@ -39,7 +39,7 @@ class MultiFluidBase : public ConstitutiveBase Group * const parent ); virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numPts ); + localIndex const numPts ) override; // *** MultiFluid-specific interface diff --git a/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp b/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp index e2f94dcdc90..24e0325bdc3 100644 --- a/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp @@ -75,7 +75,7 @@ class ConstantPermeability : public PermeabilityBase struct viewKeyStruct : public PermeabilityBase::viewKeyStruct { static constexpr char const * permeabilityComponentsString() { return "permeabilityComponents"; } - } viewKeys; + }; virtual void initializeState() const override final; diff --git a/src/coreComponents/constitutive/permeability/PressurePermeability.hpp b/src/coreComponents/constitutive/permeability/PressurePermeability.hpp index 87eaf84c961..9d654048a0e 100644 --- a/src/coreComponents/constitutive/permeability/PressurePermeability.hpp +++ b/src/coreComponents/constitutive/permeability/PressurePermeability.hpp @@ -176,7 +176,7 @@ class PressurePermeability : public PermeabilityBase static constexpr char const * referencePermeabilityString() { return "referencePermeability"; } static constexpr char const * maxPermeabilityString() { return "maxPermeability"; } static constexpr char const * pressureModelTypeString() { return "pressureModelType"; } - } viewKeys; + }; virtual void initializeState() const override final; diff --git a/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp b/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp index abe645bafa2..c9e70f9abd9 100644 --- a/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp +++ b/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp @@ -110,7 +110,7 @@ class SolidInternalEnergy : public ConstitutiveBase static constexpr char const * dVolumetricHeatCapacity_dTemperatureString() { return "dVolumetricHeatCapacity_dTemperature"; } static constexpr char const * referenceTemperatureString() { return "referenceTemperature"; } static constexpr char const * referenceInternalEnergyString() { return "referenceInternalEnergy"; } - } viewKeys; + }; using KernelWrapper = SolidInternalEnergyUpdates; diff --git a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp index 19e959bbfe2..36e04505a86 100644 --- a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp +++ b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp @@ -256,7 +256,7 @@ class BiotPorosity : public PorosityBase static constexpr char const *useUniaxialFixedStressString() { return "useUniaxialFixedStress"; } static constexpr char const *defaultBiotCoefficientString() { return "defaultBiotCoefficient"; } - } viewKeys; + }; virtual void initializeState() const override final; diff --git a/src/coreComponents/constitutive/solid/porosity/PressurePorosity.hpp b/src/coreComponents/constitutive/solid/porosity/PressurePorosity.hpp index a6e45bf4d39..6bc961e39d0 100644 --- a/src/coreComponents/constitutive/solid/porosity/PressurePorosity.hpp +++ b/src/coreComponents/constitutive/solid/porosity/PressurePorosity.hpp @@ -104,7 +104,7 @@ class PressurePorosity : public PorosityBase { static constexpr char const * referencePressureString() { return "referencePressure"; } static constexpr char const * compressibilityString() { return "compressibility"; } - } viewKeys; + }; using KernelWrapper = PressurePorosityUpdates; diff --git a/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.hpp b/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.hpp index e33a4239bc1..b217eed55a6 100644 --- a/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.hpp +++ b/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.hpp @@ -82,7 +82,7 @@ class ProppantPorosity : public PorosityBase struct viewKeyStruct : public PorosityBase::viewKeyStruct { static constexpr char const * maxProppantConcentrationString() { return "maxProppantConcentration"; } - } viewKeys; + }; using KernelWrapper = ProppantPorosityUpdates; diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp index 1a7e4daba1b..f4939ddf1f5 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp @@ -91,7 +91,7 @@ class MultiPhaseConstantThermalConductivity : public MultiPhaseThermalConductivi struct viewKeyStruct : public MultiPhaseThermalConductivityBase::viewKeyStruct { static constexpr char const * thermalConductivityComponentsString() { return "thermalConductivityComponents"; } - } viewKeys; + }; protected: diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp index 92b16a454c2..c4b1484b276 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp @@ -153,7 +153,7 @@ class MultiPhaseVolumeWeightedThermalConductivity : public MultiPhaseThermalCond { static constexpr char const * rockThermalConductivityComponentsString() { return "rockThermalConductivityComponents"; } static constexpr char const * phaseThermalConductivityString() { return "phaseThermalConductivity"; } - } viewKeys; + }; protected: diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.hpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.hpp index f6b61b80914..2e65c26f48b 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivity.hpp @@ -94,7 +94,7 @@ class SinglePhaseThermalConductivity : public SinglePhaseThermalConductivityBase static constexpr char const * defaultThermalConductivityComponentsString() { return "defaultThermalConductivityComponents"; } static constexpr char const * thermalConductivityGradientComponentsString() { return "thermalConductivityGradientComponents"; } static constexpr char const * referenceTemperatureString() { return "referenceTemperature"; } - } viewKeys; + }; protected: From 415cb8693e05885a9993fd879fa4a1b90f17a56c Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 22 Aug 2025 18:14:12 -0500 Subject: [PATCH 25/43] cleanup TODO --- .../constitutive/diffusion/DiffusionBase.cpp | 5 ----- .../SolidModelDiscretizationOpsFullyAnisotropic.hpp | 3 +-- .../constitutive/solid/porosity/BiotPorosity.cpp | 4 ++-- .../MultiPhaseThermalConductivityBase.cpp | 4 ---- .../SinglePhaseThermalConductivityBase.cpp | 9 --------- .../SinglePhaseThermalConductivityBase.hpp | 2 -- 6 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp b/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp index 6f632a823eb..c4a9fbd48b7 100644 --- a/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp +++ b/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp @@ -61,11 +61,6 @@ void DiffusionBase::postInputInitialization() GEOS_FMT( "{}: the arrays in `{}` and `{}` must have the same size", getFullName(), viewKeyStruct::phaseNamesString(), viewKeyStruct::defaultPhaseDiffusivityMultiplierString() ), InputError ); - - // TODO figure out why this is really needed - m_diffusivity.resize( 0, 0, 3 ); - m_dDiffusivity_dTemperature.resize( 0, 0, 3 ); - m_phaseDiffusivityMultiplier.resize( 0, 0, 3 ); } void DiffusionBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) diff --git a/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotropic.hpp b/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotropic.hpp index 0193f5b69a6..19a7db1bea3 100644 --- a/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotropic.hpp +++ b/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotropic.hpp @@ -28,8 +28,7 @@ namespace constitutive { -struct SolidModelDiscretizationOpsFullyAnisotropic : public SolidModelDiscretizationOps // TODO: spelling error, - // convert to "General" anyway +struct SolidModelDiscretizationOpsFullyAnisotropic : public SolidModelDiscretizationOps { template< int NUM_SUPPORT_POINTS, typename BASIS_GRADIENT > diff --git a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.cpp b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.cpp index 28065272b29..250fa01cff1 100644 --- a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.cpp +++ b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.cpp @@ -48,11 +48,11 @@ BiotPorosity::BiotPorosity( string const & name, Group * const parent ): setInputFlag( InputFlags::OPTIONAL ). setDescription( "Flag enabling uniaxial approximation in fixed stress update" ); - registerWrapper( viewKeyStruct::solidBulkModulusString(), &m_bulkModulus ). // TODO field? + registerWrapper( viewKeyStruct::solidBulkModulusString(), &m_bulkModulus ). setApplyDefaultValue( 1e-6 ). setDescription( "Solid bulk modulus" ); - registerWrapper( viewKeyStruct::solidShearModulusString(), &m_shearModulus ). // TODO field? + registerWrapper( viewKeyStruct::solidShearModulusString(), &m_shearModulus ). setApplyDefaultValue( 1e-6 ). setDescription( "Solid shear modulus" ); diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp index 63cbf420046..5040067512d 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp @@ -52,10 +52,6 @@ void MultiPhaseThermalConductivityBase::postInputInitialization() GEOS_THROW_IF_GT_MSG( numPhases, MAX_NUM_PHASES, GEOS_FMT( "{}: invalid number of phases", getFullName() ), InputError ); - - // TODO figure out why this is really needed - m_effectiveConductivity.resize( 0, 0, 3 ); - m_dEffectiveConductivity_dPhaseVolFrac.resize( 0, 0, 3, numPhases ); } void MultiPhaseThermalConductivityBase::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp index 71367d854b0..240a3792df4 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp @@ -35,15 +35,6 @@ SinglePhaseThermalConductivityBase::SinglePhaseThermalConductivityBase( string c registerField< fields::thermalconductivity::dEffectiveConductivity_dT >( &m_dEffectiveConductivity_dT ); } -void SinglePhaseThermalConductivityBase::postInputInitialization() -{ - ConstitutiveBase::postInputInitialization(); - - // TODO figure out why this is really needed - m_effectiveConductivity.resize( 0, 0, 3 ); - m_dEffectiveConductivity_dT.resize( 0, 0, 3 ); -} - void SinglePhaseThermalConductivityBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) { // NOTE: enforcing 1 quadrature point diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp index 07c8f90a474..542f3fc5f23 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp @@ -147,8 +147,6 @@ class SinglePhaseThermalConductivityBase : public ConstitutiveBase protected: - virtual void postInputInitialization() override; - /// cell-wise effective conductivities in the subregion array3d< real64 > m_effectiveConductivity; From cb02533ff954e7ebc251ca2d4411bae4b11bdeff Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 22 Aug 2025 21:09:12 -0500 Subject: [PATCH 26/43] missign override --- .../constitutive/fluid/singlefluid/SlurryFluidBase.hpp | 2 +- .../fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp | 2 +- .../thermalConductivity/SinglePhaseThermalConductivityBase.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp index 987fa5cf34c..88414b94494 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp @@ -255,7 +255,7 @@ class SlurryFluidBase : public SingleFluidBase SlurryFluidBase( string const & name, dataRepository::Group * const parent ); virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numPts ); + localIndex const numPts ) override; static constexpr localIndex MAX_NUM_COMPONENTS = 3; diff --git a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp index 71fcff96d03..1af48283199 100644 --- a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp +++ b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp @@ -62,7 +62,7 @@ class TwoPhaseImmiscibleFluid : public ConstitutiveBase ///@} virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numPts ); + localIndex const numPts ) override; /** * @brief Getter for the fluid phase names diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp index 542f3fc5f23..09444cd7e06 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp @@ -96,7 +96,7 @@ class SinglePhaseThermalConductivityBase : public ConstitutiveBase */ SinglePhaseThermalConductivityBase( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ); + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; /** * @brief Initialize the thermal conductivity state (needed when thermal conductivity depends on porosity and phase volume fraction) From c16b9966fda5696691c69ed34512d6c7576e66c3 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Mon, 25 Aug 2025 15:38:15 -0500 Subject: [PATCH 27/43] remove redundant --- .../constitutive/contact/CoulombFriction.cpp | 5 +---- .../contact/HydraulicApertureBase.cpp | 3 +-- .../fluid/multifluid/MultiFluidBase.cpp | 7 +++---- .../CompressibleSinglePhaseFluid.cpp | 8 +++---- .../ThermalCompressibleSinglePhaseFluid.cpp | 5 ++--- .../permeability/CarmanKozenyPermeability.cpp | 5 ++--- .../ParallelPlatesPermeability.cpp | 2 ++ .../permeability/PermeabilityBase.cpp | 4 +--- .../permeability/ProppantPermeability.cpp | 6 +----- .../constitutive/solid/CeramicDamage.cpp | 9 +------- .../constitutive/solid/CoupledSolidBase.cpp | 6 +----- .../constitutive/solid/Damage.cpp | 21 +------------------ .../constitutive/solid/DelftEgg.cpp | 13 +----------- .../constitutive/solid/DruckerPrager.cpp | 11 +--------- .../solid/DruckerPragerExtended.cpp | 14 +------------ .../constitutive/solid/DuvautLionsSolid.cpp | 3 +-- .../constitutive/solid/ElasticIsotropic.cpp | 6 +----- .../ElasticIsotropicPressureDependent.cpp | 10 +-------- .../constitutive/solid/ElasticOrthotropic.cpp | 20 +----------------- .../solid/ElasticTransverseIsotropic.cpp | 12 +---------- .../constitutive/solid/ModifiedCamClay.cpp | 9 +------- .../constitutive/solid/PerfectlyPlastic.cpp | 4 +--- .../constitutive/solid/SolidBase.cpp | 6 +----- .../solid/SolidInternalEnergy.cpp | 8 +------ .../solid/porosity/PorosityBase.cpp | 9 +------- .../solid/porosity/PressurePorosity.cpp | 4 +--- .../solid/porosity/ProppantPorosity.cpp | 3 +-- 27 files changed, 34 insertions(+), 179 deletions(-) diff --git a/src/coreComponents/constitutive/contact/CoulombFriction.cpp b/src/coreComponents/constitutive/contact/CoulombFriction.cpp index ff0e36fbdde..15b1abc1464 100644 --- a/src/coreComponents/constitutive/contact/CoulombFriction.cpp +++ b/src/coreComponents/constitutive/contact/CoulombFriction.cpp @@ -28,10 +28,7 @@ namespace constitutive { CoulombFriction::CoulombFriction( string const & name, Group * const parent ): - FrictionBase( name, parent ), - m_cohesion(), - m_frictionCoefficient(), - m_elasticSlip() + FrictionBase( name, parent ) { registerWrapper( viewKeyStruct::shearStiffnessString(), &m_shearStiffness ). setInputFlag( InputFlags::OPTIONAL ). diff --git a/src/coreComponents/constitutive/contact/HydraulicApertureBase.cpp b/src/coreComponents/constitutive/contact/HydraulicApertureBase.cpp index 8efdc7c2825..ecbef3d6854 100644 --- a/src/coreComponents/constitutive/contact/HydraulicApertureBase.cpp +++ b/src/coreComponents/constitutive/contact/HydraulicApertureBase.cpp @@ -29,8 +29,7 @@ namespace constitutive HydraulicApertureBase::HydraulicApertureBase( string const & name, Group * const parent ): - ConstitutiveBase( name, parent ), - m_aperture0( 0.0 ) + ConstitutiveBase( name, parent ) { /// TODO: must become a required parameter. registerWrapper( viewKeyStruct::apertureZeroString(), &m_aperture0 ). diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp index 590da816354..59969b37741 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp @@ -30,9 +30,7 @@ namespace constitutive { MultiFluidBase::MultiFluidBase( string const & name, Group * const parent ) - : ConstitutiveBase( name, parent ), - m_useMass( false ), - m_checkPVTTablesRanges( 1 ) + : ConstitutiveBase( name, parent ) { // We make base inputs optional here, since derived classes may want to predefine/hardcode // components/phases. Models that do need these inputs should change input flags accordingly. @@ -51,7 +49,8 @@ MultiFluidBase::MultiFluidBase( string const & name, Group * const parent ) setDescription( "List of fluid phases" ); registerWrapper( viewKeyStruct::useMassString(), &m_useMass ). - setRestartFlags( RestartFlags::NO_WRITE ); + setRestartFlags( RestartFlags::NO_WRITE ). + setDefaultValue( 0 ); registerWrapper( viewKeyStruct::checkPVTTablesRangesString(), &m_checkPVTTablesRanges ). setInputFlag( InputFlags::OPTIONAL ). diff --git a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp index c926eec894f..60460bf6ee8 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.cpp @@ -30,9 +30,7 @@ namespace constitutive { CompressibleSinglePhaseFluid::CompressibleSinglePhaseFluid( string const & name, Group * const parent ): - SingleFluidBase( name, parent ), - m_densityModelType( ExponentApproximationType::Linear ), - m_viscosityModelType( ExponentApproximationType::Linear ) + SingleFluidBase( name, parent ) { registerWrapper( viewKeyStruct::defaultDensityString(), &m_defaultDensity ). setInputFlag( InputFlags::REQUIRED ). @@ -68,12 +66,12 @@ CompressibleSinglePhaseFluid::CompressibleSinglePhaseFluid( string const & name, setDescription( "Reference fluid viscosity" ); registerWrapper( viewKeyStruct::densityModelTypeString(), &m_densityModelType ). - setApplyDefaultValue( m_densityModelType ). + setApplyDefaultValue( ExponentApproximationType::Linear ). setInputFlag( InputFlags::OPTIONAL ). setDescription( "Type of density model. Valid options:\n* " + EnumStrings< ExponentApproximationType >::concat( "\n* " ) ); registerWrapper( viewKeyStruct::viscosityModelTypeString(), &m_viscosityModelType ). - setApplyDefaultValue( m_viscosityModelType ). + setApplyDefaultValue( ExponentApproximationType::Linear ). setInputFlag( InputFlags::OPTIONAL ). setDescription( "Type of viscosity model. Valid options:\n* " + EnumStrings< ExponentApproximationType >::concat( "\n* " ) ); diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp index 8b648cf2e31..0e32f717116 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.cpp @@ -30,8 +30,7 @@ namespace constitutive { ThermalCompressibleSinglePhaseFluid::ThermalCompressibleSinglePhaseFluid( string const & name, Group * const parent ): - CompressibleSinglePhaseFluid( name, parent ), - m_internalEnergyModelType( ExponentApproximationType::Linear ) + CompressibleSinglePhaseFluid( name, parent ) { m_densityModelType = ExponentApproximationType::Full; m_numDOF=2; @@ -56,7 +55,7 @@ ThermalCompressibleSinglePhaseFluid::ThermalCompressibleSinglePhaseFluid( string setDescription( "Reference fluid internal energy" ); registerWrapper( viewKeyStruct::internalEnergyModelTypeString(), &m_internalEnergyModelType ). - setApplyDefaultValue( m_internalEnergyModelType ). + setApplyDefaultValue( ExponentApproximationType::Linear ). setInputFlag( InputFlags::OPTIONAL ). setDescription( "Type of internal energy model. Valid options:\n* " + EnumStrings< ExponentApproximationType >::concat( "\n* " ) ); diff --git a/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp b/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp index e2237f7ebe6..3373d3c0349 100644 --- a/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp @@ -29,8 +29,7 @@ namespace constitutive CarmanKozenyPermeability::CarmanKozenyPermeability( string const & name, Group * const parent ): - PermeabilityBase( name, parent ), - m_anisotropy{ 1.0, 1.0, 1.0 } + PermeabilityBase( name, parent ) { registerWrapper( viewKeyStruct::particleDiameterString(), &m_particleDiameter ). setInputFlag( InputFlags::REQUIRED ). @@ -42,7 +41,7 @@ CarmanKozenyPermeability::CarmanKozenyPermeability( string const & name, Group * registerWrapper( viewKeyStruct::anisotropyString(), &m_anisotropy ). setInputFlag( InputFlags::OPTIONAL ). - setDefaultValue( m_anisotropy ). + setDefaultValue( { 1.0, 1.0, 1.0 } ). setDescription( "Anisotropy factors for three permeability components." ); registerWrapper( viewKeyStruct::dPerm_dPorosityString(), &m_dPerm_dPorosity ); diff --git a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp index 9933163056c..0d4b8923210 100644 --- a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp @@ -54,6 +54,8 @@ void ParallelPlatesPermeability::allocateConstitutiveData( Group & parent, void ParallelPlatesPermeability::postInputInitialization() { + PermeabilityBase::postInputInitialization(); + if( m_transversalPermeability > -1 ) { m_updateTransversalComponent = false; diff --git a/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp b/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp index 83ce328d510..2333490d7f7 100644 --- a/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp +++ b/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp @@ -30,9 +30,7 @@ namespace constitutive PermeabilityBase::PermeabilityBase( string const & name, Group * const parent ): - ConstitutiveBase( name, parent ), - m_permeability(), - m_dPerm_dPressure() + ConstitutiveBase( name, parent ) { registerField< fields::permeability::permeability >( &m_permeability ); registerField< fields::permeability::dPerm_dPressure >( &m_dPerm_dPressure ); diff --git a/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp b/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp index c578256c534..facf9712409 100644 --- a/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp @@ -31,11 +31,7 @@ namespace constitutive ProppantPermeability::ProppantPermeability( string const & name, Group * const parent ): - PermeabilityBase( name, parent ), - m_permeabilityMultiplier(), - m_proppantDiameter(), - m_maxProppantConcentration(), - m_proppantPackPermeability() + PermeabilityBase( name, parent ) { registerWrapper( viewKeyStruct::maxProppantConcentrationString(), &m_maxProppantConcentration ). setInputFlag( InputFlags::REQUIRED ). diff --git a/src/coreComponents/constitutive/solid/CeramicDamage.cpp b/src/coreComponents/constitutive/solid/CeramicDamage.cpp index 7b8ebca87bf..76916d4a6ec 100644 --- a/src/coreComponents/constitutive/solid/CeramicDamage.cpp +++ b/src/coreComponents/constitutive/solid/CeramicDamage.cpp @@ -26,14 +26,7 @@ namespace constitutive { CeramicDamage::CeramicDamage( string const & name, Group * const parent ): - ElasticIsotropic( name, parent ), - m_damage(), - m_jacobian(), - m_lengthScale(), - m_tensileStrength(), - m_compressiveStrength(), - m_maximumStrength(), - m_crackSpeed() + ElasticIsotropic( name, parent ) { // register default values registerWrapper( viewKeyStruct::tensileStrengthString(), &m_tensileStrength ). diff --git a/src/coreComponents/constitutive/solid/CoupledSolidBase.cpp b/src/coreComponents/constitutive/solid/CoupledSolidBase.cpp index 90bcc41f62e..e1e7dcb5104 100644 --- a/src/coreComponents/constitutive/solid/CoupledSolidBase.cpp +++ b/src/coreComponents/constitutive/solid/CoupledSolidBase.cpp @@ -29,11 +29,7 @@ namespace constitutive { CoupledSolidBase::CoupledSolidBase( string const & name, Group * const parent ): - ConstitutiveBase( name, parent ), - m_solidModelName(), - m_porosityModelName(), - m_permeabilityModelName(), - m_solidInternalEnergyModelName() + ConstitutiveBase( name, parent ) { registerWrapper( viewKeyStruct::solidModelNameString(), &m_solidModelName ). setRTTypeName( rtTypes::CustomTypes::groupNameRef ). diff --git a/src/coreComponents/constitutive/solid/Damage.cpp b/src/coreComponents/constitutive/solid/Damage.cpp index c205c64628a..85becb3a1ba 100644 --- a/src/coreComponents/constitutive/solid/Damage.cpp +++ b/src/coreComponents/constitutive/solid/Damage.cpp @@ -28,26 +28,7 @@ namespace constitutive template< typename BASE > Damage< BASE >::Damage( string const & name, Group * const parent ): - BASE( name, parent ), - m_newDamage(), - m_oldDamage(), - m_damageGrad(), - m_strainEnergyDensity(), - m_volStrain(), - m_extDrivingForce(), - m_lengthScale(), - m_defaultCriticalFractureEnergy(), - m_criticalStrainEnergy(), - m_degradationLowerLimit( 0.0 ), - m_extDrivingForceFlag( 0 ), - m_defaultTensileStrength(), - m_defaultCompressStrength(), - m_defaultDeltaCoefficient(), - m_biotCoefficient(), - m_criticalFractureEnergy(), - m_tensileStrength(), - m_compressStrength(), - m_deltaCoefficient() + BASE( name, parent ) { this->registerWrapper( viewKeyStruct::newDamageString(), &m_newDamage ). setApplyDefaultValue( 0.0 ). diff --git a/src/coreComponents/constitutive/solid/DelftEgg.cpp b/src/coreComponents/constitutive/solid/DelftEgg.cpp index 548a958de2b..e22e5ff2f05 100644 --- a/src/coreComponents/constitutive/solid/DelftEgg.cpp +++ b/src/coreComponents/constitutive/solid/DelftEgg.cpp @@ -26,18 +26,7 @@ namespace constitutive { DelftEgg::DelftEgg( string const & name, Group * const parent ): - ElasticIsotropic( name, parent ), - m_defaultRecompressionIndex(), - m_defaultVirginCompressionIndex(), - m_defaultCslSlope(), - m_defaultShapeParameter(), - m_defaultPreConsolidationPressure(), - m_recompressionIndex(), - m_virginCompressionIndex(), - m_cslSlope(), - m_shapeParameter(), - m_newPreConsolidationPressure(), - m_oldPreConsolidationPressure() + ElasticIsotropic( name, parent ) { // register default values diff --git a/src/coreComponents/constitutive/solid/DruckerPrager.cpp b/src/coreComponents/constitutive/solid/DruckerPrager.cpp index 0b400763ced..703bc4e5b65 100644 --- a/src/coreComponents/constitutive/solid/DruckerPrager.cpp +++ b/src/coreComponents/constitutive/solid/DruckerPrager.cpp @@ -26,16 +26,7 @@ namespace constitutive { DruckerPrager::DruckerPrager( string const & name, Group * const parent ): - ElasticIsotropic( name, parent ), - m_defaultFrictionAngle(), - m_defaultDilationAngle(), - m_defaultCohesion(), - m_defaultHardening(), - m_friction(), - m_dilation(), - m_hardening(), - m_newCohesion(), - m_oldCohesion() + ElasticIsotropic( name, parent ) { // register default values diff --git a/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp b/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp index 895c9d598ec..9292987a366 100644 --- a/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp +++ b/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp @@ -26,19 +26,7 @@ namespace constitutive { DruckerPragerExtended::DruckerPragerExtended( string const & name, Group * const parent ): - ElasticIsotropic( name, parent ), - m_defaultInitialFrictionAngle(), - m_defaultResidualFrictionAngle(), - m_defaultDilationRatio(), - m_defaultCohesion(), - m_defaultHardening(), - m_initialFriction(), - m_residualFriction(), - m_dilationRatio(), - m_pressureIntercept(), - m_hardening(), - m_newState(), - m_oldState() + ElasticIsotropic( name, parent ) { // register default values diff --git a/src/coreComponents/constitutive/solid/DuvautLionsSolid.cpp b/src/coreComponents/constitutive/solid/DuvautLionsSolid.cpp index eb4ba0f77bf..197e392db36 100644 --- a/src/coreComponents/constitutive/solid/DuvautLionsSolid.cpp +++ b/src/coreComponents/constitutive/solid/DuvautLionsSolid.cpp @@ -33,8 +33,7 @@ namespace constitutive template< typename BASE > DuvautLionsSolid< BASE >::DuvautLionsSolid( string const & name, Group * const parent ): - BASE( name, parent ), - m_relaxationTime() + BASE( name, parent ) { this->registerWrapper( viewKeyStruct::relaxationTimeString(), &m_relaxationTime ). diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropic.cpp b/src/coreComponents/constitutive/solid/ElasticIsotropic.cpp index b6a7b1569db..f87ee2b67c7 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropic.cpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropic.cpp @@ -26,11 +26,7 @@ namespace constitutive { ElasticIsotropic::ElasticIsotropic( string const & name, Group * const parent ): - SolidBase( name, parent ), - m_defaultBulkModulus(), - m_defaultShearModulus(), - m_bulkModulus(), - m_shearModulus() + SolidBase( name, parent ) { registerWrapper( viewKeyStruct::defaultBulkModulusString(), &m_defaultBulkModulus ). setApplyDefaultValue( -1 ). diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.cpp b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.cpp index 77f62bc178b..4cebe9833c1 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.cpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.cpp @@ -26,15 +26,7 @@ namespace constitutive { ElasticIsotropicPressureDependent::ElasticIsotropicPressureDependent( string const & name, Group * const parent ): - SolidBase( name, parent ), - m_defaultRefPressure(), - m_defaultRefStrainVol(), - m_defaultRecompressionIndex(), - m_defaultShearModulus(), - m_refPressure(), - m_refStrainVol(), - m_recompressionIndex(), - m_shearModulus() + SolidBase( name, parent ) { registerWrapper( viewKeyStruct::defaultRefPressureString(), &m_defaultRefPressure ). setApplyDefaultValue( -1.0 ). diff --git a/src/coreComponents/constitutive/solid/ElasticOrthotropic.cpp b/src/coreComponents/constitutive/solid/ElasticOrthotropic.cpp index 5a1d163b027..1a08933aee5 100644 --- a/src/coreComponents/constitutive/solid/ElasticOrthotropic.cpp +++ b/src/coreComponents/constitutive/solid/ElasticOrthotropic.cpp @@ -26,25 +26,7 @@ namespace constitutive { ElasticOrthotropic::ElasticOrthotropic( string const & name, Group * const parent ): - SolidBase( name, parent ), - m_defaultE1(), - m_defaultE2(), - m_defaultE3(), - m_defaultNu12(), - m_defaultNu13(), - m_defaultNu23(), - m_defaultG12(), - m_defaultG13(), - m_defaultG23(), - m_c11(), - m_c12(), - m_c13(), - m_c22(), - m_c23(), - m_c33(), - m_c44(), - m_c55(), - m_c66() + SolidBase( name, parent ) { registerWrapper( viewKeyStruct::defaultE1String(), &m_defaultE1 ). setApplyDefaultValue( -1 ). diff --git a/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.cpp b/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.cpp index 9dd1296b7cb..770622f4f2b 100644 --- a/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.cpp +++ b/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.cpp @@ -27,17 +27,7 @@ namespace constitutive { ElasticTransverseIsotropic::ElasticTransverseIsotropic( string const & name, Group * const parent ): - SolidBase( name, parent ), - m_defaultYoungModulusTransverse(), - m_defaultYoungModulusAxial(), - m_defaultPoissonRatioTransverse(), - m_defaultPoissonRatioAxialTransverse(), - m_defaultShearModulusAxialTransverse(), - m_c11(), - m_c13(), - m_c33(), - m_c44(), - m_c66() + SolidBase( name, parent ) { registerWrapper( viewKeyStruct::defaultYoungModulusTransverseString(), &m_defaultYoungModulusTransverse ). setApplyDefaultValue( -1 ). diff --git a/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp b/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp index dea5f44565b..130ab9162af 100644 --- a/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp +++ b/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp @@ -26,14 +26,7 @@ namespace constitutive { ModifiedCamClay::ModifiedCamClay( string const & name, Group * const parent ): - ElasticIsotropicPressureDependent( name, parent ), - m_defaultVirginCompressionIndex(), - m_defaultCslSlope(), - m_defaultPreConsolidationPressure(), - m_virginCompressionIndex(), - m_cslSlope(), - m_newPreConsolidationPressure(), - m_oldPreConsolidationPressure() + ElasticIsotropicPressureDependent( name, parent ) { // register default values diff --git a/src/coreComponents/constitutive/solid/PerfectlyPlastic.cpp b/src/coreComponents/constitutive/solid/PerfectlyPlastic.cpp index 96d73602516..9e4783ad3d2 100644 --- a/src/coreComponents/constitutive/solid/PerfectlyPlastic.cpp +++ b/src/coreComponents/constitutive/solid/PerfectlyPlastic.cpp @@ -26,9 +26,7 @@ namespace constitutive { PerfectlyPlastic::PerfectlyPlastic( string const & name, Group * const parent ): - ElasticIsotropic( name, parent ), - m_defaultYieldStress(), - m_yieldStress() + ElasticIsotropic( name, parent ) { // register default values registerWrapper( viewKeyStruct::defaultYieldStressString(), &m_defaultYieldStress ). diff --git a/src/coreComponents/constitutive/solid/SolidBase.cpp b/src/coreComponents/constitutive/solid/SolidBase.cpp index 1602f11226a..620f883152c 100644 --- a/src/coreComponents/constitutive/solid/SolidBase.cpp +++ b/src/coreComponents/constitutive/solid/SolidBase.cpp @@ -28,11 +28,7 @@ namespace constitutive { SolidBase::SolidBase( string const & name, Group * const parent ): - ConstitutiveBase( name, parent ), - m_newStress( 0, 0, 6 ), - m_oldStress( 0, 0, 6 ), - m_density(), - m_thermalExpansionCoefficient() + ConstitutiveBase( name, parent ) { string const voightLabels[6] = { "XX", "YY", "ZZ", "YZ", "XZ", "XY" }; diff --git a/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp b/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp index 71ac48176a4..9c3e6e69c60 100644 --- a/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp +++ b/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp @@ -28,13 +28,7 @@ namespace constitutive { SolidInternalEnergy::SolidInternalEnergy( string const & name, Group * const parent ): - ConstitutiveBase( name, parent ), - m_internalEnergy(), - m_dInternalEnergy_dTemperature(), - m_referenceVolumetricHeatCapacity(), - m_dVolumetricHeatCapacity_dTemperature(), - m_referenceTemperature(), - m_referenceInternalEnergy() + ConstitutiveBase( name, parent ) { registerWrapper( viewKeyStruct::internalEnergyString(), &m_internalEnergy ). setPlotLevel( PlotLevel::LEVEL_0 ). diff --git a/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp b/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp index 1dbc7792ab0..fcc2cd610c2 100644 --- a/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp +++ b/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp @@ -30,14 +30,7 @@ namespace constitutive PorosityBase::PorosityBase( string const & name, Group * const parent ): - ConstitutiveBase( name, parent ), - m_newPorosity(), - m_porosity_n(), - m_dPorosity_dPressure(), - m_dPorosity_dTemperature(), - m_initialPorosity(), - m_referencePorosity(), - m_defaultReferencePorosity() + ConstitutiveBase( name, parent ) { registerWrapper( viewKeyStruct::defaultReferencePorosityString(), &m_defaultReferencePorosity ). setInputFlag( InputFlags::REQUIRED ). diff --git a/src/coreComponents/constitutive/solid/porosity/PressurePorosity.cpp b/src/coreComponents/constitutive/solid/porosity/PressurePorosity.cpp index 0f7167ccdce..2e090fa0ec8 100644 --- a/src/coreComponents/constitutive/solid/porosity/PressurePorosity.cpp +++ b/src/coreComponents/constitutive/solid/porosity/PressurePorosity.cpp @@ -28,9 +28,7 @@ namespace constitutive { PressurePorosity::PressurePorosity( string const & name, Group * const parent ): - PorosityBase( name, parent ), - m_referencePressure(), - m_compressibility() + PorosityBase( name, parent ) { registerWrapper( viewKeyStruct::referencePressureString(), &m_referencePressure ). setInputFlag( InputFlags::REQUIRED ). diff --git a/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.cpp b/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.cpp index 19577658662..efe846ad81b 100644 --- a/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.cpp +++ b/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.cpp @@ -29,8 +29,7 @@ namespace constitutive { ProppantPorosity::ProppantPorosity( string const & name, Group * const parent ): - PorosityBase( name, parent ), - m_maxProppantConcentration() + PorosityBase( name, parent ) { registerWrapper( viewKeyStruct::maxProppantConcentrationString(), &m_maxProppantConcentration ). setInputFlag( InputFlags::REQUIRED ). From 02b467c05e178c60557a7ccd7ede72934882418b Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Mon, 25 Aug 2025 16:38:33 -0500 Subject: [PATCH 28/43] fix unit test --- .../constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp | 4 ++-- .../constitutive/fluid/multifluid/MultiFluidBase.cpp | 4 ++-- .../constitutive/permeability/CarmanKozenyPermeability.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp index dace11cc49c..1bea9b283f7 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp @@ -106,13 +106,13 @@ CO2BrineFluid( string const & name, Group * const parent ): setInputFlag( InputFlags::OPTIONAL ). setRestartFlags( RestartFlags::NO_WRITE ). setDescription( "When set to 1, write PVT tables into a CSV file" ). - setDefaultValue( 0 ); + setApplyDefaultValue( 0 ); this->registerWrapper( viewKeyStruct::checkPhasePresenceString(), &m_checkPhasePresence ). setInputFlag( InputFlags::OPTIONAL ). setRestartFlags( RestartFlags::NO_WRITE ). setDescription( "Check phase presence when computing density and viscosity" ). - setDefaultValue( 0 ); + setApplyDefaultValue( 0 ); // if this is a thermal model, we need to make sure that the arrays will be properly displayed and saved to restart if( isThermal() ) diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp index 59969b37741..a5040bd53e0 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp @@ -50,13 +50,13 @@ MultiFluidBase::MultiFluidBase( string const & name, Group * const parent ) registerWrapper( viewKeyStruct::useMassString(), &m_useMass ). setRestartFlags( RestartFlags::NO_WRITE ). - setDefaultValue( 0 ); + setApplyDefaultValue( 0 ); registerWrapper( viewKeyStruct::checkPVTTablesRangesString(), &m_checkPVTTablesRanges ). setInputFlag( InputFlags::OPTIONAL ). setRestartFlags( RestartFlags::NO_WRITE ). setDescription( "Enable (1) or disable (0) an error when the input pressure or temperature of the PVT tables is out of range." ). - setDefaultValue( 1 ); + setApplyDefaultValue( 1 ); registerField< fields::multifluid::phaseFraction >( &m_phaseFraction.value ); registerField< fields::multifluid::dPhaseFraction >( &m_phaseFraction.derivs ); diff --git a/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp b/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp index 3373d3c0349..f0958c5734f 100644 --- a/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.cpp @@ -41,7 +41,7 @@ CarmanKozenyPermeability::CarmanKozenyPermeability( string const & name, Group * registerWrapper( viewKeyStruct::anisotropyString(), &m_anisotropy ). setInputFlag( InputFlags::OPTIONAL ). - setDefaultValue( { 1.0, 1.0, 1.0 } ). + setApplyDefaultValue( { 1.0, 1.0, 1.0 } ). setDescription( "Anisotropy factors for three permeability components." ); registerWrapper( viewKeyStruct::dPerm_dPorosityString(), &m_dPerm_dPorosity ); From 705beccd7a42dc217092a9f44f3fb554630fe36f Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 12 Sep 2025 15:35:15 -0500 Subject: [PATCH 29/43] this should look better --- .../CompositionalMultiphaseFluid.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp index a1885571f57..62fb0b033bb 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp @@ -100,23 +100,23 @@ string CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::catalogNam } template< typename FLASH, typename PHASE1, typename PHASE2, typename PHASE3 > -void CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::allocateConstitutiveData( Group & parent, localIndex const numPts ) +void CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::initializeState() const { - m_kValues.resize( 0, numPts, numFluidPhases()-1, numFluidComponents() ); - - MultiFluidBase::allocateConstitutiveData( parent, numPts ); - // Zero k-Values to force re-initialisation m_kValues.zero(); + + MultiFluidBase::initializeState(); } template< typename FLASH, typename PHASE1, typename PHASE2, typename PHASE3 > -void CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::initializeState() const +void CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::allocateConstitutiveData( Group & parent, localIndex const numPts ) { + m_kValues.resize( 0, numPts, numFluidPhases()-1, numFluidComponents() ); + + MultiFluidBase::allocateConstitutiveData( parent, numPts ); + // Zero k-Values to force re-initialisation m_kValues.zero(); - - MultiFluidBase::initializeState(); } template< typename FLASH, typename PHASE1, typename PHASE2, typename PHASE3 > From f6da3dbcfdb9eb482120e104cbede03c5c0165be Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Fri, 12 Sep 2025 17:19:41 -0500 Subject: [PATCH 30/43] restore initializeState --- .../constitutive/fluid/multifluid/MultiFluidBase.cpp | 6 ++++++ .../constitutive/fluid/multifluid/MultiFluidBase.hpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp index a5040bd53e0..3deec40ea99 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp @@ -204,6 +204,12 @@ void MultiFluidBase::postInputInitialization() setLabels(); } +void MultiFluidBase::initializeState() const +{ + // initialize the "old" variables + saveConvergedState(); +} + void MultiFluidBase::saveConvergedState() const { localIndex const numElem = m_phaseMassDensity.value.size( 0 ); diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp index 1518376617c..9396fe6ad3e 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp @@ -191,6 +191,12 @@ class MultiFluidBase : public ConstitutiveBase arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > dPhaseInternalEnergy() const { return m_phaseInternalEnergy.derivs; } + /** + * @brief Initialize the model + * @param[in] phaseVolFraction an array containing the initial phase volume fractions + */ + virtual void initializeState() const; + /** * @brief Save the phase densities, component fractions, enthalpies and internal energies (for accumulation) */ From adbdd4caa1ad691283a07f792a943817ddd7ab90 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Sat, 13 Sep 2025 10:47:22 -0500 Subject: [PATCH 31/43] Replace fluid.saveConvergedState with fluid.initializeState --- .../physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp index 45d30de309d..419c1222a5e 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp @@ -999,7 +999,7 @@ void CompositionalMultiphaseBase::initializeFluidState( MeshLevel & mesh, string const & fluidName = subRegion.template getReference< string >( viewKeyStruct::fluidNamesString() ); MultiFluidBase & fluid = getConstitutiveModel< MultiFluidBase >( subRegion, fluidName ); - fluid.saveConvergedState(); + fluid.initializeState(); // Update the phase mobility // Note: From 17417fe6e2caede2a38deec993e61a21e09f2f6d Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Sat, 13 Sep 2025 10:48:10 -0500 Subject: [PATCH 32/43] Change fluid state saving to initialization --- src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp index cb58e3ea112..bb4d66c6122 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp @@ -580,7 +580,7 @@ void SinglePhaseBase::initializeFluidState( MeshLevel & mesh, string_array const updateFluidState( subRegion ); // 2. save the initial density (for use in the single-phase poromechanics solver to compute the deltaBodyForce) - fluid.saveConvergedState(); + fluid.initializeState(); } ); } From 47d9edb2109103eae3105539941a0f14581f8ae8 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Sat, 13 Sep 2025 10:49:07 -0500 Subject: [PATCH 33/43] Add initializeState method to SingleFluidBase --- .../constitutive/fluid/singlefluid/SingleFluidBase.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp index e8ba330996c..3a481d0834f 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp @@ -57,6 +57,11 @@ void SingleFluidBase::postInputInitialization() setDefaultValue( defaultDensity() ); } +void SingleFluidBase::initializeState() const +{ + saveConvergedState(); +} + void SingleFluidBase::saveConvergedState() const { localIndex const numElem = m_density.value.size( 0 ); From e0222df552bda5b8753ad859c6b303e7a0d2e3ca Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Sat, 13 Sep 2025 10:50:47 -0500 Subject: [PATCH 34/43] Add initializeState method to SingleFluidBase Added a method to initialize the model state. --- .../constitutive/fluid/singlefluid/SingleFluidBase.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp index 1eea602736b..351d9743ace 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp @@ -227,6 +227,11 @@ class SingleFluidBase : public ConstitutiveBase virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; + /** + * @brief Initialize the model + */ + void initializeState() const; + virtual void saveConvergedState() const override; // *** SingleFluid-specific interface From 39c1251c552c4ab75ea06c835c1462435851e30e Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Sat, 13 Sep 2025 10:52:32 -0500 Subject: [PATCH 35/43] Replace saveConvergedState with initializeState --- .../constitutive/unitTests/testInvariantImmiscibleFluid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp b/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp index 130a61712d7..b9acb68a517 100644 --- a/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp +++ b/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp @@ -68,7 +68,7 @@ class InvariantImmiscibleFluidValidationTestFixture : public FluidModelTest< Inv discretization.resize( 1 ); // one element fluid.allocateConstitutiveData( discretization, 1 ); // one quadrature point - fluid.saveConvergedState(); + fluid.initializeState(); } ); } From e0513aae27e18a67add65ddbba82e73eabfd9dbe Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Sat, 13 Sep 2025 10:54:25 -0500 Subject: [PATCH 36/43] Replace saveConvergedState with initializeState --- .../constitutive/unitTests/testInvariantImmiscibleFluid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp b/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp index b9acb68a517..02d66eed9ae 100644 --- a/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp +++ b/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp @@ -200,7 +200,7 @@ class InvariantImmiscibleFluidTestFixture : public FluidModelTest< InvariantImmi composition[1] = 0.3; composition[2] = 0.3; CompSlice compositionSlice = composition.toSliceConst(); - fluid.saveConvergedState(); + fluid.initializeState(); // Create a test point localIndex k = 0; From 381a723b20f060eaa0b3db6de8991744f3370106 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Sat, 13 Sep 2025 19:24:27 -0500 Subject: [PATCH 37/43] Update baseline path in integrated tests configuration --- .integrated_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.integrated_tests.yaml b/.integrated_tests.yaml index 48e9731d767..a495facc435 100644 --- a/.integrated_tests.yaml +++ b/.integrated_tests.yaml @@ -1,6 +1,6 @@ baselines: bucket: geosx - baseline: integratedTests/baseline_integratedTests-pr3349-13555-41d98d4 + baseline: integratedTests/baseline_integratedTests-pr3776-13560-88bd98b allow_fail: all: '' From 08e691462079695f2a7ac49974379b9e6b6aeacc Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Sat, 13 Sep 2025 19:26:19 -0500 Subject: [PATCH 38/43] Update baseline notes with recent PR entries Added entries for PR #3776 and PR #3349 with justification. --- BASELINE_NOTES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BASELINE_NOTES.md b/BASELINE_NOTES.md index 28ce2ed50ea..bb86030b2ce 100644 --- a/BASELINE_NOTES.md +++ b/BASELINE_NOTES.md @@ -6,6 +6,10 @@ This file is designed to track changes to the integrated test baselines. Any developer who updates the baseline ID in the .integrated_tests.yaml file is expected to create an entry in this file with the pull request number, date, and their justification for rebaselining. These notes should be in reverse-chronological order, and use the following time format: (YYYY-MM-DD). +PR #3776 (2025-09-13) +===================== +Constitutive cleanup: rebaseline due to technical diffs, no real results changes. + PR #3349 (2025-09-13) ===================== Configuration loop acceleration for SolidMechanicsLagrangeContact. From c268d0c0fd201f01f6fcb533ce2bdd04b44b69d5 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Sat, 13 Sep 2025 20:58:51 -0500 Subject: [PATCH 39/43] Update baseline path in integrated tests configuration --- .integrated_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.integrated_tests.yaml b/.integrated_tests.yaml index a495facc435..fbd605bf26f 100644 --- a/.integrated_tests.yaml +++ b/.integrated_tests.yaml @@ -1,6 +1,6 @@ baselines: bucket: geosx - baseline: integratedTests/baseline_integratedTests-pr3776-13560-88bd98b + baseline: integratedTests/baseline_integratedTests-pr3776-13562-08e6914 allow_fail: all: '' From f2b24b9fffab7ca6d561a7565171973685cf3161 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Sun, 14 Sep 2025 11:42:39 -0500 Subject: [PATCH 40/43] fix hyst cases --- .../TableRelativePermeabilityHysteresis.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp index bd87ed4a0c0..0da9b4af093 100644 --- a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp +++ b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp @@ -165,12 +165,12 @@ void TableRelativePermeabilityHysteresis::postInputInitialization() getFullName() ), InputError ); - m_phaseHasHysteresis.resize( 2 ); + m_phaseMinVolumeFraction.resize( numPhases ); + m_phaseHasHysteresis.resize( numPhases ); //initialize STONE-II only used var to avoid discrepancies in baselines m_waterOilMaxRelPerm = 1.; - if( numPhases == 2 ) { GEOS_THROW_IF( m_drainageWettingNonWettingRelPermTableNames.empty(), @@ -270,7 +270,9 @@ void TableRelativePermeabilityHysteresis::checkExistenceAndValidateWettingRelPer real64 drainagePhaseRelPermMinEndPoint = -1; real64 drainagePhaseRelPermMaxEndPoint = -1; - string const tableName = ( numPhases == 2 ) ? m_drainageWettingNonWettingRelPermTableNames[0] : m_drainageWettingIntermediateRelPermTableNames[0]; + string const tableName = ( numPhases == 2 ) ? + m_drainageWettingNonWettingRelPermTableNames[0] : m_drainageWettingIntermediateRelPermTableNames[0]; + checkExistenceAndValidateRelPermTable( tableName, // input drainagePhaseMinVolFraction, // output drainagePhaseMaxVolFraction, @@ -285,7 +287,6 @@ void TableRelativePermeabilityHysteresis::checkExistenceAndValidateWettingRelPer if( m_phaseHasHysteresis[IPT::WETTING] ) { - checkExistenceAndValidateRelPermTable( m_imbibitionWettingRelPermTableName, // input imbibitionPhaseMinVolFraction, // output imbibitionPhaseMaxVolFraction, @@ -315,7 +316,6 @@ void TableRelativePermeabilityHysteresis::checkExistenceAndValidateWettingRelPer getFullName(), drainagePhaseRelPermMaxEndPoint, imbibitionPhaseRelPermMaxEndPoint ), InputError ); - } m_wettingCurve.setPoints( drainagePhaseMinVolFraction, drainagePhaseRelPermMinEndPoint, // same as imbibition min From 5b9caf6e1337580a02694eb117196a6b5168ec8e Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Sun, 14 Sep 2025 11:52:50 -0500 Subject: [PATCH 41/43] fix pressure perm --- .../permeability/PressurePermeability.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/coreComponents/constitutive/permeability/PressurePermeability.cpp b/src/coreComponents/constitutive/permeability/PressurePermeability.cpp index df88adf1ea4..aaa8c86073c 100644 --- a/src/coreComponents/constitutive/permeability/PressurePermeability.cpp +++ b/src/coreComponents/constitutive/permeability/PressurePermeability.cpp @@ -75,22 +75,24 @@ void PressurePermeability::allocateConstitutiveData( Group & parent, m_referencePermeability.resize( 0, 1, 3 ); // 0 to resize and assign default value later PermeabilityBase::allocateConstitutiveData( parent, numPts ); -} -void PressurePermeability::initializeState() const -{ - localIndex const numE = m_permeability.size( 0 ); integer constexpr numQuad = 1; // NOTE: enforcing 1 quadrature point - for( localIndex ei = 0; ei < numE; ++ei ) + for( localIndex ei = 0; ei < parent.size(); ++ei ) { for( localIndex q = 0; q < numQuad; ++q ) { - m_referencePermeability[ei][q][0] = m_referencePermeabilityComponents[0]; - m_referencePermeability[ei][q][1] = m_referencePermeabilityComponents[1]; - m_referencePermeability[ei][q][2] = m_referencePermeabilityComponents[2]; + m_referencePermeability[ei][q][0] = m_referencePermeabilityComponents[0]; + m_referencePermeability[ei][q][1] = m_referencePermeabilityComponents[1]; + m_referencePermeability[ei][q][2] = m_referencePermeabilityComponents[2]; } } +} + +void PressurePermeability::initializeState() const +{ + localIndex const numE = m_permeability.size( 0 ); + integer constexpr numQuad = 1; // NOTE: enforcing 1 quadrature point auto permView = m_permeability.toView(); real64 const permComponents[3] = { m_referencePermeabilityComponents[0], From 694fc29bfb738081081e6776a9b112f9142ace3c Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Sun, 14 Sep 2025 12:02:56 -0500 Subject: [PATCH 42/43] fix damage --- src/coreComponents/constitutive/solid/Damage.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/coreComponents/constitutive/solid/Damage.cpp b/src/coreComponents/constitutive/solid/Damage.cpp index 85becb3a1ba..53addbde00e 100644 --- a/src/coreComponents/constitutive/solid/Damage.cpp +++ b/src/coreComponents/constitutive/solid/Damage.cpp @@ -165,6 +165,11 @@ void Damage< BASE >::allocateConstitutiveData( Group & parent, localIndex const m_strainEnergyDensity.resize( 0, numPts ); m_volStrain.resize( 0, numPts ); m_extDrivingForce.resize( 0, numPts ); + m_biotCoefficient.resize( parent.size() ); + m_criticalFractureEnergy.resize( parent.size() ); + m_tensileStrength.resize( parent.size() ); + m_compressStrength.resize( parent.size() ); + m_deltaCoefficient.resize( parent.size() ); BASE::allocateConstitutiveData( parent, numPts ); } From 5d0d5f0863b7275757f08e89aae3558fab829f03 Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Sun, 14 Sep 2025 14:06:11 -0500 Subject: [PATCH 43/43] Update baseline path in integrated tests configuration --- .integrated_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.integrated_tests.yaml b/.integrated_tests.yaml index fbd605bf26f..6a207b8ff1c 100644 --- a/.integrated_tests.yaml +++ b/.integrated_tests.yaml @@ -1,6 +1,6 @@ baselines: bucket: geosx - baseline: integratedTests/baseline_integratedTests-pr3776-13562-08e6914 + baseline: integratedTests/baseline_integratedTests-pr3776-13573-694fc29 allow_fail: all: ''