Define integrand_ladvection, the 1D linear advection PDE test field that is a concrete extension of the abstract integrand type.
1D linear advection field.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=R_P), | public | :: | CFL | = | 0._R_P | CFL value. |
|
real(kind=R_P), | public | :: | Dx | = | 0._R_P | Space step. |
|
integer(kind=I_P), | public | :: | Ng | = | 0 | Ghost cells number. |
|
integer(kind=I_P), | public | :: | Ni | = | 0 | Space dimension. |
|
real(kind=R_P), | public | :: | a | = | 0._R_P | Advection coefficient. |
|
character(len=99), | public | :: | initial_state | Initial state. |
|||
class(interpolator_object), | public, | allocatable | :: | interpolator | WENO interpolator. |
||
real(kind=R_P), | public | :: | length | = | 0._R_P | Domain length. |
|
real(kind=R_P), | public, | allocatable | :: | u(:) | Integrand (state) variable. |
||
character(len=99), | public | :: | w_scheme | = | '' | WENO Scheme used. |
|
real(kind=R_P), | public | :: | weno_eps | = | 0._R_P | WENO epsilon to avoid division by zero, default value. |
|
integer(kind=I_P), | public | :: | weno_order | = | 0 | WENO reconstruction order. |
generic, public :: add_fast => integrand_add_integrand_fast | Overloading |
procedure, public, pass(lhs) :: assign_integrand |
|
procedure, public, pass(lhs) :: assign_real |
|
generic, public :: assignment(=) => assign_integrand, assign_real | Overloading |
procedure, public, pass(self) :: compute_dx | Compute the space step by means of CFL condition. |
procedure, public, pass(self) :: description | Return an informative description of the test. |
procedure, public, pass(self) :: destroy | Destroy field. |
procedure, public, pass(self) :: dt => compute_dt | Compute the current time step by means of CFL condition. |
procedure, public, pass(self) :: error | Return error. |
procedure, public, pass(self) :: exact_solution | Return exact solution. |
procedure, public, pass(self) :: export_tecplot | Export integrand to Tecplot file. |
procedure, private, pass(self) :: impose_boundary_conditions | Impose boundary conditions. |
procedure, public, pass(self) :: initialize | Initialize integrand. |
procedure, public, pass(lhs) :: integrand_add_integrand |
|
procedure, public, pass(opr) :: integrand_add_integrand_fast |
|
procedure, public, pass(lhs) :: integrand_add_real |
|
procedure, public, pass(self) :: integrand_dimension | Return integrand dimension. |
procedure, public, pass(lhs) :: integrand_multiply_integrand |
|
procedure, public, pass(opr) :: integrand_multiply_integrand_fast |
|
procedure, public, pass(lhs) :: integrand_multiply_real |
|
procedure, public, pass(lhs) :: integrand_multiply_real_scalar |
|
procedure, public, pass(opr) :: integrand_multiply_real_scalar_fast |
|
procedure, public, pass(lhs) :: integrand_sub_integrand |
|
procedure, public, pass(lhs) :: integrand_sub_real |
|
procedure, public, pass(opr) :: integrand_subtract_integrand_fast |
|
procedure, public, pass(lhs) :: local_error |
|
generic, public :: multiply_fast => integrand_multiply_integrand_fast, integrand_multiply_real_scalar_fast | Overloading |
generic, public :: operator(*) => integrand_multiply_integrand, integrand_multiply_real, real_multiply_integrand, integrand_multiply_real_scalar, real_scalar_multiply_integrand | Overloading |
generic, public :: operator(+) => integrand_add_integrand, integrand_add_real, real_add_integrand | Overloading |
generic, public :: operator(-) => integrand_sub_integrand, integrand_sub_real, real_sub_integrand | Overloading |
generic, public :: operator(.lterror.) => local_error | Estimate local truncation error. |
procedure, public, pass(self) :: output | Extract integrand state field. |
procedure, public, pass(self) :: parse_cli | Initialize from command line interface. |
procedure, public, pass(rhs) :: real_add_integrand |
|
procedure, public, pass(rhs) :: real_multiply_integrand |
|
procedure, public, pass(rhs) :: real_scalar_multiply_integrand |
|
procedure, public, pass(rhs) :: real_sub_integrand |
|
procedure, private, pass(self) :: reconstruct_interfaces | Reconstruct interface states. |
procedure, public, nopass :: set_cli | Set command line interface. |
procedure, private, pass(self) :: set_sin_wave_initial_state | Set initial state as a sin wave. |
procedure, private, pass(self) :: set_square_wave_initial_state | Set initial state as a square wave. |
generic, public :: subtract_fast => integrand_subtract_integrand_fast | Overloading |
procedure, public, pass(self) :: t => dU_dt | Time derivative, residuals. |
procedure, public, pass(self) :: t_fast | Time derivative, residuals, fast mode. |
Compute the current time step by means of CFL condition.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | self | Advection field. |
||
real(kind=R_P), | intent(in) | :: | final_time | Maximum integration time. |
||
real(kind=R_P), | intent(in), | optional | :: | t | Time. |
Time step.
Compute the space step step by means of CFL condition.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | self | Advection field. |
||
real(kind=R_P), | intent(in) | :: | Dt | Time step. |
Space step.
Time derivative of advection field, the residuals function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | self | Advection field. |
||
real(kind=R_P), | intent(in), | optional | :: | t | Time. |
Advection field time derivative.
Return informative integrator description.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | self | Integrand. |
||
character(len=*), | intent(in), | optional | :: | prefix | Prefixing string. |
Description.
Return error.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | self | Integrand. |
||
real(kind=R_P), | intent(in) | :: | t | Time. |
||
real(kind=R_P), | intent(in), | optional | :: | t0 | Initial time. |
|
class(integrand_object), | intent(in), | optional | :: | U0 | Initial conditions. |
Error.
Return exact solution.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | self | Integrand. |
||
real(kind=R_P), | intent(in) | :: | t | Time. |
||
real(kind=R_P), | intent(in), | optional | :: | t0 | Initial time. |
|
class(integrand_object), | intent(in), | optional | :: | U0 | Initial conditions. |
Exact solution.
+
operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | lhs | Left hand side. |
||
class(integrand_object), | intent(in) | :: | rhs | Right hand side. |
Operator result.
+ real
operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | lhs | Left hand side. |
||
real(kind=R_P), | intent(in) | :: | rhs(1:) | Right hand side. |
Operator result.
return integrand dimension.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | self | integrand. |
integrand dimension.
*
operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | lhs | Left hand side. |
||
class(integrand_object), | intent(in) | :: | rhs | Right hand side. |
Operator result.
* real_scalar
operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | lhs | Left hand side. |
||
real(kind=R_P), | intent(in) | :: | rhs(1:) | Right hand side. |
Operator result.
* real_scalar
operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | lhs | Left hand side. |
||
real(kind=R_P), | intent(in) | :: | rhs | Right hand side. |
Operator result.
-
operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | lhs | Left hand side. |
||
class(integrand_object), | intent(in) | :: | rhs | Right hand side. |
Operator result.
- real
operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | lhs | Left hand side. |
||
real(kind=R_P), | intent(in) | :: | rhs(1:) | Right hand side. |
Operator result.
Estimate local truncation error between 2 advection approximations.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | lhs | Left hand side. |
||
class(integrand_object), | intent(in) | :: | rhs | Right hand side. |
Error estimation.
Output the advection field state.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | self | Advection field. |
Advection state
real +
operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R_P), | intent(in) | :: | lhs(1:) | Left hand side. |
||
class(integrand_ladvection), | intent(in) | :: | rhs | Left hand side. |
Operator result.
real_scalar *
operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R_P), | intent(in) | :: | lhs(1:) | Left hand side. |
||
class(integrand_ladvection), | intent(in) | :: | rhs | Right hand side. |
Operator result.
real_scalar *
operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R_P), | intent(in) | :: | lhs | Left hand side. |
||
class(integrand_ladvection), | intent(in) | :: | rhs | Right hand side. |
Operator result.
real -
operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R_P), | intent(in) | :: | lhs(1:) | Left hand side. |
||
class(integrand_ladvection), | intent(in) | :: | rhs | Left hand side. |
Operator result.
=
operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(inout) | :: | lhs | Left hand side. |
||
class(integrand_object), | intent(in) | :: | rhs | Right hand side. |
Assign one real to an advection field.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(inout) | :: | lhs | Left hand side. |
||
real(kind=R_P), | intent(in) | :: | rhs(1:) | Right hand side. |
Destroy field.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(inout) | :: | self | Advection field. |
Export integrand to Tecplot file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | self | Advection field. |
||
character(len=*), | intent(in), | optional | :: | file_name | File name. |
|
real(kind=R_P), | intent(in), | optional | :: | t | Time. |
|
character(len=*), | intent(in), | optional | :: | scheme | Scheme used to integrate integrand. |
|
logical, | intent(in), | optional | :: | close_file | Flag for closing file. |
|
logical, | intent(in), | optional | :: | with_exact_solution | Flag for export also exact solution. |
|
class(integrand_object), | intent(in), | optional | :: | U0 | Initial conditions. |
Impose boundary conditions.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | self | Advection field. |
||
real(kind=R_P), | intent(inout) | :: | u(1-self%Ng:) | Conservative variables. |
Initialize integrand.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(inout) | :: | self | Integrand. |
||
real(kind=R_P), | intent(in) | :: | Dt | Time step. |
Initialize from command line interface.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(inout) | :: | self | Advection field. |
||
type(command_line_interface), | intent(inout) | :: | cli | Command line interface handler. |
Reconstruct interfaces states.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | self | Advection field. |
||
real(kind=R_P), | intent(in) | :: | conservative(1-self%Ng:) | Conservative variables. |
||
real(kind=R_P), | intent(inout) | :: | r_conservative(1:,0:) | Reconstructed conservative vars. |
Set command line interface.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(command_line_interface), | intent(inout) | :: | cli | Command line interface handler. |
Set initial state as a sin wave.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(inout) | :: | self | Advection field. |
Set initial state as a square wave.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(inout) | :: | self | Advection field. |