diff --git a/.integrated_tests.yaml b/.integrated_tests.yaml index 48e9731d767..6a207b8ff1c 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-13573-694fc29 allow_fail: all: '' 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. diff --git a/src/coreComponents/constitutive/CMakeLists.txt b/src/coreComponents/constitutive/CMakeLists.txt index c1901177f38..05b691b907f 100644 --- a/src/coreComponents/constitutive/CMakeLists.txt +++ b/src/coreComponents/constitutive/CMakeLists.txt @@ -197,7 +197,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..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 dd872e450cc..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 {}; @@ -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/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..9816a11adf5 100644 --- a/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp +++ b/src/coreComponents/constitutive/capillaryPressure/CapillaryPressureBase.cpp @@ -44,9 +44,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() @@ -81,20 +80,18 @@ 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 ); - // set labels on array wrappers for plottable fields setLabels(); } -void CapillaryPressureBase::resizeFields( localIndex const size, - localIndex const numPts ) +void CapillaryPressureBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) { integer const NP = numFluidPhases(); - m_phaseCapPressure.resize( size, numPts, NP ); - m_dPhaseCapPressure_dPhaseVolFrac.resize( size, numPts, NP, NP ); + m_phaseCapPressure.resize( 0, numPts, NP ); + m_dPhaseCapPressure_dPhaseVolFrac.resize( 0, numPts, NP, NP ); + + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } void CapillaryPressureBase::setLabels() @@ -103,13 +100,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 67933764f4b..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) @@ -163,13 +163,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. */ diff --git a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.cpp index 3e67db4b27b..97072a8c9a8 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() @@ -340,11 +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( parent.size(), numFluidPhases()-1 ); - CapillaryPressureBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_jFuncMultiplier.resize( 0, numFluidPhases()-1 ); + + CapillaryPressureBase::allocateConstitutiveData( parent, numPts ); } diff --git a/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp b/src/coreComponents/constitutive/capillaryPressure/JFunctionCapillaryPressure.hpp index 55f099e24fa..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; @@ -112,7 +112,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"; } }; /** @@ -126,7 +125,6 @@ class JFunctionCapillaryPressure : public CapillaryPressureBase Z, ///< use permz only }; - private: virtual void postInputInitialization() override; 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..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 ). @@ -52,9 +49,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 +57,13 @@ void CoulombFriction::postInputInitialization() } -void CoulombFriction::allocateConstitutiveData( 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 { return CoulombFrictionUpdates( m_displacementJumpThreshold, diff --git a/src/coreComponents/constitutive/contact/CoulombFriction.hpp b/src/coreComponents/constitutive/contact/CoulombFriction.hpp index 32b975acc97..e5a3387743d 100644 --- a/src/coreComponents/constitutive/contact/CoulombFriction.hpp +++ b/src/coreComponents/constitutive/contact/CoulombFriction.hpp @@ -164,11 +164,6 @@ 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(); } @@ -176,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; @@ -187,6 +182,24 @@ 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; @@ -205,24 +218,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..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 ). @@ -39,11 +38,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..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; - protected: struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct diff --git a/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp b/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp index 6fe5c08b42f..a798bc242a9 100644 --- a/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp +++ b/src/coreComponents/constitutive/contact/HydraulicApertureTable.cpp @@ -50,32 +50,28 @@ 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 ), getFullName() << ": the aperture table named " << m_apertureTableName << " could not be found", InputError ); +} + +void HydraulicApertureTable::allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numPts ) +{ + HydraulicApertureBase::allocateConstitutiveData( parent, 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(); @@ -116,12 +112,15 @@ void HydraulicApertureTable::allocateConstitutiveData( Group & parent, m_apertureTable = &apertureTable; } - void HydraulicApertureTable::validateApertureTable( TableFunction const & apertureTable ) const { 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 1ac93693ec4..bcf7626c1f9 100644 --- a/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp +++ b/src/coreComponents/constitutive/contact/HydraulicApertureTable.hpp @@ -98,19 +98,12 @@ 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; - - + localIndex const numPts ) override final; /// Type of kernel wrapper for in-kernel update using KernelWrapper = HydraulicApertureTableUpdates; @@ -124,7 +117,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..21dbdb4ca0e 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::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - return DiffusionBase::deliverClone( name, parent ); -} - -void ConstantDiffusion::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - DiffusionBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + DiffusionBase::allocateConstitutiveData( parent, numPts ); - for( localIndex ei = 0; ei < parent.size(); ++ei ) + 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 66f586ab637..90258d2e0fb 100644 --- a/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp +++ b/src/coreComponents/constitutive/diffusion/ConstantDiffusion.hpp @@ -64,18 +64,15 @@ 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 ); - - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + ConstantDiffusion( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "ConstantDiffusion"; } virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numPts ) override final; + /// Type of kernel wrapper for in-kernel update using KernelWrapper = ConstantDiffusionUpdate; @@ -92,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/diffusion/DiffusionBase.cpp b/src/coreComponents/constitutive/diffusion/DiffusionBase.cpp index 491bc987a99..c4a9fbd48b7 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() @@ -61,23 +61,18 @@ void DiffusionBase::postInputInitialization() GEOS_FMT( "{}: the arrays in `{}` and `{}` must have the same size", 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 ); } -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 ) + for( localIndex ei = 0; ei < parent.size(); ++ei ) // TODO move into initializeState? { // NOTE: enforcing 1 quadrature point for( localIndex q = 0; q < 1; ++q ) @@ -88,7 +83,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..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 @@ -158,15 +158,6 @@ class DiffusionBase : public ConstitutiveBase static constexpr char const * defaultPhaseDiffusivityMultiplierString() { return "defaultPhaseDiffusivityMultipliers"; } }; -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; diff --git a/src/coreComponents/constitutive/dispersion/DispersionBase.cpp b/src/coreComponents/constitutive/dispersion/DispersionBase.cpp index 2789f5a07d9..8368f69dcea 100644 --- a/src/coreComponents/constitutive/dispersion/DispersionBase.cpp +++ b/src/coreComponents/constitutive/dispersion/DispersionBase.cpp @@ -31,23 +31,15 @@ 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::postInputInitialization() -{ - ConstitutiveBase::postInputInitialization(); - - m_dispersivity.resize( 0, 0, 3 ); -} - -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 4a653aed6e0..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; + localIndex const numPts ) override final; /** * @brief Getter for the dispersivities in the subRegion @@ -119,19 +119,8 @@ class DispersionBase : public ConstitutiveBase virtual void saveConvergedVelocityState( arrayView2d< real64 const > const & convergedVelocity ) const { GEOS_UNUSED_VAR( convergedVelocity ); } -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; - /// 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/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..65da33a1dba 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(); } @@ -108,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/CO2Brine/CO2BrineFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp index b5aad65fe5b..6915df28649 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp @@ -102,18 +102,18 @@ CO2BrineFluid( string const & name, Group * const parent ): setRestartFlags( RestartFlags::NO_WRITE ). setDescription( "Names of solubility tables for each phase" ); - this->registerWrapper( viewKeyStruct::writeCSVFlagString(), &m_writeCSV ). + registerWrapper( viewKeyStruct::writeCSVFlagString(), &m_writeCSV ). setInputFlag( InputFlags::OPTIONAL ). setRestartFlags( RestartFlags::NO_WRITE ). setDescription( "When set to 1, write PVT tables into a CSV file.\n " "if the table is requested to be output in the log, and it is too large, a CSV file will be generated even if `writeCSV` is set to 0." ). setDefaultValue( 0 ); - this->registerWrapper( viewKeyStruct::checkPhasePresenceString(), &m_checkPhasePresence ). + 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/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..3deec40ea99 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,79 +49,81 @@ MultiFluidBase::MultiFluidBase( string const & name, Group * const parent ) setDescription( "List of fluid phases" ); registerWrapper( viewKeyStruct::useMassString(), &m_useMass ). - setRestartFlags( RestartFlags::NO_WRITE ); - - registerField( fields::multifluid::phaseFraction{}, &m_phaseFraction.value ); - registerField( fields::multifluid::dPhaseFraction{}, &m_phaseFraction.derivs ); + setRestartFlags( RestartFlags::NO_WRITE ). + setApplyDefaultValue( 0 ); - 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." ). + setApplyDefaultValue( 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 ) +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( size, numPts, numPhase ); - m_phaseFraction.derivs.resize( size, numPts, numPhase, numDof ); + m_phaseFraction.value.resize( 0, numPts, numPhase ); + m_phaseFraction.derivs.resize( 0, numPts, 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, numPts, numPhase ); + m_phaseDensity_n.resize( 0, numPts, numPhase ); + m_phaseDensity.derivs.resize( 0, numPts, numPhase, numDof ); - m_phaseMassDensity.value.resize( size, numPts, numPhase ); - m_phaseMassDensity.derivs.resize( size, numPts, numPhase, numDof ); + m_phaseMassDensity.value.resize( 0, numPts, numPhase ); + m_phaseMassDensity.derivs.resize( 0, numPts, numPhase, numDof ); - m_phaseViscosity.value.resize( size, numPts, numPhase ); - m_phaseViscosity.derivs.resize( size, numPts, numPhase, numDof ); + m_phaseViscosity.value.resize( 0, numPts, numPhase ); + m_phaseViscosity.derivs.resize( 0, numPts, 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, numPts, numPhase ); + m_phaseEnthalpy_n.resize( 0, numPts, numPhase ); + m_phaseEnthalpy.derivs.resize( 0, numPts, 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, numPts, numPhase ); + m_phaseInternalEnergy_n.resize( 0, numPts, numPhase ); + m_phaseInternalEnergy.derivs.resize( 0, numPts, 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, numPts, numPhase, numComp ); + m_phaseCompFraction_n.resize( 0, numPts, numPhase, numComp ); + m_phaseCompFraction.derivs.resize( 0, numPts, 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, numPts ); + m_totalDensity_n.resize( 0, numPts ); + m_totalDensity.derivs.resize( 0, numPts, numDof ); + + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } void MultiFluidBase::setLabels() @@ -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(); @@ -207,9 +200,6 @@ void MultiFluidBase::postInputInitialization() uniqueNames.insert( lowerCaseName ); } - // call to correctly set member array tertiary sizes on the 'main' material object - resizeFields( 0, 0 ); - // 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 761793b93a8..9396fe6ad3e 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 ) override; + localIndex const numPts ) override; // *** MultiFluid-specific interface @@ -650,8 +650,6 @@ class MultiFluidBase : public ConstitutiveBase private: - - /** * @brief Called internally to set array dim labels. */ @@ -659,17 +657,10 @@ 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 ); - 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 ee92a14f4fa..62fb0b033bb 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 ); @@ -109,10 +109,11 @@ void CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::initializeSt } 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 >::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - MultiFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_kValues.resize( 0, numPts, numFluidPhases()-1, numFluidComponents() ); + + MultiFluidBase::allocateConstitutiveData( parent, numPts ); // Zero k-Values to force re-initialisation m_kValues.zero(); @@ -208,17 +209,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() ); - - // Zero k-Values to force re-initialisation - m_kValues.zero(); -} - 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 b2433e5dd27..ac6e1f95db9 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp @@ -63,16 +63,19 @@ 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( dataRepository::Group & parent, + localIndex const numPts ) 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 @@ -86,9 +89,6 @@ class CompositionalMultiphaseFluid : public MultiFluidBase virtual void initializeState() const override; - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - virtual integer getWaterPhaseIndex() const override final; struct viewKeyStruct : MultiFluidBase::viewKeyStruct @@ -115,8 +115,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/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/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 09ac848a16a..3f59b5ac30b 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 @@ -71,18 +71,19 @@ void ReactiveMultiFluid::postInputInitialization() createChemicalReactions(); } -void ReactiveMultiFluid::resizeFields( localIndex const size, localIndex const numPts ) +void ReactiveMultiFluid::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - 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, 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 71ebd796571..c4e2719aeed 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp @@ -41,11 +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( dataRepository::Group & parent, + localIndex const numPts ) override; virtual bool isThermal() const override; @@ -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 a5475f846a9..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,29 +66,23 @@ 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* " ) ); } -CompressibleSinglePhaseFluid::~CompressibleSinglePhaseFluid() = default; - -void CompressibleSinglePhaseFluid::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void CompressibleSinglePhaseFluid::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - SingleFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - - getField< fields::singlefluid::density >().setApplyDefaultValue( m_defaultDensity ); - getField< fields::singlefluid::viscosity >().setApplyDefaultValue( m_defaultViscosity ); + SingleFluidBase::allocateConstitutiveData( parent, numPts ); - 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/CompressibleSinglePhaseFluid.hpp b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.hpp index c86f9c25b19..4446616bb9c 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/CompressibleSinglePhaseFluid.hpp @@ -144,16 +144,14 @@ class CompressibleSinglePhaseFluid : public SingleFluidBase { public: using DerivOffset = singlefluid::DerivativeOffset; - CompressibleSinglePhaseFluid( string const & name, Group * const parent ); - - virtual ~CompressibleSinglePhaseFluid() override; + CompressibleSinglePhaseFluid( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "CompressibleSinglePhaseFluid"; } virtual string getCatalogName() const override { return catalogName(); } virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + 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/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..bb7d92d6577 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.cpp @@ -42,31 +42,22 @@ 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 ); } -ParticleFluidBase::~ParticleFluidBase() = default; - -void ParticleFluidBase::postInputInitialization() -{ - ConstitutiveBase::postInputInitialization(); -} - -void ParticleFluidBase::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void ParticleFluidBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_dSettlingFactor_dComponentConcentration.resize( 0, MAX_NUM_COMPONENTS ); - this->resize( parent.size() ); - m_dSettlingFactor_dComponentConcentration.resize( parent.size(), MAX_NUM_COMPONENTS ); + 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 9960b7376ee..1f507c79373 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluidBase.hpp @@ -149,20 +149,15 @@ class ParticleFluidBase : public ConstitutiveBase { public: - ParticleFluidBase( string const & name, Group * const parent ); + ParticleFluidBase( string const & name, dataRepository::Group * const parent ); - virtual ~ParticleFluidBase() override; - - // *** ConstitutiveBase interface virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + localIndex const numPts ) override; static constexpr localIndex MAX_NUM_COMPONENTS = 4; protected: - virtual void postInputInitialization() 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 c73569ebb3c..b39cba9d6bf 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::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 ); } - 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..c80ed369c05 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.hpp @@ -288,9 +288,7 @@ class ProppantSlurryFluid : public SlurryFluidBase { public: - ProppantSlurryFluid( string const & name, Group * const parent ); - - virtual ~ProppantSlurryFluid() override; + ProppantSlurryFluid( string const & name, dataRepository::Group * const parent ); // *** ConstitutiveBase interface static string catalogName() { return "ProppantSlurryFluid"; } @@ -298,7 +296,7 @@ class ProppantSlurryFluid : public SlurryFluidBase virtual string getCatalogName() const override { return catalogName(); } virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + 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 85fbe1e1bc7..3a481d0834f 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.cpp @@ -33,26 +33,26 @@ 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() { 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() ); } @@ -84,30 +84,27 @@ void SingleFluidBase::saveConvergedState() const } //START_SPHINX_INCLUDE_00 -void SingleFluidBase::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void SingleFluidBase::allocateConstitutiveData( Group & parent, 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( 0, numPts ); + m_density.derivs.resize( 0, numPts, m_numDOF ); + m_density_n.resize( 0, numPts ); // viscosity - m_viscosity.value.resize( parent.size(), numConstitutivePointsPerParentIndex ); - m_viscosity.derivs.resize( parent.size(), numConstitutivePointsPerParentIndex, m_numDOF ); + m_viscosity.value.resize( 0, numPts ); + m_viscosity.derivs.resize( 0, 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( 0, numPts ); + m_internalEnergy.derivs.resize( 0, numPts, m_numDOF ); + m_internalEnergy_n.resize( 0, numPts ); // enthalpy - m_enthalpy.value.resize( parent.size(), numConstitutivePointsPerParentIndex ); - m_enthalpy.derivs.resize( parent.size(), numConstitutivePointsPerParentIndex, m_numDOF ); + m_enthalpy.value.resize( 0, numPts ); + m_enthalpy.derivs.resize( 0, numPts, m_numDOF ); + + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } //END_SPHINX_INCLUDE_00 diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp index 9d8d3cbfb2d..351d9743ace 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SingleFluidBase.hpp @@ -222,7 +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( dataRepository::Group & parent, + localIndex const numPts ) override; /** * @brief Initialize the model @@ -231,11 +234,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; } diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp index 1993c2993a4..3f2f93196bd 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp @@ -62,28 +62,26 @@ 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 ); } -SlurryFluidBase::~SlurryFluidBase() = default; - void SlurryFluidBase::postInputInitialization() { SingleFluidBase::postInputInitialization(); @@ -107,36 +105,32 @@ localIndex SlurryFluidBase::numFluidComponents() const } void SlurryFluidBase::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) + localIndex const 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( 0, numPts ); + m_dDensity_dCompConc.resize( 0, 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( 0, numPts, NC ); + m_dCompDens_dPres.resize( 0, numPts, NC ); + m_dCompDens_dCompConc.resize( 0, 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( 0, numPts ); + m_dFluidDens_dPres.resize( 0, numPts ); + m_dFluidDens_dCompConc.resize( 0, 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( 0, numPts ); + m_dFluidVisc_dPres.resize( 0, numPts ); + m_dFluidVisc_dCompConc.resize( 0, numPts, NC ); - m_dViscosity_dProppantConc.resize( parent.size(), numConstitutivePointsPerParentIndex ); - m_dViscosity_dCompConc.resize( parent.size(), numConstitutivePointsPerParentIndex, 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 f811e016ba4..88414b94494 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.hpp @@ -252,13 +252,10 @@ 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 ~SlurryFluidBase() override; - - // *** ConstitutiveBase interface virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + localIndex const numPts ) override; static constexpr localIndex MAX_NUM_COMPONENTS = 3; @@ -308,6 +305,19 @@ 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; @@ -342,20 +352,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..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,18 +55,16 @@ 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* " ) ); } -ThermalCompressibleSinglePhaseFluid::~ThermalCompressibleSinglePhaseFluid() = default; - -void ThermalCompressibleSinglePhaseFluid::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void ThermalCompressibleSinglePhaseFluid::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - CompressibleSinglePhaseFluid::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + 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 2a97afae9e5..d16dc3b37a7 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ThermalCompressibleSinglePhaseFluid.hpp @@ -193,16 +193,14 @@ class ThermalCompressibleSinglePhaseFluid : public CompressibleSinglePhaseFluid { public: - ThermalCompressibleSinglePhaseFluid( string const & name, Group * const parent ); - - virtual ~ThermalCompressibleSinglePhaseFluid() override; + ThermalCompressibleSinglePhaseFluid( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "ThermalCompressibleSinglePhaseFluid"; } virtual string getCatalogName() const override { return catalogName(); } virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + localIndex const numPts ) override; using CompressibleSinglePhaseFluid::m_densityModelType; diff --git a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.cpp b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.cpp index 09ac85ef7b4..3e75ef209f1 100644 --- a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.cpp +++ b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.cpp @@ -60,40 +60,28 @@ 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 ); } -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 ) +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_phaseViscosity.value.resize( size, numPts, 2 ); - m_phaseViscosity.derivs.resize( size, numPts, 2, 1 ); -} + m_phaseDensity_n.resize( 0, numPts, 2 ); + m_phaseViscosity.value.resize( 0, numPts, 2 ); + m_phaseViscosity.derivs.resize( 0, numPts, 2, 1 ); -void TwoPhaseImmiscibleFluid::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); - resizeFields( parent.size(), numConstitutivePointsPerParentIndex ); + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } diff --git a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp index b72eb248635..1af48283199 100644 --- a/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp +++ b/src/coreComponents/constitutive/fluid/twophaseimmisciblefluid/TwoPhaseImmiscibleFluid.hpp @@ -40,14 +40,7 @@ class TwoPhaseImmiscibleFluid : public ConstitutiveBase public: 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; + dataRepository::Group * const parent ); /** * @name Static Factory Catalog members and functions @@ -68,7 +61,8 @@ class TwoPhaseImmiscibleFluid : public ConstitutiveBase ///@} - + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numPts ) override; /** * @brief Getter for the fluid phase names @@ -215,8 +209,6 @@ class TwoPhaseImmiscibleFluid : public ConstitutiveBase array3d< real64, multifluid::LAYOUT_PHASE > m_phaseDensity_n; - virtual void resizeFields( localIndex const size, localIndex const numPts ); - 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 f57f52ffd77..f0958c5734f 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 ). + setApplyDefaultValue( { 1.0, 1.0, 1.0 } ). setDescription( "Anisotropy factors for three permeability components." ); registerWrapper( viewKeyStruct::dPerm_dPorosityString(), &m_dPerm_dPorosity ); @@ -55,12 +54,13 @@ CarmanKozenyPermeability::deliverClone( string const & name, return PermeabilityBase::deliverClone( name, parent ); } -void CarmanKozenyPermeability::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void CarmanKozenyPermeability::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { // NOTE: enforcing 1 quadrature point m_dPerm_dPorosity.resize( 0, 1, 3 ); - PermeabilityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + + 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 2d7605b4871..d2f85582c05 100644 --- a/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/CarmanKozenyPermeability.hpp @@ -83,18 +83,18 @@ 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; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + dataRepository::Group * const parent ) const override; static string catalogName() { return "CarmanKozenyPermeability"; } 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 = CarmanKozenyPermeabilityUpdate; @@ -119,7 +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; + }; private: diff --git a/src/coreComponents/constitutive/permeability/ConstantPermeability.cpp b/src/coreComponents/constitutive/permeability/ConstantPermeability.cpp index eecbc1c6645..1e58663783a 100644 --- a/src/coreComponents/constitutive/permeability/ConstantPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ConstantPermeability.cpp @@ -44,10 +44,12 @@ ConstantPermeability::deliverClone( string const & name, return PermeabilityBase::deliverClone( name, parent ); } -void ConstantPermeability::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void ConstantPermeability::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - PermeabilityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + PermeabilityBase::allocateConstitutiveData( parent, numPts ); + + // TODO move into initializeState? integer const numQuad = 1; // NOTE: enforcing 1 quadrature point diff --git a/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp b/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp index 4357ea50b5d..24e0325bdc3 100644 --- a/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ConstantPermeability.hpp @@ -46,18 +46,18 @@ 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; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + dataRepository::Group * const parent ) const override; static string catalogName() { return "ConstantPermeability"; } 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 = ConstantPermeabilityUpdate; @@ -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/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..2ce96485b38 100644 --- a/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.cpp @@ -40,25 +40,18 @@ 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 ); } -std::unique_ptr< ConstitutiveBase > -ExponentialDecayPermeability::deliverClone( string const & name, - Group * const parent ) const +void ExponentialDecayPermeability::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - return ConstitutiveBase::deliverClone( name, parent ); -} - -void ExponentialDecayPermeability::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ -// NOTE: enforcing 1 quadrature point + // NOTE: enforcing 1 quadrature point m_dPerm_dTraction.resize( 0, 1, 3, 3 ); m_dPerm_dDispJump.resize( 0, 1, 3, 3 ); - PermeabilityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + 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 c8d39b0bfcf..d7c0956a4a4 100644 --- a/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ExponentialDecayPermeability.hpp @@ -92,18 +92,15 @@ class ExponentialDecayPermeability : public PermeabilityBase { public: - 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; + ExponentialDecayPermeability( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "ExponentialDecayPermeability"; } 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 = ExponentialDecayPermeabilityUpdate; diff --git a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp index 379a584bbd0..0d4b8923210 100644 --- a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.cpp @@ -40,28 +40,26 @@ 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 ); } -std::unique_ptr< ConstitutiveBase > -ParallelPlatesPermeability::deliverClone( string const & name, - Group * const parent ) const +void ParallelPlatesPermeability::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - return PermeabilityBase::deliverClone( name, parent ); + // NOTE: enforcing 1 quadrature point + m_dPerm_dDispJump.resize( 0, 1, 3, 3 ); + + PermeabilityBase::allocateConstitutiveData( parent, numPts ); } -void ParallelPlatesPermeability::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void ParallelPlatesPermeability::postInputInitialization() { - // NOTE: enforcing 1 quadrature point - m_dPerm_dDispJump.resize( 0, 1, 3, 3 ); + PermeabilityBase::postInputInitialization(); 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..80b5901714b 100644 --- a/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ParallelPlatesPermeability.hpp @@ -106,18 +106,15 @@ class ParallelPlatesPermeability : public PermeabilityBase { public: - 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; + ParallelPlatesPermeability( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "ParallelPlatesPermeability"; } virtual string getCatalogName() const override { return catalogName(); } + virtual void allocateConstitutiveData( dataRepository::Group & parent, + localIndex const numPts ) override; + virtual void initializeState() const override final; /// Type of kernel wrapper for in-kernel update @@ -139,7 +136,11 @@ class ParallelPlatesPermeability : public PermeabilityBase struct viewKeyStruct : public PermeabilityBase::viewKeyStruct { static constexpr char const * transversalPermeabilityString() { return "transversalPermeability"; } - } viewKeys; + }; + +protected: + + virtual void postInputInitialization() override; private: diff --git a/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp b/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp index 0086cf6dc13..2333490d7f7 100644 --- a/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp +++ b/src/coreComponents/constitutive/permeability/PermeabilityBase.cpp @@ -30,19 +30,10 @@ 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 ); -} - -std::unique_ptr< ConstitutiveBase > -PermeabilityBase::deliverClone( string const & name, - Group * const parent ) const -{ - return ConstitutiveBase::deliverClone( name, parent ); + registerField< fields::permeability::permeability >( &m_permeability ); + registerField< fields::permeability::dPerm_dPressure >( &m_dPerm_dPressure ); } void PermeabilityBase::scaleHorizontalPermeability( arrayView1d< real64 const > scalingFactors ) const @@ -59,14 +50,14 @@ void PermeabilityBase::scaleHorizontalPermeability( arrayView1d< real64 const > } } -void PermeabilityBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void PermeabilityBase::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { // NOTE: enforcing 1 quadrature point m_permeability.resize( 0, 1, 3 ); m_dPerm_dPressure.resize( 0, 1, 3 ); - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } } diff --git a/src/coreComponents/constitutive/permeability/PermeabilityBase.hpp b/src/coreComponents/constitutive/permeability/PermeabilityBase.hpp index d983bcf8d8e..190b8f1b4f6 100644 --- a/src/coreComponents/constitutive/permeability/PermeabilityBase.hpp +++ b/src/coreComponents/constitutive/permeability/PermeabilityBase.hpp @@ -107,13 +107,10 @@ class PermeabilityBase : public ConstitutiveBase { public: - PermeabilityBase( string const & name, Group * const parent ); - - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; + PermeabilityBase( string const & name, dataRepository::Group * const parent ); virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + localIndex const numPts ) override; /** * @brief Const/non-mutable accessor for permeability. diff --git a/src/coreComponents/constitutive/permeability/PressurePermeability.cpp b/src/coreComponents/constitutive/permeability/PressurePermeability.cpp index abcb8cde307..aaa8c86073c 100644 --- a/src/coreComponents/constitutive/permeability/PressurePermeability.cpp +++ b/src/coreComponents/constitutive/permeability/PressurePermeability.cpp @@ -60,38 +60,31 @@ 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++ ) { - 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::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void PressurePermeability::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - m_referencePermeability.resize( 0, 1, 3 ); + m_referencePermeability.resize( 0, 1, 3 ); // 0 to resize and assign default value later - PermeabilityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + PermeabilityBase::allocateConstitutiveData( parent, numPts ); - integer const numQuad = 1; // NOTE: enforcing 1 quadrature point + integer constexpr numQuad = 1; // NOTE: enforcing 1 quadrature point 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]; } } } @@ -115,7 +108,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..9d654048a0e 100644 --- a/src/coreComponents/constitutive/permeability/PressurePermeability.hpp +++ b/src/coreComponents/constitutive/permeability/PressurePermeability.hpp @@ -141,18 +141,15 @@ class PressurePermeability : public PermeabilityBase { public: - 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; + PressurePermeability( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "PressurePermeability"; } 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 = PressurePermeabilityUpdate; @@ -179,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/permeability/ProppantPermeability.cpp b/src/coreComponents/constitutive/permeability/ProppantPermeability.cpp index 201afe3fd63..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 ). @@ -49,18 +45,11 @@ 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 ); } -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 +58,14 @@ void ProppantPermeability::postInputInitialization() / ( m_maxProppantConcentration * m_maxProppantConcentration ); } -void ProppantPermeability::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void ProppantPermeability::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { // NOTE: enforcing 1 quadrature point m_dPerm_dDispJump.resize( 0, 1, 3, 3 ); m_permeabilityMultiplier.resize( 0, 1, 3 ); - PermeabilityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + + PermeabilityBase::allocateConstitutiveData( parent, numPts ); } diff --git a/src/coreComponents/constitutive/permeability/ProppantPermeability.hpp b/src/coreComponents/constitutive/permeability/ProppantPermeability.hpp index 73b54febf02..703eeaeafdb 100644 --- a/src/coreComponents/constitutive/permeability/ProppantPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/ProppantPermeability.hpp @@ -113,18 +113,15 @@ class ProppantPermeability : public PermeabilityBase { public: - 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; + ProppantPermeability( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "ProppantPermeability"; } 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 = ProppantPermeabilityUpdate; diff --git a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp index b3d05280ec4..7e23dd7b02e 100644 --- a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.cpp @@ -44,23 +44,16 @@ 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 ); } -std::unique_ptr< ConstitutiveBase > -SlipDependentPermeability::deliverClone( string const & name, - Group * const parent ) const +void SlipDependentPermeability::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - return ConstitutiveBase::deliverClone( name, parent ); -} - -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 ); + 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 2c883115fa9..912e85b388f 100644 --- a/src/coreComponents/constitutive/permeability/SlipDependentPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/SlipDependentPermeability.hpp @@ -90,18 +90,15 @@ class SlipDependentPermeability : public PermeabilityBase { public: - 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; + SlipDependentPermeability( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "SlipDependentPermeability"; } 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 = SlipDependentPermeabilityUpdate; diff --git a/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.cpp b/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.cpp index 30383aa7bdf..ccbdc1f9e1c 100644 --- a/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.cpp +++ b/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.cpp @@ -44,25 +44,18 @@ 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 ); } -std::unique_ptr< ConstitutiveBase > -WillisRichardsPermeability::deliverClone( string const & name, - Group * const parent ) const +void WillisRichardsPermeability::allocateConstitutiveData( Group & parent, + localIndex const numPts ) { - return ConstitutiveBase::deliverClone( name, parent ); -} - -void WillisRichardsPermeability::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 ); m_dPerm_dTraction.resize( 0, 1, 3, 3 ); - PermeabilityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + 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 400e8f8356c..0578fdf834a 100644 --- a/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.hpp +++ b/src/coreComponents/constitutive/permeability/WillisRichardsPermeability.hpp @@ -97,18 +97,15 @@ class WillisRichardsPermeability : public PermeabilityBase { public: - 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; + WillisRichardsPermeability( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "WillisRichardsPermeability"; } 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 = WillisRichardsPermeabilityUpdate; diff --git a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp index e69f2c5b3b3..d93d335873e 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 ); } @@ -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 ); - // 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(); } @@ -117,13 +118,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 e5998928e3f..0bc67b26a39 100644 --- a/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp +++ b/src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.hpp @@ -151,7 +151,7 @@ class RelativePermeabilityBase : public ConstitutiveBase RelativePermeabilityBase( string const & name, dataRepository::Group * const parent ); virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + localIndex const numPts ) override; integer numFluidPhases() const { return LvArray::integerConversion< integer >( m_phaseNames.size() ); } @@ -198,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 ); - 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 b3d4ff3a42c..0da9b4af093 100644 --- a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp +++ b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp @@ -148,10 +148,8 @@ TableRelativePermeabilityHysteresis::TableRelativePermeabilityHysteresis( std::s setRestartFlags( RestartFlags::NO_WRITE ); // register fields - registerField( fields::relperm::phaseMaxHistoricalVolFraction{}, - &m_phaseMaxHistoricalVolFraction ); - registerField( fields::relperm::phaseMinHistoricalVolFraction{}, - &m_phaseMinHistoricalVolFraction ); + registerField< fields::relperm::phaseMaxHistoricalVolFraction >( &m_phaseMaxHistoricalVolFraction ); + registerField< fields::relperm::phaseMinHistoricalVolFraction >( &m_phaseMinHistoricalVolFraction ); } @@ -167,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(), @@ -272,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, @@ -287,7 +287,6 @@ void TableRelativePermeabilityHysteresis::checkExistenceAndValidateWettingRelPer if( m_phaseHasHysteresis[IPT::WETTING] ) { - checkExistenceAndValidateRelPermTable( m_imbibitionWettingRelPermTableName, // input imbibitionPhaseMinVolFraction, // output imbibitionPhaseMaxVolFraction, @@ -317,7 +316,6 @@ void TableRelativePermeabilityHysteresis::checkExistenceAndValidateWettingRelPer getFullName(), drainagePhaseRelPermMaxEndPoint, imbibitionPhaseRelPermMaxEndPoint ), InputError ); - } m_wettingCurve.setPoints( drainagePhaseMinVolFraction, drainagePhaseRelPermMinEndPoint, // same as imbibition min @@ -564,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..3f0d5611f4c 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( dataRepository::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/relativePermeability/unitTests/testRelPerm.cpp b/src/coreComponents/constitutive/relativePermeability/unitTests/testRelPerm.cpp index c9de1f76fd7..ce209d36699 100644 --- a/src/coreComponents/constitutive/relativePermeability/unitTests/testRelPerm.cpp +++ b/src/coreComponents/constitutive/relativePermeability/unitTests/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; @@ -1078,7 +1079,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/constitutive/solid/CeramicDamage.cpp b/src/coreComponents/constitutive/solid/CeramicDamage.cpp index 389cf93a711..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 ). @@ -70,17 +63,12 @@ CeramicDamage::CeramicDamage( string const & name, Group * const parent ): } -CeramicDamage::~CeramicDamage() -{} - - -void CeramicDamage::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void CeramicDamage::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - ElasticIsotropic::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_damage.resize( 0, numPts ); + m_jacobian.resize( 0, numPts ); - m_damage.resize( 0, numConstitutivePointsPerParentIndex ); - m_jacobian.resize( 0, numConstitutivePointsPerParentIndex ); + ElasticIsotropic::allocateConstitutiveData( parent, numPts ); } @@ -95,12 +83,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..1c9442b50e2 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; @@ -420,36 +420,24 @@ 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 ); - - /** - * Default Destructor - */ - virtual ~CeramicDamage() override; - - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; - - virtual void saveConvergedState() const override; + CeramicDamage( string const & name, dataRepository::Group * const parent ); /** * @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(); } ///@} + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; + /** * Keys for data specified in this class. */ @@ -526,6 +514,7 @@ class CeramicDamage : public ElasticIsotropic protected: + virtual void postInputInitialization() override; /// State variable: The damage values for each quadrature point 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..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 ). @@ -56,7 +52,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..53addbde00e 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 ). @@ -176,21 +157,21 @@ void Damage< BASE >::postInputInitialization() } template< typename BASE > -void Damage< BASE >::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void Damage< BASE >::allocateConstitutiveData( Group & parent, 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_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( 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::allocateConstitutiveData( parent, numPts ); } template< typename BASE > diff --git a/src/coreComponents/constitutive/solid/Damage.hpp b/src/coreComponents/constitutive/solid/Damage.hpp index 97d5d251515..c1307ecb159 100644 --- a/src/coreComponents/constitutive/solid/Damage.hpp +++ b/src/coreComponents/constitutive/solid/Damage.hpp @@ -422,15 +422,13 @@ 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 numPts ) override; - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + virtual void postInputInitialization() override; virtual void saveConvergedState() const override; /// *** The interface to get member variables 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..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 @@ -95,17 +84,12 @@ DelftEgg::DelftEgg( string const & name, Group * const parent ): } -DelftEgg::~DelftEgg() -{} - - -void DelftEgg::allocateConstitutiveData( Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void DelftEgg::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - m_newPreConsolidationPressure.resize( 0, numConstitutivePointsPerParentIndex ); - m_oldPreConsolidationPressure.resize( 0, numConstitutivePointsPerParentIndex ); + m_newPreConsolidationPressure.resize( 0, numPts ); + m_oldPreConsolidationPressure.resize( 0, numPts ); - ElasticIsotropic::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + ElasticIsotropic::allocateConstitutiveData( parent, numPts ); } diff --git a/src/coreComponents/constitutive/solid/DelftEgg.hpp b/src/coreComponents/constitutive/solid/DelftEgg.hpp index 5789b46178c..ce00a5385b9 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; @@ -468,16 +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 ); - - /** - * Default Destructor - */ - virtual ~DelftEgg() override; + DelftEgg( string const & name, dataRepository::Group * const parent ); - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; virtual void saveConvergedState() const override; @@ -486,13 +479,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,6 +574,7 @@ class DelftEgg : public ElasticIsotropic protected: + virtual void postInputInitialization() override; /// Material parameter: The default value of the recompression index diff --git a/src/coreComponents/constitutive/solid/DruckerPrager.cpp b/src/coreComponents/constitutive/solid/DruckerPrager.cpp index cfdbfb05253..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 @@ -84,17 +75,12 @@ DruckerPrager::DruckerPrager( string const & name, Group * const parent ): } -DruckerPrager::~DruckerPrager() -{} - - -void DruckerPrager::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void DruckerPrager::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - m_newCohesion.resize( 0, numConstitutivePointsPerParentIndex ); - m_oldCohesion.resize( 0, numConstitutivePointsPerParentIndex ); + m_newCohesion.resize( 0, numPts ); + m_oldCohesion.resize( 0, numPts ); - ElasticIsotropic::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + ElasticIsotropic::allocateConstitutiveData( parent, numPts ); } diff --git a/src/coreComponents/constitutive/solid/DruckerPrager.hpp b/src/coreComponents/constitutive/solid/DruckerPrager.hpp index f741f60166d..e1543d3135a 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; @@ -358,16 +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 ); - - /** - * Default Destructor - */ - virtual ~DruckerPrager() override; + DruckerPrager( string const & name, dataRepository::Group * const parent ); - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; virtual void saveConvergedState() const override; @@ -376,13 +369,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,6 +456,7 @@ class DruckerPrager : public ElasticIsotropic protected: + virtual void postInputInitialization() override; /// Material parameter: The default value of yield surface slope diff --git a/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp b/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp index 2158e78f3a0..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 @@ -100,17 +88,12 @@ DruckerPragerExtended::DruckerPragerExtended( string const & name, Group * const } -DruckerPragerExtended::~DruckerPragerExtended() -{} - - -void DruckerPragerExtended::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void DruckerPragerExtended::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - m_newState.resize( 0, numConstitutivePointsPerParentIndex ); - m_oldState.resize( 0, numConstitutivePointsPerParentIndex ); + m_newState.resize( 0, numPts ); + m_oldState.resize( 0, numPts ); - ElasticIsotropic::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + ElasticIsotropic::allocateConstitutiveData( parent, numPts ); } diff --git a/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp b/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp index 20869d79e66..660649dc14b 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; @@ -384,16 +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 ); - - /** - * Default Destructor - */ - virtual ~DruckerPragerExtended() override; + DruckerPragerExtended( string const & name, dataRepository::Group * const parent ); - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; virtual void saveConvergedState() const override; @@ -402,13 +395,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,6 +495,7 @@ class DruckerPragerExtended : public ElasticIsotropic protected: + virtual void postInputInitialization() override; /// Material parameter: The default value of the initial yield surface slope diff --git a/src/coreComponents/constitutive/solid/DuvautLionsSolid.cpp b/src/coreComponents/constitutive/solid/DuvautLionsSolid.cpp index 4e3e128adee..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 ). @@ -43,19 +42,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..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 ). @@ -61,9 +57,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..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 ). @@ -74,10 +66,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..d8666357326 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp @@ -498,24 +498,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..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 ). @@ -173,9 +155,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..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 ). @@ -110,9 +100,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..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 @@ -73,20 +66,14 @@ ModifiedCamClay::ModifiedCamClay( string const & name, Group * const parent ): } -ModifiedCamClay::~ModifiedCamClay() -{} - - -void ModifiedCamClay::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void ModifiedCamClay::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - m_newPreConsolidationPressure.resize( 0, numConstitutivePointsPerParentIndex ); - m_oldPreConsolidationPressure.resize( 0, numConstitutivePointsPerParentIndex ); + m_newPreConsolidationPressure.resize( 0, numPts ); + m_oldPreConsolidationPressure.resize( 0, numPts ); - ElasticIsotropicPressureDependent::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + ElasticIsotropicPressureDependent::allocateConstitutiveData( parent, numPts ); } - void ModifiedCamClay::postInputInitialization() { ElasticIsotropicPressureDependent::postInputInitialization(); diff --git a/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp b/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp index 4377571e603..26b570974f3 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,7 +94,7 @@ 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; @@ -485,16 +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 ); - /** - * Default Destructor - */ - virtual ~ModifiedCamClay() override; - - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; virtual void saveConvergedState() const override; @@ -503,13 +496,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,8 +577,8 @@ class ModifiedCamClay : public ElasticIsotropicPressureDependent m_disableInelasticity ); } - protected: + virtual void postInputInitialization() override; /// Material parameter: The default value of the virgin compression index diff --git a/src/coreComponents/constitutive/solid/PerfectlyPlastic.cpp b/src/coreComponents/constitutive/solid/PerfectlyPlastic.cpp index a1d39db1f50..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 ). @@ -43,17 +41,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 +51,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..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" }; @@ -66,10 +62,6 @@ SolidBase::SolidBase( string const & name, Group * const parent ): } -SolidBase::~SolidBase() -{} - - void SolidBase::postInputInitialization() { this->getWrapper< array2d< real64 > >( viewKeyStruct::densityString() ). @@ -80,14 +72,14 @@ void SolidBase::postInputInitialization() } -void SolidBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void SolidBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) { - m_density.resize( 0, numConstitutivePointsPerParentIndex ); - m_newStress.resize( 0, numConstitutivePointsPerParentIndex, 6 ); - m_oldStress.resize( 0, numConstitutivePointsPerParentIndex, 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 ); - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } diff --git a/src/coreComponents/constitutive/solid/SolidBase.hpp b/src/coreComponents/constitutive/solid/SolidBase.hpp index b56bd38b53a..bee15f6c9fd 100644 --- a/src/coreComponents/constitutive/solid/SolidBase.hpp +++ b/src/coreComponents/constitutive/solid/SolidBase.hpp @@ -562,10 +562,7 @@ class SolidBase : public constitutive::ConstitutiveBase SolidBase( string const & name, Group * const parent ); - /** - * Destructor - */ - virtual ~SolidBase() override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; /// Keys for data in this class struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct @@ -585,14 +582,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; diff --git a/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp b/src/coreComponents/constitutive/solid/SolidInternalEnergy.cpp index 6f78fd8c78b..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 ). @@ -67,14 +61,14 @@ 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::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, numConstitutivePointsPerParentIndex ); + 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 20dcdf52abb..c9e70f9abd9 100644 --- a/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp +++ b/src/coreComponents/constitutive/solid/SolidInternalEnergy.hpp @@ -93,14 +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( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct { @@ -111,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/SolidModelDiscretizationOpsFullyAnisotroipic.hpp b/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotropic.hpp similarity index 94% rename from src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotroipic.hpp rename to src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullyAnisotropic.hpp index 6eefc6d686f..19a7db1bea3 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,8 +28,7 @@ namespace constitutive { -struct SolidModelDiscretizationOpsFullyAnisotroipic : public SolidModelDiscretizationOps // TODO: spelling error, - // convert to "General" anyway +struct SolidModelDiscretizationOpsFullyAnisotropic : public SolidModelDiscretizationOps { template< int NUM_SUPPORT_POINTS, typename BASIS_GRADIENT > @@ -75,9 +74,9 @@ template< int NUM_SUPPORT_POINTS, typename BASIS_GRADIENT > GEOS_HOST_DEVICE inline -void SolidModelDiscretizationOpsFullyAnisotroipic::BTDB( BASIS_GRADIENT const & gradN, - real64 const & detJxW, - real64 (& elementStiffness)[NUM_SUPPORT_POINTS *3][NUM_SUPPORT_POINTS *3] ) +void SolidModelDiscretizationOpsFullyAnisotropic::BTDB( BASIS_GRADIENT const & gradN, + real64 const & detJxW, + real64 (& elementStiffness)[NUM_SUPPORT_POINTS *3][NUM_SUPPORT_POINTS *3] ) { for( int a=0; a GEOS_HOST_DEVICE inline -void SolidModelDiscretizationOpsFullyAnisotroipic::upperBTDB( BASIS_GRADIENT const & gradN, - real64 const & detJxW, - real64 (& elementStiffness)[NUM_SUPPORT_POINTS *3][NUM_SUPPORT_POINTS *3] ) +void SolidModelDiscretizationOpsFullyAnisotropic::upperBTDB( BASIS_GRADIENT const & gradN, + real64 const & detJxW, + real64 (& elementStiffness)[NUM_SUPPORT_POINTS *3][NUM_SUPPORT_POINTS *3] ) { for( int a=0; a GEOS_HOST_DEVICE inline -void SolidModelDiscretizationOpsFullyAnisotroipic::diagBTDB( BASIS_GRADIENT const & gradN, - real64 const & detJxW, - real64 (& diagElementStiffness)[NUM_SUPPORT_POINTS *3] ) +void SolidModelDiscretizationOpsFullyAnisotropic::diagBTDB( BASIS_GRADIENT const & gradN, + real64 const & detJxW, + real64 (& diagElementStiffness)[NUM_SUPPORT_POINTS *3] ) { for( int a=0; a GEOS_HOST_DEVICE inline -void SolidModelDiscretizationOpsFullyAnisotroipic::diagRowSumBTDB( BASIS_GRADIENT const & gradN, - real64 const & detJxW, - real64 ( & diagSumElementStiffness )[NUM_SUPPORT_POINTS*3] ) +void SolidModelDiscretizationOpsFullyAnisotropic::diagRowSumBTDB( BASIS_GRADIENT const & gradN, + real64 const & detJxW, + real64 ( & diagSumElementStiffness )[NUM_SUPPORT_POINTS*3] ) { for( int a=0; a( &m_biotCoefficient ); + + registerField< fields::porosity::grainBulkModulus >( &m_grainBulkModulus ); + + registerField< fields::porosity::thermalExpansionCoefficient >( &m_thermalExpansionCoefficient ); + + registerField< fields::porosity::meanTotalStressIncrement_k >( &m_meanTotalStressIncrement_k ); + + registerField< fields::porosity::averageMeanTotalStressIncrement_k >( &m_averageMeanTotalStressIncrement_k ); } -void BiotPorosity::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void BiotPorosity::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) { - PorosityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + m_meanTotalStressIncrement_k.resize( 0, numPts ); - m_meanTotalStressIncrement_k.resize( 0, numConstitutivePointsPerParentIndex ); + 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 54730c0b73c..36e04505a86 100644 --- a/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp +++ b/src/coreComponents/constitutive/solid/porosity/BiotPorosity.hpp @@ -231,15 +231,14 @@ class BiotPorosityUpdates : public PorosityBaseUpdates class BiotPorosity : public PorosityBase { public: - BiotPorosity( string const & name, Group * const parent ); - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + BiotPorosity( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "BiotPorosity"; } 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"; } @@ -257,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; @@ -314,7 +313,6 @@ class BiotPorosity : public PorosityBase protected: virtual void postInputInitialization() 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..fcc2cd610c2 100644 --- a/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp +++ b/src/coreComponents/constitutive/solid/porosity/PorosityBase.cpp @@ -30,42 +30,34 @@ 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 ). 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::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void PorosityBase::allocateConstitutiveData( Group & parent, 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 ); + 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, numConstitutivePointsPerParentIndex ); + 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 07f97ac5b91..5ce2cce6d38 100644 --- a/src/coreComponents/constitutive/solid/porosity/PorosityBase.hpp +++ b/src/coreComponents/constitutive/solid/porosity/PorosityBase.hpp @@ -109,15 +109,14 @@ 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 numConstitutivePointsPerParentIndex ) override; + virtual void allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) override; struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct { static constexpr char const * defaultReferencePorosityString() { return "defaultReferencePorosity"; } - } viewKeys; + }; /** * @brief Number of elements storing solid data 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/solid/porosity/PressurePorosity.cpp b/src/coreComponents/constitutive/solid/porosity/PressurePorosity.cpp index cf62672c08d..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 ). @@ -41,18 +39,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..6bc961e39d0 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(); } @@ -107,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; @@ -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..efe846ad81b 100644 --- a/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.cpp +++ b/src/coreComponents/constitutive/solid/porosity/ProppantPorosity.cpp @@ -29,29 +29,13 @@ 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 ). 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..b217eed55a6 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(); } @@ -90,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.cpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.cpp index 3ca4d0ba26a..2573679cc20 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.cpp @@ -36,21 +36,13 @@ 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::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) { - return MultiPhaseThermalConductivityBase::deliverClone( name, parent ); -} - -void MultiPhaseConstantThermalConductivity::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - MultiPhaseThermalConductivityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + MultiPhaseThermalConductivityBase::allocateConstitutiveData( parent, numPts ); + // TODO move into initializeState? for( localIndex ei = 0; ei < parent.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..f4939ddf1f5 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseConstantThermalConductivity.hpp @@ -67,18 +67,14 @@ 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 ); - - std::unique_ptr< ConstitutiveBase > deliverClone( string const & name, - Group * const parent ) const override; - - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + MultiPhaseConstantThermalConductivity( string const & name, dataRepository::Group * const parent ); static string catalogName() { return "MultiPhaseConstantThermalConductivity"; } 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,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/MultiPhaseThermalConductivityBase.cpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.cpp index 8e74a96e8ed..5040067512d 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() @@ -52,20 +52,16 @@ void MultiPhaseThermalConductivityBase::postInputInitialization() GEOS_THROW_IF_GT_MSG( numPhases, MAX_NUM_PHASES, GEOS_FMT( "{}: invalid number of phases", getFullName() ), InputError ); - - m_effectiveConductivity.resize( 0, 0, 3 ); - m_dEffectiveConductivity_dPhaseVolFrac.resize( 0, 0, 3, numPhases ); } -void MultiPhaseThermalConductivityBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void MultiPhaseThermalConductivityBase::allocateConstitutiveData( dataRepository::Group & parent, localIndex const 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 ); + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } } // namespace constitutive diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.hpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.hpp index b1a7e8ae26c..ee6f815ebbc 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.hpp @@ -111,8 +111,7 @@ class MultiPhaseThermalConductivityBase : public ConstitutiveBase */ MultiPhaseThermalConductivityBase( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + 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) @@ -165,15 +164,6 @@ 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; diff --git a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp index f72e78bfdb3..efb1341d848 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp @@ -43,24 +43,14 @@ 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 ); } -std::unique_ptr< ConstitutiveBase > -MultiPhaseVolumeWeightedThermalConductivity::deliverClone( string const & name, - Group * const parent ) const +void MultiPhaseVolumeWeightedThermalConductivity::allocateConstitutiveData( dataRepository::Group & parent, localIndex const numPts ) { - return MultiPhaseThermalConductivityBase::deliverClone( name, parent ); -} - -void MultiPhaseVolumeWeightedThermalConductivity::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) -{ - // NOTE: enforcing 1 quadrature point - m_rockThermalConductivity.resize( 0, 1, 3 ); - - MultiPhaseThermalConductivityBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + MultiPhaseThermalConductivityBase::allocateConstitutiveData( parent, numPts ); + // TODO move into initializeState? 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 ad1c4b37680..c4b1484b276 100644 --- a/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.hpp @@ -120,13 +120,9 @@ 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 ); - 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 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,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.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..2e65c26f48b 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(); } @@ -100,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: diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp index c0a4b0a47ed..240a3792df4 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.cpp @@ -31,26 +31,17 @@ 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() -{ - ConstitutiveBase::postInputInitialization(); - - m_effectiveConductivity.resize( 0, 0, 3 ); - m_dEffectiveConductivity_dT.resize( 0, 0, 3 ); -} - -void SinglePhaseThermalConductivityBase::allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) +void SinglePhaseThermalConductivityBase::allocateConstitutiveData( Group & parent, localIndex const numPts ) { // NOTE: enforcing 1 quadrature point m_effectiveConductivity.resize( 0, 1, 3 ); m_dEffectiveConductivity_dT.resize( 0, 1, 3 ); - ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex ); + ConstitutiveBase::allocateConstitutiveData( parent, numPts ); } } // namespace constitutive diff --git a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp index fd51086b7fa..09444cd7e06 100644 --- a/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp +++ b/src/coreComponents/constitutive/thermalConductivity/SinglePhaseThermalConductivityBase.hpp @@ -96,8 +96,7 @@ class SinglePhaseThermalConductivityBase : public ConstitutiveBase */ SinglePhaseThermalConductivityBase( string const & name, dataRepository::Group * const parent ); - virtual void allocateConstitutiveData( dataRepository::Group & parent, - localIndex const numConstitutivePointsPerParentIndex ) override; + 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) @@ -146,19 +145,8 @@ 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; - /// cell-wise effective conductivities in the subregion array3d< real64 > m_effectiveConductivity; diff --git a/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp b/src/coreComponents/constitutive/unitTests/testInvariantImmiscibleFluid.cpp index 6beb7fe58f5..02d66eed9ae 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.initializeState(); } ); } @@ -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/integrationTests/constitutiveTests/testRelPermHysteresis.cpp b/src/coreComponents/integrationTests/constitutiveTests/testRelPermHysteresis.cpp index e735823475d..aec4f323c85 100644 --- a/src/coreComponents/integrationTests/constitutiveTests/testRelPermHysteresis.cpp +++ b/src/coreComponents/integrationTests/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; diff --git a/src/coreComponents/mesh/ObjectManagerBase.hpp b/src/coreComponents/mesh/ObjectManagerBase.hpp index fe64efee649..62b7814e8d1 100644 --- a/src/coreComponents/mesh/ObjectManagerBase.hpp +++ b/src/coreComponents/mesh/ObjectManagerBase.hpp @@ -585,19 +585,16 @@ 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( 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 f1a14eeda34..69d738abb95 100644 --- a/src/coreComponents/mesh/PerforationData.cpp +++ b/src/coreComponents/mesh/PerforationData.cpp @@ -36,16 +36,16 @@ 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::perforationStatus{}, &m_localPerfStatus ); + 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::perforationStatus >( &m_localPerfStatus ); registerWrapper( viewKeyStruct::perforationStatusTableName(), &m_perfStatusTableName ). setInputFlag( InputFlags::INVALID ). 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(), diff --git a/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp index e8a7b812ee2..8a0474bf79c 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/EquilibriumInitialCondition.hpp"