n2p2 - A neural network potential package
|
A general function with compact support. More...
#include <CompactFunction.h>
Public Member Functions | |
CompactFunction () | |
Constructor, initializes to #CoreFunction::Type::POLY2. More... | |
void | setCoreFunction (CoreFunction::Type const type) |
Set type. More... | |
void | setCenterWidth (double center, double width) |
Set center and width. More... | |
void | setLeftRight (double left, double right) |
Set left and right boundary. More... | |
CoreFunction::Type | getCoreFunctionType () const |
Getter for #type. More... | |
void | setAsymmetric (bool asymmetric) |
Set asymmetric property in core function. More... | |
bool | getAsymmetric () const |
Check if asymmetry is enabled in core function. More... | |
double | getCenter () const |
Getter for center. More... | |
double | getWidth () const |
Getter for width. More... | |
double | getLeft () const |
Getter for left. More... | |
double | getRight () const |
Getter for right. More... | |
double | f (double a) const |
Compact function \(f_c\). More... | |
double | df (double a) const |
Derivative of compact function \(\frac{d f_c}{d a}\). More... | |
void | fdf (double a, double &fa, double &dfa) const |
Calculate compact function and derivative at once. More... | |
Private Attributes | |
double | center |
Center of compact function. More... | |
double | width |
Width of compact function. More... | |
double | left |
Left boundary of compact function. More... | |
double | right |
Right boundary of compact function. More... | |
double | scale |
Inverse width. More... | |
CoreFunction | core |
Core function to be used on either side of compact function. More... | |
A general function with compact support.
Definition at line 27 of file CompactFunction.h.
CompactFunction::CompactFunction | ( | ) |
Constructor, initializes to #CoreFunction::Type::POLY2.
Definition at line 24 of file CompactFunction.cpp.
References core, nnp::CoreFunction::POLY2, and nnp::CoreFunction::setType().
|
inline |
Set type.
[in] | type | Type of core function to use. |
Definition at line 131 of file CompactFunction.h.
References core, and nnp::CoreFunction::setType().
Referenced by nnp::SymFncBaseComp::setCompactFunction(), nnp::SymFncBaseCompAng::setParameters(), and nnp::SymFncBaseCompAngWeighted::setParameters().
void CompactFunction::setCenterWidth | ( | double | center, |
double | width | ||
) |
Set center and width.
[in] | center | Center of compact function. |
[in] | width | Width of compact function. |
Definition at line 47 of file CompactFunction.cpp.
void CompactFunction::setLeftRight | ( | double | left, |
double | right | ||
) |
Set left and right boundary.
[in] | left | Left boundary of compact function. |
[in] | right | Right boundary of compact function. |
Definition at line 63 of file CompactFunction.cpp.
References center, left, right, scale, and width.
Referenced by nnp::SymFncBaseCompAng::changeLengthUnit(), nnp::SymFncBaseCompAngWeighted::changeLengthUnit(), nnp::SymFncCompRad::changeLengthUnit(), nnp::SymFncCompRadWeighted::changeLengthUnit(), nnp::SymFncBaseCompAng::setParameters(), nnp::SymFncBaseCompAngWeighted::setParameters(), nnp::SymFncCompRad::setParameters(), and nnp::SymFncCompRadWeighted::setParameters().
|
inline |
Getter for #type.
Definition at line 138 of file CompactFunction.h.
References core, and nnp::CoreFunction::getType().
Referenced by nnp::SymFncBaseCompAng::setParameters(), and nnp::SymFncBaseCompAngWeighted::setParameters().
void CompactFunction::setAsymmetric | ( | bool | asymmetric | ) |
Set asymmetric property in core function.
[in] | asymmetric | Whether asymmetry should be activated. |
Definition at line 39 of file CompactFunction.cpp.
References core, and nnp::CoreFunction::setAsymmetric().
Referenced by nnp::SymFncBaseComp::setCompactFunction().
bool CompactFunction::getAsymmetric | ( | ) | const |
Check if asymmetry is enabled in core function.
Definition at line 34 of file CompactFunction.cpp.
References core, and nnp::CoreFunction::getAsymmetric().
|
inline |
Getter for center.
Definition at line 143 of file CompactFunction.h.
References center.
|
inline |
Getter for width.
Definition at line 144 of file CompactFunction.h.
References width.
|
inline |
Getter for left.
Definition at line 145 of file CompactFunction.h.
References left.
|
inline |
Getter for right.
Definition at line 146 of file CompactFunction.h.
References right.
|
inline |
Compact function \(f_c\).
[in] | a | Function argument. |
Definition at line 148 of file CompactFunction.h.
References center, core, nnp::CoreFunction::f(), and scale.
Referenced by nnp::SymFncBaseCompAng::calculateAngularPart(), nnp::SymFncBaseCompAngWeighted::calculateAngularPart(), nnp::SymFncBaseCompAng::calculateRadialPart(), nnp::SymFncBaseCompAngWeighted::calculateRadialPart(), nnp::SymFncCompRad::calculateRadialPart(), and nnp::SymFncCompRadWeighted::calculateRadialPart().
|
inline |
Derivative of compact function \(\frac{d f_c}{d a}\).
[in] | a | Function argument. |
Definition at line 154 of file CompactFunction.h.
References center, core, nnp::CoreFunction::df(), and scale.
|
inline |
Calculate compact function and derivative at once.
[in] | a | Function argument. |
[out] | fa | Cutoff function value. |
[out] | dfa | Value of cutoff function derivative. |
Definition at line 160 of file CompactFunction.h.
References center, core, nnp::CoreFunction::fdf(), and scale.
Referenced by nnp::SymFncCompAngn::calculate(), nnp::SymFncCompAngnWeighted::calculate(), nnp::SymFncCompAngw::calculate(), nnp::SymFncCompAngwWeighted::calculate(), nnp::SymFncCompRad::calculate(), nnp::SymFncCompRadWeighted::calculate(), nnp::SymFncBaseCompAng::getCompactAngle(), nnp::SymFncBaseCompAngWeighted::getCompactAngle(), nnp::SymFncCompRad::getCompactOnly(), nnp::SymFncCompRadWeighted::getCompactOnly(), nnp::SymFncBaseCompAng::getCompactRadial(), and nnp::SymFncBaseCompAngWeighted::getCompactRadial().
|
private |
Center of compact function.
Definition at line 113 of file CompactFunction.h.
Referenced by df(), f(), fdf(), getCenter(), setCenterWidth(), and setLeftRight().
|
private |
Width of compact function.
Definition at line 115 of file CompactFunction.h.
Referenced by getWidth(), setCenterWidth(), and setLeftRight().
|
private |
Left boundary of compact function.
Definition at line 117 of file CompactFunction.h.
Referenced by getLeft(), setCenterWidth(), and setLeftRight().
|
private |
Right boundary of compact function.
Definition at line 119 of file CompactFunction.h.
Referenced by getRight(), setCenterWidth(), and setLeftRight().
|
private |
Inverse width.
Definition at line 121 of file CompactFunction.h.
Referenced by df(), f(), fdf(), setCenterWidth(), and setLeftRight().
|
private |
Core function to be used on either side of compact function.
Definition at line 123 of file CompactFunction.h.
Referenced by CompactFunction(), df(), f(), fdf(), getAsymmetric(), getCoreFunctionType(), setAsymmetric(), and setCoreFunction().