stannum icon indicating copy to clipboard operation
stannum copied to clipboard

How best to use Vector or Matrix fields?

Open oliver-batchelor opened this issue 3 years ago • 1 comments

Is this something worth adding? Happy to give it a go.

I see this is kind of supported for complex types. Is it preferable to just convert scalar fields to vector fields (via indexing) in the kernel? I don't see any easy way of converting a n,m,3 field to a n,m vector3 field but I might be missing something?

oliver-batchelor avatar May 23 '22 01:05 oliver-batchelor

Sorry for late reply. And yes, this can be helpful but I didn't do it because I didn't need this exact feature in my dogfooding.

However, for Tube, I have FieldManager, which you can use to do even more complicated optimizations.

If you want, you can write a simple and public subclass of FieldManager that creates vector and matrix fields. And I think it can be helpful.

As for Tin and EmptyTin, they are intended to be a thinnest layer and the field they received is created and managed by the programmer, so it's the responsibility of the programmer to decide how fields are created.

ifsheldon avatar Jun 25 '22 15:06 ifsheldon