MPS-Basic
Loading...
Searching...
No Matches
weight.cpp File Reference
#include "weight.hpp"
#include <cassert>
Include dependency graph for weight.cpp:

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: