Neko  0.9.0
A portable framework for high-order spectral element flow simulations
scratch_registry Module Reference

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

Data Types

interface  scratch_registry_t
 

Functions/Subroutines

type(scratch_registry_t) function init (dof, size, expansion_size)
 Constructor, optionally taking initial registry and expansion size as argument. More...
 
subroutine scratch_registry_free (this)
 Destructor. More...
 
pure integer function get_nfields (this)
 Get the number of fields stored in the registry. More...
 
pure integer function get_nfields_inuse (this)
 
pure integer function get_size (this)
 Get the size of the fields array. More...
 
pure integer function get_expansion_size (this)
 Get the expansion size. More...
 
subroutine expand (this)
 
subroutine request_field (this, f, index)
 Get a field from the registry by assigning it to a pointer. More...
 
subroutine relinquish_field_single (this, index)
 Relinquish the use of a field in the registry. More...
 
subroutine relinquish_field_multiple (this, indices)
 
logical function get_inuse (this, index)
 

Variables

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

Function/Subroutine Documentation

◆ expand()

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

Definition at line 179 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 172 of file scratch_registry.f90.

◆ get_inuse()

logical function scratch_registry::get_inuse ( class(scratch_registry_t), intent(inout), target  this,
integer, intent(inout)  index 
)
private
Parameters
[in,out]indexThe index of the field to check

Definition at line 258 of file scratch_registry.f90.

◆ get_nfields()

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

Definition at line 146 of file scratch_registry.f90.

◆ get_nfields_inuse()

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

Definition at line 153 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 164 of file scratch_registry.f90.

◆ init()

type(scratch_registry_t) function scratch_registry::init ( type(dofmap_t), intent(in), target  dof,
integer, intent(in), optional  size,
integer, intent(in), optional  expansion_size 
)
private

Definition at line 91 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
[in,out]indicesThe indices of the field to free

Definition at line 247 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
[in,out]indexThe index of the field to free

Definition at line 239 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 
)
private
Parameters
[in,out]indexThe index of the field in the inuse array

Definition at line 202 of file scratch_registry.f90.

◆ scratch_registry_free()

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

Definition at line 124 of file scratch_registry.f90.

Variable Documentation

◆ neko_scratch_registry

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

Definition at line 85 of file scratch_registry.f90.