lattices Submodule

This SUBMODULE contains the implementation of the methods of TYPE particles that place particles on 1 or 2 lattices around the stars.

FT 12.07.2021



Uses

  • module~~lattices~~UsesGraph module~lattices lattices module~sph_particles sph_particles module~lattices->module~sph_particles module~id_base id_base module~sph_particles->module~id_base module~utility utility module~sph_particles->module~utility timing timing module~sph_particles->timing module~id_base->module~utility module~id_base->timing constants constants module~utility->constants matrix matrix module~utility->matrix

Contents


Module Procedures

module procedure place_particles_lattice module subroutine place_particles_lattice(this, central_density, xmin, xmax, ymin, ymax, zmin, zmax, npart_des, npart_out, stretch, thres, pos, pvol, nu, h, get_density, get_id, validate_position)

Places paricles on a 3D lattice containing both stars

Read more…

Arguments

Type IntentOptional Attributes Name
class(particles), intent(inout) :: this

particles object which this PROCEDURE is a member of

double precision, intent(in) :: central_density

Maximum baryon mass density of the system

double precision, intent(in) :: xmin

Left boundary of the lattice

double precision, intent(in) :: xmax

Right boundary of the lattice

double precision, intent(in) :: ymin

Left boundary of the lattice

double precision, intent(in) :: ymax

Right boundary of the lattice

double precision, intent(in) :: zmin

Left boundary of the lattice

double precision, intent(in) :: zmax

Right boundary of the lattice

integer, intent(in) :: npart_des

Desired particle number

integer, intent(out) :: npart_out

Real, output particle number

double precision, intent(in) :: stretch

Stretching factor fo the lattice. xmin to zmax are multiplied by it

double precision, intent(in) :: thres

(~rho_max)/thres is the minimum mass density considered when placing particles. Used only when redistribute_nu is .FALSE. . When redistribute_nu is .TRUE. thres= 100*nu_ratio

double precision, intent(inout), DIMENSION(:,:), ALLOCATABLE :: pos
double precision, intent(inout), DIMENSION(:), ALLOCATABLE :: pvol

Array storing the particle positions Array storing the particle volumes

double precision, intent(inout), DIMENSION(:), ALLOCATABLE :: nu

Array storing the particle baryon masses

double precision, intent(inout), DIMENSION(:), ALLOCATABLE :: h

Array storing the initial guess for the particle smoothing lengths

function get_density(x, y, z) result(density)

Returns the baryon mass density at the desired point

Arguments
Type IntentOptional Attributes Name
double precision, intent(in) :: x

coordinate of the desired point

double precision, intent(in) :: y

coordinate of the desired point

double precision, intent(in) :: z

coordinate of the desired point

Return Value double precision

Baryon mass density at

subroutine get_id(x, y, z, sqdetg, baryon_density, gamma_euler)

Returns the baryon mass density at the desired point

Arguments
Type IntentOptional Attributes Name
double precision, intent(in) :: x

coordinate of the desired point

double precision, intent(in) :: y

coordinate of the desired point

double precision, intent(in) :: z

coordinate of the desired point

double precision, intent(out) :: sqdetg
double precision, intent(out) :: baryon_density
double precision, intent(out) :: gamma_euler
procedure(validate_position_int), optional :: validate_position

Returns 1 if the position is not valid, 0 otherwise