NetDEM v1.0
Loading...
Searching...
No Matches
model_linear_spring.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "contact_model.hpp"
4
5namespace netdem {
6
16class LinearSpring : public ContactModel {
17public:
19 double kn{2e6}, kt{1e6}, beta{0.7}, mu{0.5};
20
25
33 LinearSpring(double kn, double kt, double mu, double beta);
34
39 nlohmann::json PackJson() override;
40
45 void InitFromJson(nlohmann::json const &js) override;
46
51 void SetProperty(nlohmann::json const &js) override;
52
58 void SetProperty(std::string const &name, double value) override;
59
64 ContactModel *Clone() const override;
65
75 void EvaluateForces(ContactForces *const cnt_forces,
76 CollisionGeometries &cnt_geoms, ContactPP *const cnt,
77 double dt) const override;
78
88 void EvaluateForces(ContactForces *const cnt_forces,
89 CollisionGeometries &cnt_geoms, ContactPW *const cnt,
90 double dt) const override;
91
95 void Print() const override;
96};
97
98} // namespace netdem
A class representing the geometries associated with a collision.
Definition collision_geometries.hpp:15
A class representing the contact forces and moments arising from a contact interaction.
Definition contact_forces.hpp:18
An abstract base class for contact models.
Definition contact_model.hpp:25
A class representing a contact between two particles.
Definition contact_pp.hpp:20
A class representing a contact between a particle and a wall.
Definition contact_pw.hpp:22
Contact model that uses linear spring elements to evaluate contact forces and moments.
Definition model_linear_spring.hpp:16
double kt
Definition model_linear_spring.hpp:19
double kn
< Parameters used to calculate contact forces.
Definition model_linear_spring.hpp:19
void SetProperty(std::string const &name, double value) override
Sets a specific contact model property.
void SetProperty(nlohmann::json const &js) override
Sets the contact model properties.
Definition model_linear_spring.cpp:52
ContactModel * Clone() const override
Creates a copy of this contact model.
Definition model_linear_spring.cpp:85
nlohmann::json PackJson() override
Packs the contact model properties into a JSON object.
Definition model_linear_spring.cpp:23
void EvaluateForces(ContactForces *const cnt_forces, CollisionGeometries &cnt_geoms, ContactPP *const cnt, double dt) const override
Evaluates the forces and moments between two particles using linear spring elements.
Definition model_linear_spring.cpp:87
LinearSpring()
Default constructor for LinearSpring.
Definition model_linear_spring.cpp:12
double mu
Definition model_linear_spring.hpp:19
double beta
Definition model_linear_spring.hpp:19
void Print() const override
Prints the contact model properties.
Definition model_linear_spring.cpp:134
void InitFromJson(nlohmann::json const &js) override
Initializes the contact model from a JSON object.
Definition model_linear_spring.cpp:34
Definition bond_entry.hpp:7