SpatialOps
Fields and Meshes
See also
The Field Types module, which provides additional information on the types discussed here.
The example discussing Some natively supported field types
The example discussing Inferring field types

Field types on meshes

The following table enumerates the field types defined in SpatialOps associated with each mesh.

- Scalar Mesh X-Mesh Y-Mesh Z-Mesh
Volume SVolField XVolField YVolField ZVolField
X-Surface SSurfXField XSurfXField YSurfXField ZSurfXField
Y-Surface SSurfYField XSurfYField YSurfYField ZSurfYField
Z-Surface SSurfZField XSurfZField YSurfZField ZSurfZField

The Scalar (cell-centered) Volume

The following image illustrates a scalar mesh in 2D with the associated field locations. Filled circles indicate volume centroids for cells within the domain while empty circles indicate ghost volume locations.

SVolFields_2D.jpg
Field types in 2D with their locations on a scalar (cell-centered) mesh

Key observations on the scalar volume

  • This figure illustrates one layer of ghost cells (depicted in shaded grey).
  • Face fields on the (-) side face are associated with the cell volume for indexing purposes.
  • When a domain boundary is present, the surface fields have an extra storage location. For a mesh of size (nx,ny,nz) with (+) boundaries in each direction,
    • SVolField is dimension (nx,ny,nz)
    • SSurfXField is dimension (nx+1,ny,nz)
    • SSurfYField is dimension (nx,ny+1,nz)
    • SSurfZField is dimension (nx,ny,nz+1)
  • The figure above depicts a situation where there is no (+) boundary present.

The X-Staggered Volume

The following image illustrates a scalar mesh in 2D with the associated field locations. Filled squares indicate x-volume centroids located within while the domain while empty squares indicate ghost values.

SVol_XVol.jpg
The scalar and x-staggered volume

Key observations on the x-staggered volume

  • For a uniform mesh (depicted here), the XVolField is colocated with the SSurfXField
  • Just as with The Scalar (cell-centered) Volume, face fields on the (-) side are associated with the cell volume for indexing purposes.
  • When a domain boundary is present, the surface fields have an extra storage location. For a mesh of size (nx,ny,nz)
    • XVolField is dimension (nx,ny,nz)
    • XSurfXField is dimension (nx+1,ny,nz)
    • XSurfYField is dimension (nx,ny+1,nz)
    • XSurfZField is dimension (nx,ny,nz+1)
  • Note that even though XVolField is colocated with SSurfXField, its storage behavior is different with respect to (+) side boundaries.

The Y-Staggered Volume

The following image illustrates a scalar mesh in 2D with the associated field locations. Filled triangles indicate y-volume cell centroids located within the domain while empty triangles indicate values in ghost cells.

SVol_YVol.jpg
The scalar and x-staggered volume

Key observations on the y-staggered volume

  • For a uniform mesh (depicted here), the YVolField is colocated with the SSurfYField
  • Just as with The Scalar (cell-centered) Volume, face fields on the (-) side are associated with the cell volume for indexing purposes.
  • When a domain boundary is present, the surface fields have an extra storage location. For a mesh of size (nx,ny,nz)
    • YVolField is dimension (nx,ny,nz)
    • YSurfXField is dimension (nx+1,ny,nz)
    • YSurfYField is dimension (nx,ny+1,nz)
    • YSurfZField is dimension (nx,ny,nz+1)
  • Note that even though YVolField is colocated with SSurfYField, its storage behavior is different with respect to (+) side boundaries.

The Z-Staggered Volume

The z-staggered volume behaves in an analogous way to the The X-Staggered Volume and The Y-Staggered Volume discussions above.

Field type inference

There are two key tools to aid in type inference:

  1. Given a volume field type, the associated face field types may be obtained using the FaceTypes struct.
  2. Given a face field type, the associated volume field type may be obtained using the VolType struct.
    See also
    The Inferring field types example