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

fix: fix issue #2615 #3477

merged 3 commits into from
Dec 12, 2024

Conversation

paveltomin
Copy link
Contributor

should close #2615

@paveltomin paveltomin added type: cleanup / refactor Non-functional change (NFC) flag: ready for review flag: no rebaseline Does not require rebaseline labels Dec 5, 2024
@paveltomin paveltomin self-assigned this Dec 5, 2024
@rrsettgast
Copy link
Member

@paveltomin
the underlying call is this:

  void getLocation( string const & key,
                    FieldLocation & location ) const
  {
    if( key.find( m_locationKeys.nodesKey() ) != string::npos )
    {
      location = FieldLocation::Node;
    }
    else if( key.find( m_locationKeys.edgesKey()) != string::npos )
    {
      location = FieldLocation::Edge;
    }
    else if( key.find( m_locationKeys.facesKey()) != string::npos )
    {
      location = FieldLocation::Face;
    }
    else if( key.find( m_locationKeys.elemsKey()) != string::npos )
    {
      location = FieldLocation::Elem;
    }
    else
    {
      GEOS_ERROR( GEOS_FMT( "Invalid key, {}, was provided. Location cannot be retrieved.", key ) );
    }
  }

which is properly guarded. The compiler is missing it for the reporting user. We can change function to return the value of location and set it explicitly in the call location. That would make more sense.

@paveltomin
Copy link
Contributor Author

@paveltomin the underlying call is this:

  void getLocation( string const & key,
                    FieldLocation & location ) const
  {
    if( key.find( m_locationKeys.nodesKey() ) != string::npos )
    {
      location = FieldLocation::Node;
    }
    else if( key.find( m_locationKeys.edgesKey()) != string::npos )
    {
      location = FieldLocation::Edge;
    }
    else if( key.find( m_locationKeys.facesKey()) != string::npos )
    {
      location = FieldLocation::Face;
    }
    else if( key.find( m_locationKeys.elemsKey()) != string::npos )
    {
      location = FieldLocation::Elem;
    }
    else
    {
      GEOS_ERROR( GEOS_FMT( "Invalid key, {}, was provided. Location cannot be retrieved.", key ) );
    }
  }

which is properly guarded. The compiler is missing it for the reporting user. We can change function to return the value of location and set it explicitly in the call location. That would make more sense.

please check the updated version

@paveltomin
Copy link
Contributor Author

@rrsettgast is it good now?

@paveltomin paveltomin added ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI ci: run code coverage enables running of the code coverage CI jobs and removed flag: ready for review labels Dec 12, 2024
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.89%. Comparing base (ec52431) to head (bcd0702).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3477      +/-   ##
===========================================
- Coverage    56.89%   56.89%   -0.01%     
===========================================
  Files         1154     1154              
  Lines        99873    99871       -2     
===========================================
- Hits         56825    56823       -2     
  Misses       43048    43048              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@paveltomin paveltomin merged commit f46fb7a into develop Dec 12, 2024
25 checks passed
@paveltomin paveltomin deleted the pt/fix-issue-2615 branch December 12, 2024 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci: run code coverage enables running of the code coverage CI jobs ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI flag: no rebaseline Does not require rebaseline type: cleanup / refactor Non-functional change (NFC)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unintialized error when building NeighborCommunicator.cpp
2 participants