I am trying to use a custom struct with ParallelStencil.jl. I define the custom struct as
@CellType Field2D fieldnames=(xx, yy, zz)
Then I initialize it for 2 variables as
F1 = @zeros( nx, ny, celltype=Field2D)
F2 = @zeros( nx, ny, celltype=Field2D)
Finally I would like to use its fields in a computation kernel as
@parallel_indices (ix, iy) function Evolve!(F1, F2)
F1.xx [ix, iy] = F2.yy[ix, iy] - F2.zz[ix, iy]
However, the last step fails. I am assuming i do not know the right way to access the field value of F1 and F2 variables. If so, can someone please point the correct way to access field values?
Or am I completely mistaken about the use case of @CellType macro and define a variable for each component separately?