PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
material::BaseInfluenceFn Class Referenceabstract

A base class for computing influence function. More...

#include <influenceFn.h>

Inheritance diagram for material::BaseInfluenceFn:
Collaboration diagram for material::BaseInfluenceFn:

Public Member Functions

 BaseInfluenceFn ()=default
 Constructor.
 
virtual double getInfFn (const double &r) const =0
 Returns the value of influence function.
 
virtual double getMoment (const size_t &i) const =0
 Returns the moment of influence function.
 
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 void print () const
 Prints the information about the object.
 

Detailed Description

A base class for computing influence function.

Definition at line 22 of file influenceFn.h.

Constructor & Destructor Documentation

◆ BaseInfluenceFn()

material::BaseInfluenceFn::BaseInfluenceFn ( )
default

Constructor.

Member Function Documentation

◆ getInfFn()

virtual double material::BaseInfluenceFn::getInfFn ( const double &  r) const
pure virtual

Returns the value of influence function.

Parameters
rReference (initial) bond length
Returns
value Influence function at r

Implemented in material::ConstInfluenceFn, material::LinearInfluenceFn, and material::GaussianInfluenceFn.

◆ getMoment()

virtual double material::BaseInfluenceFn::getMoment ( const size_t &  i) const
pure virtual

Returns the moment of influence function.

If \( J(r) \) is the influence function for \( r\in [0,1)\) then \( i^{th} \) moment is given by

\[ M_i = \int_0^1 J(r) r^i dr. \]

Parameters
iith moment
Returns
moment Moment

Implemented in material::ConstInfluenceFn, material::LinearInfluenceFn, and material::GaussianInfluenceFn.

◆ print() [1/2]

virtual void material::BaseInfluenceFn::print ( ) const
inlinevirtual

Prints the information about the object.

Reimplemented in material::ConstInfluenceFn, material::LinearInfluenceFn, and material::GaussianInfluenceFn.

Definition at line 75 of file influenceFn.h.

75{ print(0, 0); }
virtual void print() const
Prints the information about the object.
Definition influenceFn.h:75

References print().

Referenced by print().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print() [2/2]

virtual void material::BaseInfluenceFn::print ( int  nt,
int  lvl 
) const
inlinevirtual

Prints the information about the object.

Parameters
ntNumber of tabs to append before printing
lvlInformation level (higher means more information)

Reimplemented in material::ConstInfluenceFn, material::LinearInfluenceFn, and material::GaussianInfluenceFn.

Definition at line 72 of file influenceFn.h.

72{ std::cout << printStr(nt, lvl); }
virtual std::string printStr(int nt, int lvl) const
Returns the string containing printable information about the object.
Definition influenceFn.h:54

References printStr().

Here is the call graph for this function:

◆ printStr()

virtual std::string material::BaseInfluenceFn::printStr ( int  nt,
int  lvl 
) const
inlinevirtual

Returns the string containing printable information about the object.

Parameters
ntNumber of tabs to append before printing
lvlInformation level (higher means more information)
Returns
string String containing printable information about the object

Reimplemented in material::ConstInfluenceFn, material::LinearInfluenceFn, and material::GaussianInfluenceFn.

Definition at line 54 of file influenceFn.h.

54 {
55
56 auto tabS = util::io::getTabS(nt);
57 std::ostringstream oss;
58 oss << tabS << "------- BaseInfluenceFn --------" << std::endl << std::endl;
59 oss << tabS << "Provides abstraction for different influence function "
60 "types" << std::endl;
61 oss << tabS << std::endl;
62
63 return oss.str();
64 }
std::string getTabS(int nt)
Returns tab spaces of given size.
Definition io.h:40

References util::io::getTabS().

Referenced by print().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: