HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_DerVector3 Class Reference

#include <SIM_DerVector3.h>

Public Member Functions

 SIM_DerVector3 ()
 
 SIM_DerVector3 (const UT_Vector3 &v)
 Initialize to a constant vector, with no derivative. More...
 
 SIM_DerVector3 (const UT_Vector3 &v, const UT_Matrix3 &D)
 
const UT_Vector3v () const
 The vector v. More...
 
const UT_Matrix3D () const
 
SIM_DerVector3 operator- () const
 
SIM_DerVector3 operator+ (const SIM_DerVector3 &rhs) const
 
SIM_DerVector3 operator+ (const UT_Vector3 &rhs) const
 
SIM_DerVector3 operator- (const SIM_DerVector3 &rhs) const
 
SIM_DerVector3 operator- (const UT_Vector3 &rhs) const
 
SIM_DerVector3 operator* (const SIM_DerScalar &rhs) const
 
SIM_DerVector3 operator* (fpreal scalar) const
 
SIM_DerVector3operator+= (const SIM_DerVector3 &rhs)
 
SIM_DerVector3operator+= (const UT_Vector3 &rhs)
 
SIM_DerVector3operator-= (const SIM_DerVector3 &rhs)
 
SIM_DerVector3operator-= (const UT_Vector3 &rhs)
 
SIM_DerVector3operator*= (const SIM_DerScalar &rhs)
 
SIM_DerVector3operator*= (const fpreal rhs)
 
SIM_DerScalar dot (const SIM_DerVector3 &rhs) const
 
SIM_DerScalar dot (const UT_Vector3 &rhs) const
 
SIM_DerVector3 cross (const SIM_DerVector3 &rhs) const
 
SIM_DerVector3 cross (const UT_Vector3 &rhs) const
 
SIM_DerScalar length2 () const
 
SIM_DerScalar length () const
 
SIM_DerVector3 normalize () const
 

Static Public Member Functions

static UT_Matrix3 S (const UT_Vector3 &v)
 

Detailed Description

This class defines a 3D vector and its partial derivative w.r.t. another 3D vector. It uses automatic differentiation to maintain the dependency upon the derivative vector as arithmetic operations are performed. The derivative of a vector-valued function is, of course, a Jacobian matrix.

By performing a sequence of arithmetic operations on this vector class after initializing its derivative appropriately, you can easily keep track of the effect of those operations on the derivative. Independent variables can be included in an equation using the conventional UT_Vector3 and fpreal types, and dependent variables can use the SIM_DerVector3 and SIM_DerScalar types.

It is inspired by Eitan Grinspun's class for the same purpose, described in his 2003 SCA paper on Discrete Shells.

Definition at line 32 of file SIM_DerVector3.h.

Constructor & Destructor Documentation

SIM_DerVector3::SIM_DerVector3 ( )
inline

Definition at line 35 of file SIM_DerVector3.h.

SIM_DerVector3::SIM_DerVector3 ( const UT_Vector3 v)
inlineexplicit

Initialize to a constant vector, with no derivative.

Definition at line 37 of file SIM_DerVector3.h.

SIM_DerVector3::SIM_DerVector3 ( const UT_Vector3 v,
const UT_Matrix3 D 
)
inline

Initialize to a vector with a derivative. This is particularly useful for initializing the variables themselves, where D=I.

Definition at line 41 of file SIM_DerVector3.h.

Member Function Documentation

SIM_DerVector3 SIM_DerVector3::cross ( const SIM_DerVector3 rhs) const
inline

Definition at line 196 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::cross ( const UT_Vector3 rhs) const
inline

Definition at line 206 of file SIM_DerVector3.h.

const UT_Matrix3& SIM_DerVector3::D ( ) const
inline

Derivative matrix, dv/dx. The entries of the matrix are laid out like a typical Jacobian:

[ dv1/dx1 dv1/dx2 dv1/dx3 ] [ dv2/dx1 dv2/dx2 dv2/dx3 ] [ dv3/dx1 dv3/dx2 dv3/dx3 ]

[ dv1/dx ] = [ dv2/dx ] [ dv3/dx ]

= [ dv/dx1 dv/dx2 dv/dx3 ]

Definition at line 64 of file SIM_DerVector3.h.

SIM_DerScalar SIM_DerVector3::dot ( const SIM_DerVector3 rhs) const
inline

Definition at line 176 of file SIM_DerVector3.h.

SIM_DerScalar SIM_DerVector3::dot ( const UT_Vector3 rhs) const
inline

Definition at line 186 of file SIM_DerVector3.h.

SIM_DerScalar SIM_DerVector3::length ( void  ) const
inline
Examples:
tetprim/GEO_PrimTetra.C.

Definition at line 228 of file SIM_DerVector3.h.

SIM_DerScalar SIM_DerVector3::length2 ( ) const
inline

Definition at line 214 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::normalize ( ) const
inline
Examples:
tetprim/GR_PrimTetra.C.

Definition at line 239 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::operator* ( const SIM_DerScalar rhs) const
inline

Definition at line 165 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::operator* ( fpreal  scalar) const
inline

Definition at line 93 of file SIM_DerVector3.h.

SIM_DerVector3& SIM_DerVector3::operator*= ( const SIM_DerScalar rhs)
inline

Definition at line 106 of file SIM_DerVector3.h.

SIM_DerVector3& SIM_DerVector3::operator*= ( const fpreal  rhs)
inline

Definition at line 108 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::operator+ ( const SIM_DerVector3 rhs) const
inline

Definition at line 74 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::operator+ ( const UT_Vector3 rhs) const
inline

Definition at line 79 of file SIM_DerVector3.h.

SIM_DerVector3& SIM_DerVector3::operator+= ( const SIM_DerVector3 rhs)
inline

Definition at line 98 of file SIM_DerVector3.h.

SIM_DerVector3& SIM_DerVector3::operator+= ( const UT_Vector3 rhs)
inline

Definition at line 100 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::operator- ( ) const
inline

Definition at line 70 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::operator- ( const SIM_DerVector3 rhs) const
inline

Definition at line 83 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::operator- ( const UT_Vector3 rhs) const
inline

Definition at line 88 of file SIM_DerVector3.h.

SIM_DerVector3& SIM_DerVector3::operator-= ( const SIM_DerVector3 rhs)
inline

Definition at line 102 of file SIM_DerVector3.h.

SIM_DerVector3& SIM_DerVector3::operator-= ( const UT_Vector3 rhs)
inline

Definition at line 104 of file SIM_DerVector3.h.

static UT_Matrix3 SIM_DerVector3::S ( const UT_Vector3 v)
inlinestatic

Definition at line 123 of file SIM_DerVector3.h.

const UT_Vector3& SIM_DerVector3::v ( ) const
inline

The vector v.

Definition at line 49 of file SIM_DerVector3.h.


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