PeriDyno 1.0.0
Loading...
Searching...
No Matches
TetrahedralSystem.h
Go to the documentation of this file.
1#pragma once
2#include "Node.h"
3
4#include "Topology/TetrahedronSet.h"
5
6namespace dyno
7{
12 template<typename TDataType>
13 class TetrahedralSystem : public Node
14 {
16 public:
17 typedef typename TDataType::Real Real;
18 typedef typename TDataType::Coord Coord;
19
21 ~TetrahedralSystem() override;
22
23 DEF_ARRAY_STATE(Coord, NormalSDF, DeviceType::GPU, "");
24 DEF_VAR(Bool, SDF, false, "has SDF");
25
30
34 DEF_ARRAY_STATE(Coord, Position, DeviceType::GPU, "Vertex position");
35
39 DEF_ARRAY_STATE(Coord, Velocity, DeviceType::GPU, "Vertex velocity");
40
44 DEF_ARRAY_STATE(Coord, Force, DeviceType::GPU, "Vertex force");
45
46 public:
47 void loadVertexFromFile(std::string filename);
48 void loadVertexFromGmshFile(std::string filename);
49
50 virtual bool translate(Coord t);
51 virtual bool scale(Real s);
52 virtual bool rotate(Quat<Real> q);
53
54 protected:
55 void updateTopology() override;
56 void resetStates() override;
57 };
58}
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
DEF_ARRAY_STATE(Coord, Force, DeviceType::GPU, "Vertex force")
Vertex velocity.
DEF_VAR(Bool, SDF, false, "has SDF")
virtual bool scale(Real s)
virtual bool rotate(Quat< Real > q)
DEF_ARRAY_STATE(Coord, NormalSDF, DeviceType::GPU, "")
void loadVertexFromFile(std::string filename)
DEF_ARRAY_STATE(Coord, Velocity, DeviceType::GPU, "Vertex velocity")
Vertex velocity.
void loadVertexFromGmshFile(std::string filename)
DEF_ARRAY_STATE(Coord, Position, DeviceType::GPU, "Vertex position")
Vertex position.
DEF_INSTANCE_STATE(TetrahedronSet< TDataType >, TetrahedronSet, "Topology")
A topology.
virtual bool translate(Coord t)
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25