34 use,
intrinsic :: iso_fortran_env, only : error_unit
36 use iso_c_binding,
only : c_ptr
56 generic :: get => get_by_index, get_by_name
62 generic :: assign => assign_to_field, assign_to_field_wrapper
64 procedure, pass(this) :: assign_to_field_wrapper => &
92 integer,
intent(in) :: size
96 allocate(this%items(size))
111 integer,
intent(in) :: i
112 f => this%items(i)%field
120 character(len=*),
intent(in) :: name
125 do i = 1, this%size()
126 if (this%name(i) .eq. trim(name))
then
127 f => this%items(i)%field
133 write(error_unit,*)
"Current field list contents:"
135 do i = 1, this%size()
136 write(error_unit,*)
"- ", this%name(i)
140 call neko_error(
"No field with name " // trim(name) //
" found in list")
147 class(
field_t),
intent(in) :: f
151 len =
size(this%items)
154 tmp(1:len) = this%items
155 call move_alloc(tmp, this%items)
156 call this%items(len+1)%init(f)
163 integer :: i, n_fields
165 if (
allocated(this%items))
then
166 n_fields = this%size()
168 call this%items(i)%free()
170 deallocate(this%items)
179 integer,
intent(in) :: i
182 x_d = this%items(i)%field%x_d
187 real(kind=
rp),
pointer,
contiguous :: x(:,:,:,:)
188 integer,
intent(in) :: i
189 x => this%items(i)%field%x
196 integer,
intent(in) :: i
199 size = this%items(i)%field%size()
208 integer,
intent(in) :: i
211 call this%items(i)%init(f)
220 integer,
intent(in) :: i
223 call this%items(i)%init(wrapper%field)
230 integer,
intent(in) :: i
233 result => this%items(i)%field%dof
240 integer,
intent(in) :: i
241 type(
space_t),
pointer :: result
243 result => this%items(i)%field%Xh
250 integer,
intent(in) :: i
251 type(
mesh_t),
pointer :: result
253 result => this%items(i)%field%msh
260 integer,
intent(in) :: i
263 result = this%items(i)%field%internal_dofmap
270 integer,
intent(in) :: i
271 character(len=80) :: result
273 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.