Changeover function class.
More...
#include <changeover.hpp>
|
| ChangeOver () |
|
scaling for changeover factor (for next step)
More...
|
|
bool | checkParams () |
| check whether parameters values are correct More...
|
|
template<class Tpars > |
| ChangeOver (const Tpars &_par) |
| constructor based on inherited class More...
|
|
void | setR (const Float &_m_fac, const Float &_r_in, const Float &_r_out) |
| set r_in and r_out for changeover function More...
|
|
void | setR (const Float &_r_in, const Float &_r_out) |
| set r_in and r_out for changeover function More...
|
|
void | updateWithRScale () |
| update radius based on r_scale_next, reset r_scale_next to 1 More...
|
|
const Float & | getRin () const |
| get r_in More...
|
|
const Float & | getRout () const |
| get r_out More...
|
|
void | print (std::ostream &_fout) const |
|
void | printColumn (std::ostream &_fout, const int _width=20) |
| print data of class members using column style More...
|
|
void | writeBinary (FILE *_fp) const |
| write class data to file with binary format More...
|
|
void | readBinary (FILE *_fin) |
| read class data to file with binary format More...
|
|
void | writeAscii (FILE *_fp) const |
| write class data to file with binary format More...
|
|
void | readAscii (FILE *_fin) |
| read class data to file with binary format More...
|
|
template<class Tpars > |
void | dataCopy (const Tpars &_par) |
| copy data from inherited class object More...
|
|
Float | calcPotW (const Float &_dr) const |
| changeover function for potential More...
|
|
Float | calcAcc0W (const Float &_dr) const |
| changeover function for force More...
|
|
Float | calcAcc1W (const Float &_dr, const Float &_drdot) const |
| changeover function for force derivative More...
|
|
|
static void | printColumnTitle (std::ostream &_fout, const int _width=20) |
| print titles of class members using column style More...
|
|
static int | printTitleWithMeaning (std::ostream &_fout, const int _counter=0, const int _offset=0) |
| print column title with meaning (each line for one column) More...
|
|
static Float | calcPotWTwo (const ChangeOver &_ch1, const ChangeOver &_ch2, const Float &_dr) |
| calculate changeover function Pot by selecting maximum rout More...
|
|
static Float | calcAcc0WTwo (const ChangeOver &_ch1, const ChangeOver &_ch2, const Float &_dr) |
| calculate changeover function Acc0 by selecting maximum rout More...
|
|
static Float | calcAcc1WTwo (const ChangeOver &_ch1, const ChangeOver &_ch2, const Float &_dr, const Float &_drdot) |
| calculate changeover function Acc1 by selecting maximum rout More...
|
|
Changeover function class.
◆ ChangeOver() [1/2]
ChangeOver::ChangeOver |
( |
| ) |
|
|
inline |
scaling for changeover factor (for next step)
◆ ChangeOver() [2/2]
template<class Tpars >
ChangeOver::ChangeOver |
( |
const Tpars & |
_par | ) |
|
|
inline |
constructor based on inherited class
◆ calcAcc0W()
Float ChangeOver::calcAcc0W |
( |
const Float & |
_dr | ) |
const |
|
inline |
changeover function for force
- Parameters
-
[in] | _dr | particle separation
\( x = \frac{dr - r_{in}{r_{out} - r_{in}} \)
\( R_a = \frac{r_{in}}{r_{out} - r_{in}} \)
\( W_0(x) = (x-1)^4 (1 + 4 x + 10 x^2 + 20 x^3 + \frac{35 x^4}{2 R_a + 1} \) |
- Returns
- \( W_0(x) \)
◆ calcAcc0WTwo()
static Float ChangeOver::calcAcc0WTwo |
( |
const ChangeOver & |
_ch1, |
|
|
const ChangeOver & |
_ch2, |
|
|
const Float & |
_dr |
|
) |
| |
|
inlinestatic |
calculate changeover function Acc0 by selecting maximum rout
◆ calcAcc1W()
Float ChangeOver::calcAcc1W |
( |
const Float & |
_dr, |
|
|
const Float & |
_drdot |
|
) |
| const |
|
inline |
changeover function for force derivative
- Parameters
-
[in] | _dr | particle separation |
[in] | _drdot | time derivation of _dr \( R_a = \frac{r_{in}}{r_{out} - r_{in}} \)
\( x = \frac{dr - r_{in}{r_{out} - r_{in}} \)
\( \frac{dx}{dt} = \frac{1}{r_{out} - r_{in}} \frac{dr}{dt} \)
\( W_1(x) = \frac{280 x^3 (R_a + x)(x-1)^3}{2 R_a + 1} \) |
- Returns
- \( W_1(x) dx/dt \)
◆ calcAcc1WTwo()
static Float ChangeOver::calcAcc1WTwo |
( |
const ChangeOver & |
_ch1, |
|
|
const ChangeOver & |
_ch2, |
|
|
const Float & |
_dr, |
|
|
const Float & |
_drdot |
|
) |
| |
|
inlinestatic |
calculate changeover function Acc1 by selecting maximum rout
◆ calcPotW()
Float ChangeOver::calcPotW |
( |
const Float & |
_dr | ) |
const |
|
inline |
changeover function for potential
- Parameters
-
[in] | _dr | particle separation \( x = \frac{dr - r_{in}{r_{out} - r_{in}} \)
\( R_a = \frac{r_{in}}{r_{out} - r_{in}} \)
\( W_pot(x) = \frac{x^5}{2 R_a + 1} (5 x^3 - 20 x^2 + 28 x - 14) \) |
- Returns
- \( W_pot(x) \)
◆ calcPotWTwo()
static Float ChangeOver::calcPotWTwo |
( |
const ChangeOver & |
_ch1, |
|
|
const ChangeOver & |
_ch2, |
|
|
const Float & |
_dr |
|
) |
| |
|
inlinestatic |
calculate changeover function Pot by selecting maximum rout
◆ checkParams()
bool ChangeOver::checkParams |
( |
| ) |
|
|
inline |
check whether parameters values are correct
- Returns
- true: all correct
◆ dataCopy()
template<class Tpars >
void ChangeOver::dataCopy |
( |
const Tpars & |
_par | ) |
|
|
inline |
copy data from inherited class object
- Parameters
-
[in] | _par | object that contain data (should be inherited class) |
◆ getRin()
const Float& ChangeOver::getRin |
( |
| ) |
const |
|
inline |
◆ getRout()
const Float& ChangeOver::getRout |
( |
| ) |
const |
|
inline |
◆ print()
void ChangeOver::print |
( |
std::ostream & |
_fout | ) |
const |
|
inline |
◆ printColumn()
void ChangeOver::printColumn |
( |
std::ostream & |
_fout, |
|
|
const int |
_width = 20 |
|
) |
| |
|
inline |
print data of class members using column style
print data of class members in one line for column style. Notice no newline is printed at the end
- Parameters
-
[out] | _fout | std::ostream output object |
[in] | _width | print width (defaulted 20) |
◆ printColumnTitle()
static void ChangeOver::printColumnTitle |
( |
std::ostream & |
_fout, |
|
|
const int |
_width = 20 |
|
) |
| |
|
inlinestatic |
print titles of class members using column style
print titles of class members in one line for column style
- Parameters
-
[out] | _fout | std::ostream output object |
[in] | _width | print width (defaulted 20) |
◆ printTitleWithMeaning()
static int ChangeOver::printTitleWithMeaning |
( |
std::ostream & |
_fout, |
|
|
const int |
_counter = 0 , |
|
|
const int |
_offset = 0 |
|
) |
| |
|
inlinestatic |
print column title with meaning (each line for one column)
- Parameters
-
[out] | _fout | std::ostream output object |
[in] | _counter | offset of the number counter for each line to indicate the column index (defaulted 0) |
[in] | _offset | the printing whitespace offset for each line (defaulted 0) |
- Returns
- : the total counter of columns
◆ readAscii()
void ChangeOver::readAscii |
( |
FILE * |
_fin | ) |
|
|
inline |
read class data to file with binary format
- Parameters
-
[in] | _fp | FILE type file for reading |
◆ readBinary()
void ChangeOver::readBinary |
( |
FILE * |
_fin | ) |
|
|
inline |
read class data to file with binary format
- Parameters
-
[in] | _fp | FILE type file for reading |
◆ setR() [1/2]
void ChangeOver::setR |
( |
const Float & |
_m_fac, |
|
|
const Float & |
_r_in, |
|
|
const Float & |
_r_out |
|
) |
| |
|
inline |
set r_in and r_out for changeover function
- Parameters
-
[in] | _m_fac | mass factor |
[in] | _r_in | changeover function inner boundary |
[in] | _r_out | changeover function outer boundary |
◆ setR() [2/2]
void ChangeOver::setR |
( |
const Float & |
_r_in, |
|
|
const Float & |
_r_out |
|
) |
| |
|
inline |
set r_in and r_out for changeover function
- Parameters
-
[in] | _m_fac | mass factor |
[in] | _r_in | changeover function inner boundary |
[in] | _r_out | changeover function outer boundary |
◆ updateWithRScale()
void ChangeOver::updateWithRScale |
( |
| ) |
|
|
inline |
update radius based on r_scale_next, reset r_scale_next to 1
◆ writeAscii()
void ChangeOver::writeAscii |
( |
FILE * |
_fp | ) |
const |
|
inline |
write class data to file with binary format
- Parameters
-
[in] | _fp | FILE type file for output |
◆ writeBinary()
void ChangeOver::writeBinary |
( |
FILE * |
_fp | ) |
const |
|
inline |
write class data to file with binary format
- Parameters
-
[in] | _fp | FILE type file for output |
◆ r_scale_next
Float ChangeOver::r_scale_next |
(1 + coff_)/r_out = 2/(r_out+r_in)
The documentation for this class was generated from the following file: