AGX Dynamics 2.41.2.0
Loading...
Searching...
No Matches
agx::ContactMaterial Class Reference

This class store the combine material properties between two agx::Material's. More...

#include <Material.h>

+ Inheritance diagram for agx::ContactMaterial:

Public Types

enum  ContactReductionMode { REDUCE_NONE , REDUCE_GEOMETRY , REDUCE_ALL }
 Specifies the mode for contact reduction. More...
 
enum  FrictionDirection { PRIMARY_DIRECTION , SECONDARY_DIRECTION , BOTH_PRIMARY_AND_SECONDARY }
 Specifies the direction of friction. More...
 

Public Member Functions

 ContactMaterial (const ContactMaterial *other, bool implicit)
 Create a ContactMaterial copying attributes from other.
 
 ContactMaterial (const Material *m1, const Material *m2, bool implicit=false)
 Constructor which associates this ContactMaterial to the two given materials m1 and m2.
 
Real getAdhesion () const
 
Real getAdhesiveOverlap () const
 
agx::UInt8 getContactReductionBinResolution () const
 
ContactReductionMode getContactReductionMode () const
 Returns whether contact reduction is enabled for this surface material.
 
Real getDamping () const
 The value is the time the contact constraint has to fulfill its violation.
 
Real getFrictionCoefficient (FrictionDirection direction=PRIMARY_DIRECTION) const
 
FrictionModelgetFrictionModel () const
 
agx::Real getImpactCompliance () const
 
const MaterialgetMaterial1 () const
 
const MaterialgetMaterial2 () const
 
Real getMaxElasticRestLength () const
 Get the maximum elastic rest length of the contact material.
 
Real getMinElasticRestLength () const
 Get the minimum elastic rest length of the contact material.
 
Real getRestitution () const
 
agx::Real getRollingResistanceCoefficient () const
 
agx::Real getRollingResistanceCompliance () const
 
bool getSurfaceFrictionEnabled () const
 
Real getSurfaceViscosity (FrictionDirection direction=PRIMARY_DIRECTION) const
 
Real getTangentialCohesion (FrictionDirection direction=PRIMARY_DIRECTION) const
 
Real getTangentialRestitution (FrictionDirection direction=PRIMARY_DIRECTION) const
 
agx::Real getTwistingResistanceCoefficient () const
 
agx::Real getTwistingResistanceCompliance () const
 
bool getUseContactAreaApproach () const
 Should contacts using this contact material use the new approach for computing contact area? Default false.
 
Real getWireFrictionCoefficient (FrictionDirection direction=PRIMARY_DIRECTION) const
 
Real getYoungsModulus () const
 
bool isExplicit () const
 
void setAdhesion (Real adhesion, Real adhesiveOverlap)
 Set the adhesive force and allowed overlap between two colliding objects.
 
void setContactReductionBinResolution (agx::UInt8 binResolution)
 Specify the resolution used when evaluating contacts for reduction between geometry contacts.
 
void setContactReductionMode (ContactReductionMode mode)
 Specify if contact reduction should be enabled.
 
void setDamping (Real damping)
 Set the damping of the material.
 
void setEnableSurfaceFriction (bool flag)
 Specify if surface friction should be calculated in the solver for this contact material.
 
void setFrictionCoefficient (Real friction, FrictionDirection direction=BOTH_PRIMARY_AND_SECONDARY)
 Set the friction coefficient.
 
void setFrictionModel (FrictionModel *frictionModel)
 Set friction model for this contact material.
 
void setImpactCompliance (agx::Real impactCompliance)
 Sets the compliance used for calculating impact forces.
 
bool setMinMaxElasticRestLength (Real minElasticRestLength, Real maxElasticRestLength)
 Set the minimum and maximum elastic rest length of the contact material.
 
void setRestitution (Real restitution)
 Set the restitution parameter.
 
void setRollingResistanceCoefficient (agx::Real rollingCoefficient)
 Sets the rolling resistance coefficient of the contact material.
 
void setRollingResistanceCompliance (agx::Real compliance)
 Sets the rolling resistance compliance in the contact material.
 
void setSurfaceViscosity (Real viscosity, FrictionDirection direction=BOTH_PRIMARY_AND_SECONDARY)
 Assign the surface viscosity, i.e., how wet the friction is between the colliding materials.
 
void setTangentialCohesion (Real cohesion, FrictionDirection direction=BOTH_PRIMARY_AND_SECONDARY)
 Set the tangential cohesion (Pa) of the contact material.
 
void setTangentialRestitution (Real restitution, FrictionDirection direction=BOTH_PRIMARY_AND_SECONDARY)
 Set the tangential restitution coefficient for a given tangential direction, or both.
 
void setTwistingResistanceCoefficient (agx::Real twistingCoefficient)
 Sets the twisting resistance coefficient of the contact material.
 
void setTwistingResistanceCompliance (agx::Real compliance)
 Sets the twisting resistance compliance in the contact material.
 
void setUseContactAreaApproach (bool useContactAreaApproach)
 Should contacts using this contact material use the new approach for computing contact area? Default false.
 
void setWireFrictionCoefficient (Real friction, FrictionDirection direction=BOTH_PRIMARY_AND_SECONDARY)
 Set the friction coefficient used by the contact nodes in the wires.
 
void setYoungsModulus (Real youngsModulus)
 Set the YoungsModulus of the material, same as spring coefficient k.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referencedoperator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Protected Member Functions

 ContactMaterial ()
 
virtual ~ContactMaterial ()
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandlergetDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

This class store the combine material properties between two agx::Material's.

It can both be implicit, i.e. calculated (by the MaterialManager) during impact between two Geometry's materials. Or it can be explicit, i.e. created by the user and parameterized through the class interface.

Definition at line 515 of file Material.h.

Member Enumeration Documentation

◆ ContactReductionMode

Specifies the mode for contact reduction.

Enumerator
REDUCE_NONE 

No contact reduction enabled.

REDUCE_GEOMETRY 

Default: Reduce contacts between geometries.

REDUCE_ALL 

Two step reduction: first between geometries, and then between rigid bodies.

Definition at line 526 of file Material.h.

◆ FrictionDirection

Specifies the direction of friction.

Enumerator
PRIMARY_DIRECTION 
SECONDARY_DIRECTION 
BOTH_PRIMARY_AND_SECONDARY 

Definition at line 519 of file Material.h.

Constructor & Destructor Documentation

◆ ContactMaterial() [1/3]

agx::ContactMaterial::ContactMaterial ( const Material m1,
const Material m2,
bool  implicit = false 
)

Constructor which associates this ContactMaterial to the two given materials m1 and m2.

Parameters
m1- A Material
m2- A Material
implicit- If true this will be marked as an implicit ContactMaterial.

◆ ContactMaterial() [2/3]

agx::ContactMaterial::ContactMaterial ( const ContactMaterial other,
bool  implicit 
)

Create a ContactMaterial copying attributes from other.

Parameters
other- Attributes will be copied from this ContactMaterial
implicit- If true this will be marked as an implicit ContactMaterial.

◆ ContactMaterial() [3/3]

agx::ContactMaterial::ContactMaterial ( )
protected

◆ ~ContactMaterial()

virtual agx::ContactMaterial::~ContactMaterial ( )
protectedvirtual

Member Function Documentation

◆ getAdhesion()

Real agx::ContactMaterial::getAdhesion ( ) const
Returns
the adhesion parameter, i.e., the attractive force between two colliding objects.

Definition at line 1105 of file Material.h.

◆ getAdhesiveOverlap()

Real agx::ContactMaterial::getAdhesiveOverlap ( ) const
Returns
the adhesive overlap for this surface material

Definition at line 1110 of file Material.h.

◆ getContactReductionBinResolution()

agx::UInt8 agx::ContactMaterial::getContactReductionBinResolution ( ) const
Returns
bin resolution used in contact reduction between geometry contacts

Definition at line 1155 of file Material.h.

◆ getContactReductionMode()

ContactMaterial::ContactReductionMode agx::ContactMaterial::getContactReductionMode ( ) const

Returns whether contact reduction is enabled for this surface material.

Returns
true if contact reduction is enabled.

Definition at line 1150 of file Material.h.

◆ getDamping()

Real agx::ContactMaterial::getDamping ( ) const

The value is the time the contact constraint has to fulfill its violation.

Returns
the damping of the material

Definition at line 1125 of file Material.h.

◆ getFrictionCoefficient()

Real agx::ContactMaterial::getFrictionCoefficient ( FrictionDirection  direction = PRIMARY_DIRECTION) const
Returns
the surface friction parameter.

Definition at line 1095 of file Material.h.

◆ getFrictionModel()

FrictionModel * agx::ContactMaterial::getFrictionModel ( ) const
Returns
the friction model used when two objects with this contact material collides

Definition at line 1130 of file Material.h.

◆ getImpactCompliance()

agx::Real agx::ContactMaterial::getImpactCompliance ( ) const
Returns
The compliance for calculating impact forces. Only used by granular body system impacts.

Definition at line 1230 of file Material.h.

◆ getMaterial1()

const Material * agx::ContactMaterial::getMaterial1 ( ) const
Returns
first material in this contact material

Definition at line 1140 of file Material.h.

Referenced by agxSDK::MaterialManager::getSymmetricPair().

◆ getMaterial2()

const Material * agx::ContactMaterial::getMaterial2 ( ) const
Returns
second material in this contact material

Definition at line 1145 of file Material.h.

Referenced by agxSDK::MaterialManager::getSymmetricPair().

◆ getMaxElasticRestLength()

Real agx::ContactMaterial::getMaxElasticRestLength ( ) const

Get the maximum elastic rest length of the contact material.

This is only used if the contact area approach is used (getUseContactAreaApproach()==true). For the effect of the elastic rest length, see the user manual.

Return values
maxElasticRestLengthThe max elastic rest length.

◆ getMinElasticRestLength()

Real agx::ContactMaterial::getMinElasticRestLength ( ) const

Get the minimum elastic rest length of the contact material.

This is only used if the contact area approach is used (getUseContactAreaApproach()==true). For the effect of the elastic rest length, see the user manual.

Return values
minElasticRestLengthThe min elastic rest length.

◆ getRestitution()

Real agx::ContactMaterial::getRestitution ( ) const
Returns
the restitution parameter.

Definition at line 1090 of file Material.h.

◆ getRollingResistanceCoefficient()

agx::Real agx::ContactMaterial::getRollingResistanceCoefficient ( ) const
Returns
The coefficient of the rolling resistance in the contact material.

Definition at line 1215 of file Material.h.

◆ getRollingResistanceCompliance()

agx::Real agx::ContactMaterial::getRollingResistanceCompliance ( ) const
Returns
Set the compliance of the rolling resistance constraint.

Definition at line 1220 of file Material.h.

◆ getSurfaceFrictionEnabled()

bool agx::ContactMaterial::getSurfaceFrictionEnabled ( ) const
Returns
true if surface friction should be used when calculating friction in the solver.

Definition at line 1115 of file Material.h.

◆ getSurfaceViscosity()

Real agx::ContactMaterial::getSurfaceViscosity ( FrictionDirection  direction = PRIMARY_DIRECTION) const
Returns
the surface viscosity in the primary or secondary direction.

Definition at line 1100 of file Material.h.

◆ getTangentialCohesion()

Real agx::ContactMaterial::getTangentialCohesion ( FrictionDirection  direction = PRIMARY_DIRECTION) const
Returns
the tangential cohesion parameter.

◆ getTangentialRestitution()

Real agx::ContactMaterial::getTangentialRestitution ( FrictionDirection  direction = PRIMARY_DIRECTION) const
Returns
the tangential resitution parameter for given tangential direction.

◆ getTwistingResistanceCoefficient()

agx::Real agx::ContactMaterial::getTwistingResistanceCoefficient ( ) const
Returns
The coefficient of the twisting resistance in the contact material.

◆ getTwistingResistanceCompliance()

agx::Real agx::ContactMaterial::getTwistingResistanceCompliance ( ) const
Returns
The compliance of the twisting resistance constraint.

Definition at line 1225 of file Material.h.

◆ getUseContactAreaApproach()

bool agx::ContactMaterial::getUseContactAreaApproach ( ) const

Should contacts using this contact material use the new approach for computing contact area? Default false.

Note
: experimental feature, not fully tested yet.

Definition at line 1235 of file Material.h.

◆ getWireFrictionCoefficient()

Real agx::ContactMaterial::getWireFrictionCoefficient ( FrictionDirection  direction = PRIMARY_DIRECTION) const
Returns
the wire friction parameter along the given direction

Definition at line 1240 of file Material.h.

◆ getYoungsModulus()

Real agx::ContactMaterial::getYoungsModulus ( ) const
Returns
the YoungsModulus of the material

Definition at line 1120 of file Material.h.

◆ isExplicit()

bool agx::ContactMaterial::isExplicit ( ) const
Returns
true if contact material is explicit (created by user)

Definition at line 1135 of file Material.h.

◆ setAdhesion()

void agx::ContactMaterial::setAdhesion ( Real  adhesion,
Real  adhesiveOverlap 
)

Set the adhesive force and allowed overlap between two colliding objects.

Parameters
adhesion- adhesive force >= 0, i.e., the attractive force. The value is clamped between zero and INFINITY.
adhesiveOverlap- allowed overlap (length >= 0) from surface for resting contact. At this overlap, no force is applied. At lower overlap, the adhesion force will work, at higher overlap, the (usual) contact force. The value is clamped between zero and INFINITY.

◆ setContactReductionBinResolution()

void agx::ContactMaterial::setContactReductionBinResolution ( agx::UInt8  binResolution)

Specify the resolution used when evaluating contacts for reduction between geometry contacts.

A high value will keep more contacts, lower will result in more aggressive reduction the default. Commonly a value of 2 or 3 will give good result. Values from 0 to 10 are valid, where a value of 0 means this will be overridden by the ContactReductionBinResolution from Space.

Parameters
binResolution- parameter to ContactReducer.

◆ setContactReductionMode()

void agx::ContactMaterial::setContactReductionMode ( ContactReductionMode  mode)

Specify if contact reduction should be enabled.

Parameters
mode- The mode, default is REDUCE_GEOMETRY

◆ setDamping()

void agx::ContactMaterial::setDamping ( Real  damping)

Set the damping of the material.

The value is the time the contact constraint has to fulfill its violation.

Parameters
dampingThe new damping value

◆ setEnableSurfaceFriction()

void agx::ContactMaterial::setEnableSurfaceFriction ( bool  flag)

Specify if surface friction should be calculated in the solver for this contact material.

◆ setFrictionCoefficient()

void agx::ContactMaterial::setFrictionCoefficient ( Real  friction,
FrictionDirection  direction = BOTH_PRIMARY_AND_SECONDARY 
)

Set the friction coefficient.

The value is clamped between zero and INFINITY

Parameters
friction- New friction coefficient
direction- Specifies for which direction the friction value will be set. Default is BOTH_PRIMARY_AND_SECONDARY

◆ setFrictionModel()

void agx::ContactMaterial::setFrictionModel ( FrictionModel frictionModel)

Set friction model for this contact material.

◆ setImpactCompliance()

void agx::ContactMaterial::setImpactCompliance ( agx::Real  impactCompliance)

Sets the compliance used for calculating impact forces.

Only used by granular body system impacts.

Parameters
impactComplianceThe compliance of the impact constraint.

◆ setMinMaxElasticRestLength()

bool agx::ContactMaterial::setMinMaxElasticRestLength ( Real  minElasticRestLength,
Real  maxElasticRestLength 
)

Set the minimum and maximum elastic rest length of the contact material.

This is only used if the contact area approach is used (getUseContactAreaApproach()==true). It sets the minimum and maximum allowed value for the elastic rest length of the material - values below will be clamped to the min, values above will be clamped to the max. If the value has not been set: in contact between materials m1 and m2, the min elastic rest of the contact material cm(m1, m2) will have the sum of m1's and m2's min elastic rest length, and the max elastic rest length of cm(m1, m2) will be the sum of m1's and m2's max elastic rest length. For the effect of the elastic rest length, see the user manual.

Parameters
minElasticRestLengthThe min elastic rest length. Only values > 0 allowed. Has to be <= maxElasticRestLength.
maxElasticRestLengthThe max elastic rest length. Only values > 0 allowed. Has to be >= minElasticRestLength.
Return values
Success- Are the values in the allowed range and have thus been applied?

◆ setRestitution()

void agx::ContactMaterial::setRestitution ( Real  restitution)

Set the restitution parameter.

The value is clamped between zero and INFINITY

Parameters
restitution- New restitution value.

◆ setRollingResistanceCoefficient()

void agx::ContactMaterial::setRollingResistanceCoefficient ( agx::Real  rollingCoefficient)

Sets the rolling resistance coefficient of the contact material.

Only works with contacts that include particles from GranularBodySystem.

Parameters
rollingCoefficient- The coefficient of the rolling resistance.

◆ setRollingResistanceCompliance()

void agx::ContactMaterial::setRollingResistanceCompliance ( agx::Real  compliance)

Sets the rolling resistance compliance in the contact material.

Only works with contacts that include particles from GranularBodySystem.

Parameters
complianceThe compliance of the rolling resistance constraint.

◆ setSurfaceViscosity()

void agx::ContactMaterial::setSurfaceViscosity ( Real  viscosity,
FrictionDirection  direction = BOTH_PRIMARY_AND_SECONDARY 
)

Assign the surface viscosity, i.e., how wet the friction is between the colliding materials.

Default: ~1E-8. It's possible to have different viscosities in primary and secondary directions.

Parameters
viscosity- New viscosity value.
direction- Specifies for which direction the viscosity value will be set. Default is BOTH_PRIMARY_AND_SECONDARY

◆ setTangentialCohesion()

void agx::ContactMaterial::setTangentialCohesion ( Real  cohesion,
FrictionDirection  direction = BOTH_PRIMARY_AND_SECONDARY 
)

Set the tangential cohesion (Pa) of the contact material.

The value is clamped between zero and INFINITY

Parameters
cohesion- The tangential cohesion (Pa)
direction- Specifies for which direction the tangential cohesion value will be set. Default is BOTH_PRIMARY_AND_SECONDARY

◆ setTangentialRestitution()

void agx::ContactMaterial::setTangentialRestitution ( Real  restitution,
FrictionDirection  direction = BOTH_PRIMARY_AND_SECONDARY 
)

Set the tangential restitution coefficient for a given tangential direction, or both.

The default tangential restitutions are zero and restitution will be clamped between zero and infinity.

Parameters
restitution- New tangential restitution value.
direction- Specifies for which direction the tangential restitution value will be set. Default is BOTH_PRIMARY_AND_SECONDARY.

◆ setTwistingResistanceCoefficient()

void agx::ContactMaterial::setTwistingResistanceCoefficient ( agx::Real  twistingCoefficient)

Sets the twisting resistance coefficient of the contact material.

Only works with contacts that include particles from GranularBodySystem.

Parameters
twistingCoefficient- The coefficient of the twisting resistance.

◆ setTwistingResistanceCompliance()

void agx::ContactMaterial::setTwistingResistanceCompliance ( agx::Real  compliance)

Sets the twisting resistance compliance in the contact material.

Only works with contacts that include particles from GranularBodySystem.

Parameters
complianceThe compliance of the twisting resistance constraint.

◆ setUseContactAreaApproach()

void agx::ContactMaterial::setUseContactAreaApproach ( bool  useContactAreaApproach)

Should contacts using this contact material use the new approach for computing contact area? Default false.

Note
: experimental feature, not fully tested yet.

◆ setWireFrictionCoefficient()

void agx::ContactMaterial::setWireFrictionCoefficient ( Real  friction,
FrictionDirection  direction = BOTH_PRIMARY_AND_SECONDARY 
)

Set the friction coefficient used by the contact nodes in the wires.

The primary direction is along the wire and the secondary direction is long the contact edge on the object the wire contact is sliding (close to orthogonal to the wire direction). The value is clamped between zero and INFINITY

Parameters
friction- New friction coefficient
direction- Specifies for which direction the friction value will be set. Default is BOTH_PRIMARY_AND_SECONDARY.

◆ setYoungsModulus()

void agx::ContactMaterial::setYoungsModulus ( Real  youngsModulus)

Set the YoungsModulus of the material, same as spring coefficient k.


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