Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more context to errors - constitutive/ files #2447

Merged
merged 100 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
7601706
Adding context to errors when reading wrapper from xml
MelReyCG Mar 23, 2023
622f8d6
added XML hierarchy to the wrapper parsing error
MelReyCG Mar 24, 2023
a5fb1fe
Modified testXmlWrapper so it expect exceptions
MelReyCG Mar 27, 2023
4524704
Changed the regexs so the schema detects more errors
MelReyCG Mar 27, 2023
c36a052
updating LvArray submodule
MelReyCG Mar 27, 2023
081939c
Adding documentation
MelReyCG Mar 28, 2023
a123a15
added C++17 string_view comments
MelReyCG Apr 6, 2023
0b1cd21
- Added the ability to know the line of xml nodes & attributes
MelReyCG Apr 20, 2023
7a7331f
merge branch "feature/rey/error-xml-line-2" with PR branch "bugfix/re…
MelReyCG Apr 20, 2023
d56087e
Merge remote-tracking branch 'origin/bugfix/rey/2320-xml-errors-feedb…
MelReyCG Apr 20, 2023
fb418c8
Indentation, code style, naming
MelReyCG Apr 24, 2023
e995b0c
Renaming SourceContext to DataContext
MelReyCG Apr 24, 2023
7b793c9
comment update in Logger.hpp
jeannepellerin Apr 24, 2023
e1af0c6
- Added xml line to messages from PR 2341 & 2357
MelReyCG Apr 24, 2023
3e95803
Added getWrapperDataContext()
MelReyCG Apr 27, 2023
cbfa507
uncrustify + documentation corrections
MelReyCG Apr 27, 2023
c69a98d
added compatibility with GEOS_FMT
MelReyCG Apr 28, 2023
e716a9f
Added more context in constitutive/ error messages
MelReyCG May 3, 2023
703d88b
Adapted getGroupByPath test with new error message
MelReyCG May 10, 2023
7a7e053
error message improvements + bugfixes + removed unused header
MelReyCG May 10, 2023
9445618
Group::printDataHierarchy : wrapper type fix + layout
MelReyCG May 10, 2023
c3a034c
Merge branch 'feature/rey/error-xml-line-2' into feature/rey/error-xm…
MelReyCG May 10, 2023
f25415e
Merge branch 'develop' into feature/rey/error-xml-line-2
MelReyCG May 11, 2023
8f26f6d
Merge remote-tracking branch 'origin/develop' into feature/rey/error-…
MelReyCG May 11, 2023
7d08ddc
Merge remote-tracking branch 'origin/develop' into feature/rey/error-…
MelReyCG May 16, 2023
0267860
uncrustify
MelReyCG May 16, 2023
40aae17
code style
MelReyCG May 16, 2023
f5f1276
update LvArray version
MelReyCG May 16, 2023
faa7358
update LvArray version
MelReyCG May 16, 2023
be91af3
improved messages with group/wrapper path
MelReyCG May 16, 2023
5fae7b6
rewrited WrapperContext message
MelReyCG May 16, 2023
2b42ef1
Merge remote-tracking branch 'origin/feature/rey/error-xml-line-2' (a…
MelReyCG May 16, 2023
585d59d
Documentation
MelReyCG May 17, 2023
b9bc74b
Merge remote-tracking branch 'origin/feature/rey/error-xml-line-2' in…
MelReyCG May 17, 2023
0d57ddc
submodule develop sync
MelReyCG May 17, 2023
d79b0c9
code style / factorization + constness
MelReyCG May 23, 2023
7ab5641
Merge remote-tracking branch 'origin/develop' into feature/rey/error-…
MelReyCG May 23, 2023
dd2fc9f
Merge remote-tracking branch 'origin/develop' into feature/rey/error-…
MelReyCG May 23, 2023
ab7f397
Merge remote-tracking branch 'origin/feature/rey/error-xml-line-2' in…
MelReyCG May 23, 2023
f7217ee
docs fixes
MelReyCG May 24, 2023
0526793
Merge remote-tracking branch 'origin/feature/rey/error-xml-line-2' in…
MelReyCG May 24, 2023
186d212
Merge remote-tracking branch 'origin/develop' into feature/rey/error-…
MelReyCG May 25, 2023
2b33ce9
Merge remote-tracking branch 'origin/develop' into feature/rey/error-…
MelReyCG May 25, 2023
b8fb6bf
Merge remote-tracking branch 'origin/develop' into feature/rey/error-…
MelReyCG Jun 5, 2023
aceb723
Merge remote-tracking branch 'origin/feature/rey/error-xml-line-2' in…
MelReyCG Jun 5, 2023
17759eb
code cleaning / refactoring, docs improvements
MelReyCG Jun 20, 2023
4045ce2
removing circular dependency:
MelReyCG Jun 20, 2023
b7b756e
Merge remote-tracking branch 'origin/develop' into feature/rey/error-…
MelReyCG Jun 20, 2023
041d4a7
Docs fixes & params names
MelReyCG Jun 26, 2023
1a5c02a
Refactorization: removing "isDataFileContext()"
MelReyCG Jun 29, 2023
1508b00
memleak fix
MelReyCG Jul 3, 2023
8db1cc3
Refactorization: removed getWrapperSeparator()
MelReyCG Jul 3, 2023
e416cdf
getTargetNameInPath() docs
MelReyCG Jul 3, 2023
5750d12
removed virtual destructors
MelReyCG Jul 3, 2023
8f35760
Refactorings
MelReyCG Jul 4, 2023
b96630b
Added a test for DataContext string formatting
MelReyCG Jul 4, 2023
f5e823f
improved getAttributeLine() robustness
MelReyCG Jul 5, 2023
729df9f
Refactoring: hide xml_document implementation
MelReyCG Jul 6, 2023
4864a30
xmlDocument refactorings
MelReyCG Jul 7, 2023
d5ab61a
WIP: more wrapping (xmlNode+xmlAttribute)
MelReyCG Jul 7, 2023
d463a93
Revert "WIP: more wrapping (xmlNode+xmlAttribute)"
MelReyCG Jul 7, 2023
c03e81f
Merge commit '08ba8f7e2c04af6ad07ff7d3ddc54f091b8e8564' into feature/…
MelReyCG Jul 10, 2023
dad53ce
wrong method name
MelReyCG Jul 10, 2023
39a0cdc
DataContext architecture refactorization
MelReyCG Jul 12, 2023
ee76f62
GroupContext / WrapperContext fixes
MelReyCG Jul 17, 2023
b627575
Extended test for WrapperContext::toString()
MelReyCG Jul 17, 2023
1a69a92
Merge branch 'develop' into feature/rey/error-xml-line-2
MelReyCG Jul 17, 2023
374223d
docs fixes
MelReyCG Jul 17, 2023
3b188ae
improving testGroupPath with more implicit groups & wrapper
MelReyCG Jul 18, 2023
e1ffd1d
GroupContext::toString() rewrite
MelReyCG Jul 18, 2023
630efc7
compilation bugfix
MelReyCG Jul 19, 2023
8cc3e8f
Merge remote-tracking branch 'origin/develop' into feature/rey/error-…
MelReyCG Jul 19, 2023
7bdf50f
compilation warning fix
MelReyCG Jul 20, 2023
a7fb525
Merge remote-tracking branch 'origin/develop' into feature/rey/error-…
MelReyCG Jul 21, 2023
fa4f7f2
Merge remote-tracking branch 'origin/develop' into feature/rey/error-…
MelReyCG Jul 24, 2023
971ea0f
Merge branch 'develop' into feature/rey/error-xml-line-2
MelReyCG Jul 28, 2023
6eae848
Merge branch 'develop' into feature/rey/error-xml-line-2
TotoGaz Aug 8, 2023
9bcee6a
removed loadBuffer in favor of loadString
MelReyCG Aug 21, 2023
60599e5
missing a pugi::node_declaration wrapping
MelReyCG Aug 21, 2023
290285f
Merge branch 'feature/rey/error-xml-line-2' of https://github.com/GEO…
MelReyCG Aug 21, 2023
ebffe3f
changed to /** doxygen syntax
MelReyCG Aug 21, 2023
9795f54
Refactorings
MelReyCG Aug 22, 2023
5262422
Added a dedicated WrapperContext cpp & hpp file
MelReyCG Aug 22, 2023
83c5116
refactoring
MelReyCG Aug 22, 2023
9640797
Merge remote-tracking branch 'origin/develop' into feature/rey/error-…
MelReyCG Aug 22, 2023
4501dc4
uncrustify
MelReyCG Aug 23, 2023
44f4fed
Docs fixes
MelReyCG Aug 23, 2023
40879dd
reverse iterator bugfix
MelReyCG Aug 23, 2023
b792974
DataContext format options fix
MelReyCG Aug 25, 2023
212e611
DataContext toString bugfix when no DataFileContext exist
MelReyCG Aug 25, 2023
42f53b5
Added docs for xmlWrapper attribute line search
MelReyCG Aug 25, 2023
0bc5032
Merge remote-tracking branch 'origin/develop' into feature/rey/error-…
MelReyCG Aug 25, 2023
38d33d7
removed Group::forAllDataContext in profit of a private function in t…
MelReyCG Aug 25, 2023
1bcf5ba
refactoring DataContext::ToStringInfo
MelReyCG Aug 25, 2023
919830b
a few refactorings
MelReyCG Aug 30, 2023
197dc00
Merge remote-tracking branch 'origin/develop' into feature/rey/error-…
MelReyCG Aug 31, 2023
071b10c
Merge remote-tracking branch 'origin/develop' into feature/rey/error-…
MelReyCG Aug 31, 2023
de5ff10
Merge with new version of DataContext.
MelReyCG Aug 31, 2023
af51a26
Merge remote-tracking branch 'origin/develop' into feature/rey/error-…
MelReyCG Sep 14, 2023
fd437bf
Drop a toShortString idea (may come back to it later)
MelReyCG Sep 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/coreComponents/constitutive/ConstitutiveBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

///@}

Expand Down
4 changes: 2 additions & 2 deletions src/coreComponents/constitutive/ConstitutiveManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand All @@ -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 );

Expand Down
12 changes: 6 additions & 6 deletions src/coreComponents/constitutive/ConstitutivePassThru.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
}
}
Expand All @@ -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 ) );
}
}
Expand Down Expand Up @@ -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 ) );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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." );
}
};
Expand Down
12 changes: 6 additions & 6 deletions src/coreComponents/constitutive/contact/ContactBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

}

Expand All @@ -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 );
Expand Down Expand Up @@ -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 );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down Expand Up @@ -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 );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" );

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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] ) )
Expand Down
18 changes: 9 additions & 9 deletions src/coreComponents/constitutive/solid/CoupledSolid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<<PORO_TYPE::catalogName()<<
" but the specified porosity model \""<<m_porosityModelName<<
GEOS_ERROR( " The coupled solid " << getDataContext() <<
" expects a porosity model of type " << PORO_TYPE::catalogName() <<
" but the specified porosity model \"" << m_porosityModelName <<
"\" is of type " << getPorosityModel().getCatalogName() );
}
if( PERM_TYPE::catalogName() != getPermModel().getCatalogName() )
{
GEOS_ERROR( " The coupled solid "<<this->getName()<<
" expects a permeability model of type "<<PERM_TYPE::catalogName()<<
" but the specified permeability model \""<<m_permeabilityModelName<<
GEOS_ERROR( " The coupled solid " << getDataContext() <<
" expects a permeability model of type " << PERM_TYPE::catalogName() <<
" but the specified permeability model \"" << m_permeabilityModelName <<
"\" is of type " << getPermModel().getCatalogName() );
}
if( SOLID_TYPE::catalogName() != getSolidModel().getCatalogName() )
{
GEOS_ERROR( " The coupled solid "<<this->getName()<<
" expects a solid model of type "<<SOLID_TYPE::catalogName()<<
" but the specified solid model \""<<this->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() );
}
}
Expand Down
Loading