2 use,
intrinsic :: iso_fortran_env, only : error_unit
4 use iso_c_binding,
only : c_ptr
24 generic :: get => get_by_index, get_by_name
30 generic :: assign => assign_to_field, assign_to_field_wrapper
32 procedure, pass(this) :: assign_to_field_wrapper => &
60 integer,
intent(in) :: size
64 allocate(this%items(size))
79 integer,
intent(in) :: i
80 f => this%items(i)%field
88 character(len=*),
intent(in) :: name
94 if (this%name(i) .eq. trim(name))
then
95 f => this%items(i)%field
101 write(error_unit,*)
"Current field list contents:"
103 do i = 1, this%size()
104 write(error_unit,*)
"- ", this%name(i)
108 call neko_error(
"No field with name " // trim(name) //
" found in list")
115 class(
field_t),
intent(in) :: f
119 len =
size(this%items)
122 tmp(1:len) = this%items
123 call move_alloc(tmp, this%items)
124 call this%items(len+1)%init(f)
131 integer :: i, n_fields
133 if (
allocated(this%items))
then
134 n_fields = this%size()
136 call this%items(i)%free()
138 deallocate(this%items)
147 integer,
intent(in) :: i
150 x_d = this%items(i)%field%x_d
155 real(kind=
rp),
pointer,
contiguous :: x(:,:,:,:)
156 integer,
intent(in) :: i
157 x => this%items(i)%field%x
164 integer,
intent(in) :: i
167 size = this%items(i)%field%size()
176 integer,
intent(in) :: i
179 call this%items(i)%init(f)
188 integer,
intent(in) :: i
191 call this%items(i)%init(wrapper%field)
198 integer,
intent(in) :: i
201 result => this%items(i)%field%dof
208 integer,
intent(in) :: i
209 type(
space_t),
pointer :: result
211 result => this%items(i)%field%Xh
218 integer,
intent(in) :: i
219 type(
mesh_t),
pointer :: result
221 result => this%items(i)%field%msh
228 integer,
intent(in) :: i
231 result = this%items(i)%field%internal_dofmap
238 integer,
intent(in) :: i
239 character(len=80) :: result
241 result = this%items(i)%field%name
integer, public pe_rank
MPI rank.
Defines a mapping of the degrees of freedom.
real(kind=rp) function, dimension(:,:,:,:), pointer, contiguous field_array_x(this, i)
type(field_t) function, pointer field_array_get_by_name(this, name)
Get an item pointer by array index.
type(field_t) function, pointer field_array_get_by_index(this, i)
Get an item pointer by array index.
subroutine field_array_assign_to_field_wrapper(this, i, wrapper)
Point item at a given index.
type(c_ptr) function field_array_x_d(this, i)
Get device pointer for a given index.
character(len=80) function field_array_name(this, i)
Get the name for an item in the list.
logical function field_array_internal_dofmap(this, i)
Whether the dofmap is internal for item i.
type(dofmap_t) function, pointer field_array_dof(this, i)
Get the the dofmap for item i.
pure integer function field_array_size(this)
Get number of items in the list.
subroutine field_array_free(this)
Destructor.
type(mesh_t) function, pointer field_array_msh(this, i)
Get the the mesh for item i.
integer function field_array_item_size(this, i)
Get the size of the dofmap for item i.
type(space_t) function, pointer field_array_space(this, i)
Get the the space for item i.
subroutine field_array_init(this, size)
Constructor. Just allocates the array.
subroutine field_array_append(this, f)
Append a field to the list, by copy assignment.
subroutine field_array_assign_to_field(this, i, f)
Assign item at a given index to field, by copy assignment.
integer, parameter, public rp
Global precision used in computations.
Defines a function space.
field_wrapper_t, used to wrap an allocated field for use in a field list
field_array_t, To be able to group fields together
The function space for the SEM solution fields.