conduit icon indicating copy to clipboard operation
conduit copied to clipboard

ndarray extension to fields

Open cyrush opened this issue 4 years ago • 8 comments

a few ideas I don't want to lose, so throwing them up here:

using a ND array to define a field on a 2D structured mesh where assoc between field values and the elements is fully specified (vs blueprints implicit i,j relationship)

These examples are for a 10x10 element mesh:

scalar field:

field:
  values: [ lots of values] 
  topology: "topo"
  association: "element"
  shape: [ 10, 10]
  indices: [ "i","j"] # order corresponds to shape above, names matter
  strides: [ blah,blah] # optional

vector field:

field:
  values: [ lots of values] 
  topology: "topo"
  association: "element"
  shape: [ 10, 10, 3 ]
  indices: [ "i", "j", "v"] # order corresponds to shape above, "i" and "j" names matter
  strides: [ blah,blah,blah]  # optional

using a ND array to define a field o on an unstructured mesh where assoc between field values and the elements is fully specified (vs implicit id ->element relationship)

These examples are for a 100 element mesh:

scalar field:

field:
  values: [ lots of values] 
  topology: "topo"
  association: "element"
  shape: [ 100]
  indices: [ "id" ] # "id" name matters
  strides: [ blah,blah] # optional

vector field:

field:
  values: [ lots of values] 
  topology: "topo"
  association: "element"
  shape: [ 100, 3 ]
  indices: [ "id","v"] # "id" name matters
  strides: [ blah,blah] # optional

cyrush avatar Apr 30 '21 22:04 cyrush

@xjrc

this extra info would allow us to automatically use things like ZFP that exploit ND structure.

I think -- its also an idea that could help us solve the striding demands for complex cases like @bryujin has.

cyrush avatar Apr 30 '21 22:04 cyrush

the same approach could be applied to link structured topos to almost structured but kind of funky coordsets.

cyrush avatar Apr 30 '21 22:04 cyrush

offsets is another option we may need.

cyrush avatar Apr 30 '21 23:04 cyrush

and indices conflicts with the o2m use.

Overall - these ideas can help, but we need to carefully consider the proper names (the ones above aren't my proposal for proper names)

cyrush avatar Apr 30 '21 23:04 cyrush

the shapes here implies ND vs sizes which implies o2m (1D to many (ragged/varying))

cyrush avatar Apr 30 '21 23:04 cyrush

matt used labels instead of indices in a demo, that's another option.

cyrush avatar May 05 '21 15:05 cyrush

In general, I think this is a great idea and very necessary to deal with the growing complexity of data abstraction being folded into Conduit/Blueprint. I remember @mclarsen presenting some of his ideas on this subject a few months ago at the Conduit meeting; is there anywhere that I can find some recent examples? Looking at some concrete samples would help me better understand the logic/needs.

xjrc avatar May 05 '21 16:05 xjrc

TODO: We have an evolution of this and a much better example, add the example here.

cyrush avatar Aug 18 '21 02:08 cyrush