walberla::pe::Material Class Reference

Detailed Description

Rigid body material.

A material specifies the properties of a rigid body: the density of the body, the coefficient of restitution and the coefficients of static and dynamic friction.
The pe module provides several predefined materials that can be directly used:

  • iron
  • copper
  • granite
  • oak
  • fir

In order to create a new custom material use the createMaterial() function:

// Creating a new material using the following material properties:
// - name/identifier: myMaterial
// - density: 2.54
// - coefficient of restitution: 0.8
// - coefficient of static friction: 0.1
// - coefficient of dynamic friction: 0.05
// - Poisson's ratio: 0.2
// - Young's modulus: 80.0
// - Contact stiffness: 100
// - dampingN: 10
// - dampingT: 11
MaterialID myMaterial = createMaterial( "myMaterial", 2.54, 0.8, 0.1, 0.05, 0.2, 80, 100, 10, 11 );

The following functions can be used to acquire a specific MaterialID or to get a specific property of a material:

// Searching a material
MaterialID myMaterial = Material::find( "myMaterial" );
// Getting the density, coefficient of restitution, coefficient of static and
// dynamic friction, Poisson's ratio and Young's modulus of the material
real_t density = Material::getDensity( myMaterial );
real_t cor = Material::getRestitution( myMaterial );
real_t csf = Material::getStaticFriction( myMaterial );
real_t poisson = Material::getPoissonRatio( myMaterial );
real_t young = Material::getYoungModulus( myMaterial ):

#include <Materials.h>

+ Inheritance diagram for walberla::pe::Material:

Public Member Functions

Constructor
 Material (const std::string &name, real_t density, real_t cor, real_t csf, real_t cdf, real_t poisson, real_t young, real_t stiffness, real_t dampingN, real_t dampingT)
 The constructor of the Material class. More...
 

Static Public Member Functions

Set functions
static void setRestitution (MaterialID material1, MaterialID material2, real_t cor)
 Setting the coefficient of restitution between material material1 and material2. More...
 
static void setStaticFriction (MaterialID material1, MaterialID material2, real_t csf)
 Setting the coefficient of static friction between material material1 and material2. More...
 
static void setDynamicFriction (MaterialID material1, MaterialID material2, real_t cdf)
 Setting the coefficient of dynamic friction between material material1 and material2. More...
 

Private Types

using SizeType = Materials::size_type
 Size type of the Material class. More...
 

Static Private Member Functions

Setup functions
static bool activateMaterials ()
 Automatic registration of the default materials. More...
 

Get functions

const std::string & getName () const
 Returns the name of the material. More...
 
real_t getDensity () const
 Returns the density of the material. More...
 
real_t getRestitution () const
 Returns the coefficient of restitution of the material. More...
 
real_t getStaticFriction () const
 Returns the coefficient of static friction of the material. More...
 
real_t getDynamicFriction () const
 Returns the coefficient of dynamic friction of the material. More...
 
real_t getPoissonRatio () const
 Returns the Poisson's ratio of the material. More...
 
real_t getYoungModulus () const
 Returns the Young's modulus of the material. More...
 
real_t getStiffness () const
 Returns the stiffness in normal direction of the material's contact region. More...
 
real_t getDampingN () const
 Returns the damping coefficient in normal direction of the material's contact region. More...
 
real_t getDampingT () const
 Returns the damping coefficient in tangential direction of the material's contact region. More...
 
static MaterialID find (const std::string &name)
 Searching for a registered material. More...
 
static std::vector< MaterialIDfindPrefix (const std::string &prefix)
 Searching for registered materials with a prefix. More...
 
static const std::string & getName (MaterialID material)
 Returns the name of the given material. More...
 
static real_t getDensity (MaterialID material)
 Returns the density of the given material. More...
 
static real_t getRestitution (MaterialID material)
 Returns the coefficient of restitution of the given material. More...
 
static real_t getRestitution (MaterialID material1, MaterialID material2)
 Returns the composite coefficient of restitution for a collision between two rigid bodies. More...
 
static real_t getStaticFriction (MaterialID material)
 Returns the coefficient of static friction of the given material. More...
 
static real_t getStaticFriction (MaterialID material1, MaterialID material2)
 Returns the coefficient of static friction for a collision between two rigid bodies. More...
 
static real_t getDynamicFriction (MaterialID material)
 Returns the coefficient of dynamic friction of the given material. More...
 
static real_t getDynamicFriction (MaterialID material1, MaterialID material2)
 Returns the coefficient of dynamic friction for a collision between two rigid bodies. More...
 
static real_t getPoissonRatio (MaterialID material)
 Returns the Poisson's ratio of the given material. More...
 
static real_t getYoungModulus (MaterialID material)
 Returns the Young's modulus of the given material. More...
 
static real_t getYoungModulus (MaterialID material1, MaterialID material2)
 Returns the (effective) Young's modulus for a collision between two rigid bodies. More...
 
static real_t getStiffness (MaterialID material)
 Returns the stiffness in normal direction of the material's contact region. More...
 
static real_t getStiffness (MaterialID material1, MaterialID material2)
 Returns the stiffness in normal direction of the contact between two materials. More...
 
static real_t getDampingN (MaterialID material)
 Returns the damping coefficient in normal direction of the material's contact region. More...
 
static real_t getDampingN (MaterialID material1, MaterialID material2)
 Returns the damping in normal direction of the contact between two materials. More...
 
static real_t getDampingT (MaterialID material)
 Returns the damping coefficient in tangential direction of the material's contact region. More...
 
static real_t getDampingT (MaterialID material1, MaterialID material2)
 Returns the damping in tangential direction of the contact between two materials. More...
 
static std::string toString (const MaterialID &v)
 

Member variables

std::string name_
 The name of the material. More...
 
real_t density_
 The density of the material. More...
 
real_t restitution_
 The coefficient of restitution (COR) of a self-similar collision \( [0..1] \). More...
 
real_t static_
 The coefficient of static friction (CSF) \( [0..\infty) \). More...
 
real_t dynamic_
 The coefficient of dynamic friction (CDF) \( [0..\infty) \). More...
 
real_t poisson_
 The Poisson's ratio for the material \( [-1..0.5] \). More...
 
real_t young_
 The Young's modulus for the material \( (0..\infty) \). More...
 
real_t stiffness_
 The stiffness of the contact region \( (0..\infty) \). More...
 
real_t dampingN_
 The damping at the contact region in normal direction \( [0..\infty) \). More...
 
real_t dampingT_
 The damping at the contact region in tangential direction \( [0..\infty) \). More...
 
static Materials materials_
 Vector for the registered materials. More...
 
static MatN corTable_
 Table for the coefficients of restitution. More...
 
static MatN csfTable_
 Table for the coefficients of static friction. More...
 
static MatN cdfTable_
 Table for the coefficients of dynamic friction. More...
 
static bool materialsActivated_
 Helper variable for the automatic registration process. More...
 
static unsigned int anonymousMaterials_ = 0
 Counter for the amount of anonymous materials. More...
 

Member Typedef Documentation

◆ SizeType

using walberla::pe::Material::SizeType = Materials::size_type
private

Size type of the Material class.

Constructor & Destructor Documentation

◆ Material()

walberla::pe::Material::Material ( const std::string &  name,
real_t  density,
real_t  cor,
real_t  csf,
real_t  cdf,
real_t  poisson,
real_t  young,
real_t  stiffness,
real_t  dampingN,
real_t  dampingT 
)
inlineexplicit

The constructor of the Material class.

Parameters
nameThe name of the material.
densityThe density of the material \( (0..\infty) \).
corThe coefficient of restitution (COR) of the material \( [0..1] \).
csfThe coefficient of static friction (CSF) of the material \( [0..\infty) \).
cdfThe coefficient of dynamic friction (CDF) of the material \( [0..\infty) \).
poissonThe Poisson's ratio of the material \( [-1..0.5] \).
youngThe Young's modulus of the material \( (0..\infty) \).
stiffnessThe stiffness in normal direction of the material's contact region.
dampingNThe damping coefficient in normal direction of the material's contact region.
dampingTThe damping coefficient in tangential direction of the material's contact region.

Member Function Documentation

◆ activateMaterials()

bool walberla::pe::Material::activateMaterials ( )
staticprivate

Automatic registration of the default materials.

Returns
true after the materials have been registered.

◆ find()

MaterialID walberla::pe::Material::find ( const std::string &  name)
static

Searching for a registered material.

Parameters
nameThe name of the material.
Returns
The MaterialID of the material if the material is found, invalid_material otherwise.

The function searches for a registered material with the given name. If the material is found, the corresponding MaterialID is returned. Otherwise, invalid_material is returned.

◆ findPrefix()

std::vector< MaterialID > walberla::pe::Material::findPrefix ( const std::string &  prefix)
static

Searching for registered materials with a prefix.

Parameters
prefixThe prefix common to the names of the materials.
Returns
A std::vector object containing the MaterialIDs of all materials found.

The function collects all registered materials with names beginning with the given string. Their IDs are assembled in an std::vector object. If no Materials are found, the container is empty.

◆ getDampingN() [1/3]

real_t walberla::pe::Material::getDampingN ( ) const
inline

Returns the damping coefficient in normal direction of the material's contact region.

Returns
The damping coefficient in normal direction of the material's contact region.

◆ getDampingN() [2/3]

real_t walberla::pe::Material::getDampingN ( MaterialID  material)
inlinestatic

Returns the damping coefficient in normal direction of the material's contact region.

Parameters
materialThe material to be queried.
Returns
The damping in normal direction of the contact region of the given material.

◆ getDampingN() [3/3]

real_t walberla::pe::Material::getDampingN ( MaterialID  material1,
MaterialID  material2 
)
inlinestatic

Returns the damping in normal direction of the contact between two materials.

Parameters
material1The material of the first colliding rigid body.
material2The material of the second colliding rigid body.
Returns
The damping in normal direction of the contact between two materials.

Rigid body theory assumes that deformation during contact is localized to the contact region. Therefore the contact region is often modelled simplified as a spring-damper. When two bodies are in contact the spring-dampers are serially connected and thus the contact damping can be expressed as the series connection of two viscous dampers: \( c_*^{-1} = c_1^{-1} + c_2^{-1}\).

◆ getDampingT() [1/3]

real_t walberla::pe::Material::getDampingT ( ) const
inline

Returns the damping coefficient in tangential direction of the material's contact region.

Returns
The damping coefficient in tangential direction of the material's contact region.

◆ getDampingT() [2/3]

real_t walberla::pe::Material::getDampingT ( MaterialID  material)
inlinestatic

Returns the damping coefficient in tangential direction of the material's contact region.

Parameters
materialThe material to be queried.
Returns
The damping in tangential direction of the contact region of the given material.

◆ getDampingT() [3/3]

real_t walberla::pe::Material::getDampingT ( MaterialID  material1,
MaterialID  material2 
)
inlinestatic

Returns the damping in tangential direction of the contact between two materials.

Parameters
material1The material of the first colliding rigid body.
material2The material of the second colliding rigid body.
Returns
The damping in tangential direction of the contact between two materials.

Rigid body theory assumes that deformation during contact is localized to the contact region. Therefore the contact region is often modelled simplified as a spring-damper. When two bodies are in contact the spring-dampers are serially connected and thus the contact damping can be expressed as the series connection of two viscous dampers: \( c_*^{-1} = c_1^{-1} + c_2^{-1}\).

◆ getDensity() [1/2]

real_t walberla::pe::Material::getDensity ( ) const
inline

Returns the density of the material.

Returns
The density of the material.

◆ getDensity() [2/2]

real_t walberla::pe::Material::getDensity ( MaterialID  material)
inlinestatic

Returns the density of the given material.

Parameters
materialThe material to be queried.
Returns
The density of the given material.

◆ getDynamicFriction() [1/3]

real_t walberla::pe::Material::getDynamicFriction ( ) const
inline

Returns the coefficient of dynamic friction of the material.

Returns
The coefficient of dynamic friction of the material.

◆ getDynamicFriction() [2/3]

real_t walberla::pe::Material::getDynamicFriction ( MaterialID  material)
inlinestatic

Returns the coefficient of dynamic friction of the given material.

Parameters
materialThe material to be queried.
Returns
The coefficient of dynamic friction of the given material.

◆ getDynamicFriction() [3/3]

real_t walberla::pe::Material::getDynamicFriction ( MaterialID  material1,
MaterialID  material2 
)
inlinestatic

Returns the coefficient of dynamic friction for a collision between two rigid bodies.

Parameters
material1The material of the first colliding rigid body.
material2The material of the second colliding rigid body.
Returns
The resulting coefficient of dynamic friction of the collision.

◆ getName() [1/2]

const std::string & walberla::pe::Material::getName ( ) const
inline

Returns the name of the material.

Returns
The name of the material.

◆ getName() [2/2]

const std::string & walberla::pe::Material::getName ( MaterialID  material)
inlinestatic

Returns the name of the given material.

Parameters
materialThe material to be queried.
Returns
The name of the given material.

◆ getPoissonRatio() [1/2]

real_t walberla::pe::Material::getPoissonRatio ( ) const
inline

Returns the Poisson's ratio of the material.

Returns
The Poisson's ratio of the material.

◆ getPoissonRatio() [2/2]

real_t walberla::pe::Material::getPoissonRatio ( MaterialID  material)
inlinestatic

Returns the Poisson's ratio of the given material.

Parameters
materialThe material to be queried.
Returns
The Poisson's ratio of the given material.

◆ getRestitution() [1/3]

real_t walberla::pe::Material::getRestitution ( ) const
inline

Returns the coefficient of restitution of the material.

Returns
The coefficient of restitution of the material.

◆ getRestitution() [2/3]

real_t walberla::pe::Material::getRestitution ( MaterialID  material)
inlinestatic

Returns the coefficient of restitution of the given material.

Parameters
materialThe material to be queried.
Returns
The coefficient of restitution of the given material.

◆ getRestitution() [3/3]

real_t walberla::pe::Material::getRestitution ( MaterialID  material1,
MaterialID  material2 
)
inlinestatic

Returns the composite coefficient of restitution for a collision between two rigid bodies.

Parameters
material1The material of the first colliding rigid body.
material2The material of the second colliding rigid body.
Returns
The resulting composite coefficient of restitution of the collision.

◆ getStaticFriction() [1/3]

real_t walberla::pe::Material::getStaticFriction ( ) const
inline

Returns the coefficient of static friction of the material.

Returns
The coefficient of static friction of the material.

◆ getStaticFriction() [2/3]

real_t walberla::pe::Material::getStaticFriction ( MaterialID  material)
inlinestatic

Returns the coefficient of static friction of the given material.

Parameters
materialThe material to be queried.
Returns
The coefficient of static friction of the given material.

◆ getStaticFriction() [3/3]

real_t walberla::pe::Material::getStaticFriction ( MaterialID  material1,
MaterialID  material2 
)
inlinestatic

Returns the coefficient of static friction for a collision between two rigid bodies.

Parameters
material1The material of the first colliding rigid body.
material2The material of the second colliding rigid body.
Returns
The resulting coefficient of static friction of the collision.

◆ getStiffness() [1/3]

real_t walberla::pe::Material::getStiffness ( ) const
inline

Returns the stiffness in normal direction of the material's contact region.

Returns
The stiffness in normal direction of the material's contact region.

◆ getStiffness() [2/3]

real_t walberla::pe::Material::getStiffness ( MaterialID  material)
inlinestatic

Returns the stiffness in normal direction of the material's contact region.

Parameters
materialThe material to be queried.
Returns
The stiffness in normal direction of the contact region of the given material.

◆ getStiffness() [3/3]

real_t walberla::pe::Material::getStiffness ( MaterialID  material1,
MaterialID  material2 
)
inlinestatic

Returns the stiffness in normal direction of the contact between two materials.

Parameters
material1The material of the first colliding rigid body.
material2The material of the second colliding rigid body.
Returns
The stiffness in normal direction of the contact between two materials.

Rigid body theory assumes that deformation during contact is localized to the contact region. Therefore the contact region is often modelled simplified as a spring-damper. When two bodies are in contact the spring-dampers are serially connected and thus the contact stiffness can be expressed as the series connection of two springs: \( k_*^{-1} = k_1^{-1} + k_2^{-1}\).

◆ getYoungModulus() [1/3]

real_t walberla::pe::Material::getYoungModulus ( ) const
inline

Returns the Young's modulus of the material.

Returns
The Young's modulus of the material.

◆ getYoungModulus() [2/3]

real_t walberla::pe::Material::getYoungModulus ( MaterialID  material)
inlinestatic

Returns the Young's modulus of the given material.

Parameters
materialThe material to be queried.
Returns
The Young's modulus of the given material.

◆ getYoungModulus() [3/3]

real_t walberla::pe::Material::getYoungModulus ( MaterialID  material1,
MaterialID  material2 
)
inlinestatic

Returns the (effective) Young's modulus for a collision between two rigid bodies.

Parameters
material1The material of the first colliding rigid body.
material2The material of the second colliding rigid body.
Returns
The resulting (effective) Young's modulus of the collision.

This function returns the effective Young's modulus for a collision between two rigid bodies. The effective Young's modulus is calculated as

   \f[ \frac{1}{E_{eff}} = \frac{1 - \nu_1^2}{E_1} + \frac{1 - \nu_2^2}{E_2}, \f]

where \( E_1 \) and \( E_2 \) are the Young's modulus for the first and second material, respectively, and \( \nu_1 \) and \( \nu_2 \) are the Poisson's ratio for the materials.

◆ setDynamicFriction()

void walberla::pe::Material::setDynamicFriction ( MaterialID  material1,
MaterialID  material2,
real_t  cdf 
)
inlinestatic

Setting the coefficient of dynamic friction between material material1 and material2.

Parameters
material1The material of the first colliding rigid body.
material2The material of the second colliding rigid body.
cdfThe coefficient of dynamic friction between material1 and material2.
Returns
void

◆ setRestitution()

void walberla::pe::Material::setRestitution ( MaterialID  material1,
MaterialID  material2,
real_t  cor 
)
inlinestatic

Setting the coefficient of restitution between material material1 and material2.

Parameters
material1The material of the first colliding rigid body.
material2The material of the second colliding rigid body.
corThe coefficient of restitution between material1 and material2.
Returns
void

◆ setStaticFriction()

void walberla::pe::Material::setStaticFriction ( MaterialID  material1,
MaterialID  material2,
real_t  csf 
)
inlinestatic

Setting the coefficient of static friction between material material1 and material2.

Parameters
material1The material of the first colliding rigid body.
material2The material of the second colliding rigid body.
csfThe coefficient of static friction between material1 and material2.
Returns
void

◆ toString()

std::string walberla::pe::Material::toString ( const MaterialID v)
static

Member Data Documentation

◆ anonymousMaterials_

unsigned int walberla::pe::Material::anonymousMaterials_ = 0
staticprivate

Counter for the amount of anonymous materials.

◆ cdfTable_

MatN walberla::pe::Material::cdfTable_
staticprivate

Table for the coefficients of dynamic friction.

◆ corTable_

MatN walberla::pe::Material::corTable_
staticprivate

Table for the coefficients of restitution.

◆ csfTable_

MatN walberla::pe::Material::csfTable_
staticprivate

Table for the coefficients of static friction.

◆ dampingN_

real_t walberla::pe::Material::dampingN_
private

The damping at the contact region in normal direction \( [0..\infty) \).

Rigid body theory assumes that the deformation during contact is localized to the contact region. This local compliance in normal direction can be modelled simplified as a spring-damper. The viscous damping coefficient corresponds to this parameter.

◆ dampingT_

real_t walberla::pe::Material::dampingT_
private

The damping at the contact region in tangential direction \( [0..\infty) \).

Friction counteracts the tangential relative velocity and thus can be modelled as a viscous damper with a limited damping force. The viscous damping coefficient corresponds to this parameter.

◆ density_

real_t walberla::pe::Material::density_
private

The density of the material.

◆ dynamic_

real_t walberla::pe::Material::dynamic_
private

The coefficient of dynamic friction (CDF) \( [0..\infty) \).

The CDF is a dimensionless, non-negative quantity representing the amount of dynamic friction between two touching rigid bodies. Dynamic friction occurs in case the relative tangential velocity between the two bodies is greater than 0. Then the force magnitudes of the normal and friction force are related by an inequality:

\[ |\vec{f_t}| = -\mu_d |\vec{f_n}| \frac{\vec{v_t}}{|\vec{v_t}|} \]

◆ materials_

Materials walberla::pe::Material::materials_
staticprivate

Vector for the registered materials.

◆ materialsActivated_

bool walberla::pe::Material::materialsActivated_
staticprivate

Helper variable for the automatic registration process.

◆ name_

std::string walberla::pe::Material::name_
private

The name of the material.

◆ poisson_

real_t walberla::pe::Material::poisson_
private

The Poisson's ratio for the material \( [-1..0.5] \).

When a material is compressed in one direction, it usually tends to expand in the other two directions perpendicular to the direction of compression. This effect is called Poisson effect. In this context, the Poisson's ratio is the ratio of the contraction or transverse strain (perpendicular to the applied load) to the extension or axial strain (in the direction of the applied load). For stable, isotropic, linear elastic materials this ratio cannot be less than -1.0 nor greater than 0.5 due to the requirement that Young's modulus has positive values.

◆ restitution_

real_t walberla::pe::Material::restitution_
private

The coefficient of restitution (COR) of a self-similar collision \( [0..1] \).

The COR represents the energy dissipated during a collision between self-similar bodies, that is bodies with similar materials. A value of 0 corresponds to completely inelastic collision where all energy is dissipated, a value of 1 corresponds to a completely elastic collision where no energy is lost. The COR is assumed to be rate-independent. The COR is often determined experimentally by measuring the pre- and post-impact relative velocities:

\[ C_R = \frac{V_{2,after}-V_{1,after}}{V_{2,before}-V_{1,before}} \]

During a collision, the COR values of the two colliding rigid bodies can be used by the collision response mechanism to determine the restitution factor of the contact point.

◆ static_

real_t walberla::pe::Material::static_
private

The coefficient of static friction (CSF) \( [0..\infty) \).

The CSF is a dimensionless, non-negative quantity representing the amount of static friction between two touching rigid bodies. Static friction occurs in case the relative tangential velocity between the two bodies is 0. Then the force magnitudes of the normal and friction force are related by an inequality:

\[ |\vec{f_t}| \leq \mu_s |\vec{f_n}| \]

The direction of the friction must oppose acceleration if sliding is imminent and is unrestricted otherwise.

◆ stiffness_

real_t walberla::pe::Material::stiffness_
private

The stiffness of the contact region \( (0..\infty) \).

Rigid body theory assumes that the deformation during contact is localized to the contact region. This local compliance can be modelled simplified as a spring-damper. The spring constant corresponds to this parameter.

◆ young_

real_t walberla::pe::Material::young_
private

The Young's modulus for the material \( (0..\infty) \).

The Young's modulus is a measure for the stiffness of an isotropic elastic material. It is defined as the ratio of the uniaxial stress over the uniaxial strain in the range of stress in which Hooke's law holds. The SI unit for Young's modulus is \( Pa \) or \( N/m^2 \).


The documentation for this class was generated from the following files:
MaterialID createMaterial(const std::string &name, real_t density, real_t cor, real_t csf, real_t cdf, real_t poisson, real_t young, real_t stiffness, real_t dampingN, real_t dampingT)
Creating a new custom material.
Definition: Materials.cpp:161
real_t getDynamicFriction() const
Returns the coefficient of dynamic friction of the material.
Definition: Materials.h:343
real_t getDensity() const
Returns the density of the material.
Definition: Materials.h:307
real_t getRestitution() const
Returns the coefficient of restitution of the material.
Definition: Materials.h:319
real_t getYoungModulus() const
Returns the Young's modulus of the material.
Definition: Materials.h:367
float real_t
Definition: DataTypes.h:167
Materials::size_type MaterialID
Unique material ID.
Definition: Types.h:159
static MaterialID find(const std::string &name)
Searching for a registered material.
Definition: Materials.cpp:280
real_t getStaticFriction() const
Returns the coefficient of static friction of the material.
Definition: Materials.h:331
real_t getPoissonRatio() const
Returns the Poisson's ratio of the material.
Definition: Materials.h:355