11#ifndef MATERIAL_PD_INFLUENCEFN_H
12#define MATERIAL_PD_INFLUENCEFN_H
34 virtual double getInfFn(
const double &r)
const = 0;
45 virtual double getMoment(
const size_t &i)
const = 0;
54 virtual std::string
printStr(
int nt,
int lvl)
const {
57 std::ostringstream oss;
58 oss << tabS <<
"------- BaseInfluenceFn --------" << std::endl << std::endl;
59 oss << tabS <<
"Provides abstraction for different influence function "
61 oss << tabS << std::endl;
72 virtual void print(
int nt,
int lvl)
const { std::cout <<
printStr(nt, lvl); }
95 double getInfFn(
const double &r)
const override;
106 double getMoment(
const size_t &i)
const override;
115 std::string
printStr(
int nt,
int lvl)
const override {
118 std::ostringstream oss;
119 oss << tabS <<
"------- ConstInfluenceFn --------" << std::endl << std::endl;
120 oss << tabS <<
"Constant function with constant = " <<
d_a0 << std::endl;
121 oss << tabS <<
"First moment = " <<
getMoment(1)
123 <<
", third moment = " <<
getMoment(3) << std::endl;
124 oss << tabS << std::endl;
135 void print(
int nt,
int lvl)
const override {
167 double getInfFn(
const double &r)
const override;
178 double getMoment(
const size_t &i)
const override;
187 std::string
printStr(
int nt,
int lvl)
const override {
190 std::ostringstream oss;
191 oss << tabS <<
"------- LinearInfluenceFn --------" << std::endl << std::endl;
192 oss << tabS <<
"Linear function a0 + a1*r with constants: a0 = "
193 <<
d_a0 <<
", a1 = " <<
d_a1 << std::endl;
194 oss << tabS <<
"First moment = " <<
getMoment(1)
196 <<
", third moment = " <<
getMoment(3) << std::endl;
197 oss << tabS << std::endl;
208 void print(
int nt,
int lvl)
const override {
243 double getInfFn(
const double &r)
const override;
254 double getMoment(
const size_t &i)
const override;
263 std::string
printStr(
int nt,
int lvl)
const override {
266 std::ostringstream oss;
267 oss << tabS <<
"------- GaussianInfluenceFn --------" << std::endl << std::endl;
268 oss << tabS <<
"Gaussian function a0 * exp(-r*r / a1) with constants: a0 = "
270 oss << tabS <<
"First moment = " <<
getMoment(1)
272 <<
", third moment = " <<
getMoment(3) << std::endl;
273 oss << tabS << std::endl;
284 void print(
int nt,
int lvl)
const override {
A base class for computing influence function.
BaseInfluenceFn()=default
Constructor.
virtual double getMoment(const size_t &i) const =0
Returns the moment of influence function.
virtual void print() const
Prints the information about the object.
virtual std::string printStr(int nt, int lvl) const
Returns the string containing printable information about the object.
virtual void print(int nt, int lvl) const
Prints the information about the object.
virtual double getInfFn(const double &r) const =0
Returns the value of influence function.
A class to implement constant influence function.
double getMoment(const size_t &i) const override
Returns the moment of influence function.
void print() const override
Prints the information about the object.
double getInfFn(const double &r) const override
Returns the value of influence function.
double d_a0
Constant such that J(r) = Constant.
void print(int nt, int lvl) const override
Prints the information about the object.
std::string printStr(int nt, int lvl) const override
Returns the string containing printable information about the object.
A class to implement Gaussian influence function.
double getInfFn(const double &r) const override
Returns the value of influence function.
double getMoment(const size_t &i) const override
Returns the moment of influence function.
std::string printStr(int nt, int lvl) const override
Returns the string containing printable information about the object.
void print(int nt, int lvl) const override
Prints the information about the object.
void print() const override
Prints the information about the object.
A class to implement linear influence function.
double d_a0
Constants such that J(r) = d_a0 + d_a1 * r.
double getInfFn(const double &r) const override
Returns the value of influence function.
void print(int nt, int lvl) const override
Prints the information about the object.
std::string printStr(int nt, int lvl) const override
Returns the string containing printable information about the object.
double d_a1
Constants such that J(r) = d_a0 + d_a1 * r.
void print() const override
Prints the information about the object.
double getMoment(const size_t &i) const override
Returns the moment of influence function.
std::string getTabS(int nt)
Returns tab spaces of given size.