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:
In order to create a new custom material use the createMaterial() function:
The following functions can be used to acquire a specific MaterialID or to get a specific property of a material:
#include <Materials.h>
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< MaterialID > | findPrefix (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... | |
|
private |
Size type of the Material class.
|
inlineexplicit |
The constructor of the Material class.
name | The name of the material. |
density | The density of the material \( (0..\infty) \). |
cor | The coefficient of restitution (COR) of the material \( [0..1] \). |
csf | The coefficient of static friction (CSF) of the material \( [0..\infty) \). |
cdf | The coefficient of dynamic friction (CDF) of the material \( [0..\infty) \). |
poisson | The Poisson's ratio of the material \( [-1..0.5] \). |
young | The Young's modulus of the material \( (0..\infty) \). |
stiffness | The stiffness in normal direction of the material's contact region. |
dampingN | The damping coefficient in normal direction of the material's contact region. |
dampingT | The damping coefficient in tangential direction of the material's contact region. |
|
staticprivate |
Automatic registration of the default materials.
|
static |
Searching for a registered material.
name | The name of the material. |
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.
|
static |
Searching for registered materials with a prefix.
prefix | The prefix common to the names of the materials. |
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.
|
inline |
Returns the damping coefficient in normal direction of the material's contact region.
|
inlinestatic |
Returns the damping coefficient in normal direction of the material's contact region.
material | The material to be queried. |
|
inlinestatic |
Returns the damping in normal direction of the contact between two materials.
material1 | The material of the first colliding rigid body. |
material2 | The material of the second colliding rigid body. |
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}\).
|
inline |
Returns the damping coefficient in tangential direction of the material's contact region.
|
inlinestatic |
Returns the damping coefficient in tangential direction of the material's contact region.
material | The material to be queried. |
|
inlinestatic |
Returns the damping in tangential direction of the contact between two materials.
material1 | The material of the first colliding rigid body. |
material2 | The material of the second colliding rigid body. |
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}\).
|
inline |
Returns the density of the material.
|
inlinestatic |
Returns the density of the given material.
material | The material to be queried. |
|
inline |
Returns the coefficient of dynamic friction of the material.
|
inlinestatic |
Returns the coefficient of dynamic friction of the given material.
material | The material to be queried. |
|
inlinestatic |
Returns the coefficient of dynamic friction for a collision between two rigid bodies.
material1 | The material of the first colliding rigid body. |
material2 | The material of the second colliding rigid body. |
|
inline |
Returns the name of the material.
|
inlinestatic |
Returns the name of the given material.
material | The material to be queried. |
|
inline |
Returns the Poisson's ratio of the material.
|
inlinestatic |
Returns the Poisson's ratio of the given material.
material | The material to be queried. |
|
inline |
Returns the coefficient of restitution of the material.
|
inlinestatic |
Returns the coefficient of restitution of the given material.
material | The material to be queried. |
|
inlinestatic |
Returns the composite coefficient of restitution for a collision between two rigid bodies.
material1 | The material of the first colliding rigid body. |
material2 | The material of the second colliding rigid body. |
|
inline |
Returns the coefficient of static friction of the material.
|
inlinestatic |
Returns the coefficient of static friction of the given material.
material | The material to be queried. |
|
inlinestatic |
Returns the coefficient of static friction for a collision between two rigid bodies.
material1 | The material of the first colliding rigid body. |
material2 | The material of the second colliding rigid body. |
|
inline |
Returns the stiffness in normal direction of the material's contact region.
|
inlinestatic |
Returns the stiffness in normal direction of the material's contact region.
material | The material to be queried. |
|
inlinestatic |
Returns the stiffness in normal direction of the contact between two materials.
material1 | The material of the first colliding rigid body. |
material2 | The material of the second colliding rigid body. |
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}\).
|
inline |
Returns the Young's modulus of the material.
|
inlinestatic |
Returns the Young's modulus of the given material.
material | The material to be queried. |
|
inlinestatic |
Returns the (effective) Young's modulus for a collision between two rigid bodies.
material1 | The material of the first colliding rigid body. |
material2 | The material of the second colliding rigid body. |
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.
|
inlinestatic |
Setting the coefficient of dynamic friction between material material1 and material2.
material1 | The material of the first colliding rigid body. |
material2 | The material of the second colliding rigid body. |
cdf | The coefficient of dynamic friction between material1 and material2. |
|
inlinestatic |
Setting the coefficient of restitution between material material1 and material2.
material1 | The material of the first colliding rigid body. |
material2 | The material of the second colliding rigid body. |
cor | The coefficient of restitution between material1 and material2. |
|
inlinestatic |
Setting the coefficient of static friction between material material1 and material2.
material1 | The material of the first colliding rigid body. |
material2 | The material of the second colliding rigid body. |
csf | The coefficient of static friction between material1 and material2. |
|
static |
|
staticprivate |
Counter for the amount of anonymous materials.
|
staticprivate |
Table for the coefficients of dynamic friction.
|
staticprivate |
Table for the coefficients of restitution.
|
staticprivate |
Table for the coefficients of static friction.
|
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.
|
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.
|
private |
The density of the material.
|
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}|} \]
|
staticprivate |
Vector for the registered materials.
|
staticprivate |
Helper variable for the automatic registration process.
|
private |
The name of the material.
|
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.
|
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.
|
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.
|
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.
|
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 \).