Neko 1.99.2
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
scratch_registry Module Reference

Defines a registry for storing and requesting temporary objects This can be used when you have a function that will be called often and you don't want to create temporary objects (work arrays) inside it on each call.

Data Types

type  scratch_registry_t
 

Functions/Subroutines

subroutine scratch_registry_init (this, size, expansion_size, dof)
 Constructor, optionally taking initial registry and expansion size as argument.
 
subroutine scratch_registry_free (this)
 Destructor.
 
subroutine scratch_registry_set_dofmap (this, dof)
 Assign a dofmap to the scratch registry.
 
pure integer function get_n_entries (this)
 Get the number of objects stored in the registry.
 
pure integer function get_n_inuse (this)
 Get the number of objects currently in use.
 
pure integer function get_size (this)
 Get the size of the objects array.
 
pure integer function get_expansion_size (this)
 Get the expansion size.
 
pure logical function get_inuse (this, index)
 Get the inuse status for a given index.
 
subroutine expand (this)
 
subroutine request_field (this, f, index, clear)
 Get a field from the registry by assigning it to a pointer.
 
subroutine request_vector (this, v, index, n, clear)
 Get a vector from the registry by assigning it to a pointer.
 
subroutine request_matrix (this, m, index, nrows, ncols, clear)
 Get a matrix from the registry by assigning it to a pointer.
 
subroutine relinquish_field_single (this, index)
 Relinquish the use of a field in the registry.
 
subroutine relinquish_field_multiple (this, indices)
 Relinquish the use of multiple fields in the registry.
 
subroutine relinquish_vector_single (this, index)
 Relinquish the use of a vector in the registry.
 
subroutine relinquish_vector_multiple (this, indices)
 Relinquish the use of multiple vectors in the registry.
 
subroutine relinquish_matrix_single (this, index)
 Relinquish the use of a matrix in the registry.
 
subroutine relinquish_matrix_multiple (this, indices)
 Relinquish the use of multiple matrices in the registry.
 
subroutine relinquish_single (this, index)
 Relinquish the use of an object in the registry.
 
subroutine relinquish_multiple (this, indices)
 Relinquish the use of multiple objects in the registry.
 

Variables

type(scratch_registry_t), target, public neko_scratch_registry
 Global scratch registry.
 

Function/Subroutine Documentation

◆ expand()

subroutine scratch_registry::expand ( class(scratch_registry_t), intent(inout this)
private

Definition at line 243 of file scratch_registry.f90.

◆ get_expansion_size()

pure integer function scratch_registry::get_expansion_size ( class(scratch_registry_t), intent(in this)
private

Definition at line 228 of file scratch_registry.f90.

◆ get_inuse()

pure logical function scratch_registry::get_inuse ( class(scratch_registry_t), intent(in), target  this,
integer, intent(in index 
)
private

Definition at line 236 of file scratch_registry.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_n_entries()

pure integer function scratch_registry::get_n_entries ( class(scratch_registry_t), intent(in this)
private

Definition at line 200 of file scratch_registry.f90.

◆ get_n_inuse()

pure integer function scratch_registry::get_n_inuse ( class(scratch_registry_t), intent(in this)
private

Definition at line 208 of file scratch_registry.f90.

◆ get_size()

pure integer function scratch_registry::get_size ( class(scratch_registry_t), intent(in this)
private

Definition at line 216 of file scratch_registry.f90.

◆ relinquish_field_multiple()

subroutine scratch_registry::relinquish_field_multiple ( class(scratch_registry_t), intent(inout), target  this,
integer, dimension(:), intent(inout indices 
)
private
Parameters
indicesThe indices of the fields to free

Definition at line 426 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_field_single()

subroutine scratch_registry::relinquish_field_single ( class(scratch_registry_t), intent(inout), target  this,
integer, intent(inout index 
)
private
Parameters
indexThe index of the field to free

Definition at line 411 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_matrix_multiple()

subroutine scratch_registry::relinquish_matrix_multiple ( class(scratch_registry_t), intent(inout), target  this,
integer, dimension(:), intent(inout indices 
)
private
Parameters
indicesThe indices of the matrices to free

Definition at line 492 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_matrix_single()

subroutine scratch_registry::relinquish_matrix_single ( class(scratch_registry_t), intent(inout), target  this,
integer, intent(inout index 
)
private
Parameters
indexThe index of the matrix to free

Definition at line 477 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_multiple()

subroutine scratch_registry::relinquish_multiple ( class(scratch_registry_t), intent(inout), target  this,
integer, dimension(:), intent(inout indices 
)
private
Parameters
indicesThe indices of the objects to free

Definition at line 520 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_single()

subroutine scratch_registry::relinquish_single ( class(scratch_registry_t), intent(inout), target  this,
integer, intent(inout index 
)
private
Parameters
indexThe index of the object to free

Definition at line 510 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_vector_multiple()

subroutine scratch_registry::relinquish_vector_multiple ( class(scratch_registry_t), intent(inout), target  this,
integer, dimension(:), intent(inout indices 
)
private
Parameters
indicesThe indices of the vectors to free

Definition at line 459 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_vector_single()

subroutine scratch_registry::relinquish_vector_single ( class(scratch_registry_t), intent(inout), target  this,
integer, intent(inout index 
)
private
Parameters
indexThe index of the vector to free

Definition at line 444 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ request_field()

subroutine scratch_registry::request_field ( class(scratch_registry_t), intent(inout), target  this,
type(field_t), intent(inout), pointer  f,
integer, intent(inout index,
logical, intent(in clear 
)
private
Parameters
fPointer to the requested field.
indexIndex of the field in the registry (for relinquishing later).
clearIf true, the field values are set to zero upon request.

Definition at line 263 of file scratch_registry.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ request_matrix()

subroutine scratch_registry::request_matrix ( class(scratch_registry_t), intent(inout), target  this,
type(matrix_t), intent(inout), pointer  m,
integer, intent(inout index,
integer, intent(in nrows,
integer, intent(in ncols,
logical, intent(in clear 
)
private
Parameters
mPointer to the requested matrix.
indexIndex of the matrix in the registry (for relinquishing later).
nrowsNumber of rows of the requested matrix.
ncolsNumber of columns of the requested matrix.
clearIf true, the matrix values are set to zero upon request.

Definition at line 364 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ request_vector()

subroutine scratch_registry::request_vector ( class(scratch_registry_t), intent(inout), target  this,
type(vector_t), intent(inout), pointer  v,
integer, intent(inout index,
integer, intent(in n,
logical, intent(in clear 
)
private
Parameters
vPointer to the requested vector.
indexIndex of the vector in the registry (for relinquishing later).
nSize of the requested vector.
clearIf true, the vector values are set to zero upon request.

Definition at line 314 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ scratch_registry_free()

subroutine scratch_registry::scratch_registry_free ( class(scratch_registry_t), intent(inout this)
private

Definition at line 152 of file scratch_registry.f90.

◆ scratch_registry_init()

subroutine scratch_registry::scratch_registry_init ( class(scratch_registry_t), intent(inout this,
integer, intent(in), optional  size,
integer, intent(in), optional  expansion_size,
type(dofmap_t), intent(in), optional, target  dof 
)
private
Parameters
sizeInitial size of the registry
expansion_sizeSize to expand the registry by when needed
dofDofmap to associate with the scratch registry
Note
If no DOF map is provided here, it must be set later using scratch_registry_t::set_dofmap before requesting fields.

Definition at line 129 of file scratch_registry.f90.

◆ scratch_registry_set_dofmap()

subroutine scratch_registry::scratch_registry_set_dofmap ( class(scratch_registry_t), intent(inout this,
type(dofmap_t), intent(in), target  dof 
)
private
Parameters
dofDofmap to assign
Note
First check if a dofmap is already assigned, and throw an error, unless it's the same dofmap.

Definition at line 185 of file scratch_registry.f90.

Variable Documentation

◆ neko_scratch_registry

type(scratch_registry_t), target, public scratch_registry::neko_scratch_registry

Definition at line 117 of file scratch_registry.f90.