diff --git a/src/coreComponents/constitutive/ConstitutiveManager.cpp b/src/coreComponents/constitutive/ConstitutiveManager.cpp index 913f0898971..92a3fe1561a 100644 --- a/src/coreComponents/constitutive/ConstitutiveManager.cpp +++ b/src/coreComponents/constitutive/ConstitutiveManager.cpp @@ -86,6 +86,10 @@ ConstitutiveManager::hangConstitutiveRelation( string const & constitutiveRelati material->allocateConstitutiveData( *parent, numConstitutivePointsPerParentIndex ); + GEOS_LOG_RANK_0( GEOS_FMT( " {}/{} allocated", + constitutiveGroup->getName(), + constitutiveRelation.getName(), + numConstitutivePointsPerParentIndex ) ); ConstitutiveBase & materialGroup = constitutiveGroup->registerGroup< ConstitutiveBase >( constitutiveRelationInstanceName, std::move( material ) ); @@ -96,25 +100,7 @@ ConstitutiveManager::hangConstitutiveRelation( string const & constitutiveRelati std::vector< string > const subRelationNames = constitutiveRelation.getSubRelationNames(); for( string const & subRelationName : subRelationNames ) { - // we only want to register the subRelation if it has not been registered yet. - GEOS_ERROR_IF( constitutiveGroup->hasGroup( subRelationName ), - GEOS_FMT( "Error! The constitutive relation {} has already been registered on the subRegion {}. " - "Make sure that the same constitutive model is not listed as a material on a" - " region both as a stand-alone one and as part of a compound constitutive model.", - subRelationName, parent->getDataContext().toString() ) ); - - ConstitutiveBase const & subRelation = getConstitutiveRelation( subRelationName ); - - std::unique_ptr< ConstitutiveBase > constitutiveModel = subRelation.deliverClone( subRelationName, parent ); - - constitutiveModel->allocateConstitutiveData( *parent, - numConstitutivePointsPerParentIndex ); - - - ConstitutiveBase & - group = constitutiveGroup->registerGroup< ConstitutiveBase >( subRelationName, std::move( constitutiveModel ) ); - group.setSizedFromParent( 1 ); - group.resize( constitutiveGroup->size() ); + hangConstitutiveRelation( subRelationName, parent, numConstitutivePointsPerParentIndex ); } } diff --git a/src/coreComponents/constitutive/ConstitutiveManager.hpp b/src/coreComponents/constitutive/ConstitutiveManager.hpp index 1ef7f194314..2e3d7cec562 100644 --- a/src/coreComponents/constitutive/ConstitutiveManager.hpp +++ b/src/coreComponents/constitutive/ConstitutiveManager.hpp @@ -72,17 +72,11 @@ class ConstitutiveManager : public dataRepository::Group return this->getGroup< T >( key ); } - // template< typename T > - // ViewAccessor< T > - // GetConstitutiveData( string const & name, - // dataRepository::Group * const relationGroup ); - template< typename T > ViewAccessor< T > getConstitutiveData( string const & name, dataRepository::Group const * const relationGroup ) const; - struct groupKeyStruct { static constexpr auto constitutiveModelsString() { return "ConstitutiveModels"; } @@ -110,15 +104,6 @@ ConstitutiveManager::getConstitutiveData( string const & name, return rval; } -// template< typename T > -// ViewAccessor< T > -// ConstitutiveManager::GetConstitutiveData( string const & name, -// dataRepository::Group * const relationGroup ) -// { -// return const_cast< ViewAccessor >(const_cast(this-> -// GetConstitutiveData( name, relationGroup ) ); -// } - } } /* namespace geos */ diff --git a/src/coreComponents/mainInterface/ProblemManager.cpp b/src/coreComponents/mainInterface/ProblemManager.cpp index 890f550c752..081a9942104 100644 --- a/src/coreComponents/mainInterface/ProblemManager.cpp +++ b/src/coreComponents/mainInterface/ProblemManager.cpp @@ -1040,10 +1040,9 @@ void ProblemManager::setRegionQuadrature( Group & meshBodies, string const regionName = std::get< 2 >( key ); string const subRegionName = std::get< 3 >( key ); - GEOS_LOG_RANK_0( "regionQuadrature: meshBodyName, meshLevelName, regionName, subRegionName = "<< - meshBodyName<<", "<( meshBodyName ); MeshLevel & meshLevel = meshBody.getMeshLevel( meshLevelName ); @@ -1058,13 +1057,6 @@ void ProblemManager::setRegionQuadrature( Group & meshBodies, for( auto & materialName : materialList ) { constitutiveManager.hangConstitutiveRelation( materialName, &particleSubRegion, numQuadraturePoints ); - GEOS_LOG_RANK_0( GEOS_FMT( "{}/{}/{}/{}/{} allocated {} quadrature points", - meshBodyName, - meshLevelName, - regionName, - subRegionName, - materialName, - numQuadraturePoints ) ); } } // if( meshLevel.isShallowCopy() ) @@ -1078,13 +1070,6 @@ void ProblemManager::setRegionQuadrature( Group & meshBodies, for( auto & materialName : materialList ) { constitutiveManager.hangConstitutiveRelation( materialName, &elemSubRegion, numQuadraturePoints ); - GEOS_LOG_RANK_0( GEOS_FMT( "{}/{}/{}/{}/{} allocated {} quadrature points", - meshBodyName, - meshLevelName, - regionName, - subRegionName, - materialName, - numQuadraturePoints ) ); } } }