9class DeformationAnalysis;
89 void SetPosition(
double x,
double y,
double z)
override;
103 void SetRodrigues(
double angle,
double axis_x,
double axis_y,
104 double axis_z)
override;
118 void SetQuaternion(
double q_0,
double q_1,
double q_2,
double q_3)
override;
130 void SetVelocity(
double v_x,
double v_y,
double v_z)
override;
240 void SaveAsVTK(std::string
const &filename)
override;
257 void InitFEMSimulator();
A class representing a deformable particle simulated using the Finite Element Method (FEM).
Definition deformable_particle.hpp:21
void SetVelocity(double v_x, double v_y, double v_z) override
Sets the velocity of the particle.
Definition deformable_particle.cpp:114
void SetRodrigues(double angle, double axis_x, double axis_y, double axis_z) override
Sets the angle and axis of rotation for the particle.
Definition deformable_particle.cpp:100
void SetPosition(double x, double y, double z) override
Sets the position of the particle.
Definition deformable_particle.cpp:82
void ClearForce() override
Clears all forces on the particle's mesh.
Definition deformable_particle.cpp:150
void ApplyContactForce(ContactPP const *cnt) override
Applies a contact force to the particle.
Definition deformable_particle.cpp:158
void UpdateMotion(double dt) override
Updates the motion of the particle.
Definition deformable_particle.cpp:183
void UpdateBoundFast() override
Updates the bounding box of the particle.
Definition deformable_particle.cpp:203
Vec3d GetVelocity(Vec3d const &pos) override
Gets the velocity of the particle at a given position.
Definition deformable_particle.cpp:118
void SetShape(Shape *s) override
Sets the shape of the particle.
Definition deformable_particle.cpp:21
TriMesh * trimesh
Pointer to the triangular mesh shape of the particle.
Definition deformable_particle.hpp:24
TetMesh tetmesh
The tetrahedral mesh used for the simulation.
Definition deformable_particle.hpp:27
void SetDensity(double dens) override
Sets the density of the particle.
Definition deformable_particle.cpp:71
int mesh_res
The resolution of the tetrahedral mesh.
Definition deformable_particle.hpp:33
~DeformableParticle() override
Destroys the DeformableParticle object and frees any memory used by it.
Definition deformable_particle.cpp:273
void UpdateBound() override
Updates the bounding box of the particle.
Definition deformable_particle.cpp:220
Particle * Clone() const override
Creates a new instance of this object.
Definition deformable_particle.cpp:17
void SaveAsVTK(std::string const &filename) override
Saves the particle as a VTK file.
Definition deformable_particle.cpp:269
void InitFEMMesh()
Initialized the mesh for FEM analysis.
Definition deformable_particle.cpp:48
void SaveSurfaceAsVTK(std::string const &filename)
Saves the surface of the particle as a VTK file.
Definition deformable_particle.cpp:228
void AddForce(int node_id, Vec3d const &f)
Adds a force to a node on the particle's mesh.
Definition deformable_particle.cpp:135
FEMSimulator fem_simulator
The FEM simulator object used to simulate the particle.
Definition deformable_particle.hpp:30
void SetQuaternion(double q_0, double q_1, double q_2, double q_3) override
Sets the orientation of the particle using a quaternion.
Definition deformable_particle.cpp:107
void UpdateShape()
Updates the shape of the particle.
Definition deformable_particle.cpp:194
DeformableParticle()
Constructs a new DeformableParticle object.
Definition deformable_particle.cpp:10
A Finite Element Method (FEM) simulator used for simulating the deformation of objects.
Definition fem_simulator.hpp:18
Definition particle.hpp:26
Vec3d pos
The position of the particle.
Definition particle.hpp:103
This class represents different types of shapes and performs various calculations on them.
Definition shape.hpp:15
A class that represents a tetrahedral mesh.
Definition tetmesh.hpp:17
A class representing a triangular mesh in 3D space.
Definition shape_trimesh.hpp:23
Definition bond_entry.hpp:7
node_id
Definition json_serilization.hpp:23
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18