PeriDyno 1.0.0
Loading...
Searching...
No Matches
dyno::HyperelasticBody< TDataType > Class Template Reference

#include <HyperelasticBody.h>

Inheritance diagram for dyno::HyperelasticBody< TDataType >:
Collaboration diagram for dyno::HyperelasticBody< TDataType >:

Public Types

typedef TDataType::Real Real
 
typedef TDataType::Coord Coord
 
typedef TDataType::Matrix Matrix
 
typedef ::dyno::TBond< TDataType > Bond
 
typedef TopologyModule::Tetrahedron Tetrahedron
 
- Public Types inherited from dyno::TetrahedralSystem< TDataType >
typedef TDataType::Real Real
 
typedef TDataType::Coord Coord
 
- Public Types inherited from dyno::Node
template<class T>
using SPtr = std::shared_ptr<T>
 
- Public Types inherited from dyno::OBase
typedef std::vector< FBase * > FieldVector
 
typedef std::map< FieldID, FBase * > FieldMap
 

Public Member Functions

 HyperelasticBody ()
 
 ~HyperelasticBody () override
 
bool translate (Coord t)
 
bool scale (Real s)
 
bool scale (Coord s)
 
bool rotate (Quat< Real > angle)
 
bool rotate (Coord angle)
 
void setEnergyModel (StVKModel< Real > model)
 
void setEnergyModel (LinearModel< Real > model)
 
void setEnergyModel (NeoHookeanModel< Real > model)
 
void setEnergyModel (XuModel< Real > model)
 
void loadSDF (std::string filename, bool inverted)
 
 DEF_VAR (Vec3f, Location, 0, "Node location")
 
 DEF_VAR (Vec3f, Rotation, 0, "Node rotation")
 
 DEF_VAR (Vec3f, Scale, Vec3f(1.0f), "Node scale")
 
 DEF_VAR (Real, Horizon, 0.01, "Horizon")
 
 DEF_VAR (bool, AlphaComputed, true, "alphaComputed")
 
 DEF_VAR (EnergyType, EnergyType, NeoHooekean, "")
 
 DEF_VAR (EnergyModels< Real >, EnergyModel, EnergyModels< Real >(), "")
 
 DEF_ARRAY_STATE (Coord, RestPosition, DeviceType::GPU, "")
 
 DEF_ARRAYLIST_STATE (Bond, Bonds, DeviceType::GPU, "")
 
 DEF_ARRAYLIST_STATE (Real, VolumePair, DeviceType::GPU, "")
 
 DEF_ARRAY_STATE (Matrix, VertexRotation, DeviceType::GPU, "")
 
 DEF_ARRAY_STATE (Attribute, Attribute, DeviceType::GPU, "")
 
 DEF_ARRAY_STATE (Real, Volume, DeviceType::GPU, "")
 
 DEF_VAR (bool, NeighborSearchingAdjacent, true, "")
 
 DEF_VAR (FilePath, FileName, std::string(""), "")
 
 DEF_ARRAY_STATE (Tetrahedron, Tets, DeviceType::GPU, "")
 
- Public Member Functions inherited from dyno::TetrahedralSystem< TDataType >
 TetrahedralSystem ()
 
 ~TetrahedralSystem () override
 
 DEF_ARRAY_STATE (Coord, NormalSDF, DeviceType::GPU, "")
 
 DEF_VAR (Bool, SDF, false, "has SDF")
 
 DEF_INSTANCE_STATE (TetrahedronSet< TDataType >, TetrahedronSet, "Topology")
 A topology.
 
 DEF_ARRAY_STATE (Coord, Position, DeviceType::GPU, "Vertex position")
 Vertex position.
 
 DEF_ARRAY_STATE (Coord, Velocity, DeviceType::GPU, "Vertex velocity")
 Vertex velocity.
 
 DEF_ARRAY_STATE (Coord, Force, DeviceType::GPU, "Vertex force")
 Vertex velocity.
 
void loadVertexFromFile (std::string filename)
 
void loadVertexFromGmshFile (std::string filename)
 
- Public Member Functions inherited from dyno::Node
 Node ()
 
 ~Node () override
 
void setName (std::string name)
 
std::string getName () override
 
virtual std::string getNodeType ()
 
bool isAutoSync ()
 
bool isAutoHidden ()
 
void setAutoSync (bool con)
 Whether the node can be automatically synchronized when its ancestor is updated.
 
void setAutoHidden (bool con)
 
virtual bool isActive ()
 Check the state of dynamics.
 
virtual void setActive (bool active)
 Set the state of dynamics.
 
virtual bool isVisible ()
 Check the visibility of context.
 
virtual void setVisible (bool visible)
 Set the visibility of context.
 
virtual Real getDt ()
 Simulation timestep.
 
void setDt (Real dt)
 
void setSceneGraph (SceneGraph *scn)
 
SceneGraphgetSceneGraph ()
 
std::vector< NodePort * > & getImportNodes ()
 
std::vector< NodePort * > & getExportNodes ()
 
bool addModule (std::shared_ptr< Module > module)
 Add a module to m_module_list and other special module lists.
 
bool deleteModule (std::shared_ptr< Module > module)
 
template<class TModule>
bool addModule (std::shared_ptr< TModule > tModule)
 Add a speical kind of module.
 
template<class TModule>
bool deleteModule (std::shared_ptr< TModule > tModule)
 
std::list< std::shared_ptr< Module > > & getModuleList ()
 
bool hasModule (std::string name)
 
std::shared_ptr< ModulegetModule (std::string name)
 Get a module by its name.
 
template<class TModule>
std::shared_ptr< TModule > getModule ()
 Get the Module by the module class name.
 
template<class TModule>
std::shared_ptr< TModule > getModule (std::string name)
 
std::shared_ptr< PipelineresetPipeline ()
 
std::shared_ptr< AnimationPipelineanimationPipeline ()
 
std::shared_ptr< GraphicsPipelinegraphicsPipeline ()
 
template<class TModule>
std::shared_ptr< TModule > addModule (std::string name)
 
void update ()
 Called every time interval.
 
void updateGraphicsContext ()
 
void reset ()
 
virtual NBoundingBox boundingBox ()
 
bool connect (NodePort *nPort)
 Depth-first tree traversal.
 
bool disconnect (NodePort *nPort)
 
bool attachField (FBase *field, std::string name, std::string desc, bool autoDestroy=true) override
 Attach a field to Node.
 
std::vector< NodePort * > & getAllNodePorts ()
 
uint sizeOfNodePorts ()
 
uint sizeOfImportNodes () const
 
uint sizeOfExportNodes () const
 
void setForceUpdate (bool b)
 
 DEF_VAR_STATE (Real, ElapsedTime, 0, "Elapsed Time")
 
 DEF_VAR_STATE (Real, TimeStep, Real(0.033), "Time step size")
 
 DEF_VAR_STATE (uint, FrameNumber, 0, "Frame number")
 
- Public Member Functions inherited from dyno::OBase
 OBase ()
 
 ~OBase () override
 
virtual std::string caption ()
 Return the caption.
 
virtual bool captionVisible ()
 Whether to hide the caption in the GUI.
 
virtual std::string description ()
 Return a description for the node or module, override this function to support user-defined description.
 
bool addField (FBase *data)
 Add a field to Base FieldID will be set to the name of Field by default.
 
bool addField (FieldID name, FBase *data)
 Add a field to Base.
 
bool addFieldAlias (FieldID name, FBase *data)
 
bool addFieldAlias (FieldID name, FBase *data, FieldMap &fieldAlias)
 
bool findField (FBase *data)
 Find a field by its pointer.
 
bool findFieldAlias (const FieldID name)
 Find a field by its name.
 
bool findFieldAlias (const FieldID name, FieldMap &fieldAlias)
 Find a field in fieldAlias by its name This function is typically called by other functions.
 
bool removeField (FBase *data)
 Remove a field by its pointer.
 
bool removeFieldAlias (const FieldID name)
 Remove a field by its name.
 
bool removeFieldAlias (const FieldID name, FieldMap &fieldAlias)
 
FBasegetField (const FieldID name)
 Return a field by its name.
 
std::vector< FBase * > & getAllFields ()
 
template<typename T>
TgetField (FieldID name)
 
bool isAllFieldsReady ()
 Check the completeness of all required fields.
 
std::vector< FieldIDgetFieldAlias (FBase *data)
 
int getFieldAliasCount (FBase *data)
 
void setBlockCoord (float x, float y)
 
float bx ()
 
float by ()
 
bool findInputField (FBase *field)
 
bool addInputField (FBase *field)
 
bool removeInputField (FBase *field)
 
std::vector< FBase * > & getInputFields ()
 
bool findOutputField (FBase *field)
 
bool addOutputField (FBase *field)
 
bool addToOutput (FBase *field)
 
bool removeOutputField (FBase *field)
 
bool removeFromOutput (FBase *field)
 
std::vector< FBase * > & getOutputFields ()
 
bool findParameter (FBase *field)
 
bool addParameter (FBase *field)
 
bool removeParameter (FBase *field)
 
std::vector< FBase * > & getParameters ()
 
- Public Member Functions inherited from dyno::Object
 Object ()
 
virtual ~Object ()
 
ObjectId objectId ()
 

Protected Member Functions

void resetStates () override
 
virtual void updateRestShape ()
 
virtual void updateVolume ()
 
- Protected Member Functions inherited from dyno::TetrahedralSystem< TDataType >
void updateTopology () override
 
void resetStates () override
 
- Protected Member Functions inherited from dyno::Node
bool appendExportNode (NodePort *nodePort)
 
bool removeExportNode (NodePort *nodePort)
 
virtual void preUpdateStates ()
 
virtual void updateStates ()
 
virtual void postUpdateStates ()
 
virtual bool validateInputs ()
 
virtual bool requireUpdate ()
 
void tick ()
 notify all state and output fields are updated
 

Additional Inherited Members

- Static Public Member Functions inherited from dyno::Object
static bool registerClass (ClassInfo *ci)
 
static ObjectcreateObject (std::string name)
 
static std::map< std::string, ClassInfo * > * getClassMap ()
 
static ObjectId baseId ()
 Base Id.
 
- Public Attributes inherited from dyno::Node
std::string m_node_name
 
- Protected Attributes inherited from dyno::OBase
std::vector< FBase * > fields_input
 
std::vector< FBase * > fields_output
 
std::vector< FBase * > fields_param
 

Detailed Description

template<typename TDataType>
class dyno::HyperelasticBody< TDataType >

Definition at line 18 of file HyperelasticBody.h.

Member Typedef Documentation

◆ Bond

template<typename TDataType>
typedef ::dyno::TBond<TDataType> dyno::HyperelasticBody< TDataType >::Bond

Definition at line 26 of file HyperelasticBody.h.

◆ Coord

template<typename TDataType>
typedef TDataType::Coord dyno::HyperelasticBody< TDataType >::Coord

Definition at line 24 of file HyperelasticBody.h.

◆ Matrix

template<typename TDataType>
typedef TDataType::Matrix dyno::HyperelasticBody< TDataType >::Matrix

Definition at line 25 of file HyperelasticBody.h.

◆ Real

template<typename TDataType>
typedef TDataType::Real dyno::HyperelasticBody< TDataType >::Real

Definition at line 22 of file HyperelasticBody.h.

◆ Tetrahedron

template<typename TDataType>
typedef TopologyModule::Tetrahedron dyno::HyperelasticBody< TDataType >::Tetrahedron

Definition at line 27 of file HyperelasticBody.h.

Constructor & Destructor Documentation

◆ HyperelasticBody()

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::HyperelasticBody ( )

◆ ~HyperelasticBody()

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::~HyperelasticBody ( )
override

Member Function Documentation

◆ DEF_ARRAY_STATE() [1/5]

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::DEF_ARRAY_STATE ( Attribute ,
Attribute ,
DeviceType::GPU ,
""  )

◆ DEF_ARRAY_STATE() [2/5]

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::DEF_ARRAY_STATE ( Coord ,
RestPosition ,
DeviceType::GPU ,
""  )

◆ DEF_ARRAY_STATE() [3/5]

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::DEF_ARRAY_STATE ( Matrix ,
VertexRotation ,
DeviceType::GPU ,
""  )

◆ DEF_ARRAY_STATE() [4/5]

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::DEF_ARRAY_STATE ( Real ,
Volume ,
DeviceType::GPU ,
""  )

◆ DEF_ARRAY_STATE() [5/5]

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::DEF_ARRAY_STATE ( Tetrahedron ,
Tets ,
DeviceType::GPU ,
""  )

◆ DEF_ARRAYLIST_STATE() [1/2]

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::DEF_ARRAYLIST_STATE ( Bond ,
Bonds ,
DeviceType::GPU ,
""  )

◆ DEF_ARRAYLIST_STATE() [2/2]

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::DEF_ARRAYLIST_STATE ( Real ,
VolumePair ,
DeviceType::GPU ,
""  )

◆ DEF_VAR() [1/9]

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::DEF_VAR ( bool ,
AlphaComputed ,
true ,
"alphaComputed"  )

◆ DEF_VAR() [2/9]

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::DEF_VAR ( bool ,
NeighborSearchingAdjacent ,
true ,
""  )

◆ DEF_VAR() [3/9]

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::DEF_VAR ( EnergyModels< Real > ,
EnergyModel ,
EnergyModels< Real > (),
""  )

◆ DEF_VAR() [4/9]

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::DEF_VAR ( EnergyType ,
EnergyType ,
NeoHooekean ,
""  )

◆ DEF_VAR() [5/9]

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::DEF_VAR ( FilePath ,
FileName ,
std::string("") ,
""  )

◆ DEF_VAR() [6/9]

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::DEF_VAR ( Real ,
Horizon ,
0. 01,
"Horizon"  )

◆ DEF_VAR() [7/9]

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::DEF_VAR ( Vec3f ,
Location ,
0 ,
"Node location"  )

◆ DEF_VAR() [8/9]

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::DEF_VAR ( Vec3f ,
Rotation ,
0 ,
"Node rotation"  )

◆ DEF_VAR() [9/9]

template<typename TDataType>
dyno::HyperelasticBody< TDataType >::DEF_VAR ( Vec3f ,
Scale ,
Vec3f(1.0f) ,
"Node scale"  )

◆ loadSDF()

template<typename TDataType>
void dyno::HyperelasticBody< TDataType >::loadSDF ( std::string filename,
bool inverted )

◆ resetStates()

template<typename TDataType>
void dyno::HyperelasticBody< TDataType >::resetStates ( )
overrideprotectedvirtual

Reimplemented from dyno::Node.

◆ rotate() [1/2]

template<typename TDataType>
bool dyno::HyperelasticBody< TDataType >::rotate ( Coord angle)

◆ rotate() [2/2]

template<typename TDataType>
bool dyno::HyperelasticBody< TDataType >::rotate ( Quat< Real > angle)
virtual

◆ scale() [1/2]

template<typename TDataType>
bool dyno::HyperelasticBody< TDataType >::scale ( Coord s)

◆ scale() [2/2]

template<typename TDataType>
bool dyno::HyperelasticBody< TDataType >::scale ( Real s)
virtual

◆ setEnergyModel() [1/4]

template<typename TDataType>
void dyno::HyperelasticBody< TDataType >::setEnergyModel ( LinearModel< Real > model)

◆ setEnergyModel() [2/4]

template<typename TDataType>
void dyno::HyperelasticBody< TDataType >::setEnergyModel ( NeoHookeanModel< Real > model)

◆ setEnergyModel() [3/4]

template<typename TDataType>
void dyno::HyperelasticBody< TDataType >::setEnergyModel ( StVKModel< Real > model)

◆ setEnergyModel() [4/4]

template<typename TDataType>
void dyno::HyperelasticBody< TDataType >::setEnergyModel ( XuModel< Real > model)

◆ translate()

template<typename TDataType>
bool dyno::HyperelasticBody< TDataType >::translate ( Coord t)
virtual

◆ updateRestShape()

template<typename TDataType>
virtual void dyno::HyperelasticBody< TDataType >::updateRestShape ( )
protectedvirtual

◆ updateVolume()

template<typename TDataType>
virtual void dyno::HyperelasticBody< TDataType >::updateVolume ( )
protectedvirtual

The documentation for this class was generated from the following file: