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

#include <PJSNJSConstraintSolver.h>

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

Public Types

typedef TDataType::Real Real
 
typedef TDataType::Coord Coord
 
typedef TDataType::Matrix Matrix
 
typedef ::dyno::Quat< RealTQuat
 
typedef ::dyno::TContactPair< RealContactPair
 
typedef ::dyno::TConstraintPair< RealConstraint
 
typedef ::dyno::BallAndSocketJoint< RealBallAndSocketJoint
 
typedef ::dyno::SliderJoint< RealSliderJoint
 
typedef ::dyno::HingeJoint< RealHingeJoint
 
typedef ::dyno::FixedJoint< RealFixedJoint
 
typedef ::dyno::PointJoint< RealPointJoint
 
- Public Types inherited from dyno::OBase
typedef std::vector< FBase * > FieldVector
 
typedef std::map< FieldID, FBase * > FieldMap
 

Public Member Functions

 PJSNJSConstraintSolver ()
 
 ~PJSNJSConstraintSolver ()
 
 DEF_VAR (bool, FrictionEnabled, true, "")
 
 DEF_VAR (bool, GravityEnabled, true, "")
 
 DEF_VAR (Real, GravityValue, 9.8, "")
 
 DEF_VAR (Real, FrictionCoefficient, 100, "")
 
 DEF_VAR (Real, Slop, 0, "")
 
 DEF_VAR (Real, BaumgarteBias, 1.0, "")
 
 DEF_VAR (uint, IterationNumberForVelocitySolver, 100, "")
 
 DEF_VAR (uint, IterationNumberForPositionSolver, 200, "")
 
 DEF_VAR (Real, LinearDamping, 0.1, "")
 
 DEF_VAR (Real, AngularDamping, 0.1, "")
 
 DEF_VAR_IN (Real, TimeStep, "Time step size")
 
 DEF_ARRAY_IN (Real, Mass, DeviceType::GPU, "Mass of rigid bodies")
 
 DEF_ARRAY_IN (Coord, Center, DeviceType::GPU, "Center of rigid bodies")
 
 DEF_ARRAY_IN (Coord, Velocity, DeviceType::GPU, "Velocity of rigid bodies")
 
 DEF_ARRAY_IN (Coord, AngularVelocity, DeviceType::GPU, "Angular velocity of rigid bodies")
 
 DEF_ARRAY_IN (Matrix, RotationMatrix, DeviceType::GPU, "Rotation matrix of rigid bodies")
 
 DEF_ARRAY_IN (Matrix, Inertia, DeviceType::GPU, "Interial matrix")
 
 DEF_ARRAY_IN (Matrix, InitialInertia, DeviceType::GPU, "Interial matrix")
 
 DEF_ARRAY_IN (TQuat, Quaternion, DeviceType::GPU, "Quaternion")
 
 DEF_ARRAY_IN (ContactPair, Contacts, DeviceType::GPU, "")
 
 DEF_INSTANCE_IN (DiscreteElements< TDataType >, DiscreteElements, "")
 
 DEF_ARRAY_IN (Attribute, Attribute, DeviceType::GPU, "Rigid body attributes")
 
 DEF_ARRAY_IN (Real, FrictionCoefficients, DeviceType::GPU, "FrictionCoefficients of rigid bodies")
 
- Public Member Functions inherited from dyno::ConstraintModule
 ConstraintModule ()
 
 ~ConstraintModule () override
 
std::string getModuleType () override
 
- Public Member Functions inherited from dyno::Module
 Module (std::string name="default")
 
 ~Module (void) override
 
bool initialize ()
 
void update ()
 
void setName (std::string name)
 
std::string getName () override
 
virtual void setParentNode (Node *node)
 Set the parent node.
 
NodegetParentNode ()
 
SceneGraphgetSceneGraph ()
 
bool isInitialized ()
 
bool attachField (FBase *field, std::string name, std::string desc, bool autoDestroy=true) override
 Attach a field to Base.
 
bool isInputComplete ()
 Check the completeness of input fields.
 
bool isOutputCompete ()
 
 DEF_VAR (bool, ForceUpdate, false, "")
 
void setUpdateAlways (bool b)
 Set the update strategy for the module.
 
- 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 constrain () override
 
- Protected Member Functions inherited from dyno::ConstraintModule
void updateImpl () override
 
- Protected Member Functions inherited from dyno::Module
virtual bool initializeImpl ()
 
virtual void preprocess ()
 
virtual void postprocess ()
 
virtual bool validateInputs ()
 
virtual bool validateOutputs ()
 
virtual bool requireUpdate ()
 
virtual void updateStarted ()
 Two functions called at the beginning and end of update() used for debug.
 
virtual void updateEnded ()
 

Private Member Functions

void initializeJacobian (Real dt)
 
void initializeJacobianForNJS ()
 

Private Attributes

DArray< CoordmJ
 
DArray< CoordmJ_p
 
DArray< CoordmB
 
DArray< CoordmB_p
 
DArray< CoordmImpulseC
 
DArray< CoordmImpulseExt
 
DArray< RealmEta
 
DArray< RealmEta_p
 
DArray< RealmLambda
 
DArray< ContactPairmContactsInLocalFrame
 
DArray< ConstraintmVelocityConstraints
 
DArray< ConstraintmPositionConstraints
 
DArray< int > mContactNumber
 
DArray< RealmK_1
 
DArray< Mat2fmK_2
 
DArray< MatrixmK_3
 

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.
 
- 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::PJSNJSConstraintSolver< TDataType >

Definition at line 30 of file PJSNJSConstraintSolver.h.

Member Typedef Documentation

◆ BallAndSocketJoint

template<typename TDataType>
typedef ::dyno::BallAndSocketJoint<Real> dyno::PJSNJSConstraintSolver< TDataType >::BallAndSocketJoint

Definition at line 42 of file PJSNJSConstraintSolver.h.

◆ Constraint

template<typename TDataType>
typedef ::dyno::TConstraintPair<Real> dyno::PJSNJSConstraintSolver< TDataType >::Constraint

Definition at line 40 of file PJSNJSConstraintSolver.h.

◆ ContactPair

template<typename TDataType>
typedef ::dyno::TContactPair<Real> dyno::PJSNJSConstraintSolver< TDataType >::ContactPair

Definition at line 39 of file PJSNJSConstraintSolver.h.

◆ Coord

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

Definition at line 35 of file PJSNJSConstraintSolver.h.

◆ FixedJoint

template<typename TDataType>
typedef ::dyno::FixedJoint<Real> dyno::PJSNJSConstraintSolver< TDataType >::FixedJoint

Definition at line 45 of file PJSNJSConstraintSolver.h.

◆ HingeJoint

template<typename TDataType>
typedef ::dyno::HingeJoint<Real> dyno::PJSNJSConstraintSolver< TDataType >::HingeJoint

Definition at line 44 of file PJSNJSConstraintSolver.h.

◆ Matrix

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

Definition at line 36 of file PJSNJSConstraintSolver.h.

◆ PointJoint

template<typename TDataType>
typedef ::dyno::PointJoint<Real> dyno::PJSNJSConstraintSolver< TDataType >::PointJoint

Definition at line 46 of file PJSNJSConstraintSolver.h.

◆ Real

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

Definition at line 34 of file PJSNJSConstraintSolver.h.

◆ SliderJoint

template<typename TDataType>
typedef ::dyno::SliderJoint<Real> dyno::PJSNJSConstraintSolver< TDataType >::SliderJoint

Definition at line 43 of file PJSNJSConstraintSolver.h.

◆ TQuat

template<typename TDataType>
typedef ::dyno::Quat<Real> dyno::PJSNJSConstraintSolver< TDataType >::TQuat

Definition at line 38 of file PJSNJSConstraintSolver.h.

Constructor & Destructor Documentation

◆ PJSNJSConstraintSolver()

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

◆ ~PJSNJSConstraintSolver()

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::~PJSNJSConstraintSolver ( )

Member Function Documentation

◆ constrain()

template<typename TDataType>
void dyno::PJSNJSConstraintSolver< TDataType >::constrain ( )
overrideprotectedvirtual

◆ DEF_ARRAY_IN() [1/11]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_ARRAY_IN ( Attribute ,
Attribute ,
DeviceType::GPU ,
"Rigid body attributes"  )

◆ DEF_ARRAY_IN() [2/11]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_ARRAY_IN ( ContactPair ,
Contacts ,
DeviceType::GPU ,
""  )

◆ DEF_ARRAY_IN() [3/11]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_ARRAY_IN ( Coord ,
AngularVelocity ,
DeviceType::GPU ,
"Angular velocity of rigid bodies"  )

◆ DEF_ARRAY_IN() [4/11]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_ARRAY_IN ( Coord ,
Center ,
DeviceType::GPU ,
"Center of rigid bodies"  )

◆ DEF_ARRAY_IN() [5/11]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_ARRAY_IN ( Coord ,
Velocity ,
DeviceType::GPU ,
"Velocity of rigid bodies"  )

◆ DEF_ARRAY_IN() [6/11]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_ARRAY_IN ( Matrix ,
Inertia ,
DeviceType::GPU ,
"Interial matrix"  )

◆ DEF_ARRAY_IN() [7/11]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_ARRAY_IN ( Matrix ,
InitialInertia ,
DeviceType::GPU ,
"Interial matrix"  )

◆ DEF_ARRAY_IN() [8/11]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_ARRAY_IN ( Matrix ,
RotationMatrix ,
DeviceType::GPU ,
"Rotation matrix of rigid bodies"  )

◆ DEF_ARRAY_IN() [9/11]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_ARRAY_IN ( Real ,
FrictionCoefficients ,
DeviceType::GPU ,
"FrictionCoefficients of rigid bodies"  )

◆ DEF_ARRAY_IN() [10/11]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_ARRAY_IN ( Real ,
Mass ,
DeviceType::GPU ,
"Mass of rigid bodies"  )

◆ DEF_ARRAY_IN() [11/11]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_ARRAY_IN ( TQuat ,
Quaternion ,
DeviceType::GPU ,
"Quaternion"  )

◆ DEF_INSTANCE_IN()

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_INSTANCE_IN ( DiscreteElements< TDataType > ,
DiscreteElements ,
""  )

◆ DEF_VAR() [1/10]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_VAR ( bool ,
FrictionEnabled ,
true ,
""  )

◆ DEF_VAR() [2/10]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_VAR ( bool ,
GravityEnabled ,
true ,
""  )

◆ DEF_VAR() [3/10]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_VAR ( Real ,
AngularDamping ,
0. 1,
""  )

◆ DEF_VAR() [4/10]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_VAR ( Real ,
BaumgarteBias ,
1. 0,
""  )

◆ DEF_VAR() [5/10]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_VAR ( Real ,
FrictionCoefficient ,
100 ,
""  )

◆ DEF_VAR() [6/10]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_VAR ( Real ,
GravityValue ,
9. 8,
""  )

◆ DEF_VAR() [7/10]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_VAR ( Real ,
LinearDamping ,
0. 1,
""  )

◆ DEF_VAR() [8/10]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_VAR ( Real ,
Slop ,
0 ,
""  )

◆ DEF_VAR() [9/10]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_VAR ( uint ,
IterationNumberForPositionSolver ,
200 ,
""  )

◆ DEF_VAR() [10/10]

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_VAR ( uint ,
IterationNumberForVelocitySolver ,
100 ,
""  )

◆ DEF_VAR_IN()

template<typename TDataType>
dyno::PJSNJSConstraintSolver< TDataType >::DEF_VAR_IN ( Real ,
TimeStep ,
"Time step size"  )

◆ initializeJacobian()

template<typename TDataType>
void dyno::PJSNJSConstraintSolver< TDataType >::initializeJacobian ( Real dt)
private

◆ initializeJacobianForNJS()

template<typename TDataType>
void dyno::PJSNJSConstraintSolver< TDataType >::initializeJacobianForNJS ( )
private

Member Data Documentation

◆ mB

template<typename TDataType>
DArray<Coord> dyno::PJSNJSConstraintSolver< TDataType >::mB
private

Definition at line 110 of file PJSNJSConstraintSolver.h.

◆ mB_p

template<typename TDataType>
DArray<Coord> dyno::PJSNJSConstraintSolver< TDataType >::mB_p
private

Definition at line 111 of file PJSNJSConstraintSolver.h.

◆ mContactNumber

template<typename TDataType>
DArray<int> dyno::PJSNJSConstraintSolver< TDataType >::mContactNumber
private

Definition at line 126 of file PJSNJSConstraintSolver.h.

◆ mContactsInLocalFrame

template<typename TDataType>
DArray<ContactPair> dyno::PJSNJSConstraintSolver< TDataType >::mContactsInLocalFrame
private

Definition at line 121 of file PJSNJSConstraintSolver.h.

◆ mEta

template<typename TDataType>
DArray<Real> dyno::PJSNJSConstraintSolver< TDataType >::mEta
private

Definition at line 116 of file PJSNJSConstraintSolver.h.

◆ mEta_p

template<typename TDataType>
DArray<Real> dyno::PJSNJSConstraintSolver< TDataType >::mEta_p
private

Definition at line 117 of file PJSNJSConstraintSolver.h.

◆ mImpulseC

template<typename TDataType>
DArray<Coord> dyno::PJSNJSConstraintSolver< TDataType >::mImpulseC
private

Definition at line 113 of file PJSNJSConstraintSolver.h.

◆ mImpulseExt

template<typename TDataType>
DArray<Coord> dyno::PJSNJSConstraintSolver< TDataType >::mImpulseExt
private

Definition at line 114 of file PJSNJSConstraintSolver.h.

◆ mJ

template<typename TDataType>
DArray<Coord> dyno::PJSNJSConstraintSolver< TDataType >::mJ
private

Definition at line 107 of file PJSNJSConstraintSolver.h.

◆ mJ_p

template<typename TDataType>
DArray<Coord> dyno::PJSNJSConstraintSolver< TDataType >::mJ_p
private

Definition at line 108 of file PJSNJSConstraintSolver.h.

◆ mK_1

template<typename TDataType>
DArray<Real> dyno::PJSNJSConstraintSolver< TDataType >::mK_1
private

Definition at line 128 of file PJSNJSConstraintSolver.h.

◆ mK_2

template<typename TDataType>
DArray<Mat2f> dyno::PJSNJSConstraintSolver< TDataType >::mK_2
private

Definition at line 129 of file PJSNJSConstraintSolver.h.

◆ mK_3

template<typename TDataType>
DArray<Matrix> dyno::PJSNJSConstraintSolver< TDataType >::mK_3
private

Definition at line 130 of file PJSNJSConstraintSolver.h.

◆ mLambda

template<typename TDataType>
DArray<Real> dyno::PJSNJSConstraintSolver< TDataType >::mLambda
private

Definition at line 119 of file PJSNJSConstraintSolver.h.

◆ mPositionConstraints

template<typename TDataType>
DArray<Constraint> dyno::PJSNJSConstraintSolver< TDataType >::mPositionConstraints
private

Definition at line 124 of file PJSNJSConstraintSolver.h.

◆ mVelocityConstraints

template<typename TDataType>
DArray<Constraint> dyno::PJSNJSConstraintSolver< TDataType >::mVelocityConstraints
private

Definition at line 123 of file PJSNJSConstraintSolver.h.


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