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

refactor: FieldSpecification context when targeting wrong fieldName #3508

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from

Conversation

arng40
Copy link
Contributor

@arng40 arng40 commented Jan 6, 2025

Here's the typical error encountered when setting the wrong target for a FieldSpecification :

***** LOCATION: /path/to/GEOS/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp:208
***** Controlling expression (should be false): true
***** Rank 17:
initialPressure_channel/fieldName (staircase_3d.xml, l.133): there is no fieldName named `pressure_t` under the objectPath `ElementRegions/Channel`.
 
 
** StackTrace of 5 frames **
[...]
=====

Here we wanted to define initial conditions in FieldSpecifications to impose the value of a property (here: “rock_initialPorosity”).
However, this property doesn't exist because we've given it the wrong name. It expects the name of the Porosity model for stress (i.e. “rockPorosity_initialPorosity” here).

With more indications we would have (in progress)

***** LOCATION: /path/to/GEOS/src/coreComponents/fieldSpecification/FieldSpecificationManager.cpp:228
***** Controlling expression (should be false): true
***** Rank 0: 
initialPressure_channel/fieldName (staircase_3d.xml, l.133): there is no fieldName named `pressure_t` under the objectPath `ElementRegions/Channel`.
Available fields in ElementRegions/Channel are:
bcPressure, bcTemperature, dMass, dMobility, deltaPressure, deltaVolume, gravityCoefficient, initialPressure, initialTemperature, mass, mass_n, mobility, netToGross, pressure, pressure_n, temperature, temperature_n

** StackTrace of 5 frames **
[...]

@arng40 arng40 self-assigned this Jan 6, 2025
@arng40 arng40 added the type: feature New feature or request label Jan 6, 2025
@arng40 arng40 linked an issue Jan 6, 2025 that may be closed by this pull request
9 tasks
@arng40 arng40 requested a review from MelReyCG January 6, 2025 09:55
@arng40 arng40 changed the title FieldSpecification msg when targeting the wrong fieldName FieldSpecification message when targeting wrong fieldName Jan 6, 2025
@arng40 arng40 changed the title FieldSpecification message when targeting wrong fieldName FieldSpecification context when targeting wrong fieldName Jan 6, 2025
@arng40 arng40 marked this pull request as ready for review January 6, 2025 14:23
@arng40 arng40 changed the title FieldSpecification context when targeting wrong fieldName refactor: FieldSpecification context when targeting wrong fieldName Jan 6, 2025
@arng40 arng40 added ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI labels Jan 10, 2025
@arng40 arng40 requested a review from wrtobin as a code owner February 12, 2025 15:04
@arng40 arng40 requested a review from untereiner as a code owner February 12, 2025 15:04
@arng40 arng40 requested a review from MelReyCG February 12, 2025 15:14
Comment on lines 229 to 238
WrapperBase const & targetField = targetObject.getWrapperBase( fieldName );
string const solverName = *(targetField.getRegisteringObjects().begin());

for( auto const & view : targetObject.wrappers() )
{
if( *(view.second->getRegisteringObjects().begin()) == solverName )
{
fieldNameAvail.insert( view.second->getName() );
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This loop could completely be flatten.
Also, does the call to getRegisteringObjects() changes the result of the list?

Copy link
Contributor Author

@arng40 arng40 Feb 13, 2025

Choose a reason for hiding this comment

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

loop can be flatten, afterwards this is a bit confusing 😅

@arng40 arng40 added the flag: no rebaseline Does not require rebaseline label Feb 13, 2025
@arng40 arng40 requested a review from MelReyCG February 13, 2025 14:29
Copy link
Contributor

@MelReyCG MelReyCG left a comment

Choose a reason for hiding this comment

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

Nice!

@arng40 arng40 added the ci: run code coverage enables running of the code coverage CI jobs label Apr 10, 2025
Copy link

codecov bot commented Apr 11, 2025

Codecov Report

Attention: Patch coverage is 13.63636% with 19 lines in your changes missing coverage. Please review.

Project coverage is 56.64%. Comparing base (e09f499) to head (0eac053).

Files with missing lines Patch % Lines
...s/fieldSpecification/FieldSpecificationManager.cpp 5.26% 18 Missing ⚠️
src/coreComponents/mesh/ObjectManagerBase.hpp 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3508      +/-   ##
===========================================
- Coverage    56.65%   56.64%   -0.01%     
===========================================
  Files         1216     1216              
  Lines       105074   105091      +17     
===========================================
+ Hits         59529    59531       +2     
- Misses       45545    45560      +15     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@arng40 arng40 requested a review from MelReyCG April 11, 2025 13:19
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: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EPIC] Improve feedback to user on XML errors
3 participants