MPS-Basic
Loading...
Searching...
No Matches
weight.hpp File Reference
#include "common.hpp"
Include dependency graph for weight.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

double weight (double dis, double re)
 Wight function for MPS method presented by Koshizuka and Oka, 1996
 

Function Documentation

◆ weight()

double weight ( double dis,
double re )

Wight function for MPS method presented by Koshizuka and Oka, 1996

Parameters
disdistance of each particle \(r\). It must be positive.
reeffective radius \(r_e\)
Returns
weight

\[w(r) = \frac{r_e}{r} - 1\]

Definition at line 5 of file weight.cpp.

5 {
6 assert(dis > 0.0);
7
8 if (dis >= re) {
9 return 0.0;
10
11 } else {
12 return (re / dis) - 1.0;
13 }
14}
Here is the caller graph for this function: