Ease the interleave data process by creating empty arrays on all sibling objects #2014
Replies: 2 comments 2 replies
-
An alternative is to only store data on 'parent' or 'full domain' objects (i.e. network and phases), and the subdomain objects just 'look-up' data from the parent as needed, knowing what indices its associated with. In this scenario, phys and geom would store NO data on themselves at all. Their parent objects would have all the data, including the label indicating where the subdomains apply (which is already how things work). This label would literally be used as a mask to fetch the data for the subdomain, like When calling The main downside to this is that you can no longer add labels to the subdomain objects. I am 99.9% sure nobody has ever used this feature. I certainly haven't. I think this is a radical change, but is worth seriously considering. |
Beta Was this translation helpful? Give feedback.
-
We have decided to go with the latter option, so that all data is stored on the network/phase (i.e. FullDomain), and the geometry/physics (i.e. SubDomain) just reads/writes to the respective FullDomain. This means that when a value is written to the SubDomain, the FULL array is created on the FullDomain but only partially filled with values. Interleaving is then no longer necessary as the FULL (i.e. interleaved) array is now already in existence. |
Beta Was this translation helpful? Give feedback.
-
At the moment if you have two physics objects,
phys1
and phys2`, and you createphys1['pore.blah'] = 1.0
, then you do ``phys2['pore.blah']`` it will do a BUNCHA stuff behind the scenes to eventually return nans. The process is complicated and take about 200 lines.What if, instead, upon the creation of
phys1['pore.blah'] = 1.0
we automatically createphys2['pore.blah'] = np.nan
. This would literally reduce the size of the interleave_data to just a few lines.Downside: creating new arrays requires checking all the other objects...but the setitem method already does a tonne of that stuff anyway.
Beta Was this translation helpful? Give feedback.
All reactions