PeriDyno 1.0.0
Loading...
Searching...
No Matches
HyperelasticBody.h
Go to the documentation of this file.
1#pragma once
2
4#include "ParticleSystem/ParticleSystem.h"
5
7
8#include "Bond.h"
10#include "FilePath.h"
11
12namespace dyno
13{
14 template<typename> class PointSetToPointSet;
15 template<typename TDataType> class DistanceField3D;
16
17 template<typename TDataType>
18 class HyperelasticBody : public TetrahedralSystem<TDataType>
19 {
21 public:
22 typedef typename TDataType::Real Real;
23
24 typedef typename TDataType::Coord Coord;
25 typedef typename TDataType::Matrix Matrix;
26 typedef typename ::dyno::TBond<TDataType> Bond;
28
31
33 bool scale(Real s);
34 bool scale(Coord s);
35
36 bool rotate(Quat<Real> angle);
37
38 bool rotate(Coord angle);
39
44
45
46 void loadSDF(std::string filename, bool inverted);
47 //void updateStates() override;
48
49 public:
50 DEF_VAR(Vec3f, Location, 0, "Node location");
51 DEF_VAR(Vec3f, Rotation, 0, "Node rotation");
52 DEF_VAR(Vec3f, Scale, Vec3f(1.0f), "Node scale");
53
54 DEF_VAR(Real, Horizon, 0.01, "Horizon");
55
56 DEF_VAR(bool, AlphaComputed, true, "alphaComputed");
57
59
61
62 DEF_ARRAY_STATE(Coord, RestPosition, DeviceType::GPU, "");
63
64 DEF_ARRAYLIST_STATE(Bond, Bonds, DeviceType::GPU, "");
65
66 DEF_ARRAYLIST_STATE(Real, VolumePair, DeviceType::GPU, "");
67
68
69 DEF_ARRAY_STATE(Matrix, VertexRotation, DeviceType::GPU, "");
70
71 DEF_ARRAY_STATE(Attribute, Attribute, DeviceType::GPU, "");
72
73 DEF_ARRAY_STATE(Real, Volume, DeviceType::GPU, "");
74
75 DEF_VAR(bool, NeighborSearchingAdjacent, true, "");
76
77 DEF_VAR(FilePath, FileName, std::string(""), "");
78
79 DEF_ARRAY_STATE(Tetrahedron, Tets, DeviceType::GPU, "");
80
81 //DEF_ARRAY_STATE(Real, DisranceSDF, DeviceType::GPU, "");
82
83 //DEF_ARRAY_STATE(Coord, NormalSDF, DeviceType::GPU, "");
84
85
86 protected:
87 void resetStates() override;
88
89 virtual void updateRestShape();
90 virtual void updateVolume();
91 //std::shared_ptr<DistanceField3D<TDataType>> m_cSDF;
92 //DArray<Real> initDistance;
93 };
94}
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
particle attribute 0x00000000: [31-30]material; [29]motion; [28]Dynamic; [27-8]undefined yet,...
Definition Attribute.h:26
bool rotate(Quat< Real > angle)
::dyno::TBond< TDataType > Bond
DEF_ARRAY_STATE(Attribute, Attribute, DeviceType::GPU, "")
void setEnergyModel(NeoHookeanModel< Real > model)
DEF_ARRAY_STATE(Coord, RestPosition, DeviceType::GPU, "")
~HyperelasticBody() override
virtual void updateRestShape()
void loadSDF(std::string filename, bool inverted)
void resetStates() override
DEF_ARRAY_STATE(Matrix, VertexRotation, DeviceType::GPU, "")
DEF_VAR(FilePath, FileName, std::string(""), "")
TopologyModule::Tetrahedron Tetrahedron
DEF_ARRAYLIST_STATE(Real, VolumePair, DeviceType::GPU, "")
DEF_ARRAYLIST_STATE(Bond, Bonds, DeviceType::GPU, "")
DEF_ARRAY_STATE(Tetrahedron, Tets, DeviceType::GPU, "")
DEF_VAR(Vec3f, Scale, Vec3f(1.0f), "Node scale")
DEF_VAR(bool, NeighborSearchingAdjacent, true, "")
void setEnergyModel(StVKModel< Real > model)
DEF_VAR(Vec3f, Rotation, 0, "Node rotation")
DEF_VAR(bool, AlphaComputed, true, "alphaComputed")
DEF_VAR(EnergyModels< Real >, EnergyModel, EnergyModels< Real >(), "")
virtual void updateVolume()
bool translate(Coord t)
void setEnergyModel(LinearModel< Real > model)
TDataType::Matrix Matrix
bool rotate(Coord angle)
DEF_VAR(Vec3f, Location, 0, "Node location")
DEF_ARRAY_STATE(Real, Volume, DeviceType::GPU, "")
DEF_VAR(EnergyType, EnergyType, NeoHooekean, "")
DEF_VAR(Real, Horizon, 0.01, "Horizon")
void setEnergyModel(XuModel< Real > model)
VectorND< PointType, 4 > Tetrahedron
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Vector< float, 3 > Vec3f
Definition Vector3D.h:93