Skip to content

Commit

Permalink
Changed Group::getParent and Wrapper constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
corbett5 committed Feb 19, 2021
1 parent 0fd606c commit 444a4e0
Show file tree
Hide file tree
Showing 62 changed files with 141 additions and 136 deletions.
10 changes: 5 additions & 5 deletions src/coreComponents/constitutive/ConstitutiveBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ ConstitutiveBase::CatalogInterface::CatalogType & ConstitutiveBase::getCatalog()
return catalog;
}

void ConstitutiveBase::allocateConstitutiveData( dataRepository::Group * const parent,
void ConstitutiveBase::allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex )
{
m_numQuadraturePoints = numConstitutivePointsPerParentIndex;
m_constitutiveDataGroup = parent;
m_constitutiveDataGroup = &parent;

for( auto & group : this->getSubGroups() )
{
Expand All @@ -76,7 +76,7 @@ void ConstitutiveBase::allocateConstitutiveData( dataRepository::Group * const p
if( wrapper.second->sizedFromParent() )
{
string const & wrapperName = wrapper.first;
parent->registerWrapper( makeFieldName( this->getName(), wrapperName ), wrapper.second->clone( wrapperName, parent ) ).
parent.registerWrapper( makeFieldName( this->getName(), wrapperName ), wrapper.second->clone( wrapperName, parent ) ).
setRestartFlags( RestartFlags::NO_WRITE );
}
}
Expand All @@ -87,12 +87,12 @@ void ConstitutiveBase::allocateConstitutiveData( dataRepository::Group * const p
if( wrapper.second->sizedFromParent() )
{
string const wrapperName = wrapper.first;
parent->registerWrapper( makeFieldName( this->getName(), wrapperName ), wrapper.second->clone( wrapperName, parent ) ).
parent.registerWrapper( makeFieldName( this->getName(), wrapperName ), wrapper.second->clone( wrapperName, parent ) ).
setRestartFlags( RestartFlags::NO_WRITE );
}
}

this->resize( parent->size() );
this->resize( parent.size() );
}

std::unique_ptr< ConstitutiveBase >
Expand Down
4 changes: 2 additions & 2 deletions src/coreComponents/constitutive/ConstitutiveBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ class ConstitutiveBase : public dataRepository::Group

/**
* @brief Allocate constitutive data and make views to data on parent objects
* @param[in] parent pointer to the group that holds the constitutive relation
* @param[in] parent reference to the group that holds the constitutive relation
* @param[in] numConstitutivePointsPerParentIndex number of quadrature points
*
* This function does 2 things:
* 1) Allocate data according to the size of parent and numConstitutivePointsPerParentIndex
* 2) Create wrappers to the constitutive data in the parent for easier access
*/
virtual void allocateConstitutiveData( dataRepository::Group * const parent,
virtual void allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex );

struct viewKeyStruct
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/constitutive/ConstitutiveManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ConstitutiveManager::hangConstitutiveRelation( string const & constitutiveRelati

std::unique_ptr< ConstitutiveBase > material = constitutiveRelation.deliverClone( constitutiveRelationInstanceName, parent );

material->allocateConstitutiveData( parent,
material->allocateConstitutiveData( *parent,
numConstitutivePointsPerParentIndex );

dataRepository::Group * constitutiveGroup = parent->getGroupPointer( groupKeyStruct::constitutiveModelsString() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void CapillaryPressureBase::resizeFields( localIndex const size,
}


void CapillaryPressureBase::allocateConstitutiveData( dataRepository::Group * const parent,
void CapillaryPressureBase::allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex )
{
resizeFields( 0, numConstitutivePointsPerParentIndex );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class CapillaryPressureBase : public ConstitutiveBase

virtual ~CapillaryPressureBase() override;

virtual void allocateConstitutiveData( dataRepository::Group * const parent,
virtual void allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex ) override;

localIndex numFluidPhases() const { return m_phaseNames.size(); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ CompressibleSinglePhaseFluid::CompressibleSinglePhaseFluid( string const & name,

CompressibleSinglePhaseFluid::~CompressibleSinglePhaseFluid() = default;

void CompressibleSinglePhaseFluid::allocateConstitutiveData( dataRepository::Group * const parent,
void CompressibleSinglePhaseFluid::allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex )
{
SingleFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class CompressibleSinglePhaseFluid : public SingleFluidBase

virtual string getCatalogName() const override { return catalogName(); }

virtual void allocateConstitutiveData( dataRepository::Group * const parent,
virtual void allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex ) override;

/// Type of kernel wrapper for in-kernel update (TODO: support multiple EAT, not just linear)
Expand Down
4 changes: 2 additions & 2 deletions src/coreComponents/constitutive/fluid/MultiFluidBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ void MultiFluidBase::resizeFields( localIndex const size, localIndex const numPt
m_dTotalDensity_dGlobalCompFraction.resize( size, numPts, NC );
}

void MultiFluidBase::allocateConstitutiveData( dataRepository::Group * const parent,
void MultiFluidBase::allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex )
{
ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex );
resizeFields( parent->size(), numConstitutivePointsPerParentIndex );
resizeFields( parent.size(), numConstitutivePointsPerParentIndex );
}

MultiFluidBase::~MultiFluidBase()
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/constitutive/fluid/MultiFluidBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class MultiFluidBase : public ConstitutiveBase

virtual ~MultiFluidBase() override;

virtual void allocateConstitutiveData( dataRepository::Group * const parent,
virtual void allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex ) override;

// *** MultiFluid-specific interface
Expand Down
6 changes: 3 additions & 3 deletions src/coreComponents/constitutive/fluid/ParticleFluidBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ void ParticleFluidBase::postProcessInput()
ConstitutiveBase::postProcessInput();
}

void ParticleFluidBase::allocateConstitutiveData( Group * const parent,
void ParticleFluidBase::allocateConstitutiveData( Group & parent,
localIndex const numConstitutivePointsPerParentIndex )
{
ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex );

this->resize( parent->size() );
m_dSettlingFactor_dComponentConcentration.resize( parent->size(), MAX_NUM_COMPONENTS );
this->resize( parent.size() );
m_dSettlingFactor_dComponentConcentration.resize( parent.size(), MAX_NUM_COMPONENTS );
}

} //namespace constitutive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class ParticleFluidBase : public ConstitutiveBase
virtual ~ParticleFluidBase() override;

// *** ConstitutiveBase interface
virtual void allocateConstitutiveData( dataRepository::Group * const parent,
virtual void allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex ) override;

static constexpr localIndex MAX_NUM_COMPONENTS = 4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ProppantSlurryFluid::ProppantSlurryFluid( string const & name, Group * const par

ProppantSlurryFluid::~ProppantSlurryFluid() = default;

void ProppantSlurryFluid::allocateConstitutiveData( dataRepository::Group * const parent,
void ProppantSlurryFluid::allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex )
{
SlurryFluidBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class ProppantSlurryFluid : public SlurryFluidBase

virtual string getCatalogName() const override { return catalogName(); }

virtual void allocateConstitutiveData( dataRepository::Group * const parent,
virtual void allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex ) override;

using KernelWrapper = ProppantSlurryFluidUpdate;
Expand Down
12 changes: 6 additions & 6 deletions src/coreComponents/constitutive/fluid/SingleFluidBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ void SingleFluidBase::postProcessInput()

}

void SingleFluidBase::allocateConstitutiveData( Group * const parent,
void SingleFluidBase::allocateConstitutiveData( Group & parent,
localIndex const numConstitutivePointsPerParentIndex )
{
ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex );

this->resize( parent->size() );
this->resize( parent.size() );

m_density.resize( parent->size(), numConstitutivePointsPerParentIndex );
m_dDensity_dPressure.resize( parent->size(), numConstitutivePointsPerParentIndex );
m_density.resize( parent.size(), numConstitutivePointsPerParentIndex );
m_dDensity_dPressure.resize( parent.size(), numConstitutivePointsPerParentIndex );

m_viscosity.resize( parent->size(), numConstitutivePointsPerParentIndex );
m_dViscosity_dPressure.resize( parent->size(), numConstitutivePointsPerParentIndex );
m_viscosity.resize( parent.size(), numConstitutivePointsPerParentIndex );
m_dViscosity_dPressure.resize( parent.size(), numConstitutivePointsPerParentIndex );
}

} //namespace constitutive
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/constitutive/fluid/SingleFluidBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class SingleFluidBase : public ConstitutiveBase

// *** ConstitutiveBase interface

virtual void allocateConstitutiveData( dataRepository::Group * const parent,
virtual void allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex ) override;

// *** SingleFluid-specific interface
Expand Down
38 changes: 19 additions & 19 deletions src/coreComponents/constitutive/fluid/SlurryFluidBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,37 +103,37 @@ localIndex SlurryFluidBase::numFluidComponents() const
return LvArray::integerConversion< localIndex >( m_componentNames.size());
}

void SlurryFluidBase::allocateConstitutiveData( Group * const parent,
void SlurryFluidBase::allocateConstitutiveData( Group & parent,
localIndex const numConstitutivePointsPerParentIndex )
{
ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex );

this->resize( parent->size() );
this->resize( parent.size() );

localIndex const NC = numFluidComponents();

m_density.resize( parent->size(), numConstitutivePointsPerParentIndex );
m_dDens_dPres.resize( parent->size(), numConstitutivePointsPerParentIndex );
m_dDens_dProppantConc.resize( parent->size(), numConstitutivePointsPerParentIndex );
m_dDens_dCompConc.resize( parent->size(), numConstitutivePointsPerParentIndex, NC );
m_density.resize( parent.size(), numConstitutivePointsPerParentIndex );
m_dDens_dPres.resize( parent.size(), numConstitutivePointsPerParentIndex );
m_dDens_dProppantConc.resize( parent.size(), numConstitutivePointsPerParentIndex );
m_dDens_dCompConc.resize( parent.size(), numConstitutivePointsPerParentIndex, NC );

m_componentDensity.resize( parent->size(), numConstitutivePointsPerParentIndex, NC );
m_dCompDens_dPres.resize( parent->size(), numConstitutivePointsPerParentIndex, NC );
m_dCompDens_dCompConc.resize( parent->size(), numConstitutivePointsPerParentIndex, NC, NC );
m_componentDensity.resize( parent.size(), numConstitutivePointsPerParentIndex, NC );
m_dCompDens_dPres.resize( parent.size(), numConstitutivePointsPerParentIndex, NC );
m_dCompDens_dCompConc.resize( parent.size(), numConstitutivePointsPerParentIndex, NC, NC );


m_fluidDensity.resize( parent->size(), numConstitutivePointsPerParentIndex );
m_dFluidDens_dPres.resize( parent->size(), numConstitutivePointsPerParentIndex );
m_dFluidDens_dCompConc.resize( parent->size(), numConstitutivePointsPerParentIndex, NC );
m_fluidDensity.resize( parent.size(), numConstitutivePointsPerParentIndex );
m_dFluidDens_dPres.resize( parent.size(), numConstitutivePointsPerParentIndex );
m_dFluidDens_dCompConc.resize( parent.size(), numConstitutivePointsPerParentIndex, NC );

m_fluidViscosity.resize( parent->size(), numConstitutivePointsPerParentIndex );
m_dFluidVisc_dPres.resize( parent->size(), numConstitutivePointsPerParentIndex );
m_dFluidVisc_dCompConc.resize( parent->size(), numConstitutivePointsPerParentIndex, NC );
m_fluidViscosity.resize( parent.size(), numConstitutivePointsPerParentIndex );
m_dFluidVisc_dPres.resize( parent.size(), numConstitutivePointsPerParentIndex );
m_dFluidVisc_dCompConc.resize( parent.size(), numConstitutivePointsPerParentIndex, NC );

m_viscosity.resize( parent->size(), numConstitutivePointsPerParentIndex );
m_dVisc_dPres.resize( parent->size(), numConstitutivePointsPerParentIndex );
m_dVisc_dProppantConc.resize( parent->size(), numConstitutivePointsPerParentIndex );
m_dVisc_dCompConc.resize( parent->size(), numConstitutivePointsPerParentIndex, NC );
m_viscosity.resize( parent.size(), numConstitutivePointsPerParentIndex );
m_dVisc_dPres.resize( parent.size(), numConstitutivePointsPerParentIndex );
m_dVisc_dProppantConc.resize( parent.size(), numConstitutivePointsPerParentIndex );
m_dVisc_dCompConc.resize( parent.size(), numConstitutivePointsPerParentIndex, NC );

}

Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/constitutive/fluid/SlurryFluidBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class SlurryFluidBase : public ConstitutiveBase
virtual ~SlurryFluidBase() override;

// *** ConstitutiveBase interface
virtual void allocateConstitutiveData( dataRepository::Group * const parent,
virtual void allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex ) override;

static constexpr localIndex MAX_NUM_COMPONENTS = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ void RelativePermeabilityBase::resizeFields( localIndex const size, localIndex c
m_dPhaseRelPerm_dPhaseVolFrac.resize( size, numPts, NP, NP );
}

void RelativePermeabilityBase::allocateConstitutiveData( dataRepository::Group * const parent,
void RelativePermeabilityBase::allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex )
{
ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex );
resizeFields( parent->size(), numConstitutivePointsPerParentIndex );
resizeFields( parent.size(), numConstitutivePointsPerParentIndex );
}

} // namespace constitutive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class RelativePermeabilityBase : public ConstitutiveBase

virtual ~RelativePermeabilityBase() override;

virtual void allocateConstitutiveData( dataRepository::Group * const parent,
virtual void allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex ) override;

localIndex numFluidPhases() const { return m_phaseNames.size(); }
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/constitutive/solid/Damage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void Damage< BASE >::postProcessInput()
}

template< typename BASE >
void Damage< BASE >::allocateConstitutiveData( dataRepository::Group * const parent,
void Damage< BASE >::allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex )
{
m_damage.resize( 0, numConstitutivePointsPerParentIndex );
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/constitutive/solid/Damage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class Damage : public BASE

virtual void postProcessInput() override;

virtual void allocateConstitutiveData( dataRepository::Group * const parent,
virtual void allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex ) override;


Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/constitutive/solid/DruckerPrager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ DruckerPrager::~DruckerPrager()
{}


void DruckerPrager::allocateConstitutiveData( dataRepository::Group * const parent,
void DruckerPrager::allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex )
{
m_newCohesion.resize( 0, numConstitutivePointsPerParentIndex );
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/constitutive/solid/DruckerPrager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class DruckerPrager : public ElasticIsotropic
virtual ~DruckerPrager() override;


virtual void allocateConstitutiveData( dataRepository::Group * const parent,
virtual void allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex ) override;

virtual void saveConvergedState() const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ DruckerPragerExtended::~DruckerPragerExtended()
{}


void DruckerPragerExtended::allocateConstitutiveData( dataRepository::Group * const parent,
void DruckerPragerExtended::allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex )
{
m_newState.resize( 0, numConstitutivePointsPerParentIndex );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ class DruckerPragerExtended : public ElasticIsotropic
virtual ~DruckerPragerExtended() override;


virtual void allocateConstitutiveData( dataRepository::Group * const parent,
virtual void allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex ) override;

virtual void saveConvergedState() const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ PoreVolumeCompressibleSolid::deliverClone( string const & name,
return clone;
}

void PoreVolumeCompressibleSolid::allocateConstitutiveData( dataRepository::Group * const parent,
void PoreVolumeCompressibleSolid::allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex )
{
ConstitutiveBase::allocateConstitutiveData( parent, numConstitutivePointsPerParentIndex );

this->resize( parent->size() );
this->resize( parent.size() );

m_poreVolumeMultiplier.resize( parent->size(), numConstitutivePointsPerParentIndex );
m_dPVMult_dPressure.resize( parent->size(), numConstitutivePointsPerParentIndex );
m_poreVolumeMultiplier.resize( parent.size(), numConstitutivePointsPerParentIndex );
m_dPVMult_dPressure.resize( parent.size(), numConstitutivePointsPerParentIndex );
m_poreVolumeMultiplier.setValues< serialPolicy >( 1.0 );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PoreVolumeCompressibleSolid : public ConstitutiveBase
std::unique_ptr< ConstitutiveBase > deliverClone( string const & name,
Group * const parent ) const override;

virtual void allocateConstitutiveData( dataRepository::Group * const parent,
virtual void allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex ) override;


Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/constitutive/solid/PoroElastic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ PoroElastic< BASE >::deliverClone( string const & name,
}

template< typename BASE >
void PoroElastic< BASE >::allocateConstitutiveData( dataRepository::Group * const parent,
void PoroElastic< BASE >::allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex )
{
m_poreVolumeMultiplier.resize( 0, numConstitutivePointsPerParentIndex );
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/constitutive/solid/PoroElastic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class PoroElastic : public BASE
* @param parent Object's parent group (an element region)
* @param numConstitutivePointsPerParentIndex (number of quadrature points per element)
*/
virtual void allocateConstitutiveData( dataRepository::Group * const parent,
virtual void allocateConstitutiveData( dataRepository::Group & parent,
localIndex const numConstitutivePointsPerParentIndex ) override;

/**
Expand Down
Loading

0 comments on commit 444a4e0

Please sign in to comment.