m_base_case Module

Provides the base case for running a simulation. New cases are implemented by extending this to specify the initial and boundary conditions, forcing terms and case-specific postprocessing and analysis.



Abstract Interfaces

abstract interface

  • public subroutine boundary_conditions(self)

    Applies case-specific boundary coinditions

    Arguments

    Type IntentOptional Attributes Name
    class(base_case_t) :: self

abstract interface

  • public subroutine initial_conditions(self)

    Sets case-specific initial conditions

    Arguments

    Type IntentOptional Attributes Name
    class(base_case_t) :: self

abstract interface

  • public subroutine forcings(self, du, dv, dw)

    Applies case-specific or model realated forcings after transeq

    Arguments

    Type IntentOptional Attributes Name
    class(base_case_t) :: self
    class(field_t), intent(inout) :: du
    class(field_t), intent(inout) :: dv
    class(field_t), intent(inout) :: dw

abstract interface

  • public subroutine postprocess(self, i, t)

    Triggers case-specific postprocessings at user specified intervals

    Arguments

    Type IntentOptional Attributes Name
    class(base_case_t) :: self
    integer, intent(in) :: i
    real(kind=dp), intent(in) :: t

Derived Types

type, public, abstract ::  base_case_t

Components

Type Visibility Attributes Name Initial
class(solver_t), public, allocatable :: solver

Type-Bound Procedures

procedure(boundary_conditions), public, deferred :: boundary_conditions
procedure(initial_conditions), public, deferred :: initial_conditions
procedure(forcings), public, deferred :: forcings
procedure(postprocess), public, deferred :: postprocess
procedure, public :: case_init
procedure, public :: set_init
procedure, public :: run
procedure, public :: print_enstrophy
procedure, public :: print_div_max_mean

Subroutines

public subroutine case_init(self, backend, mesh, host_allocator)

Arguments

Type IntentOptional Attributes Name
class(base_case_t) :: self
class(base_backend_t), intent(inout), target :: backend
type(mesh_t), intent(inout), target :: mesh
type(allocator_t), intent(inout), target :: host_allocator

public subroutine set_init(self, field, field_func)

Arguments

Type IntentOptional Attributes Name
class(base_case_t) :: self
class(field_t), intent(inout) :: field
public pure function field_func(coords) result(r)
Arguments
Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: coords(3)
Return Value real(kind=dp)

public subroutine print_enstrophy(self, u, v, w)

Reports the enstrophy

Arguments

Type IntentOptional Attributes Name
class(base_case_t), intent(in) :: self
class(field_t), intent(in) :: u
class(field_t), intent(in) :: v
class(field_t), intent(in) :: w

public subroutine print_div_max_mean(self, u, v, w)

Reports the div(u) at cell centres

Arguments

Type IntentOptional Attributes Name
class(base_case_t), intent(in) :: self
class(field_t), intent(in) :: u
class(field_t), intent(in) :: v
class(field_t), intent(in) :: w

public subroutine run(self)

Runs the solver forwards in time from t=t_0 to t=T, performing postprocessing/IO and reporting diagnostics.

Arguments

Type IntentOptional Attributes Name
class(base_case_t), intent(inout) :: self