Neko 0.9.99
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
scalar_user_source_term::scalar_user_source_term_t Type Referenceabstract

A source-term for the scalar, with procedure pointers pointing to the actual implementation in the user file. More...

Inheritance diagram for scalar_user_source_term::scalar_user_source_term_t:
Collaboration diagram for scalar_user_source_term::scalar_user_source_term_t:

Public Member Functions

procedure, pass(thisinit (this, json, fields, coef)
 Constructor from JSON (will throw!).
 
procedure, pass(thisinit_from_components (this, fields, coef, source_term_type, eval_vector, eval_pointwise)
 Constructor from components.
 
procedure, pass(thisfree (this)
 Destructor.
 
procedure, pass(thiscompute_ (this, t, tstep)
 Computes the source term and adds the result to fields.
 
procedure, pass(thisinit_base (this, fields, coef, start_time, end_time)
 Constructor for the source_term_t (base) type.
 
procedure, pass(thisfree_base (this)
 Destructor for the source_term_t (base) type.
 
procedure, pass(thiscompute (this, t, tstep)
 Executes compute_ based on time conditions.
 
procedure(source_term_init), deferred, pass init (this, json, fields, coef)
 The common constructor using a JSON object.
 
procedure(source_term_free), deferred, pass free (this)
 Destructor.
 
procedure(source_term_compute), deferred, pass compute_ (this, t, tstep)
 Computes the source term and adds the result to fields.
 

Public Attributes

type(dofmap_t), pointer dm
 Pointer to the dofmap of the right-hand-side fields.
 
real(kind=rp), dimension(:, :, :, :), allocatable s
 The source term.
 
type(c_ptr) s_d = C_NULL_PTR
 Device pointer for s.
 
type(field_list_tfields
 The fields to be updated with the source term values.
 
type(coef_t), pointer coef => null()
 Coefficients for the SEM.
 
real(kind=rp) start_time = 0.0_rp
 Start time for adding the source term.
 
real(kind=rp) end_time = huge(0.0_rp)
 End time for adding the source term.
 

Static Public Attributes

procedure(scalar_source_compute_pointwise), pointer, nopass compute_pw_ => null()
 Compute the source term for a single point.
 
procedure(scalar_source_compute_vector), pointer, nopass compute_vector_ => null()
 Compute the source term for the entire boundary.
 

Detailed Description

The user source term can be applied either pointiwse or acting on the whole array in a single call, which is referred to as "vector" application.

Warning
The user source term does not support init from JSON and should instead be directly initialized from components.

Definition at line 60 of file scalar_user_source_term.f90.

Member Function/Subroutine Documentation

◆ compute()

procedure, pass(this) source_term::source_term_t::compute ( class(source_term_t), intent(inout this,
real(kind=rp), intent(in t,
integer, intent(in tstep 
)
inherited
Parameters
tTime value.
tstepCurrent time step.

Definition at line 58 of file source_term.f90.

◆ compute_() [1/2]

procedure, pass(this) scalar_user_source_term::scalar_user_source_term_t::compute_ ( class(scalar_user_source_term_t), intent(inout this,
real(kind=rp), intent(in t,
integer, intent(in tstep 
)
Parameters
tThe time value.
tstepThe current time-step.

Definition at line 83 of file scalar_user_source_term.f90.

◆ compute_() [2/2]

procedure(source_term_compute), deferred, pass source_term::source_term_t::compute_ ( class(source_term_t), intent(inout this,
real(kind=rp), intent(in t,
integer, intent(in tstep 
)
pure virtualinherited

Definition at line 64 of file source_term.f90.

◆ free() [1/2]

procedure, pass(this) scalar_user_source_term::scalar_user_source_term_t::free ( class(scalar_user_source_term_t), intent(inout this)

Definition at line 81 of file scalar_user_source_term.f90.

◆ free() [2/2]

procedure(source_term_free), deferred, pass source_term::source_term_t::free ( class(source_term_t), intent(inout this)
pure virtualinherited

Definition at line 62 of file source_term.f90.

◆ free_base()

procedure, pass(this) source_term::source_term_t::free_base ( class(source_term_t), intent(inout this)
inherited

Definition at line 56 of file source_term.f90.

◆ init() [1/2]

procedure, pass(this) scalar_user_source_term::scalar_user_source_term_t::init ( class(scalar_user_source_term_t), intent(inout this,
type(json_file), intent(inout json,
type(field_list_t), intent(in), target  fields,
type(coef_t), intent(in), target  coef 
)

This will throw, as the user source term should be initialized directly from components.

Definition at line 76 of file scalar_user_source_term.f90.

◆ init() [2/2]

procedure(source_term_init), deferred, pass source_term::source_term_t::init ( class(source_term_t), intent(inout this,
type(json_file), intent(inout json,
type(field_list_t), intent(in), target  fields,
type(coef_t), intent(in), target  coef 
)
pure virtualinherited

Definition at line 60 of file source_term.f90.

◆ init_base()

procedure, pass(this) source_term::source_term_t::init_base ( class(source_term_t), intent(inout this,
type(field_list_t fields,
type(coef_t), intent(in), target  coef,
real(kind=rp), intent(in start_time,
real(kind=rp), intent(in end_time 
)
inherited
Parameters
jsonJSON object initializing the source term.
fieldsThe list of fields updated by the source term.
coefThe SEM coefficients. Constructor for the source_term_t (base) type.
fieldsA list of pointers to fields to be updated by the source term.
coefSEM coefs.
start_timeWhen to start adding the source term.
end_timeWhen to stop adding the source term.

Definition at line 54 of file source_term.f90.

◆ init_from_components()

procedure, pass(this) scalar_user_source_term::scalar_user_source_term_t::init_from_components ( class(scalar_user_source_term_t), intent(inout this,
type(field_list_t), intent(in), target  fields,
type(coef_t), intent(in coef,
character(len=*)  source_term_type,
procedure(scalar_source_compute_vector), optional  eval_vector,
procedure(scalar_source_compute_pointwise), optional  eval_pointwise 
)
Parameters
fieldsA list with 1 field for adding the source values.
coefThe SEM coeffs.
sourc_term_typeThe type of the user source term, "user_vector" or "user_pointwise".
eval_vectorThe procedure to vector-compute the source term.
eval_pointwiseThe procedure to pointwise-compute the source term.

Definition at line 78 of file scalar_user_source_term.f90.

Member Data Documentation

◆ coef

type(coef_t), pointer source_term::source_term_t::coef => null()
inherited

Definition at line 47 of file source_term.f90.

◆ compute_pw_

procedure(scalar_source_compute_pointwise), pointer, nopass scalar_user_source_term::scalar_user_source_term_t::compute_pw_ => null()
static

Definition at line 69 of file scalar_user_source_term.f90.

◆ compute_vector_

procedure(scalar_source_compute_vector), pointer, nopass scalar_user_source_term::scalar_user_source_term_t::compute_vector_ => null()
static

Definition at line 72 of file scalar_user_source_term.f90.

◆ dm

type(dofmap_t), pointer scalar_user_source_term::scalar_user_source_term_t::dm

Definition at line 62 of file scalar_user_source_term.f90.

◆ end_time

real(kind=rp) source_term::source_term_t::end_time = huge(0.0_rp)
inherited

Definition at line 51 of file source_term.f90.

◆ fields

type(field_list_t) source_term::source_term_t::fields
inherited

Definition at line 45 of file source_term.f90.

◆ s

real(kind=rp), dimension(:, :, :, :), allocatable scalar_user_source_term::scalar_user_source_term_t::s

Definition at line 64 of file scalar_user_source_term.f90.

◆ s_d

type(c_ptr) scalar_user_source_term::scalar_user_source_term_t::s_d = C_NULL_PTR

Definition at line 67 of file scalar_user_source_term.f90.

◆ start_time

real(kind=rp) source_term::source_term_t::start_time = 0.0_rp
inherited

Definition at line 49 of file source_term.f90.


The documentation for this type was generated from the following file: