49     logical, 
private, 
allocatable :: inuse(:)
 
   51     integer, 
private :: nfields
 
   53     integer, 
private :: nfields_inuse
 
   55     integer, 
private :: expansion_size
 
   59     procedure, 
private, pass(this) :: 
expand 
 
   92    type(
dofmap_t), 
target, 
intent(in) :: dof
 
   93    integer, 
optional, 
intent(in) :: size
 
   94    integer, 
optional, 
intent(in) :: expansion_size
 
  101    if (
present(size)) 
then 
  102       allocate (this%fields(size))
 
  104          allocate(this%fields(i)%ptr)
 
  106       allocate (this%inuse(size))
 
  108       allocate (this%fields(10))
 
  109       allocate (this%inuse(10))
 
  112    this%inuse(:) = .false.
 
  113    if (
present(expansion_size)) 
then 
  114       this%expansion_size = expansion_size
 
  116       this%expansion_size = 10
 
  120    this%nfields_inuse = 0
 
 
  128    if (
allocated(this%fields)) 
then 
  130          call this%fields(i)%ptr%free()
 
  131          deallocate(this%fields(i)%ptr)
 
  134       deallocate(this%fields)
 
  135       deallocate(this%inuse)
 
  138    if (
associated(this%dof)) 
then 
 
  158    do i=1,this%get_size()
 
  159       if (this%inuse(i)) n = n + 1
 
 
  168    n = 
size(this%fields)
 
 
  176    n = this%expansion_size
 
 
  182    logical, 
allocatable :: temp2(:)
 
  185    allocate(temp(this%get_size() + this%expansion_size))
 
  186    temp(1:this%nfields) = this%fields(1:this%nfields)
 
  188    do i=this%nfields +1, 
size(temp)
 
  189       allocate(temp(i)%ptr)
 
  192    call move_alloc(temp, this%fields)
 
  194    allocate(temp2(this%get_size() + this%expansion_size))
 
  195    temp2(1:this%nfields) = this%inuse(1:this%nfields)
 
  196    temp2(this%nfields+1:) = .false.
 
 
  204    type(
field_t), 
pointer, 
intent(inout) :: f
 
  205    integer, 
intent(inout) :: index
 
  206    character(len=10) :: name
 
  209    associate(nfields => this%nfields, nfields_inuse => this%nfields_inuse)
 
  211      do index = 1, this%get_size()
 
  212         if (this%inuse(index) .eqv. .false.) 
then 
  213            write(name, 
"(A3,I0.3)") 
"wrk", index
 
  215            if (.not. 
allocated(this%fields(index)%ptr%x)) 
then 
  216               call this%fields(index)%ptr%init(this%dof, trim(name))
 
  217               nfields = nfields + 1
 
  219            f => this%fields(index)%ptr
 
  221            this%inuse(index) = .true.
 
  222            this%nfields_inuse = this%nfields_inuse + 1
 
  229      nfields = nfields + 1
 
  230      nfields_inuse = nfields_inuse + 1
 
  231      this%inuse(nfields) = .true.
 
  232      write (name, 
"(A3,I0.3)") 
"wrk", index
 
  233      call this%fields(nfields)%ptr%init(this%dof, trim(name))
 
  234      f => this%fields(nfields)%ptr
 
 
  242    integer, 
intent(inout) :: index
 
  244    this%inuse(index) = .false.
 
  245    this%nfields_inuse = this%nfields_inuse - 1
 
 
  250    integer, 
intent(inout) :: indices(:)
 
  253    do i=1, 
size(indices)
 
  254       this%inuse(indices(i)) = .false.
 
  256    this%nfields_inuse = this%nfields_inuse - 
size(indices)
 
 
  261    integer, 
intent(inout) :: index
 
 
Defines a mapping of the degrees of freedom.
 
subroutine, public field_rzero(a, n)
Zero a real vector.
 
Defines a registry for storing and requesting temporary fields This can be used when you have a funct...
 
logical function get_inuse(this, index)
 
pure integer function get_nfields_inuse(this)
 
subroutine scratch_registry_free(this)
Destructor.
 
subroutine scratch_registry_init(this, dof, size, expansion_size)
Constructor, optionally taking initial registry and expansion size as argument.
 
subroutine relinquish_field_single(this, index)
Relinquish the use of a field in the registry.
 
pure integer function get_size(this)
Get the size of the fields array.
 
subroutine relinquish_field_multiple(this, indices)
 
type(scratch_registry_t), target, public neko_scratch_registry
Global scratch registry.
 
subroutine request_field(this, f, index)
Get a field from the registry by assigning it to a pointer.
 
pure integer function get_nfields(this)
Get the number of fields stored in the registry.
 
pure integer function get_expansion_size(this)
Get the expansion size.
 
field_ptr_t, To easily obtain a pointer to a field