Version 1 (modified by 13 years ago) ( diff ) | ,
---|
Layout Objects
Layouts can be used to load and unload data from the AMR data set onto distributed fixed grids. Layouts define the partition of the data as well as coordinates the communication required to transfer data between the AMR dataset and layouts as well as between different layouts. To create layouts you first need to add a USE
statement to your problem.f90
USE LayoutDeclarations
Then in ProblemModuleInit declare a variable pointer of type LayoutDef
TYPE(LayoutDef), POINTER :: layout
Then create the Layout and load data into it
CALL CreateLayout(GmGlobal, layout) layout%level = 0 mB=layout%mB(MPI_ID,:,:) ALLOCATE(data(mB(1,1):mB(1,2), mB(2,1):mB(2,2),mB(3,1):mB(3,2),4)) ALLOCATE(FieldID(4)) FieldID=(/(i,i=1,4)/) CALL LoadFieldIntoLayout(layout, data, FieldID)
Once the AMR data is loaded into a distributed fixed grid data set, it can be manipulated in various ways - but one option is to modify the layout to be able to map the data back onto a different region of the AMR data set.
For example after loading the data above, we can unload the data onto the level 1 grids offset by 64 level 1 cells in x y and z.
layout%level = 1 layout%mB(:,:,:)=layout%mB(:,:,:)+64 CALL UnloadFieldFromLayout(layout, data, FieldID)
- For more information on the Field sub-object's properties see ProcessingFields