Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
2c3a2a7
set an error when a box has no selection
arng40 Sep 5, 2025
bfe7b49
fix
arng40 Sep 5, 2025
82055c1
string correction viewkeystruct
arng40 Sep 5, 2025
94104fb
revert changement on dataContext
arng40 Sep 5, 2025
c125ae2
Merge remote-tracking branch 'origin/develop' into feat/dudes/error-w…
arng40 Sep 8, 2025
b1fe1a0
test for cuda
arng40 Sep 8, 2025
37bc92d
fix sink selection in test unit test
arng40 Sep 8, 2025
bb3a1ac
fix all test
arng40 Sep 8, 2025
5f84879
doc
arng40 Sep 8, 2025
d93c3d8
uncrustify
arng40 Sep 8, 2025
ed02e2b
trigger integrated
arng40 Sep 8, 2025
1de66c8
add more context & clean log
arng40 Sep 8, 2025
c19069f
syntax
arng40 Sep 9, 2025
59d2d7a
add error to test in integrated test & rebaseline
arng40 Sep 9, 2025
3dca3c4
Merge branch 'develop' into feat/dudes/error-when-box-select-nothing
arng40 Sep 9, 2025
9054c64
wip
arng40 Sep 10, 2025
0fbd101
set a flag from surfaceGenrator to fs
arng40 Sep 10, 2025
7db4040
Merge remote-tracking branch 'origin/develop' into feat/dudes/error-w…
arng40 Sep 10, 2025
5599217
Merge remote-tracking branch 'origin/develop' into feat/dudes/error-w…
arng40 Sep 11, 2025
3d89422
Update thermal leaky well example
dkachuma Sep 16, 2025
82359ae
update the logic set error output
arng40 Sep 19, 2025
f6bd260
Merge branch 'feat/dudes/error-when-box-select-nothing' of https://gi…
arng40 Sep 19, 2025
26fba63
add unit test
arng40 Sep 19, 2025
af62cbc
change map to pair and add MPIComm
arng40 Sep 22, 2025
58e284c
Merge remote-tracking branch 'origin/develop' into feat/dudes/error-w…
arng40 Sep 22, 2025
f09ef8d
xsd
arng40 Sep 22, 2025
5521545
testSet
arng40 Sep 22, 2025
e993c6e
renaming & remove comment
arng40 Sep 22, 2025
3fe65b0
replace integer to string for set error
arng40 Sep 22, 2025
30e85fd
reaname enum errorAsWarning to warning
arng40 Sep 22, 2025
2d8ea45
update fs test
arng40 Sep 23, 2025
e469dfd
add case for SG & update fs wrapper
arng40 Sep 23, 2025
abedcc5
xsd
arng40 Sep 23, 2025
97bc914
doc
arng40 Sep 23, 2025
03f061d
enum loc
arng40 Sep 23, 2025
869ddaf
UPDATE LOGIC
arng40 Sep 23, 2025
d7a3aea
doc
arng40 Sep 23, 2025
4a83b8e
code style
arng40 Sep 24, 2025
02e981e
yaml
arng40 Sep 24, 2025
03d280e
add warning flag for integrated tests failed
arng40 Sep 24, 2025
7433d26
baseline
arng40 Sep 24, 2025
0fe2c58
reduce smoke step & silent for wavePropagation deck
arng40 Sep 25, 2025
1017ecd
move ManagersLoop to MeshObjectPath and renaming variables
arng40 Sep 26, 2025
13b012c
add comment
arng40 Sep 26, 2025
ec86c38
fix space margin
arng40 Sep 29, 2025
8840280
Merge remote-tracking branch 'origin/develop' into feat/dudes/error-w…
arng40 Sep 29, 2025
39675d7
fix capture by ref
arng40 Sep 29, 2025
88d9589
remove setName from capture binding
arng40 Sep 29, 2025
65ed1a0
baseline
arng40 Sep 30, 2025
a28b7c6
Merge remote-tracking branch 'origin/develop' into feat/dudes/error-w…
arng40 Sep 30, 2025
b95f304
fix timeout leakywell
arng40 Sep 30, 2025
3387d4a
revert restart removed
arng40 Oct 7, 2025
308f0e8
Merge remote-tracking branch 'origin/develop' into feat/dudes/error-w…
arng40 Oct 7, 2025
54c013a
news rebaseline
arng40 Oct 7, 2025
4ee688e
Merge remote-tracking branch 'origin/develop' into feat/dudes/error-w…
arng40 Oct 8, 2025
a5f2a43
Merge remote-tracking branch 'origin/develop' into feat/dudes/error-w…
arng40 Oct 9, 2025
874186b
revert thermalLeakyWell
arng40 Oct 10, 2025
2886078
Revert "revert thermalLeakyWell"
arng40 Oct 10, 2025
4b3161a
Merge remote-tracking branch 'origin/develop' into feat/dudes/error-w…
arng40 Oct 10, 2025
562842f
address typo, duplcation & description
arng40 Oct 10, 2025
181e571
Merge remote-tracking branch 'origin/develop' into feat/dudes/error-w…
arng40 Oct 10, 2025
03c20b2
Merge remote-tracking branch 'origin/develop' into feat/dudes/error-w…
arng40 Oct 13, 2025
7c79821
rebaseline
arng40 Oct 13, 2025
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
Prev Previous commit
Next Next commit
update the logic set error output
  • Loading branch information
arng40 committed Sep 19, 2025
commit 82359ae947752e54a5dd5c4617adb758c375e06c
2 changes: 1 addition & 1 deletion src/coreComponents/dataRepository/Group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ void Group::printDataHierarchy( integer const indent ) const
for( auto & view : wrappers() )
{
GEOS_LOG( string( indent, '\t' ) << "-> " << view.second->getName() << " : "
<< LvArray::system::demangleType( *view.second ) );
<< LvArray::system::demangleType( *view.second ) << " size : "<<view.second->size());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add spaces to keep formatting consistent

}
GEOS_LOG( string( indent, '\t' ) );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,15 @@ class FieldSpecificationBase : public dataRepository::Group
{
dataRepository::Group const & setGroup = object.getGroup( ObjectManagerBase::groupKeyStruct::setsString() );
string_array setNames = this->getSetNames();
// std::cout << "--- setNames -----" << std::endl;
// std::cout << " object: " << object.getName() << std::endl;
// std::cout << " setGroup: " << setGroup.getName() << std::endl;
for( auto & setName : setNames )
{
// std::cout << " setName: " << setName << std::endl;
if( setGroup.hasWrapper( setName ) )
{
// std::cout << " yes " << setName << std::endl;
SortedArrayView< localIndex const > const & targetSet = setGroup.getReference< SortedArray< localIndex > >( setName );
lambda( dynamic_cast< BC_TYPE const & >(*this), setName, targetSet, object, getFieldName() );
}
Expand Down
148 changes: 99 additions & 49 deletions src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "FieldSpecificationManager.hpp"
#include "mesh/DomainPartition.hpp"
#include "mesh/MeshBody.hpp"
#include "mesh/MeshObjectPath.hpp"


namespace geos
{
Expand Down Expand Up @@ -67,8 +69,53 @@ void FieldSpecificationManager::expandObjectCatalogs()
}
}

using SetNameToTypesMap = std::map< std::string, std::vector< MeshObjectPath::ObjectTypes > >;

template< typename TYPE, typename ... NEXT_TYPES >
void forTypes( FieldSpecificationBase const & fs, MeshLevel const & mesh,
MeshObjectPath::ObjectTypes const targetType,
string const & setName, SetNameToTypesMap & setTypesMap )
{
mesh.forSubGroups< TYPE >( [&]( Group const & targetManager )
{
TYPE const * manager = dynamic_cast< TYPE const * >( &targetManager );

if( manager != nullptr )
{
if( manager->sets().hasWrapper( setName ))
{
auto const & targetSet = manager->getSet( setName );

if( std::is_same_v< TYPE, NodeManager > &&
targetType != MeshObjectPath::ObjectTypes::nodes &&
targetSet.size() > 0 )
{
setTypesMap[setName].push_back( MeshObjectPath::ObjectTypes::nodes );
}
else if( std::is_same_v< TYPE, EdgeManager > &&
targetType != MeshObjectPath::ObjectTypes::edges &&
targetSet.size() > 0 )
{
setTypesMap[setName].push_back( MeshObjectPath::ObjectTypes::edges );
}
else if( std::is_same_v< TYPE, FaceManager > &&
targetType != MeshObjectPath::ObjectTypes::faces &&
targetSet.size() > 0 )
{
setTypesMap[setName].push_back( MeshObjectPath::ObjectTypes::faces );
}
}
}
} );

if constexpr ( sizeof...(NEXT_TYPES) > 0 )
forTypes< NEXT_TYPES... >( fs, mesh, targetType, setName, setTypesMap );
}

void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) const
{
DomainPartition const & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" );
Group const & meshBodies = domain.getMeshBodies();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the duplication and let this one

// loop over all the FieldSpecification of the XML file
this->forSubGroups< FieldSpecificationBase >( [&] ( FieldSpecificationBase const & fs )
{
Expand All @@ -77,6 +124,11 @@ void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) c
map< string, localIndex > isTargetSetEmpty;
// map from set name to a flag (1 if targetSet has been created, 0 otherwise)
map< string, localIndex > isTargetSetCreated;
// map from setName where we store the derived class of objectManager (if exist)
SetNameToTypesMap setTypesMap;
// The target type of objectPath
MeshObjectPath::ObjectTypes expectedSetType = fs.getMeshObjectPaths().getObjectType();


// Step 1: collect all the set names in a map (this is made necessary by the "apply" loop pattern

Expand All @@ -85,6 +137,7 @@ void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) c
{
isTargetSetEmpty[setNames[i]] = 1;
isTargetSetCreated[setNames[i]] = 0;
setTypesMap[setNames[i]].push_back( expectedSetType );
}

// We have to make sure that the meshLevel is in the target of the boundary conditions
Expand All @@ -96,7 +149,6 @@ void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) c
}

// Step 2: apply the boundary condition

fs.apply< Group >( mesh,
[&]( FieldSpecificationBase const &,
string const & setName,
Expand All @@ -105,31 +157,20 @@ void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) c
string const fieldName )
{
InputFlags const flag = fs.getWrapper< string >( FieldSpecificationBase::viewKeyStruct::fieldNameString() ).getInputFlag();

// 2.a) If we enter this loop, we know that the set has been created
// Fracture/fault sets are created later and the "apply" call silently ignores them
isTargetSetCreated.at( setName ) = 1;

// 2.b) If the fieldName is registered on this target, we record it
// Unfortunately, we need two exceptions:
// - FieldSpecification that do not target a field, like Aquifer, Traction, Equilibrium, etc. For these, the check is not
// necessary (the user cannot mess up)
// - Face boundary conditions that target cell-based quantities, like the face BC of the flow solvers
if( targetGroup.hasWrapper( fieldName ) ||
flag == InputFlags::FALSE || // no need to check input if the input flag is false (Aquifer, Traction, Equilibrium do not target a
// field)
targetGroup.getName() == MeshLevel::groupStructKeys::faceManagerString() ) // the field names of the face BCs are not always
// registered on
// the faceManager...
if( targetGroup.hasWrapper( fieldName ) ||flag == InputFlags::FALSE ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

targetGroup.getName() == MeshLevel::groupStructKeys::faceManagerString() ) // the field names of the face BCs are not always
// registered on
// the faceManager...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you delete those comments? Not useful?

Suggested change
InputFlags const flag = fs.getWrapper< string >( FieldSpecificationBase::viewKeyStruct::fieldNameString() ).getInputFlag();
// 2.a) If we enter this loop, we know that the set has been created
// Fracture/fault sets are created later and the "apply" call silently ignores them
isTargetSetCreated.at( setName ) = 1;
// 2.b) If the fieldName is registered on this target, we record it
// Unfortunately, we need two exceptions:
// - FieldSpecification that do not target a field, like Aquifer, Traction, Equilibrium, etc. For these, the check is not
// necessary (the user cannot mess up)
// - Face boundary conditions that target cell-based quantities, like the face BC of the flow solvers
if( targetGroup.hasWrapper( fieldName ) ||
flag == InputFlags::FALSE || // no need to check input if the input flag is false (Aquifer, Traction, Equilibrium do not target a
// field)
targetGroup.getName() == MeshLevel::groupStructKeys::faceManagerString() ) // the field names of the face BCs are not always
// registered on
// the faceManager...
if( targetGroup.hasWrapper( fieldName ) ||flag == InputFlags::FALSE ||
targetGroup.getName() == MeshLevel::groupStructKeys::faceManagerString() ) // the field names of the face BCs are not always
// registered on
// the faceManager...
InputFlags const flag = fs.getWrapper< string >( FieldSpecificationBase::viewKeyStruct::fieldNameString() ).getInputFlag();
isTargetSetCreated.at( setName ) = 1;
if( targetGroup.hasWrapper( fieldName ) ||flag == InputFlags::FALSE ||
targetGroup.getName() == MeshLevel::groupStructKeys::faceManagerString() ) // the field names of the face BCs are not always
// registered on the faceManager...

{
isFieldNameFound = 1;
}


// 2.c) If the target set is not empty, we record it
// Fracture/fault sets are sometimes at initialization and the "apply" call silently ignores them
if( targetSet.size() > 0 )
{
if( setTypesMap.count( setName ) == 1 )
setTypesMap.erase( setName );

isTargetSetEmpty.at( setName ) = 0;
}
} );
Expand Down Expand Up @@ -168,7 +209,6 @@ void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) c
}

std::set< string > registeredSets;
DomainPartition const & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" );
Group const & meshBody = domain.getMeshBodies();
objectPath.forObjectsInPath( meshBody,
[&]( Group const & targetGroup )
Expand All @@ -195,37 +235,50 @@ void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) c
GEOS_THROW( errorMessageBuilder.str(), InputError );
}

GeometricObjectManager & geometricObjManager = GeometricObjectManager::getInstance();

for( auto const & mapEntry : isTargetSetEmpty )
if( !setTypesMap.empty())
{
if( mapEntry.second == 1 )
for( auto const & [key, values] : setTypesMap )
{
forTypes< FaceManager,
EdgeManager,
NodeManager >( fs, mesh, expectedSetType, key, setTypesMap );
}

std::ostringstream message;
message << GEOS_FMT( "{}: this FieldSpecification targets (an) empty set(s).\n",
fs.getDataContext() );
for( auto const & [setName, values] : setTypesMap )
{
geometricObjManager.forSubGroups< SimpleGeometricObjectBase >(
[&]( SimpleGeometricObjectBase const & object )
string_array types;
for( auto const & type : values )
{
if( mapEntry.first == object.getName())
if( type != expectedSetType )
{
std::ostringstream message;
message << GEOS_FMT( "{}: this FieldSpecification targets (an) empty set(s)\n"
"The box {} does not select any region.\n",
fs.getDataContext(), object.getDataContext());
Wrapper< integer > const & wrapper = fs.getWrapper< integer >( FieldSpecificationBase::viewKeyStruct::emptySetErrorModeString());
switch( wrapper.getDefaultValue() )
{
case FieldSpecificationBase::setErrorMode::Silent:
break;
case FieldSpecificationBase::setErrorMode::Error:
GEOS_ERROR( message.str() );
break;
case FieldSpecificationBase::setErrorMode::SurfaceGeneratorWarning:
message << GEOS_FMT( "As the simulation includes a SurfaceGenerator, the set may be modified later",
fs.getDataContext() );
GEOS_WARNING( message.str() );
break;
}
types.push_back( EnumStrings< MeshObjectPath::ObjectTypes >::toString( type ) );
}
} );
}
message << GEOS_FMT( "Set '{}':\n"
" - Does not capture: {}\n", setName, fs.getObjectPath());
if( !types.empty())
{
message << GEOS_FMT( " - Instead, captures: {}\n", stringutilities::join( types, ", " ));
}
}

Wrapper< integer > const & wrapper = fs.getWrapper< integer >(
FieldSpecificationBase::viewKeyStruct::emptySetErrorModeString());
switch( wrapper.getDefaultValue() )
{
case FieldSpecificationBase::setErrorMode::Silent:
break;
case FieldSpecificationBase::setErrorMode::Error:
GEOS_WARNING( message.str() );
break;
case FieldSpecificationBase::setErrorMode::SurfaceGeneratorWarning:
message << GEOS_FMT( "As the simulation includes a SurfaceGenerator, the set may be modified later",
fs.getDataContext() );
GEOS_WARNING( message.str() );
break;
}
}

Expand All @@ -236,9 +289,6 @@ void FieldSpecificationManager::validateBoundaryConditions( MeshLevel & mesh ) c
fs.getWrapperDataContext( FieldSpecificationBase::viewKeyStruct::fieldNameString() ),
fs.getFieldName(), fs.getObjectPath() );

DomainPartition const & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" );
Group const & meshBodies = domain.getMeshBodies();

std::set< string > registeredFields;
objectPath.forObjectsInPath( meshBodies,
[&]( Group const & targetGroup )
Expand Down