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

TimeHistory cannot gather the same field from different locations #2300

Open
TotoGaz opened this issue Feb 15, 2023 · 6 comments
Open

TimeHistory cannot gather the same field from different locations #2300

TotoGaz opened this issue Feb 15, 2023 · 6 comments
Labels
type: feature New feature or request

Comments

@TotoGaz
Copy link
Contributor

TotoGaz commented Feb 15, 2023

It’s possible for TimeHistory to gather multiple sources of information into one unique file.
But it’s not possible for the TimeHistory/PackCollection pair to extract the same field on multiple locations and save them into the same file.
Consider the PoroElastic_Mandel test case.
For convenience, generate the cubic mesh with two different cell blocks (here cb1 and cb2):

<Mesh>
 <InternalMesh
  name="mesh1"
  elementTypes="{ C3D8 }"
  xCoords="{ 0.0, 0.5, 1.0 }"
  yCoords="{ 0.0, 0.1 }"
  zCoords="{ 0.0, 1.0 }"
  nx="{ 10, 10 }"
  ny="{ 1 }"
  nz="{ 20 }"
  cellBlockNames="{ cb1, cb2 }"/>
</Mesh>

and accordingly

<ElementRegions>
 <CellElementRegion
  name="Domain"
  cellBlocks="{ cb1, cb2 }"
  materialList="{ shale, water }"/>
</ElementRegions>

Then create/update the Tasks

<PackCollection
 name="pressureCollection"
 objectPath="ElementRegions/Domain/cb1"
 fieldName="pressure"/>
<PackCollection
 name="pressureCollection2"
 objectPath="ElementRegions/Domain/cb2"
 fieldName="pressure"/>

and the TimeHistory

<TimeHistory
 name="pressureHistoryOutput"
 sources="{/Tasks/pressureCollection, /Tasks/pressureCollection2}"
 filename="pressure_history"/>

Do not forget to trigger

<PeriodicEvent
 name="pressureCollection" 
 target="/Tasks/pressureCollection"/>
<PeriodicEvent
 name="pressureCollection2"
 target="/Tasks/pressureCollection2"/>
<PeriodicEvent
 name="pressureOutput"
 targetExactTimestep="0"
 target="/Outputs/pressureHistoryOutput"/>

The case described does not work as TimeHistory does not know how to “merge” the same field into the same file.

Additionally, we can provide one set, but if this set is spread over two sub regions, then the process fails since they can't be merged.

@TotoGaz TotoGaz added type: feature New feature or request type: new A new issue has been created and requires attention and removed type: new A new issue has been created and requires attention labels Feb 15, 2023
@sytuannguyen
Copy link
Contributor

sytuannguyen commented Feb 21, 2023

@TotoGaz I experienced the same issue when working with a cased wellbore problem comprising three regions casing, cement and rock. For instant I need to defined one TimeHistory per region. It works fine but the input xml is quite verbose.

image

@wrtobin
Copy link
Collaborator

wrtobin commented Feb 21, 2023

Likely the way to implement this with the least amount of refactoring is allowing the PackCollection to collect from multiple objects via lists and/or wildcard specifications. The modifications to the collection itself will be fairly straightforward. The changes to our timehistory IO operations with hdf5 will likely take the most time.

@wrtobin
Copy link
Collaborator

wrtobin commented Feb 21, 2023

Related to #1636

@untereiner
Copy link
Contributor

To go further for this issue, as suggested by @wrtobin what do you think of allowing packCollection to read objectPath like this one: objectPath="ElementRegions/Domain/{cb1,cb2}" in addition to the existing ones. This would add a minimal change to the existing xml decks.

It needs a rework of getTargetObject maybe with a signature like:
std::vector<dataRepository::Group const *> HistoryCollectionBase::getTargetObject( DomainPartition const & domain, string const & objectPath ) const
and also:
std::vector<std::reference_wrapper<Group>> getBaseGroupsByPath( string const & path ) const;

Should I change those functions or add new functions with plural name (getTargetObjects, etc) ?

@TotoGaz
Copy link
Contributor Author

TotoGaz commented May 31, 2023

It's surely a good way to move in the correct direction.
But how should we "merge" the results? I think this is the most challenging part?

@untereiner
Copy link
Contributor

There is a globalID. Is it global to all cellblocks of a cellElementRegion ? In that case we could either « merge and permut » or concat the fields and output also the global index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants