Skip to content

Commit

Permalink
first attempt to add additonnal msg
Browse files Browse the repository at this point in the history
  • Loading branch information
arng40 committed Dec 24, 2024
1 parent b3592de commit 563d0ac
Showing 1 changed file with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,34 @@ void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) c

if( isFieldNameFound == 0 )
{
std::ostringstream listFieldsName;
fs.apply< dataRepository::Group >( mesh,
[&]( FieldSpecificationBase const &,
string const &,
SortedArrayView< localIndex const > const &,
Group & targetGroup,
string const fieldName )
{

if( !targetGroup.hasWrapper( fieldName ) )
{
for( auto const & wrapperIter : targetGroup.wrappers() )
{
auto const & wrapper = wrapperIter.second;
listFieldsName<< wrapper->getName() << " ";
}
}
} );

char const fieldNameNotFoundMessage[] =
"\n{}: there is no {} named `{}` under the {} `{}`.\n";
"\n{}: there is no {} named `{}` under the {} `{}`.\n The fields ame available are :\n{}";
string const errorMsg =
GEOS_FMT( fieldNameNotFoundMessage,
fs.getWrapperDataContext( FieldSpecificationBase::viewKeyStruct::fieldNameString() ),
FieldSpecificationBase::viewKeyStruct::fieldNameString(),
fs.getFieldName(), FieldSpecificationBase::viewKeyStruct::objectPathString(), fs.getObjectPath() );
fs.getFieldName(), FieldSpecificationBase::viewKeyStruct::objectPathString(), fs.getObjectPath(),
listFieldsName.str() );

if( areAllSetsEmpty )
{
GEOS_LOG_RANK_0( errorMsg );
Expand Down

0 comments on commit 563d0ac

Please sign in to comment.