Encapsulate scalar-field state and operations, storing a mesh association in the parent field
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private, | allocatable | :: | bmat(:) | |||
real(kind=psb_dpk_), | private, | allocatable | :: | bx(:) | face values |
||
integer, | private, | allocatable | :: | mat(:) | |||
real(kind=psb_dpk_), | private, | allocatable | :: | x(:) | field nodal values |
||
real(kind=psb_dpk_), | private, | allocatable | :: | xp(:) | previous nodal values |
Result is new scalar_field from parent field
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(field), | intent(in) | :: | base | |||
real(kind=psb_dpk_), | intent(in) | :: | x(:) | |||
real(kind=psb_dpk_), | intent(in) | :: | bx(:) |
User-defined assignment
----- Algebra Operations -----
----- Algebra Operations -----
----- Destructor -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(field), | intent(in), | target | :: | fld |
----- Destructor -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(field), | intent(in) | :: | f1 | |||
type(field), | intent(in) | :: | f2 | |||
character(len=*), | intent(in) | :: | where |
----- Destructor -----
----- Algebra Operations -----
----- Destructor -----
Constructor Mandatory arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(field), | intent(out) | :: | fld | |||
type(mesh), | intent(in), | target | :: | msh | Optional arguments |
|
type(dimensions), | intent(in), | optional | :: | dim | ||
type(bc_poly), | intent(in), | optional | target | :: | bc(:) | |
type(matptr), | intent(in), | optional | target | :: | mats(:) | |
logical, | intent(in), | optional | :: | on_faces | ||
character(len=*), | intent(in), | optional | :: | name |
Constructor
----- Algebra Operations -----
Define scalar_field from mesh, dimensions, boundary conditions, materials, face-centeredness, and values
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(out) | :: | fld | |||
type(mesh), | intent(in), | target | :: | msh | ||
type(dimensions), | intent(in), | optional | :: | dim | ||
type(bc_poly), | intent(in), | optional | target | :: | bc(:) | |
type(matptr), | intent(in), | optional | target | :: | mats(:) | |
logical, | intent(in), | optional | :: | on_faces | ||
real(kind=psb_dpk_), | intent(in), | optional | :: | x0 | ||
character(len=*), | intent(in), | optional | :: | name |
----- Destructor -----
----- Algebra Operations -----
----- Algebra Operations -----
----- Destructor -----
Destructor
----- Algebra Operations -----
Deallocate scalar_field components: field parent and component arrays
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(inout) | :: | fld |
----- Algebra Operations -----
Get parent field
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | fld | |||
type(field), | intent(out) | :: | base |
----- Algebra Operations -----
----- Destructor -----
----- Destructor -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(field), | intent(in) | :: | fld | |||
type(mesh), | pointer | :: | msh |
----- Algebra Operations -----
Result is scalar_field material identifier
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | fld | |||
integer, | intent(in) | :: | i |
----- Algebra Operations -----
----- Algebra Operations -----
----- Algebra Operations -----
----- Algebra Operations -----
----- Algebra Operations -----
Mark the object as user-defined
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(object), | intent(inout) | :: | this |
----- Destructor -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(field), | intent(in) | :: | fld | |||
integer, | intent(in), | optional | :: | i |
----- Destructor -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(field), | intent(in), | target | :: | fld |
----- Destructor -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(field), | intent(in) | :: | fld |
----- Algebra Operations -----
Result is the scalar_field size
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | fld |
Getters
----- Destructor -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(field), | intent(in) | :: | fld |
Algebra operations
----- Algebra Operations -----
----- Algebra Operations -----
----- Algebra Operations -----
----- Algebra Operations -----
----- Algebra Operations -----
----- Algebra Operations -----
----- Destructor -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(field), | intent(inout) | :: | fld | |||
type(dimensions), | intent(in) | :: | dim |
----- Algebra Operations -----
----- Algebra Operations -----
Setters
----- Destructor -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(field), | intent(inout) | :: | fld | |||
logical, | intent(in) | :: | on_faces |
----- Algebra Operations -----
Return a boolean result indicating whether this object has been initialized since its declaration
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(object), | intent(in) | :: | this |
----- Algebra Operations -----
Set the left-hand-side scalar_field values to the provided constant
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(inout) | :: | f | |||
real(kind=psb_dpk_), | intent(in) | :: | x |
----- Algebra Operations -----
Set the left-hand-side scalar_field values to the provided values
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(inout) | :: | f | |||
real(kind=psb_dpk_), | intent(in) | :: | x(:) |
----- Algebra Operations -----
Abort iff the scalar_field arguments are not associated with the same mesh
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | f1 | |||
type(scalar_field), | intent(in) | :: | f2 | |||
character(len=*), | intent(in) | :: | where |
----- Algebra Operations -----
get scalar_field boundary values
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | fld | |||
real(kind=psb_dpk_), | intent(out), | allocatable | :: | bx(:) |
----- Algebra Operations -----
get one scalar_field value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | fld | |||
real(kind=psb_dpk_), | intent(out) | :: | x | |||
integer, | intent(in) | :: | i |
----- Algebra Operations -----
get one scalar_field previous value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | fld | |||
real(kind=psb_dpk_), | intent(out) | :: | xp | |||
integer, | intent(in) | :: | i |
----- Algebra Operations -----
get all scalar_field values
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | fld | |||
real(kind=psb_dpk_), | intent(out), | allocatable | :: | x(:) |
----- Algebra Operations -----
Get all scalar_field previous values
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | fld | |||
real(kind=psb_dpk_), | intent(out), | allocatable | :: | xp(:) |
----- Algebra Operations -----
Result contains scalar_field cell values interpolated onto cell faces
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | fld |
----- Algebra Operations -----
Result is L1 norm of scalar_field
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | fld |
----- Algebra Operations -----
Result is infinity-norm of scalar_field
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | fld |
----- Algebra Operations -----
Result is the arithmetic difference of the two scalar_field operands
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | f1 | |||
type(scalar_field), | intent(in) | :: | f2 |
----- Algebra Operations -----
Result is the arithmetic difference of the scalar_field operand and the constant operand
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | f1 | |||
real(kind=psb_dpk_), | intent(in) | :: | f2 |
----- Algebra Operations -----
Result is the ratio of the left-hand-side numerator and right-hand-side denominator scalar_field objects
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | f1 | |||
type(scalar_field), | intent(in) | :: | f2 |
----- Algebra Operations -----
REsult is the arithmetic product of two scalar_field objects
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | f1 | |||
type(scalar_field), | intent(in) | :: | f2 |
----- Algebra Operations -----
Rescale the scalar_field argument by the provided multiplicative constant
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=psb_dpk_), | intent(in) | :: | a | |||
class(scalar_field), | intent(in) | :: | f |
----- Algebra Operations -----
Result is the arithmetic sum of the two scalar_field operands
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(in) | :: | f1 | |||
type(scalar_field), | intent(in) | :: | f2 |
----- Algebra Operations -----
Set one scalar_field value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(inout) | :: | f | |||
integer, | intent(in) | :: | i | element number to set |
||
real(kind=psb_dpk_), | intent(in) | :: | x | value |
----- Algebra Operations -----
Set a group of scalar field values
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(inout) | :: | f | |||
integer, | intent(in) | :: | ig | |||
real(kind=psb_dpk_), | intent(in) | :: | x |
----- Algebra Operations -----
Set all scalar_field values
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(scalar_field), | intent(inout) | :: | fld | |||
type(matptr), | intent(in), | pointer | :: | mats(:) | ||
type(scalar_field), | intent(in), | optional | :: | temp | temperature |
TYPE, EXTENDS(field) :: scalar_field
!! label: Morfeus-FV
!!
!! Encapsulate scalar-field state and operations, storing a mesh association in the parent field
!!
PRIVATE
REAL(psb_dpk_), ALLOCATABLE :: x(:) !! field nodal values
REAL(psb_dpk_), ALLOCATABLE :: xp(:) !! previous nodal values
REAL(psb_dpk_), ALLOCATABLE :: bx(:) !! face values
INTEGER, ALLOCATABLE :: mat(:)
INTEGER, ALLOCATABLE :: bmat(:)
CONTAINS
PROCEDURE, PUBLIC :: create_scalar_field !! Constructor
PROCEDURE, PUBLIC :: free_field !! Destructor
PROCEDURE, PUBLIC :: get_base
PROCEDURE, PRIVATE :: get_scalar_field_x, get_scalar_field_element
GENERIC, PUBLIC :: get_x => get_scalar_field_x, get_scalar_field_element
PROCEDURE, PRIVATE :: get_scalar_field_xp, get_scalar_field_element_prev
GENERIC, PUBLIC :: get_xp => get_scalar_field_xp, get_scalar_field_element_prev
PROCEDURE, PRIVATE :: get_scalar_field_bx
GENERIC, PUBLIC :: get_bx => get_scalar_field_bx
PROCEDURE :: get_scalar_field_mat_id
PROCEDURE, PRIVATE :: update_scalar_field
GENERIC, PUBLIC :: update_field => update_scalar_field
PROCEDURE, PRIVATE :: set_scalar_field_element, set_scalar_field_group
GENERIC, PUBLIC :: set_field_element => set_scalar_field_element
GENERIC, PUBLIC :: set_field_group => set_scalar_field_group
PROCEDURE,PRIVATE :: interp_on_faces_s
GENERIC, PUBLIC :: interp_on_faces => interp_on_faces_s
PROCEDURE, PRIVATE :: nemo_scalar_field_normi, nemo_scalar_field_norm1
GENERIC, PUBLIC :: field_normi => nemo_scalar_field_normi
GENERIC, PUBLIC :: field_norm1 => nemo_scalar_field_norm1
PROCEDURE, PRIVATE :: scalar_field_sum, scalar_field_dif, scalar_field_dif_s
PROCEDURE, PRIVATE :: scalar_field_div
PROCEDURE, PASS(f), PRIVATE :: scalar_field_scal
PROCEDURE, PRIVATE :: scalar_field_mul
PROCEDURE, PRIVATE :: assign_scalar_field_s, assign_scalar_field_v
GENERIC :: ASSIGNMENT(=) => assign_scalar_field_s, assign_scalar_field_v !! User-defined assignment
GENERIC :: OPERATOR(*) => scalar_field_scal, scalar_field_mul !! Algebra operations
GENERIC :: OPERATOR(+) => scalar_field_sum
GENERIC :: OPERATOR(-) => scalar_field_dif, scalar_field_dif_s
GENERIC :: OPERATOR(/) => scalar_field_div
PROCEDURE, PUBLIC :: nemo_sizeof
PROCEDURE, PRIVATE :: check_mesh_consistency_sf
GENERIC, PUBLIC :: check_mesh_consistency => check_mesh_consistency_sf
END TYPE scalar_field