Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
source_term_template.f90
Go to the documentation of this file.
1
3 use coefs, only : coef_t
4 use field_list, only : field_list_t
5 use json_module, only : json_file
6 use num_types, only : rp
8 register_source_term
9 use time_state, only : time_state_t
10 implicit none
11 private
12
14 contains
15 procedure :: init => source_term_template_init
16 procedure :: free => source_term_template_free
17 procedure :: compute_ => source_term_template_compute
19
21
22contains
23
24 subroutine source_term_template_init(this, json, fields, coef, variable_name)
25 class(source_term_template_t), intent(inout) :: this
26 type(json_file), intent(inout) :: json
27 type(field_list_t), target, intent(in) :: fields
28 type(coef_t), target, intent(in) :: coef
29 character(len=*), intent(in) :: variable_name
30
31 call this%free()
32 ! TODO: Read source-term-specific parameters from json.
33 call this%init_base(fields, coef, 0.0_rp, huge(0.0_rp))
34 end subroutine source_term_template_init
35
37 class(source_term_template_t), intent(inout) :: this
38 ! TODO: Release fields owned by this derived type.
39 call this%free_base()
40 end subroutine source_term_template_free
41
42 subroutine source_term_template_compute(this, time)
43 class(source_term_template_t), intent(inout) :: this
44 type(time_state_t), intent(in) :: time
45 ! TODO: Add this source term to this%fields.
46 end subroutine source_term_template_compute
47
49 procedure(source_term_allocate), pointer :: allocator
51 call register_source_term('source_term_template', allocator)
53
55 class(source_term_t), allocatable, intent(inout) :: obj
56 allocate(source_term_template_t :: obj)
58end module source_term_template
Source term factory. Both constructs and initializes the object.
Coefficients.
Definition coef.f90:34
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:14
Template for a user-defined source term.
subroutine source_term_template_init(this, json, fields, coef, variable_name)
subroutine, public source_term_template_register_types()
subroutine source_term_template_compute(this, time)
subroutine source_term_template_free(this)
subroutine source_term_template_allocate(obj)
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,...
Definition coef.f90:93
field_list_t, To be able to group fields together
Base abstract type for source terms.
A struct that contains all info about the time, expand as needed.