feat: add PermeabilitySpecification as an high-level FieldSpecification#4019
feat: add PermeabilitySpecification as an high-level FieldSpecification#4019
Conversation
Implement methods to add factories to the manager to handle the creation of FieldSpecificationBase object via higher-level specifications (like PermeabilitySpecification)
|
Hi @kdrienCG |
Hi @rrsettgast , and thanks for the suggestion I propose doing that in a follow-up PR so we can keep this one focused on specialized components and easier to review. I've also put together a prototype to test the generalized approach, I can open a separate PR so we can agree on what its interface should be. |
Modify the specification parameter name in PermeabilitySpecificationFactory to match the parent class method definition (FieldSpecificationFactory)
|
@kdrienCG I would really insist that don't create a dedicated FieldSpecification for permeability. This should be handled in the generic way, with an improvement on the processing of "scale" to allow for tensor input, and the subsequent processing. |
|
Hi @rrsettgast, the goal here was to offer a user-oriented interface, as
I understand that this very proposal of the idea of specialized user-oriented components for each common field can seem quite empty for now, as there is no validation for the field for now, but it offer an opportunity to add specialized validations, dedicated documentation and a stable interface. Adding a vectorized version of the |
|
Also, we don't have region name array on |
|
|
||
| AquiferBoundaryCondition | ||
|
|
||
| PermeabilitySpecification |
There was a problem hiding this comment.
Hmm.. I don't see that in the generated readthedocs build.
There was a problem hiding this comment.
maybe its an issue due to the aborting of the jobs on the last CI compilation
| <PermeabilitySpecification | ||
| name="perm" | ||
| setNames="{ all }" | ||
| regionNames="{ reservoir/block1 }" |
There was a problem hiding this comment.
Can we do that?
| regionNames="{ reservoir/block1 }" | |
| regionNames="{ reservoir }" |
And what about that to target all region? (maybe you'd have to implement something on * in the factory)
| regionNames="{ reservoir/block1 }" | |
| regionNames="{ * }" |
Maybe we should these syntaxes in the examples.
| **PermeabilitySpecification** is an optional, higher-level XML tag that you can place in the **FieldSpecifications** block. | ||
| It describes a 3-axis permeability on one or more element regions. |
There was a problem hiding this comment.
| **PermeabilitySpecification** is an optional, higher-level XML tag that you can place in the **FieldSpecifications** block. | |
| It describes a 3-axis permeability on one or more element regions. | |
| **PermeabilitySpecification** is a XML tag that you can place in the **FieldSpecifications** block to describe a 3-axis permeability on one or more element regions. | |
| It is an higher-level component than **FieldSpecification**, specialized on permeability. |
| void setComponent( int component ) | ||
| { | ||
| m_component = component; | ||
| } |
There was a problem hiding this comment.
1 liners (only the methods you added, as you did the rest in another PR)
| public: | ||
|
|
||
| /** | ||
| * @defgroup alias and functions to defined statically initialized catalog |
There was a problem hiding this comment.
| * @defgroup alias and functions to defined statically initialized catalog | |
| * @defgroup alias and functions to define statically initialized catalog |
|
|
||
| R1Tensor scales = ps->getScales(); | ||
|
|
||
| for( string const & regionName : ps->getRegionNames() ) |
There was a problem hiding this comment.
Is it possible to add a validation of the region names?
|
|
||
| stdArray< string, 3 > suffixes = {{ "_x", "_y", "_z" }}; | ||
|
|
||
| R1Tensor scales = ps->getScales(); |
There was a problem hiding this comment.
We would need to GEOS_ERROR() on negative values.
I don't understand what exactly is meant when you say that FieldSpecification has "no real interface between user configuration and internal GEOS data. It is the specification of "field data". I read it as an implication that a "user" will not understand the concept that permeability is stored as a field. This is pretty basic.
This seems like it is a documentation issue. I do not understand what you mean by "per-field validation". Do you mean checking that the specification makes sense? The criteria for this check is not determined at the specification action level. The coupling of data with user inputs is intentional.
This is a documentation issue. How will the user know they can use a "PermeabilitySpecification" block, and what the available attributes/inputs are for that block? I guess they would have to find the specification somewhere in the documentation or examples? Is this any harder than finding the examples with "FieldSpecification" setting the permeability field? Also, lucky for us that claude or codex/ChatGPT can easily figure this stuff out now. Just give the agent access to the examples and documentation and it will do it for you.
Can you give examples of the type of validation that must occur specifying a field? Why must it be a stand alone class in field specification rather than validation based on field name and specified solvers? I think it is correct to say that the solvers should be the ones decided what input specifications are valid not the actual FieldSpecification, and a mechanism exist for this already. Do the "Initialization" functions from Group not do this?
This really would solve a lot of "user interface" issues. However again, claude and codex handle the replication for you without any error. |
(Previously #4012)
This PR proposes to add an easy way to add higher-level components that create FieldSpecifications without the boilerplate.
As an example, to define the permeability you have to specify 3 differents FieldSpecifications.
One for the x-axis, a second for the y-axis, and a last one for the z-axis.
There is also some implementation details that could be hidden, like the
componentXML attribute for example.With this PR, their would be a
PermeabilitySpecificationcomponent that would create behind the scene those three FieldSpecifications to keep full compatibility with other parts that rely onFieldSpecificationBase. One could think of PermeabilitySpecification as a blueprint or recipe to create FieldSpecificationBase objects.Here is how it looks like for
PermeabilitySpecification:The following architecture is proposed:
This way, similar components could be added by providing a data class (like
PermeabilitySpecification) and a factory with ageneratemethod to describe how to transform the high-level components into one or multiple "low-level"FieldSpecificationBase.