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

fix: fix issue #2615 #3477

Merged
merged 3 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions src/coreComponents/mesh/FieldIdentifiers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ class FieldIdentifiers
* @brief Get the Location object
*
* @param key key used to store the list of fields in the map.
* @param location mesh location where fields defined by the key provided were registered.
* @return mesh location where fields defined by the key provided were registered.
*/
void getLocation( string const & key,
FieldLocation & location ) const
FieldLocation getLocation( string const & key ) const
{
FieldLocation location{};
if( key.find( m_locationKeys.nodesKey() ) != string::npos )
{
location = FieldLocation::Node;
Expand All @@ -123,6 +123,7 @@ class FieldIdentifiers
{
GEOS_ERROR( GEOS_FMT( "Invalid key, {}, was provided. Location cannot be retrieved.", key ) );
}
return location;
}

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,7 @@ int NeighborCommunicator::packCommSizeForSync( FieldIdentifiers const & fieldsTo

for( auto const & iter : fieldsToBeSync.getFields() )
{
FieldLocation location{};
fieldsToBeSync.getLocation( iter.first, location );
FieldLocation const location = fieldsToBeSync.getLocation( iter.first );
switch( location )
{
case FieldLocation::Node:
Expand Down Expand Up @@ -569,8 +568,7 @@ void NeighborCommunicator::packCommBufferForSync( FieldIdentifiers const & field

for( auto const & iter : fieldsToBeSync.getFields() )
{
FieldLocation location{};
fieldsToBeSync.getLocation( iter.first, location );
FieldLocation const location = fieldsToBeSync.getLocation( iter.first );
switch( location )
{
case FieldLocation::Node:
Expand Down Expand Up @@ -628,8 +626,7 @@ void NeighborCommunicator::unpackBufferForSync( FieldIdentifiers const & fieldsT

for( auto const & iter : fieldsToBeSync.getFields() )
{
FieldLocation location{};
fieldsToBeSync.getLocation( iter.first, location );
FieldLocation const location = fieldsToBeSync.getLocation( iter.first );
switch( location )
{
case FieldLocation::Node:
Expand Down
Loading