37 use json_module,
only : json_file
53 real(kind=
rp),
allocatable :: values(:)
58 procedure, pass(this) :: init_from_compenents => &
73 type(json_file),
intent(inout) :: json
75 type(
coef_t),
intent(inout),
target :: coef
76 real(kind=
rp),
allocatable :: values(:)
77 real(kind=
rp) :: start_time, end_time
79 call json_get(json,
"values", values)
96 coef, start_time, end_time)
99 real(kind=
rp),
intent(in) :: values(:)
101 real(kind=
rp),
intent(in) :: start_time
102 real(kind=
rp),
intent(in) :: end_time
105 call this%init_base(fields, coef, start_time, end_time)
107 if (
size(values) .ne. fields%size())
then
108 call neko_error(
"Number of fields and values inconsistent.")
118 call this%free_base()
126 real(kind=
rp),
intent(in) :: t
127 integer,
intent(in) :: tstep
128 integer :: n_fields, i, n
130 n_fields = this%fields%size()
132 n = this%fields%item_size(1)
Retrieves a parameter by name or assigns a provided default value. In the latter case also adds the m...
Retrieves a parameter by name or throws an error.
Implements the cpu kernel for the const_source_term_t type.
subroutine, public const_source_term_compute_cpu(fields, values)
Computes the constant source term on the cpu.
Implements the device kernel for the const_source_term_t type.
subroutine, public const_source_term_compute_device(fields, values)
Computes the constant source term on the device.
Implements the const_source_term_t type.
subroutine const_source_term_free(this)
Destructor.
subroutine const_source_term_init_from_components(this, fields, values, coef, start_time, end_time)
The constructor from type components.
subroutine const_source_term_compute(this, t, tstep)
Computes the source term and adds the result to fields.
subroutine const_source_term_init_from_json(this, json, fields, coef)
The common constructor using a JSON object.
Utilities for retrieving parameters from the case files.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Implements the source_term_t type and a wrapper source_term_wrapper_t.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
A constant source term. The strength is specified with the values keyword, which should be an array,...
field_list_t, To be able to group fields together
Base abstract type for source terms.