|
Peano
|
Tools related to the (computation of) the smoothing length. More...
Functions | |
| _neighbour_loop_vectorized (ndarray r, float h, str kernel, int ndim) | |
| A neighbour interaction loop used to determine the smoothing lengths. | |
| _neighbour_loop (ndarray r, float h, str kernel, int ndim) | |
| A neighbour interaction loop used to determine the smoothing lengths. | |
| find_smoothing_length (ndarray xp, ndarray xn, str kernel, float eta, float h_tolerance, int ndim, bool verbose=False) | |
| Determine the smoothing length of a particle with coordinates xp and neighbours with positions xn. | |
| eta_from_number_of_neighbours (float N, str kernel, int ndim) | |
| Compute the resolution eta from a given (approximate) number of neighbours. | |
| number_of_neighbours_from_eta (float eta, str kernel, int ndim) | |
| Compute the (approximate) number of neighbours from a given resolution eta. | |
Tools related to the (computation of) the smoothing length.
|
protected |
A neighbour interaction loop used to determine the smoothing lengths.
r: ndarray distances from the particle to the neighbours
h: float current guess for the particle's smoothing length
kernel: str which SPH kernel to use.
ndim: int number of dimensions to work for.
wcount: float sum of particle's kernel weight at neighbour positions
wcount_dh: float sum of particle's kernel derivative weight at neighbour positions
Definition at line 64 of file smltools.py.
|
protected |
A neighbour interaction loop used to determine the smoothing lengths.
r: ndarray distances from the particle to the neighbours
h: float current guess for the particle's smoothing length
kernel: str which SPH kernel to use.
ndim: int number of dimensions to work for.
wcount: float sum of particle's kernel weight at neighbour positions
wcount_dh: float sum of particle's kernel derivative weight at neighbour positions
Definition at line 15 of file smltools.py.
Referenced by exaparty.api.sphtools.smltools.find_smoothing_length().

| exaparty.api.sphtools.smltools.eta_from_number_of_neighbours | ( | float | N, |
| str | kernel, | ||
| int | ndim | ||
| ) |
Compute the resolution eta from a given (approximate) number of neighbours.
Note that the neighbour number does not need be an integer. See Price 2012, https://ui.adsabs.harvard.edu/abs/2012JCoPh.231..759P, eq. 12
N: float Number of neighbours
kernel: str which kernel we're computing for.
ndim: int how many dimensions we are working with.
eta: float the corresponding resolution eta
Definition at line 315 of file smltools.py.
| exaparty.api.sphtools.smltools.find_smoothing_length | ( | ndarray | xp, |
| ndarray | xn, | ||
| str | kernel, | ||
| float | eta, | ||
| float | h_tolerance, | ||
| int | ndim, | ||
| bool | verbose = False |
||
| ) |
Determine the smoothing length of a particle with coordinates xp and neighbours with positions xn.
This function assumes that the an appropriate amount of neighbours is passed on via the xn array of their positions, meaning that max{|xn - xp|} <= gamma * h.
xp: ndarray Coordiate of particle to determine smoothing length for
xn: ndarray Array of coordinates of neighbour particles
kernel: str Which kernel to use. Choices are given in sph_kernels.py:sph_kernel_list
eta: float resolution eta to use, "smoothing scale". This determines the number of neighbours.
h_tolerance: float tolerance to adapt to consider smoothing length converged
ndim: int number of dimensions to work with
verbose: bool whether to be verbose about what's going on
h: float the smoothing length
Definition at line 115 of file smltools.py.
References exaparty.api.sphtools.smltools._neighbour_loop_vectorized().

| exaparty.api.sphtools.smltools.number_of_neighbours_from_eta | ( | float | eta, |
| str | kernel, | ||
| int | ndim | ||
| ) |
Compute the (approximate) number of neighbours from a given resolution eta.
Note that the neighbour number does not need be an integer. See Price 2012, https://ui.adsabs.harvard.edu/abs/2012JCoPh.231..759P, eq. 12
eta: float resolution eta
kernel: str which kernel we're computing for.
ndim: int how many dimensions we are working with.
N: float the (approximate) number of neighbours
Definition at line 353 of file smltools.py.