|
Neko 1.99.9
A portable framework for high-order spectral element flow simulations
|
This section is meant to help new developers get a quick introduction to some of the most important types in Neko, to get an idea of where to look for what. In this spirit, the descriptions here are not meant to be exhaustive. In many cases, we will just point to top type in a hierarchy, and leave the reader to explore the descendants.
Here, we also list file names rather than types, since the basic math is implemented as subroutines.
math.f90: Basic math operations on raw arrays.device_math.F90: Basic math operations on device arrays.field_math.f90: Basic math operations on field_t.vector_math.f90 and matrix_math.f90: Basic math operations on vector_t and matrix_t.operators.f90: Various explicit operators, including derivatives, etc.Neko wraps raw Fortran arrays in a handful of container types. The main motivation is running on accelerators: each container holds both a host array x and a device pointer x_d, and manages the allocation of both, so that code higher up does not have to deal with device memory explicitly. The containers also carry a name, which is what the registries below use to look them up. All containers share a common lifecycle: init to allocate, free to deallocate, size to query the number of entries and copy_from to move data between the host and the device. The assignment operator = is overloaded to copy from another container of the same kind or to set all entries to a scalar.
get_nrows and get_ncols for the dimensions. Also provides inverse.get_n1, get_n2, etc. for the dimensions. Not to be confused with the tensor.f90 file, which implements tensor product operations on raw arrays.Fortran does not allow arrays of pointers, so for every container there is a corresponding *_ptr_t type holding a single pointer component ptr.
The adt directory holds abstract data types that are used mostly in the mesh and gather-scatter setup, rather than for the solution itself. As Fortran has no templates, each comes as a family of types specialised to a data type, with the suffix indicating the payload: i4 for 32-bit integers, i8 for 64-bit integers, r8 for double precision reals, and so on.
push, pop and array to get the contents as a plain array. This is the go-to container when the final number of entries is not known in advance.Singleton types are meant to only have a single object of their kind to be created. These objects are declared in the same module where the type resides, and all have their name starting with neko_.
neko_simcomps.