6 parallel field arrays plus size/capacity bookkeeping.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public, | allocatable | :: | active(:) |
Whether the particle takes part in the simulation. |
||
| type(soa_extent_t), | public | :: | extent |
Live element count and allocated capacity. |
|||
| integer(kind=int32), | public, | allocatable | :: | id(:) |
Particle identifier. |
||
| real(kind=dp), | public, | allocatable | :: | mass(:) |
Particle mass. |
||
| real(kind=dp), | public, | allocatable | :: | x(:) |
Cartesian x coordinate. |
||
| real(kind=dp), | public, | allocatable | :: | y(:) |
Cartesian y coordinate. |
||
| real(kind=dp), | public, | allocatable | :: | z(:) |
Cartesian z coordinate. |
Give the container n live elements, discarding any it already had.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(particle_soa_t), | intent(inout) | :: | this |
Container to (re)allocate. |
||
| integer(kind=default_int), | intent(in) | :: | n |
Number of live elements. Must not be negative. |
||
| type(error_t), | intent(inout) | :: | err |
Error state, |
Allocated length of every field array. Always at least size().
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(particle_soa_t), | intent(in) | :: | this |
Container to query. |
Drop every live element but keep the allocated capacity.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(particle_soa_t), | intent(inout) | :: | this |
Container to empty. |
Release every field array and reset both counters to zero.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(particle_soa_t), | intent(inout) | :: | this |
Container to empty. |
Read a container back from an open stream unit.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(particle_soa_t), | intent(inout) | :: | this |
Container to fill. Any previous contents are discarded. |
||
| integer(kind=default_int), | intent(in) | :: | unit |
Stream unit opened for unformatted stream reading. |
||
| type(error_t), | intent(inout) | :: | err |
Error state, |
Change the number of live elements, preserving the elements that survive.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(particle_soa_t), | intent(inout) | :: | this |
Container to resize. |
||
| integer(kind=default_int), | intent(in) | :: | n |
New number of live elements. Must not be negative. |
||
| type(error_t), | intent(inout) | :: | err |
Error state, |
Write the container to an open stream unit.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(particle_soa_t), | intent(in) | :: | this |
Container to write. |
||
| integer(kind=default_int), | intent(in) | :: | unit |
Stream unit opened for unformatted stream writing. |
||
| type(error_t), | intent(inout) | :: | err |
Error state, |
Exact size in bytes of the stream serialize would write now.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(particle_soa_t), | intent(in) | :: | this |
Container to measure. |
Number of live elements.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(particle_soa_t), | intent(in) | :: | this |
Container to query. |
32-bit FNV-1a digest of the container’s live state.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(particle_soa_t), | intent(in) | :: | this |
Container to fingerprint. |
64-bit FNV-1a digest of the container’s live state.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(particle_soa_t), | intent(in) | :: | this |
Container to fingerprint. |
type :: particle_soa_t !! 6 parallel field arrays plus size/capacity bookkeeping. type(soa_extent_t) :: extent !! Live element count and allocated capacity. integer(int32), allocatable :: id(:) !! Particle identifier. real(dp), allocatable :: x(:) !! Cartesian x coordinate. real(dp), allocatable :: y(:) !! Cartesian y coordinate. real(dp), allocatable :: z(:) !! Cartesian z coordinate. real(dp), allocatable :: mass(:) !! Particle mass. logical, allocatable :: active(:) !! Whether the particle takes part in the simulation. contains procedure :: allocate => particle_soa_allocate procedure :: resize => particle_soa_resize procedure :: deallocate => particle_soa_deallocate procedure :: clear => particle_soa_clear procedure :: size => particle_soa_size procedure :: capacity => particle_soa_capacity procedure :: serialized_bytes => particle_soa_serialized_bytes procedure :: serialize => particle_soa_serialize procedure :: deserialize => particle_soa_deserialize procedure :: state_hash => particle_soa_state_hash procedure :: state_hash64 => particle_soa_state_hash64 end type particle_soa_t