Provides an extension of the uniform field type which also appears to have a uniform gradient. This was written to allow some of the same code used when solving the plume in a Runge-Kutta solver, where I pass in uniform fields rather than ones using a Chebyshev grid.
Creates a new scalar field with a uniform value across all of space but a non-zero gradient.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r8), | intent(in) | :: | val | The value of the field |
||
real(kind=r8), | intent(in), | dimension(:) | :: | grad | An array in which the |
A scalar field initated based on teh arguments of this function.
A type of uniform field which also has a uniform gradient. Of course, this is impossible in practice, but it can be useful for tricking certain routines into working properly. Ideally a whole new derived type would be created which just holds the value and gradient at a single point, but the emphasis is on getting something quickly. Note that the gradient is not propagated across operations--the result of all overloaded operators is just a normal uniform field with no gradient.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=r8), | public, | dimension(:), allocatable | :: | grad | The values of the gradient in each direction. |
private function constructor(val, grad) | Creates a new scalar field with a uniform value across all of space but a non-zero gradient. |
procedure, public :: d_dx => uniform_gradient_d_dx |
|
procedure, private :: gradient => uniform_gradient_gradient |
|
procedure, private :: is_equal => uniform_gradient_is_equal | Checks fields are equal within a tolerance |
procedure, private :: assign_field => uniform_gradient_assign |
|
Creates a new scalar field with a uniform value across all of space but a non-zero gradient.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r8), | intent(in) | :: | val | The value of the field |
||
real(kind=r8), | intent(in), | dimension(:) | :: | grad | An array in which the |
A scalar field initated based on teh arguments of this function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(uniform_gradient_field), | intent(in) | :: | this | |||
integer, | intent(in) | :: | dir | Direction in which to differentiate |
||
integer, | intent(in), | optional | :: | order | Order of the derivative, default = 1 |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(uniform_gradient_field), | intent(in) | :: | this |
The result of this operation
Evaluates whether two scalar fields are equal within a tolerance,
specified by set_tol
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(uniform_gradient_field), | intent(in) | :: | this | |||
class(scalar_field), | intent(in) | :: | rhs |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(uniform_gradient_field), | intent(inout) | :: | this | |||
class(scalar_field), | intent(in) | :: | rhs |