diff --git a/src/coreComponents/constitutive/ConstitutiveBase.hpp b/src/coreComponents/constitutive/ConstitutiveBase.hpp index 1dff33c3666..b0f9adbf148 100644 --- a/src/coreComponents/constitutive/ConstitutiveBase.hpp +++ b/src/coreComponents/constitutive/ConstitutiveBase.hpp @@ -85,9 +85,13 @@ class ConstitutiveBase : public dataRepository::Group /** * @brief Get full name of the model. - * @return full name, consisting of XML (catalog) name and actual model name + * @return full name, consisting of XML (catalog) name and actual model name, and if possible + * followed by the xml file and line. */ - string getFullName() const { return getCatalogName() + " " + getName(); } + string getFullName() const + { + return getCatalogName() + " " + getDataContext().toString(); + } ///@} diff --git a/src/coreComponents/constitutive/ConstitutiveManager.cpp b/src/coreComponents/constitutive/ConstitutiveManager.cpp index 840a18a6c01..f1e587822ab 100644 --- a/src/coreComponents/constitutive/ConstitutiveManager.cpp +++ b/src/coreComponents/constitutive/ConstitutiveManager.cpp @@ -75,7 +75,7 @@ ConstitutiveManager::hangConstitutiveRelation( string const & constitutiveRelati 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.", - constitutiveRelationInstanceName, parent->getName() ) ); + constitutiveRelationInstanceName, parent->getDataContext().toString() ) ); ConstitutiveBase const & constitutiveRelation = getConstitutiveRelation( constitutiveRelationInstanceName ); @@ -98,7 +98,7 @@ ConstitutiveManager::hangConstitutiveRelation( string const & constitutiveRelati 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->getName() ) ); + subRelationName, parent->getDataContext().toString() ) ); ConstitutiveBase const & subRelation = getConstitutiveRelation( subRelationName ); diff --git a/src/coreComponents/constitutive/ConstitutivePassThru.hpp b/src/coreComponents/constitutive/ConstitutivePassThru.hpp index 546aa42d756..304c4377673 100644 --- a/src/coreComponents/constitutive/ConstitutivePassThru.hpp +++ b/src/coreComponents/constitutive/ConstitutivePassThru.hpp @@ -170,8 +170,8 @@ struct ConstitutivePassThru< NullModel > } else { - GEOS_ERROR( "ConstitutivePassThru< NullModel >::execute failed. The constitutive relation is named " - << constitutiveRelation.getName() << " with type " + GEOS_ERROR( "ConstitutivePassThru< NullModel >::execute failed on constitutive relation " + << constitutiveRelation.getDataContext() << " with type " << LvArray::system::demangleType( constitutiveRelation ) ); } } @@ -194,8 +194,8 @@ struct ConstitutivePassThru< PorousSolid< ElasticIsotropic > > } else { - GEOS_ERROR( "ConstitutivePassThru< PorousSolid< ElasticIsotropic > >::execute failed. The constitutive relation is named " - << constitutiveRelation.getName() << " with type " + GEOS_ERROR( "ConstitutivePassThru< PorousSolid< ElasticIsotropic > >::execute failed on constitutive relation " + << constitutiveRelation.getDataContext() << " with type " << LvArray::system::demangleType( constitutiveRelation ) ); } } @@ -293,8 +293,8 @@ struct ConstitutivePassThru< ProppantSolid< ProppantPorosity, ProppantPermeabili } else { - GEOS_ERROR( "ConstitutivePassThru< ProppantSolid >::execute failed. The constitutive relation is named " - << constitutiveRelation.getName() << " with type " + GEOS_ERROR( "ConstitutivePassThru< ProppantSolid >::execute failed on constitutive relation " + << constitutiveRelation.getDataContext() << " with type " << LvArray::system::demangleType( constitutiveRelation ) ); } } diff --git a/src/coreComponents/constitutive/ConstitutivePassThruHandler.hpp b/src/coreComponents/constitutive/ConstitutivePassThruHandler.hpp index c99683088f2..14013dd6ddb 100644 --- a/src/coreComponents/constitutive/ConstitutivePassThruHandler.hpp +++ b/src/coreComponents/constitutive/ConstitutivePassThruHandler.hpp @@ -44,7 +44,7 @@ struct ConstitutivePassThruHandler<> static void execute( BASE & relation, LAMBDA lambda ) { GEOS_UNUSED_VAR( relation, lambda ); - GEOS_ERROR( "The constitutive model " << relation.getName() << " was not dispatched." << + GEOS_ERROR( "The constitutive model " << relation.getDataContext() << " was not dispatched. " << "The model type does not match the list of supported types." ); } }; diff --git a/src/coreComponents/constitutive/contact/ContactBase.cpp b/src/coreComponents/constitutive/contact/ContactBase.cpp index 0b74639b5a9..01d9c5738c8 100644 --- a/src/coreComponents/constitutive/contact/ContactBase.cpp +++ b/src/coreComponents/constitutive/contact/ContactBase.cpp @@ -70,7 +70,7 @@ void ContactBase::postProcessInput() { GEOS_THROW_IF( m_apertureTableName.empty(), - getCatalogName() << " " << getName() << ": the aperture table name " << m_apertureTableName << " is empty", InputError ); + getFullName() << ": the aperture table name " << m_apertureTableName << " is empty", InputError ); } @@ -86,7 +86,7 @@ void ContactBase::allocateConstitutiveData( Group & parent, FunctionManager & functionManager = FunctionManager::getInstance(); GEOS_THROW_IF( !functionManager.hasGroup( m_apertureTableName ), - getCatalogName() << " " << getName() << ": the aperture table named " << m_apertureTableName << " could not be found", + getFullName() << ": the aperture table named " << m_apertureTableName << " could not be found", InputError ); TableFunction & apertureTable = functionManager.getGroup< TableFunction >( m_apertureTableName ); @@ -126,25 +126,25 @@ void ContactBase::validateApertureTable( TableFunction const & apertureTable ) c arrayView1d< real64 const > const & hydraulicApertureValues = apertureTable.getValues(); GEOS_THROW_IF( coords.size() > 1, - getCatalogName() << " " << getName() << ": Aperture limiter table cannot be greater than a 1D table.", + getFullName() << ": Aperture limiter table cannot be greater than a 1D table.", InputError ); arraySlice1d< real64 const > apertureValues = coords[0]; localIndex const size = apertureValues.size(); GEOS_THROW_IF( coords( 0, size-1 ) > 0.0 || coords( 0, size-1 ) < 0.0, - getCatalogName() << " " << getName() << ": Invalid aperture limiter table. Last coordinate must be zero!", + getFullName() << ": Invalid aperture limiter table. Last coordinate must be zero!", InputError ); GEOS_THROW_IF( apertureValues.size() < 2, - getCatalogName() << " " << getName() << ": Invalid aperture limiter table. Must have more than two points specified", + getFullName() << ": Invalid aperture limiter table. Must have more than two points specified", InputError ); localIndex const n = apertureValues.size()-1; real64 const slope = ( hydraulicApertureValues[n] - hydraulicApertureValues[n-1] ) / ( apertureValues[n] - apertureValues[n-1] ); GEOS_THROW_IF( slope >= 1.0, - getCatalogName() << " " << getName() << ": Invalid aperture table. The slope of the last two points >= 1 is invalid.", + getFullName() << ": Invalid aperture table. The slope of the last two points >= 1 is invalid.", InputError ); } diff --git a/src/coreComponents/constitutive/contact/CoulombContact.cpp b/src/coreComponents/constitutive/contact/CoulombContact.cpp index ea535b76563..49d98a9244e 100644 --- a/src/coreComponents/constitutive/contact/CoulombContact.cpp +++ b/src/coreComponents/constitutive/contact/CoulombContact.cpp @@ -54,7 +54,7 @@ CoulombContact::~CoulombContact() void CoulombContact::postProcessInput() { GEOS_THROW_IF( m_frictionCoefficient < 0.0, - getCatalogName() << " " << getName() << ": The provided friction coefficient is less than zero. Value: " << m_frictionCoefficient, + getFullName() << ": The provided friction coefficient is less than zero. Value: " << m_frictionCoefficient, InputError ); } diff --git a/src/coreComponents/constitutive/contact/deprecated/ApertureTableContact.cpp b/src/coreComponents/constitutive/contact/deprecated/ApertureTableContact.cpp index 3fcbf8eea2e..3cebdcd857e 100644 --- a/src/coreComponents/constitutive/contact/deprecated/ApertureTableContact.cpp +++ b/src/coreComponents/constitutive/contact/deprecated/ApertureTableContact.cpp @@ -58,11 +58,11 @@ void ApertureTableContact::postProcessInput() FunctionManager const & functionManager = FunctionManager::getInstance(); GEOS_THROW_IF( m_apertureTableName.empty(), - getCatalogName() << " " << getName() << ": the aperture table name " << m_apertureTableName << " is empty", + getFullName() << ": the aperture table name " << m_apertureTableName << " is empty", InputError ); GEOS_THROW_IF( !functionManager.hasGroup( m_apertureTableName ), - getCatalogName() << " " << getName() << ": the aperture table named " << m_apertureTableName << " could not be found", + getFullName() << ": the aperture table named " << m_apertureTableName << " could not be found", InputError ); } @@ -95,25 +95,25 @@ void ApertureTableContact::validateApertureTable( TableFunction const & aperture arrayView1d< real64 const > const & effectiveApertureValues = apertureTable.getValues(); GEOS_THROW_IF( coords.size() > 1, - getCatalogName() << " " << getName() << ": Aperture limiter table cannot be greater than a 1D table.", + getFullName() << ": Aperture limiter table cannot be greater than a 1D table.", InputError ); arraySlice1d< real64 const > apertureValues = coords[0]; localIndex const size = apertureValues.size(); GEOS_THROW_IF( coords( 0, size-1 ) > 0.0 || coords( 0, size-1 ) < 0.0, - getCatalogName() << " " << getName() << ": Invalid aperture limiter table. Last coordinate must be zero!", + getFullName() << ": Invalid aperture limiter table. Last coordinate must be zero!", InputError ); GEOS_THROW_IF( apertureValues.size() < 2, - getCatalogName() << " " << getName() << ": Invalid aperture limiter table. Must have more than two points specified", + getFullName() << ": Invalid aperture limiter table. Must have more than two points specified", InputError ); localIndex const n = apertureValues.size()-1; real64 const slope = ( effectiveApertureValues[n] - effectiveApertureValues[n-1] ) / ( apertureValues[n] - apertureValues[n-1] ); GEOS_THROW_IF( slope >= 1.0, - getCatalogName() << " " << getName() << ": Invalid aperture table. The slope of the last two points >= 1 is invalid.", + getFullName() << ": Invalid aperture table. The slope of the last two points >= 1 is invalid.", InputError ); } diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.cpp index ef7a749f749..ee186e16c4f 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ParticleFluid.cpp @@ -84,22 +84,28 @@ void ParticleFluid::postProcessInput() ParticleFluidBase::postProcessInput(); GEOS_ERROR_IF( m_proppantDensity < 500.0, - "Invalid proppantDensity in ParticleFluid, which must >= 500.0 " ); + "Invalid proppantDensity in ParticleFluid " + << getDataContext() << ", which must >= 500.0 " ); GEOS_ERROR_IF( m_proppantDiameter < 10e-6, - "Invalid proppantDiameter in ParticleFluid, which must >= 10e-6 " ); + "Invalid proppantDiameter in ParticleFluid " + << getDataContext() << ", which must >= 10e-6 " ); GEOS_ERROR_IF( m_hinderedSettlingCoefficient< 0.0 || m_hinderedSettlingCoefficient > 10.0, - "Invalid hinderedSettlingCoefficient in ParticleFluid, which must between 0 and 10 " ); + "Invalid hinderedSettlingCoefficient in ParticleFluid " + << getDataContext() << ", which must between 0 and 10 " ); GEOS_ERROR_IF( m_collisionAlpha < 1.0, - "Invalid collisionAlpha in ParticleFluid, which must >= 1 " ); + "Invalid collisionAlpha in ParticleFluid " + << getDataContext() << ", which must >= 1 " ); GEOS_ERROR_IF( m_collisionBeta < 0.0, - "Invalid collisionBeta in ParticleFluid, which must >= 0" ); + "Invalid collisionBeta in ParticleFluid " + << getDataContext() << ", which must >= 0" ); GEOS_ERROR_IF( m_slipConcentration > 0.3, - "Invalid slipConcentration in ParticleFluid, which must <= 0.3" ); + "Invalid slipConcentration in ParticleFluid " + << getDataContext() << ", which must <= 0.3" ); m_packPermeabilityCoef = pow( m_sphericity * m_proppantDiameter, 2.0 ) / 180.0; } diff --git a/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.cpp b/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.cpp index 4bd96a1c41a..713a0f04b45 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/ProppantSlurryFluid.cpp @@ -78,19 +78,19 @@ void ProppantSlurryFluid::postProcessInput() SlurryFluidBase::postProcessInput(); GEOS_ERROR_IF_LT_MSG( m_compressibility, 0.0, - getName() << ": invalid value of " << viewKeyStruct::compressibilityString() ); + getFullName() << ": invalid value of " << viewKeyStruct::compressibilityString() ); GEOS_ERROR_IF_LE_MSG( m_referenceDensity, 0.0, - getName() << ": invalid value of " << viewKeyStruct::referenceDensityString() ); + getFullName() << ": invalid value of " << viewKeyStruct::referenceDensityString() ); GEOS_ERROR_IF_LT_MSG( m_referenceViscosity, 0.0, - getName() << ": invalid value of " << viewKeyStruct::referenceViscosityString() ); + getFullName() << ": invalid value of " << viewKeyStruct::referenceViscosityString() ); GEOS_ERROR_IF_LE_MSG( m_maxProppantConcentration, 0.0, - getName() << ": invalid value of " << viewKeyStruct::maxProppantConcentrationString() ); + getFullName() << ": invalid value of " << viewKeyStruct::maxProppantConcentrationString() ); GEOS_ERROR_IF_GT_MSG( m_maxProppantConcentration, 1.0, - getName() << ": invalid value of " << viewKeyStruct::maxProppantConcentrationString() ); + getFullName() << ": invalid value of " << viewKeyStruct::maxProppantConcentrationString() ); } ProppantSlurryFluid::KernelWrapper diff --git a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp index 08c5d8dc1f8..1c4b6199357 100644 --- a/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/singlefluid/SlurryFluidBase.cpp @@ -88,13 +88,13 @@ void SlurryFluidBase::postProcessInput() localIndex const NC = numFluidComponents(); GEOS_ERROR_IF( m_defaultComponentDensity.size() != NC, - "The number of default density values is not the same as the component number" ); + getFullName() << ": The number of default density values is not the same as the component number" ); GEOS_ERROR_IF( m_defaultComponentCompressibility.size() != NC, - "The number of default compressibility values is not the same as the component number" ); + getFullName() << ": The number of default compressibility values is not the same as the component number" ); GEOS_ERROR_IF( m_defaultComponentViscosity.size() != NC, - "The number of default viscosity values is not the same as the component number" ); + getFullName() << ": The number of default viscosity values is not the same as the component number" ); } diff --git a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHelpers.cpp b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHelpers.cpp index 6c92a795303..ea15c74924e 100644 --- a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHelpers.cpp +++ b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHelpers.cpp @@ -36,13 +36,16 @@ TableRelativePermeabilityHelpers::validateRelativePermeabilityTable( TableFuncti ArrayOfArraysView< real64 const > coords = relPermTable.getCoordinates(); GEOS_THROW_IF_NE_MSG( relPermTable.getInterpolationMethod(), TableFunction::InterpolationType::Linear, - GEOS_FMT( "{}: in table '{}' interpolation method must be linear", fullConstitutiveName, relPermTable.getName() ), + GEOS_FMT( "{}: TableFunction '{}' interpolation method must be linear", + fullConstitutiveName, relPermTable.getDataContext() ), InputError ); GEOS_THROW_IF_NE_MSG( relPermTable.numDimensions(), 1, - GEOS_FMT( "{}: table '{}' must have a single independent coordinate", fullConstitutiveName, relPermTable.getName() ), + GEOS_FMT( "{}: TableFunction '{}' must have a single independent coordinate", + fullConstitutiveName, relPermTable.getDataContext() ), InputError ); GEOS_THROW_IF_LT_MSG( coords.sizeOfArray( 0 ), 2, - GEOS_FMT( "{}: table `{}` must contain at least two values", fullConstitutiveName, relPermTable.getName() ), + GEOS_FMT( "{}: TableFunction `{}` must contain at least two values", + fullConstitutiveName, relPermTable.getDataContext() ), InputError ); arraySlice1d< real64 const > phaseVolFrac = coords[0]; @@ -53,21 +56,23 @@ TableRelativePermeabilityHelpers::validateRelativePermeabilityTable( TableFuncti // note that the TableFunction class has already checked that coords.sizeOfArray( 0 ) == relPerm.size() GEOS_THROW_IF( !isZero( relPerm[0] ), - GEOS_FMT( "{}: in table '{}' the first value must be equal to 0", fullConstitutiveName, relPermTable.getName() ), + GEOS_FMT( "{}: TableFunction '{}' first value must be equal to 0", + fullConstitutiveName, relPermTable.getDataContext() ), InputError ); for( localIndex i = 1; i < coords.sizeOfArray( 0 ); ++i ) { // check phase volume fraction GEOS_THROW_IF( phaseVolFrac[i] < 0 || phaseVolFrac[i] > 1, - GEOS_FMT( "{}: in table '{}' values must be between 0 and 1", fullConstitutiveName, relPermTable.getName() ), + GEOS_FMT( "{}: TableFunction '{}' values must be between 0 and 1", + fullConstitutiveName, relPermTable.getDataContext() ), InputError ); // note that the TableFunction class has already checked that the coordinates are monotone // check phase relative permeability GEOS_THROW_IF( !isZero( relPerm[i] ) && (relPerm[i] - relPerm[i-1]) < 1e-15, - GEOS_FMT( "{}: in table '{}' values must be strictly increasing (|Delta kr| > 1e-15 between two non-zero values)", - fullConstitutiveName, relPermTable.getName() ), + GEOS_FMT( "{}: TableFunction '{}' values must be strictly increasing (|Delta kr| > 1e-15 between two non-zero values)", + fullConstitutiveName, relPermTable.getDataContext() ), InputError ); if( isZero( relPerm[i-1] ) && !isZero( relPerm[i] ) ) diff --git a/src/coreComponents/constitutive/solid/CoupledSolid.hpp b/src/coreComponents/constitutive/solid/CoupledSolid.hpp index 1e719d3ff31..e871f07e219 100644 --- a/src/coreComponents/constitutive/solid/CoupledSolid.hpp +++ b/src/coreComponents/constitutive/solid/CoupledSolid.hpp @@ -188,23 +188,23 @@ void CoupledSolid< SOLID_TYPE, PORO_TYPE, PERM_TYPE >::initializePreSubGroups() { if( PORO_TYPE::catalogName() != getPorosityModel().getCatalogName() ) { - GEOS_ERROR( " The coupled solid "<< this->getName()<< - " expects a porosity model of type "<getName()<< - " expects a permeability model of type "<getName()<< - " expects a solid model of type "<m_solidModelName<< + GEOS_ERROR( " The coupled solid " << getDataContext() << + " expects a solid model of type " << SOLID_TYPE::catalogName() << + " but the specified solid model \"" << m_solidModelName << "\" is of type" << getSolidModel().getCatalogName() ); } } diff --git a/src/coreComponents/constitutive/solid/Damage.cpp b/src/coreComponents/constitutive/solid/Damage.cpp index d2922ffa585..4812112f17c 100644 --- a/src/coreComponents/constitutive/solid/Damage.cpp +++ b/src/coreComponents/constitutive/solid/Damage.cpp @@ -101,10 +101,18 @@ void Damage< BASE >::postProcessInput() { BASE::postProcessInput(); - GEOS_ERROR_IF( m_extDrivingForceFlag != 0 && m_extDrivingForceFlag!= 1, "invalid external driving force flag option - must be 0 or 1" ); - GEOS_ERROR_IF( m_extDrivingForceFlag == 1 && m_tensileStrength <= 0.0, "tensile strength must be input and positive when the external driving force flag is turned on" ); - GEOS_ERROR_IF( m_extDrivingForceFlag == 1 && m_compressStrength <= 0.0, "compressive strength must be input and positive when the external driving force flag is turned on" ); - GEOS_ERROR_IF( m_extDrivingForceFlag == 1 && m_deltaCoefficient < 0.0, "delta coefficient must be input and non-negative when the external driving force flag is turned on" ); + GEOS_ERROR_IF( m_extDrivingForceFlag != 0 && m_extDrivingForceFlag!= 1, + BASE::getDataContext() << ": invalid external driving force flag option - must" + " be 0 or 1" ); + GEOS_ERROR_IF( m_extDrivingForceFlag == 1 && m_tensileStrength <= 0.0, + BASE::getDataContext() << ": tensile strength must be input and positive when the" + " external driving force flag is turned on" ); + GEOS_ERROR_IF( m_extDrivingForceFlag == 1 && m_compressStrength <= 0.0, + BASE::getDataContext() << ": compressive strength must be input and positive when the" + " external driving force flag is turned on" ); + GEOS_ERROR_IF( m_extDrivingForceFlag == 1 && m_deltaCoefficient < 0.0, + BASE::getDataContext() << ": delta coefficient must be input and non-negative when the" + " external driving force flag is turned on" ); } template< typename BASE > diff --git a/src/coreComponents/constitutive/solid/DelftEgg.cpp b/src/coreComponents/constitutive/solid/DelftEgg.cpp index 8bc955dd3ef..695e6cad813 100644 --- a/src/coreComponents/constitutive/solid/DelftEgg.cpp +++ b/src/coreComponents/constitutive/solid/DelftEgg.cpp @@ -112,10 +112,14 @@ void DelftEgg::postProcessInput() { ElasticIsotropic::postProcessInput(); - GEOS_THROW_IF( m_defaultCslSlope <= 0, "Non-positive slope of critical state line detected", InputError ); - GEOS_THROW_IF( m_defaultShapeParameter < 1., "Shape parameter for yield surface must be greater than or equal to one", InputError ); - GEOS_THROW_IF( m_defaultVirginCompressionIndex <= 0, "Non-positive virgin compression index detected", InputError ); - GEOS_THROW_IF( m_defaultVirginCompressionIndex <= m_defaultRecompressionIndex, "Recompression index should exceed virgin recompression index", InputError ); + GEOS_THROW_IF( m_defaultCslSlope <= 0, + getFullName() << ": Non-positive slope of critical state line detected", InputError ); + GEOS_THROW_IF( m_defaultShapeParameter < 1., + getFullName() << ": Shape parameter for yield surface must be greater than or equal to one", InputError ); + GEOS_THROW_IF( m_defaultVirginCompressionIndex <= 0, + getFullName() << ": Non-positive virgin compression index detected", InputError ); + GEOS_THROW_IF( m_defaultVirginCompressionIndex <= m_defaultRecompressionIndex, + getFullName() << ": Recompression index should exceed virgin recompression index", InputError ); // set results as array default values diff --git a/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp b/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp index e6ff5025f05..5c87d625358 100644 --- a/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp +++ b/src/coreComponents/constitutive/solid/Deprecated/PoreVolumeCompressibleSolid.cpp @@ -76,8 +76,7 @@ void PoreVolumeCompressibleSolid::postProcessInput() { if( m_compressibility < 0.0 ) { - string const message = "An invalid value of fluid bulk modulus (" + std::to_string( m_compressibility ) + ") is specified"; - GEOS_ERROR( message ); + GEOS_ERROR( getDataContext() << ": An invalid value of fluid bulk modulus (" << m_compressibility << ") is specified" ); } m_poreVolumeRelation.setCoefficients( m_referencePressure, 1.0, m_compressibility ); } diff --git a/src/coreComponents/constitutive/solid/DruckerPrager.cpp b/src/coreComponents/constitutive/solid/DruckerPrager.cpp index bca361b1da9..37d67fd8be4 100644 --- a/src/coreComponents/constitutive/solid/DruckerPrager.cpp +++ b/src/coreComponents/constitutive/solid/DruckerPrager.cpp @@ -101,10 +101,14 @@ void DruckerPrager::postProcessInput() { ElasticIsotropic::postProcessInput(); - GEOS_THROW_IF( m_defaultCohesion < 0, "Negative cohesion value detected", InputError ); - GEOS_THROW_IF( m_defaultFrictionAngle < 0, "Negative friction angle detected", InputError ); - GEOS_THROW_IF( m_defaultDilationAngle < 0, "Negative dilation angle detected", InputError ); - GEOS_THROW_IF( m_defaultFrictionAngle < m_defaultDilationAngle, "Dilation angle should not exceed friction angle", InputError ); + GEOS_THROW_IF( m_defaultCohesion < 0, + getFullName() << ": Negative cohesion value detected", InputError ); + GEOS_THROW_IF( m_defaultFrictionAngle < 0, + getFullName() << ": Negative friction angle detected", InputError ); + GEOS_THROW_IF( m_defaultDilationAngle < 0, + getFullName() << ": Negative dilation angle detected", InputError ); + GEOS_THROW_IF( m_defaultFrictionAngle < m_defaultDilationAngle, + getFullName() << ": Dilation angle should not exceed friction angle", InputError ); // convert from Mohr-Coulomb constants to Drucker-Prager constants, assuming DP // passes through the triaxial compression corners of the MC surface. diff --git a/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp b/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp index b0152d7f8ac..90e260f77bc 100644 --- a/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp +++ b/src/coreComponents/constitutive/solid/DruckerPragerExtended.cpp @@ -117,12 +117,18 @@ void DruckerPragerExtended::postProcessInput() { ElasticIsotropic::postProcessInput(); - GEOS_THROW_IF( m_defaultCohesion < 0, "Negative cohesion value detected", InputError ); - GEOS_THROW_IF( m_defaultInitialFrictionAngle < 0, "Negative initial friction angle detected", InputError ); - GEOS_THROW_IF( m_defaultResidualFrictionAngle < 0, "Negative residual friction angle detected", InputError ); - GEOS_THROW_IF( m_defaultDilationRatio < 0, "Dilation ratio out of [0,1] range detected", InputError ); - GEOS_THROW_IF( m_defaultDilationRatio > 1, "Dilation ratio out of [0,1] range detected", InputError ); - GEOS_THROW_IF( m_defaultHardening < 0, "Negative hardening parameter detected", InputError ); + GEOS_THROW_IF( m_defaultCohesion < 0, + getFullName() << ": Negative cohesion value detected", InputError ); + GEOS_THROW_IF( m_defaultInitialFrictionAngle < 0, + getFullName() << ": Negative initial friction angle detected", InputError ); + GEOS_THROW_IF( m_defaultResidualFrictionAngle < 0, + getFullName() << ": Negative residual friction angle detected", InputError ); + GEOS_THROW_IF( m_defaultDilationRatio < 0, + getFullName() << ": Dilation ratio out of [0,1] range detected", InputError ); + GEOS_THROW_IF( m_defaultDilationRatio > 1, + getFullName() << ": Dilation ratio out of [0,1] range detected", InputError ); + GEOS_THROW_IF( m_defaultHardening < 0, + getFullName() << ": Negative hardening parameter detected", InputError ); // convert from Mohr-Coulomb constants to Drucker-Prager constants, assuming DP // passes through the triaxial tension corners of the MC surface. diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropic.cpp b/src/coreComponents/constitutive/solid/ElasticIsotropic.cpp index 3497f4fa262..46d9ce7212e 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropic.cpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropic.cpp @@ -102,8 +102,9 @@ void ElasticIsotropic::postProcessInput() errorCheck += ")"; GEOS_ERROR_IF( numConstantsSpecified != 2, - "A specific pair of elastic constants is required. Either (K,G), (K,E), (G,E), (K,nu), (G,nu) or (E,nu). "<< - "You have specified "< -0.5 && nu < 0.5 && E > 0.0 ) { @@ -137,7 +138,8 @@ void ElasticIsotropic::postProcessInput() } else { - GEOS_ERROR( "Invalid specification for default elastic constants. "<getWrapper< array1d< real64 > >( viewKeyStruct::c11String() ). diff --git a/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp b/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp index b52f56572ef..8f7ff754a4e 100644 --- a/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp +++ b/src/coreComponents/constitutive/solid/ModifiedCamClay.cpp @@ -90,9 +90,12 @@ void ModifiedCamClay::postProcessInput() { ElasticIsotropicPressureDependent::postProcessInput(); - GEOS_THROW_IF( m_defaultCslSlope <= 0, "Non-positive slope of critical state line detected", InputError ); - GEOS_THROW_IF( m_defaultVirginCompressionIndex <= 0, "Non-positive virgin compression index detected", InputError ); - GEOS_THROW_IF( m_defaultVirginCompressionIndex <= m_defaultRecompressionIndex, "Recompression index should exceed virgin recompression index", InputError ); + GEOS_THROW_IF( m_defaultCslSlope <= 0, + getFullName() << ": Non-positive slope of critical state line detected", InputError ); + GEOS_THROW_IF( m_defaultVirginCompressionIndex <= 0, + getFullName() << ": Non-positive virgin compression index detected", InputError ); + GEOS_THROW_IF( m_defaultVirginCompressionIndex <= m_defaultRecompressionIndex, + getFullName() << ": Recompression index should exceed virgin recompression index", InputError ); // set results as array default values diff --git a/src/coreComponents/constitutive/solid/TriaxialDriver.cpp b/src/coreComponents/constitutive/solid/TriaxialDriver.cpp index 4414cb46931..105652c66d8 100644 --- a/src/coreComponents/constitutive/solid/TriaxialDriver.cpp +++ b/src/coreComponents/constitutive/solid/TriaxialDriver.cpp @@ -75,7 +75,7 @@ void TriaxialDriver::postProcessInput() { GEOS_THROW_IF( m_mode != "stressControl" && m_mode != "strainControl" && m_mode != "mixedControl", - "Test mode \'" << m_mode << "\' not recognized.", + getDataContext() << ": Test mode \'" << m_mode << "\' not recognized.", InputError ); // initialize table functions @@ -147,11 +147,11 @@ void TriaxialDriver::postProcessInput() // may overwrite it. GEOS_THROW_IF( !isEqual( m_initialStress, m_table( 0, SIG0 ), 1e-6 ), - "Initial stress values indicated by initialStress and axialFunction(time=0) appear inconsistent", + getDataContext() << ": Initial stress values indicated by initialStress and axialFunction(time=0) appear inconsistent", InputError ); GEOS_THROW_IF( !isEqual( m_initialStress, m_table( 0, SIG1 ), 1e-6 ), - "Initial stress values indicated by initialStress and radialFunction(time=0) appear inconsistent", + getDataContext() << ": Initial stress values indicated by initialStress and radialFunction(time=0) appear inconsistent", InputError ); }