refactor: split FieldSpecificationBase into two classes#4025
Open
refactor: split FieldSpecificationBase into two classes#4025
Conversation
MelReyCG
reviewed
Apr 13, 2026
Comment on lines
224
to
229
| integer const isInitialCondition = fs.initialCondition(); | ||
| if( ( isInitialCondition && fieldName=="") || // this only use case for this line is in the unit test for field specification | ||
| ( !isInitialCondition && time >= fs.getStartTime() && time < fs.getEndTime() && fieldName == fs.getFieldName() ) ) | ||
| { | ||
| fs.template apply< OBJECT_TYPE, BCTYPE, LAMBDA >( mesh, std::forward< LAMBDA >( lambda ) ); | ||
| FieldSpecificationImpl::apply< OBJECT_TYPE, BCTYPE, LAMBDA >( fs, mesh, std::forward< LAMBDA >( lambda ) ); | ||
| } |
Contributor
There was a problem hiding this comment.
I understand that you keep the apply() / applyFieldValue() methods in the manager as there is some data-hierarchy matters involved that are manager's responsability, but is it possible to extract this part in FieldSpecificationImpl? I think this is more related with internal FieldSpecification behavior.
Contributor
There was a problem hiding this comment.
Also, becareful of long lines (>100 char).
src/coreComponents/fieldSpecification/FieldSpecificationImpl.hpp
Outdated
Show resolved
Hide resolved
Comment on lines
+19
to
+20
| #include "fieldSpecification/FieldSpecification.hpp" | ||
| #include "fieldSpecification/FieldSpecificationImpl.hpp" |
Contributor
There was a problem hiding this comment.
Suggested change
| #include "fieldSpecification/FieldSpecification.hpp" | |
| #include "fieldSpecification/FieldSpecificationImpl.hpp" | |
| #include "fieldSpecification/FieldSpecificationImpl.hpp" |
Comment on lines
+20
to
+21
| #include "fieldSpecification/FieldSpecificationManager.hpp" | ||
| #include "fieldSpecification/FieldSpecificationBase.hpp" | ||
| #include "fieldSpecification/FieldSpecification.hpp" |
Contributor
There was a problem hiding this comment.
Suggested change
| #include "fieldSpecification/FieldSpecificationManager.hpp" | |
| #include "fieldSpecification/FieldSpecificationBase.hpp" | |
| #include "fieldSpecification/FieldSpecification.hpp" | |
| #include "fieldSpecification/FieldSpecificationManager.hpp" |
| #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_IMMISCIBLEMULTIPHASEFLOW_HPP_ | ||
|
|
||
| #include "physicsSolvers/fluidFlow/FlowSolverBase.hpp" | ||
| #include "fieldSpecification/FieldSpecificationImpl.hpp" |
Contributor
There was a problem hiding this comment.
Is it really needed to include FieldSpecificationImpl.hpp in here and in SinglePhaseReactiveTransport? Should applyFieldValue() be relocated? (Can it be in a cpp or in FieldSpecificationImpl.hpp)?
MelReyCG
reviewed
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(Previously #4011)
This PR aims to refactor the FieldSpecificationBase class into two separate class.
FieldSpecificationfor the data.FieldSpecificationImplfor the "behavior" (with methods likeapply,computeRhsContribution, etc.).This will separate concerns and make the code easier to understand when encountering field specifications.
The following architecture is proposed: