This SUBMODULE contains the implementation of the PROCEDURES to handle particle positions.
FT 24.03.2022
Return the number of times that pos_a appears in the array pos
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | npart | |||
double precision, | intent(in), | DIMENSION(3,npart) | :: | pos | ||
double precision, | intent(in), | DIMENSION(3) | :: | pos_a |
Check that the particles are not at the same positions
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | npart |
Number of particles |
||
double precision, | intent(in), | DIMENSION(3,npart) | :: | pos |
Array of particle positions |
|
logical, | intent(in), | optional | :: | debug |
|
Translate the particles so that their center of mass coincides with the center of mass of the star, given by \(\mathrm{ID}\)
Type | Intent | Optional | Attributes | Name | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
integer, | intent(in) | :: | npart | |||||||||||||||||||||||||||||||
double precision, | intent(inout), | DIMENSION(3,npart) | :: | pos | ||||||||||||||||||||||||||||||
double precision, | intent(inout), | DIMENSION(npart) | :: | nu | ||||||||||||||||||||||||||||||
function get_density(x, y, z) result(density)Arguments
Return Value double precision |
||||||||||||||||||||||||||||||||||
function validate_pos(x, y, z) result(answer)Arguments
Return Value logical |
||||||||||||||||||||||||||||||||||
double precision, | intent(in), | DIMENSION(3) | :: | com_star | ||||||||||||||||||||||||||||||
logical, | intent(in), | optional | :: | verbose |
Find the particles above the plane
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | npart | |||
double precision, | intent(in), | DIMENSION(3,npart) | :: | pos | ||
integer, | intent(out) | :: | npart_above_xy | |||
integer, | intent(out), | DIMENSION(:), ALLOCATABLE | :: | above_xy_plane_a |
just for test purposes: get neighbours of particle ipart in a "brute force" way; ipart is ALSO on the neighbour list; SKR 8.2.2010
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ipart | |||
integer, | intent(in) | :: | npart | |||
double precision, | intent(in) | :: | pos(dimensions,npart) | |||
double precision, | intent(in) | :: | h(npart) | |||
integer, | intent(in) | :: | dimensions | |||
integer, | intent(out) | :: | nnei | |||
integer, | intent(out) | :: | neilist(npart) |
Returns the number of the matter object asociated with the particle number given as input. Example: give number as input; this particle number corresponds to a particle on matter object . This functions returns .
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(particles), | intent(in) | :: | this |
particles object which this PROCEDURE is a member of |
||
integer, | intent(in) | :: | a |
Particle number |
Mirror the particle with z>0 with respect to the xy plane, to impose the equatorial-plane symmetry
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(inout) | :: | npart | |||
double precision, | intent(inout), | DIMENSION(3,npart) | :: | pos | ||
double precision, | intent(inout), | optional, | DIMENSION(npart) | :: | nu | |
double precision, | intent(in), | optional | :: | com_star | ||
logical, | intent(in), | optional | :: | verbose |
Reflect the particle with z>0 with respect to the xy plane
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | npart | |||
double precision, | intent(inout), | DIMENSION(3,npart) | :: | pos | ||
double precision, | intent(out), | DIMENSION(3,npart_above_xy) | :: | pos_below | ||
integer, | intent(inout) | :: | npart_above_xy | |||
integer, | intent(in), | DIMENSION(npart_above_xy) | :: | above_xy_plane_a | ||
double precision, | intent(inout), | optional, | DIMENSION(npart) | :: | nu | |
double precision, | intent(out), | optional, | DIMENSION(npart_above_xy) | :: | nu_below |