NetDEM v1.0
|
An abstract base class for contact models. More...
#include <contact_model.hpp>
Public Types | |
enum | Type { none , linear_spring , hertz_mindlin , volume_based , parallel_bond } |
Public Member Functions | |
virtual nlohmann::json | PackJson () |
Serialize this contact model to JSON format. | |
virtual void | InitFromJson (nlohmann::json const &js) |
Initialize this contact model from a JSON configuration object. | |
virtual void | SetProperty (nlohmann::json const &js) |
Set a property of this contact model from a JSON object. | |
virtual void | SetProperty (std::string const &name, double value) |
Set a property of this contact model by name and value. | |
virtual ContactModel * | Clone () const |
Create a new instance of this contact model. | |
virtual void | EvaluateForces (ContactForces *const cnt_forces, CollisionGeometries &cnt_geoms, ContactPP *const cnt, double dt) const |
Calculate the contact forces and moments due to this model. | |
virtual void | EvaluateForces (ContactForces *const cnt_forces, BondGeometries &cnt_geoms, ContactPP *const cnt, double dt) const |
Calculate the contact forces and moments due to this model. | |
virtual void | EvaluateForces (ContactForces *const cnt_forces, CollisionGeometries &cnt_geoms, ContactPW *const cnt, double dt) const |
Calculate the contact forces and moments due to this model. | |
virtual void | EvaluateForces (ContactForces *const cnt_forces, BondGeometries &cnt_geoms, ContactPW *const cnt, double dt) const |
Calculate the contact forces and moments due to this model. | |
virtual void | Print () const |
Print debugging information about this contact model. | |
virtual | ~ContactModel () |
Public Attributes | |
int | id {0} |
std::string | label {"default"} |
int | model_type {0} |
std::string | model_name {"contact_model"} |
An abstract base class for contact models.
This class defines a set of virtual methods and member variables that must be implemented by any subclass representing a specific contact model. The Type
enumeration provides a list of possible model types, while the id
, label
, and model_name
variables can be used to identify and describe individual instances of contact models.
|
inlinevirtual |
A virtual destructor for this class.
|
inlinevirtual |
Create a new instance of this contact model.
This method creates a new instance of the current contact model and returns a pointer to it. This is a virtual method that can be overridden in any subclass of ContactModel
that needs to customize the cloning behavior.
Reimplemented in netdem::HertzMindlin, netdem::LinearSpring, netdem::ParallelBond, and netdem::VolumeBased.
|
inlinevirtual |
Calculate the contact forces and moments due to this model.
Given a set of bond geometries representing the contact interaction, this method calculates the resulting contact forces and moments and stores them in the provided ContactForces
object. This is a pure virtual method that must be implemented by any subclass of ContactModel
.
cnt_forces | A pointer to the ContactForces object to store the resulting forces and moments in. |
cnt_geoms | The bond geometries representing the contact interaction. |
cnt | A pointer to the ContactPP or ContactPW object representing the contact point(s). |
dt | The time step size for the simulation. |
Reimplemented in netdem::ParallelBond.
|
inlinevirtual |
Calculate the contact forces and moments due to this model.
Given a set of bond geometries representing the contact interaction, this method calculates the resulting contact forces and moments and stores them in the provided ContactForces
object. This is a pure virtual method that must be implemented by any subclass of ContactModel
.
cnt_forces | A pointer to the ContactForces object to store the resulting forces and moments in. |
cnt_geoms | The bond geometries representing the contact interaction. |
cnt | A pointer to the ContactPW object representing the contact point(s). |
dt | The time step size for the simulation. |
Reimplemented in netdem::ParallelBond.
|
inlinevirtual |
Calculate the contact forces and moments due to this model.
Given a set of collision or bond geometries representing the contact interaction, this method calculates the resulting contact forces and moments and stores them in the provided ContactForces
object. This is a pure virtual method that must be implemented by any subclass of ContactModel
.
cnt_forces | A pointer to the ContactForces object to store the resulting forces and moments in. |
cnt_geoms | The collision or bond geometries representing the contact interaction. |
cnt | A pointer to the ContactPP or ContactPW object representing the contact point(s). |
dt | The time step size for the simulation. |
Reimplemented in netdem::HertzMindlin, netdem::LinearSpring, and netdem::VolumeBased.
|
inlinevirtual |
Calculate the contact forces and moments due to this model.
Given a set of collision geometries representing the contact interaction, this method calculates the resulting contact forces and moments and stores them in the provided ContactForces
object. This is a pure virtual method that must be implemented by any subclass of ContactModel
.
cnt_forces | A pointer to the ContactForces object to store the resulting forces and moments in. |
cnt_geoms | The collision geometries representing the contact interaction. |
cnt | A pointer to the ContactPW object representing the contact point(s). |
dt | The time step size for the simulation. |
Reimplemented in netdem::HertzMindlin, netdem::LinearSpring, and netdem::VolumeBased.
|
inlinevirtual |
Initialize this contact model from a JSON configuration object.
Given a JSON object containing configuration data for this contact model, this method reads the data and updates the state of the object accordingly. This is a pure virtual method that must be implemented by any subclass of ContactModel
.
js | A JSON object containing configuration data for this contact model. |
Reimplemented in netdem::HertzMindlin, netdem::LinearSpring, netdem::ParallelBond, and netdem::VolumeBased.
|
inlinevirtual |
Serialize this contact model to JSON format.
This method converts the current state of the contact model to a JSON object and returns it as the result value.
Reimplemented in netdem::HertzMindlin, netdem::LinearSpring, netdem::ParallelBond, and netdem::VolumeBased.
|
inlinevirtual |
Print debugging information about this contact model.
This method prints a summary of the current state of the contact model to the console or log file, including the values of all member variables and any other relevant information.
Reimplemented in netdem::HertzMindlin, netdem::LinearSpring, netdem::ParallelBond, and netdem::VolumeBased.
|
inlinevirtual |
Set a property of this contact model from a JSON object.
Given a JSON object representing a named property of this contact model, this method reads the value of the property and updates the state of the object accordingly. This is a pure virtual method that must be implemented by any subclass of ContactModel
.
js | A JSON object representing a named property of this contact model. |
Reimplemented in netdem::HertzMindlin, netdem::LinearSpring, netdem::ParallelBond, and netdem::VolumeBased.
|
inlinevirtual |
Set a property of this contact model by name and value.
Given a string representing the name of a property and a value to set it to, this method updates the state of the contact model accordingly. This is a pure virtual method that must be implemented by any subclass of ContactModel
.
name | The name of the property to set. |
value | The new value of the property. |
Reimplemented in netdem::HertzMindlin, and netdem::LinearSpring.
int netdem::ContactModel::id {0} |
A unique identifier for this instance of the contact model.
std::string netdem::ContactModel::label {"default"} |
A descriptive label for this instance of the contact model.
std::string netdem::ContactModel::model_name {"contact_model"} |
The name of this contact model, used primarily for debugging and logging purposes.
int netdem::ContactModel::model_type {0} |
The type of this contact model, as one of the Type
enumeration values.