Base structure for a collection of Lagrangian objects.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(block_obj), | public, | pointer | :: | block | => | null() |
Associated block structure |
| integer, | public | :: | count | = | 0 |
Total count across all MPI ranks |
|
| integer, | public | :: | count_ | = | 0 |
Local count for this rank |
|
| integer, | public, | allocatable | :: | count_proc(:) |
Nbr of lagrangian objects per proc |
||
| procedure(kernel_1D), | public, | pointer, nopass | :: | g1ex | => | int_g1_triangle |
1D kernel used in extrapolations |
| procedure(kernel_1D), | public, | pointer, nopass | :: | g1in | => | g1_triangle |
1D kernel used in interpolations |
| logical, | public | :: | is_initialized | = | .false. |
Flag to determine whether this has been initialized |
|
| real(kind=wp), | public | :: | l_filter |
Half filter width |
|||
| character(len=:), | public, | allocatable | :: | name |
Name of the Lagrangian set |
||
| logical, | public | :: | overwrite | = | .true. |
Switch to overwrite IO files |
|
| class(lagrangian_obj), | public, | allocatable | :: | p(:) |
Array of Lagrangian_obj or any extended type |
||
| type(parallel_obj), | public, | pointer | :: | parallel | => | null() |
Associated parallel structure |
| character(len=str64), | public | :: | read_file |
File to read |
|||
| class(lagrangian_obj), | public, | allocatable | :: | sample |
Sample used in allocation of polymorphic data |
||
| integer, | public | :: | stib | = | 3 |
Stencil size for filtering |
|
| character(len=str64), | public | :: | write_file |
File to write |
|||
| integer, | private | :: | MPI_SIZE | = | 44 |
MPI size |
|
| type(MPI_Datatype), | private | :: | MPI_TYPE |
MPI variable type |
Applies periodic boundary conditions.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
Communicates lagrangian objects across MPI_rank. This subroutine relies on a rank locator procedure (GetOwnerRankOpt) to determine the rank that should own each Lagrangian object. The default rank locator is the one provided by the block object associated with this Lagrangian_set. From there, each rank will send objects that they no longer own and receive objects from other ranks that belongs to it. Note that this subroutine allocates an array (buf_send) of size (MAX NUMBER of OBJECTS to SEND) x (NUMBER OF MPI RANKS) For massively parallel simulations, this may cause out of memory issues. In those cases, care must be exercised to reduce the number of objects to be sent at any given time (e.g.: by doing communications in small batches).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
||
| procedure(locator), | optional | :: | GetOwnerRankOpt |
MPI Rank locator for communications |
Creates an MPI data type for parallel communication of the Lagrangian objects.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
Finalizes the ResPart_set type. This subourtine replaces the inheritted lagrangian_final.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ResPart_set), | intent(inout) | :: | this |
Set of resolved partilces |
Frees the MPI data type.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
Returns whether overwriting is true or false.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(in) | :: | this |
A set of Lagrangian objects |
Overwrite value
Returns the base name of file to read.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(in) | :: | this |
A set of Lagrangian objects |
Name of file
Returns the base name of file to write.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(in) | :: | this |
A set of Lagrangian objects |
Name of file
Prints diagnostics information about the derived type to the standard output.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
Initializes the ResPart_set type. This subourtine replaces the inheritted lagrangian_init.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ResPart_set), | intent(inout) | :: | this |
Set of resolved partilces |
||
| character(len=*), | intent(in) | :: | name |
Name of instance |
||
| type(block_obj), | intent(in), | target | :: | block |
A block object |
|
| type(parallel_obj), | intent(in), | target | :: | parallel |
Parallel structure to link with |
Localizes all Lagrangian object on the grid. For each Lagrangian object in the set, this subroutine finds the cell (staggering=0) where this object is located and updates its cell indices.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
(Deferred) Reads lagrangian objects from file in parallel.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
||
| integer, | intent(out) | :: | iter |
Iteration at write |
||
| real(kind=wp), | intent(out) | :: | time |
Time at write |
||
| integer, | intent(in), | optional | :: | step |
Optional step |
Sorting routine: stacks active lagrangian objects (i.e., who's id is >=1) at the beginning of the array then resizes. Objects with id <= 0 (such as ghost objects) are removed by this subroutine.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
Changes the size of an array of Lagrangian objects. To avoid excessive reallocating, the object array will be reallocated only if the new size is (1+RESIZE_INCREMENT) larger or (1-RESIZE_INCREMENT) smaller than previous size. When the size change does not justify reallocating, the excess objects at the end tail of the object array will be marked as inactive with a large negative ID.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
||
| integer, | intent(in) | :: | n |
New target size |
Sets the interpolation and extrapolation filter kernels. Default is the Triangle kernel.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
||
| integer, | intent(in) | :: | kernel_interp |
Filter kernel for interpolations |
||
| integer, | intent(in) | :: | kernel_extrap |
Filter kernel for extrapolations |
Adjusts the filter half size. Note that the block needs to contain enough ghost cells to be able to represent a filter kernel centered on the edge of the domain. Otherwise, an error will be returnned. The larger the filter size, the more ghost cells are required.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
Set of Lagrangian objects |
||
| real(kind=wp), | intent(in) | :: | l_filter |
Filter size |
(Deferred) Sets up parameters used to create the MPI derived type.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
Set of Lagrangian objects |
||
| type(MPI_DATATYPE), | intent(out), | allocatable | :: | types(:) |
Array of types |
|
| integer, | intent(out), | allocatable | :: | lengths(:) |
Array of lengths |
|
| integer(kind=MPI_ADDRESS_KIND), | intent(out), | allocatable | :: | displacement(:) |
Array of displacements |
(Deferred) Sets the type of the polymorphic sample.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
Sets file overwritting.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
||
| logical, | intent(in) | :: | overwrite |
Overwrite value |
Sets the base name of file to read.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
||
| character(len=*), | intent(in) | :: | name |
Name of file |
Sets the base name of file to write.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
||
| character(len=*), | intent(in) | :: | name |
Name of file |
Updates the total count of Lagrangian objects.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
Updates ghost objects. Copies objects that lie "dist"-away from the block's boundaries to neighboring MPI-ranks and designate copies as Ghost Objects (id<0). This subroutine will also update the local count (i.e., this%count_) to (NBR of ACTIVE OBJECTS) + (NBR of GHOST OBJECTS). However, the global count (this%count) will remain unchanged (i.e., equal to the total count of active ojbects only)0
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
||
| real(kind=wp), | intent(in) | :: | dist |
Distance from boundaries |
(Deferred) Writes Lagrangian objects to file in parallel.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
||
| integer, | intent(in) | :: | iter |
Iteration at write |
||
| real(kind=wp), | intent(in) | :: | time |
Time at write |
Finalizes the structure and frees memory.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
Initialize lagrangian objects related IO.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(inout) | :: | this |
A set of Lagrangian objects |
||
| character(len=*), | intent(in) | :: | name |
Variable name |
||
| type(block_obj), | intent(in), | target | :: | block |
A block object |
|
| type(parallel_obj), | intent(in), | target | :: | parallel |
Parallel structure to link with |
Returns the MPI rank that should own this lagrangian object based on which block it belongs to.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lagrangian_set), | intent(in) | :: | this |
A set of Lagrangian objects |
||
| class(lagrangian_obj), | intent(in) | :: | lagobj |
Lagrangian obj to locate |
rank that should own lagobj
type,abstract :: lagrangian_set !> Base structure for a collection of Lagrangian objects. character(len=:), allocatable :: name !! Name of the Lagrangian set class(lagrangian_obj), allocatable :: p(:) !! Array of Lagrangian_obj or any extended type type(block_obj), pointer :: block => null() !! Associated block structure type(parallel_obj), pointer :: parallel => null() !! Associated parallel structure integer :: count_ = 0 !! Local count for this rank integer :: count = 0 !! Total count across all MPI ranks character(len=str64) :: read_file !! File to read character(len=str64) :: write_file !! File to write logical :: overwrite = .true. !! Switch to overwrite IO files real(wp) :: l_filter !! Half filter width integer :: stib = 3 !! Stencil size for filtering procedure(kernel_1D), pointer, & nopass :: g1in => g1_triangle !! 1D kernel used in interpolations procedure(kernel_1D), pointer, & nopass :: g1ex => int_g1_triangle !! 1D kernel used in extrapolations class(lagrangian_obj), allocatable :: sample !! Sample used in allocation of polymorphic data integer, allocatable :: count_proc(:) !! Nbr of lagrangian objects per proc type(MPI_Datatype), private :: MPI_TYPE !! MPI variable type integer, private :: MPI_SIZE = 44 !! MPI size logical :: is_initialized = .false. !! Flag to determine whether this has been initialized contains generic :: Initialize => lagrangian_set_Init generic :: Finalize => lagrangian_set_Final ! Procedures related to Lagrangian object procedure :: Resize => lagrangian_set_Resize procedure :: Recycle => lagrangian_set_Recycle procedure :: UpdateCount => lagrangian_set_UpdateCount procedure :: Localize => lagrangian_set_Localize procedure :: ApplyPeriodicity => lagrangian_set_ApplyPeriodicity ! Procedures related to filtering procedure :: SetFilterKernel => lagrangian_set_SetFilterKernel procedure :: SetFilterSize => lagrangian_set_SetFilterSize ! Procedures related to I/O procedure :: SetWriteFileName => lagrangian_set_SetWriteFileName procedure :: GetWriteFileName => lagrangian_set_GetWriteFileName procedure :: SetReadFileName => lagrangian_set_SetReadFileName procedure :: GetReadFileName => lagrangian_set_GetReadFileName procedure :: SetOverwrite => lagrangian_set_SetOverwrite procedure :: GetOverwrite => lagrangian_set_GetOverwrite ! Procedures related to MPI communications procedure :: Communicate => lagrangian_set_Communicate procedure :: UpdateGhostObjects => lagrangian_set_UpdateGhostObjects procedure, & private :: GetOwnerRankByBlock => lagrangian_set_GetOwnerRankByBlock procedure :: CreateMPIType => lagrangian_set_CreateMPIType procedure :: FreeMPIType => lagrangian_set_FreeMPIType ! Other procedure :: Info => lagrangian_set_Info procedure :: lagrangian_set_Init procedure :: lagrangian_set_Final ! Deffered procedures procedure(lagrangian_SetObjectType), deferred :: SetObjectType procedure(lagrangian_read), deferred :: Read procedure(lagrangian_write), deferred :: Write procedure(lagrangian_SetMPIDataTypeParams),deferred :: SetMPIDataTypeParams end type lagrangian_set