39 use json_module,
only : json_file
48 type(
coef_t),
pointer :: coef => null()
50 real(kind=
rp) :: start_time = 0.0_rp
52 real(kind=
rp) :: end_time = huge(0.0_rp)
86 type(json_file),
intent(inout) :: json
88 type(
coef_t),
intent(inout) :: coef
107 real(kind=
rp),
intent(in) :: t
108 integer,
intent(in) :: tstep
123 type(
coef_t),
intent(inout),
target :: coef
124 real(kind=
rp),
intent(in) :: start_time
125 real(kind=
rp),
intent(in) :: end_time
126 integer :: n_fields, i
129 this%start_time = start_time
130 this%end_time = end_time
131 n_fields =
size(fields%fields)
132 allocate(this%fields%fields(n_fields))
137 this%fields%fields(i)%f => fields%fields(i)%f
145 call this%fields%free()
152 integer :: n_fields, i
154 if (
allocated(this%source_term))
then
155 call this%source_term%free()
156 deallocate(this%source_term)
165 real(kind=
rp),
intent(in) :: t
166 integer,
intent(in) :: tstep
168 if (t .ge. this%start_time .and. t .le. this%end_time)
then
169 call this%compute_(t, tstep)
Computes the source term and adds the result to fields.
The common constructor using a JSON object.
integer, parameter, public rp
Global precision used in computations.
Implements the source_term_t type and a wrapper source_term_wrapper_t.
subroutine source_term_wrapper_free(this)
Destructor for the source_term_wrapper_t type.
subroutine source_term_compute_wrapper(this, t, tstep)
Executes compute_ based on time conditions.
subroutine source_term_free_base(this)
Destructor for the source_term_t (base) type.
subroutine source_term_init_base(this, fields, coef, start_time, end_time)
Constructor for the source_term_t (base) type.
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
Base abstract type for source terms.
A helper type that is needed to have an array of polymorphic objects.