37 use json_module,
only : json_file
58 procedure, pass(this) :: init_from_compenents => &
76 type(json_file),
intent(inout) :: json
78 type(
coef_t),
intent(in),
target :: coef
79 character(len=*),
intent(in) :: variable_name
80 real(kind=
rp) :: start_time, end_time
81 character(len=20),
allocatable :: field_names(:)
83 call json_get(json,
"field_names", field_names)
89 coef, start_time, end_time)
101 coef, start_time, end_time)
104 character(len=*),
intent(in) :: field_names(:)
105 type(
coef_t),
target :: coef
106 real(kind=
rp),
intent(in) :: start_time
107 real(kind=
rp),
intent(in) :: end_time
112 call this%init_base(fields, coef, start_time, end_time)
114 if (
size(field_names) .ne. fields%size())
then
115 call neko_error(
"Number of fields and field names inconsistent.")
118 call this%registry_fields%init(
size(field_names))
120 do i = 1,
size(field_names)
123 call neko_registry%add_field(this%coef%dof, field_names(i), &
124 ignore_existing = .true.)
125 call this%registry_fields%assign(i, &
135 call this%free_base()
136 call this%registry_fields%free()
145 integer :: n_fields, i, n
147 n_fields = this%fields%size()
150 call field_add2(this%fields%get(i), this%registry_fields%get(i))
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.
subroutine, public field_add2(a, b, n)
Vector addition .
Implements the field_source_term_t type.
subroutine field_source_term_compute(this, time)
Computes the source term and adds the result to fields.
subroutine field_source_term_init_from_components(this, fields, field_names, coef, start_time, end_time)
The constructor from type components.
subroutine field_source_term_free(this)
Destructor.
subroutine field_source_term_init_from_json(this, json, fields, coef, variable_name)
The common constructor using a JSON object.
Utilities for retrieving parameters from the case files.
integer, parameter, public rp
Global precision used in computations.
Defines a registry for storing solution fields.
type(registry_t), target, public neko_registry
Global field registry.
Implements the source_term_t type and a wrapper source_term_wrapper_t.
Module with things related to the simulation time.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
field_list_t, To be able to group fields together
A source term that grabs the values from fields in the registry. The fields are specified with the fi...
Base abstract type for source terms.
A struct that contains all info about the time, expand as needed.