feat: support non-scalar valued field specifications #4034
Open
kdrienCG wants to merge 57 commits into
Open
Conversation
Contributor
Author
|
I've removed the |
…/nonScalarFieldSpecification
Contributor
|
@kdrienCG can you look if you can add a check on the user input vector dimension in relation to the field tensorial dimensions? |
Potential solution was:
```cpp
#ifndef NDEBUG
GEOS_WARNING_IF( m_functionName.size() > 1,
"getFunctionName() used while m_functionName has multiple values. Consider using getFunctionNames()" );
#endif
```
It may not be worth bringing the whole Logger header for this check...
MelReyCG
reviewed
Jun 22, 2026
| * Accessor | ||
| * @return const m_scales | ||
| */ | ||
| arrayView1d< real64 const > getScales() const |
Contributor
There was a problem hiding this comment.
Be consistent (plural) with scaleString() { return "scale"; }
Comment on lines
+318
to
+319
| bool usesNonScalarValues() const | ||
| { return m_scale.size() > 1 || m_functionName.size() > 1; } |
Contributor
There was a problem hiding this comment.
Seems quite complicated to maintain. To avoid having 4 ways branching ( scale scalar or not, functionNames scalar or not ), I suggest to, for scale and functionNames:
- control that if we have >1-dim vectors, it has the the same dimensions as the field (
numArrayComp()?) inpostProcessInput(); - still in
postProcessInput(), duplicate any 1-dim vector so it has the same dimensions as the field; - then we are able to remove this method, and any downstream branching.
rename "scale" to "scales" in the code only. rename "functionName" to "functionNames" in the code only.
…dSpecification' into feature/kdrienCG/nonScalarFieldSpecification
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.
This PR generalizes field specifications to support non-scalar values, notably scales (and so function names).
The following interface is proposed:
Instead of:
This PR also add aregionNamesarray to make it easier to specify multiple regions.