MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
TotalForce Class Reference

#include <totalj.h>

Inheritance diagram for TotalForce:
Collaboration diagram for TotalForce:

Public Member Functions

 TotalForce (unsigned int uL, TplDriveCaller< Vec3 > *const pDCForce, TplDriveCaller< Vec3 > *const pDCCouple, const StructNode *pN1, const Vec3 &f1Tmp, const Mat3x3 &R1hTmp, const Mat3x3 &R1hrTmp, const StructNode *pN2, const Vec3 &f2Tmp, const Mat3x3 &R2hTmp, const Mat3x3 &R2hrTmp, flag fOut)
 
 ~TotalForce (void)
 
virtual Force::Type GetForceType (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual bool bInverseDynamics (void) const
 
SubVectorHandlerAssRes (SubVectorHandler &WorkVec, const VectorHandler &, const VectorHandler &, const VectorHandler &, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
virtual void Output (OutputHandler &OH) const
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
virtual unsigned int iGetNumDof (void) const
 
virtual std::ostream & DescribeDof (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeDof (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual std::ostream & DescribeEq (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeEq (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual DofOrder::Order GetDofType (unsigned int) const
 
virtual void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
void SetInverseDynamicsFlags (unsigned uIDF)
 
unsigned GetInverseDynamicsFlags (void) const
 
bool bIsErgonomy (void) const
 
bool bIsRightHandSide (void) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual int GetNumConnectedNodes (void) const
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
- Public Member Functions inherited from WithLabel
 WithLabel (unsigned int uL=0, const std::string &sN="")
 
virtual ~WithLabel (void)
 
void PutLabel (unsigned int uL)
 
void PutName (const std::string &sN)
 
unsigned int GetLabel (void) const
 
const std::string & GetName (void) const
 
- Public Member Functions inherited from SimulationEntity
 SimulationEntity (void)
 
virtual ~SimulationEntity (void)
 
virtual bool bIsValidIndex (unsigned int i) const
 
virtual DofOrder::Order GetEqType (unsigned int i) const
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
 
virtual HintParseHint (DataManager *pDM, const char *s) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void DerivativesUpdate (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH, const VectorHandler &X, const VectorHandler &XP) const
 
virtual flag fToBeOutput (void) const
 
virtual bool bToBeOutput (void) const
 
virtual void SetOutputFlag (flag f=flag(1))
 
- Public Member Functions inherited from Force
 Force (unsigned int uL, flag fOut)
 
virtual ~Force (void)
 
virtual Elem::Type GetElemType (void) const
 
virtual unsigned int iGetInitialNumDof (void) const
 
- Public Member Functions inherited from InitialAssemblyElem
 InitialAssemblyElem (unsigned int uL, flag fOut)
 
virtual ~InitialAssemblyElem (void)
 
- Public Member Functions inherited from SubjectToInitialAssembly
 SubjectToInitialAssembly (void)
 
virtual ~SubjectToInitialAssembly (void)
 

Private Attributes

const StructNodepNode1
 
const StructNodepNode2
 
Vec3 f1
 
Mat3x3 R1h
 
Mat3x3 R1hr
 
Vec3 f2
 
Mat3x3 R2h
 
Mat3x3 R2hr
 
TplDriveOwner< Vec3FDrv
 
TplDriveOwner< Vec3MDrv
 
Vec3 M
 
Vec3 F
 

Additional Inherited Members

- Public Types inherited from Elem
enum  Type {
  UNKNOWN = -1, AIRPROPERTIES = 0, INDUCEDVELOCITY, AUTOMATICSTRUCTURAL,
  GRAVITY, BODY, JOINT, JOINT_REGULARIZATION,
  BEAM, PLATE, FORCE, INERTIA,
  ELECTRICBULK, ELECTRIC, THERMAL, HYDRAULIC,
  BULK, LOADABLE, DRIVEN, EXTERNAL,
  AEROMODAL, AERODYNAMIC, GENEL, SOCKETSTREAM_OUTPUT,
  RTAI_OUTPUT = SOCKETSTREAM_OUTPUT, LASTELEMTYPE
}
 
- Public Types inherited from SimulationEntity
typedef std::vector< Hint * > Hints
 
- Public Types inherited from ToBeOutput
enum  { OUTPUT = 0x1U, OUTPUT_MASK = 0xFU, OUTPUT_PRIVATE = 0x10U, OUTPUT_PRIVATE_MASK = ~OUTPUT_MASK }
 
- Public Types inherited from Force
enum  Type {
  UNKNOWN = -1, ABSTRACTFORCE = 0, ABSTRACTINTERNALFORCE, ABSOLUTEDISPFORCE,
  ABSOLUTEINTERNALDISPFORCE, ABSOLUTEFORCE, FOLLOWERFORCE, ABSOLUTECOUPLE,
  FOLLOWERCOUPLE, ABSOLUTEINTERNALFORCE, FOLLOWERINTERNALFORCE, ABSOLUTEINTERNALCOUPLE,
  FOLLOWERINTERNALCOUPLE, TOTALFORCE, TOTALINTERNALFORCE, EXTERNALSTRUCTURAL,
  MODALFORCE, EXTERNALMODAL, LASTFORCETYPE
}
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 

Detailed Description

Definition at line 482 of file totalj.h.

Constructor & Destructor Documentation

TotalForce::TotalForce ( unsigned int  uL,
TplDriveCaller< Vec3 > *const  pDCForce,
TplDriveCaller< Vec3 > *const  pDCCouple,
const StructNode pN1,
const Vec3 f1Tmp,
const Mat3x3 R1hTmp,
const Mat3x3 R1hrTmp,
const StructNode pN2,
const Vec3 f2Tmp,
const Mat3x3 R2hTmp,
const Mat3x3 R2hrTmp,
flag  fOut 
)

Definition at line 3746 of file totalj.cc.

References NO_OP.

3754 : Elem(uL, fOut),
3755 Force(uL, fOut),
3756 pNode1(pN1), pNode2(pN2),
3757 f1(f1Tmp), R1h(R1hTmp), R1hr(R1hrTmp),
3758 f2(f2Tmp), R2h(R2hTmp), R2hr(R2hrTmp),
3759 FDrv(pDCForce), MDrv(pDCCouple),
3760 M(::Zero3), F(::Zero3)
3761 {
3762  NO_OP;
3763 }
Mat3x3 R2hr
Definition: totalj.h:491
Mat3x3 R1hr
Definition: totalj.h:488
const Vec3 Zero3(0., 0., 0.)
Force(unsigned int uL, flag fOut)
Definition: force.h:87
#define NO_OP
Definition: myassert.h:74
TplDriveOwner< Vec3 > MDrv
Definition: totalj.h:495
const StructNode * pNode2
Definition: totalj.h:485
Vec3 f2
Definition: totalj.h:489
Vec3 F
Definition: totalj.h:498
Mat3x3 R2h
Definition: totalj.h:490
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
Vec3 M
Definition: totalj.h:497
const StructNode * pNode1
Definition: totalj.h:484
TplDriveOwner< Vec3 > FDrv
Definition: totalj.h:493
Mat3x3 R1h
Definition: totalj.h:487
Vec3 f1
Definition: totalj.h:486
TotalForce::~TotalForce ( void  )
inline

Definition at line 510 of file totalj.h.

References NO_OP.

510  {
511  NO_OP;
512  };
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

VariableSubMatrixHandler & TotalForce::AssJac ( VariableSubMatrixHandler WorkMat,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 3795 of file totalj.cc.

References FullSubMatrixHandler::Add(), DEBUGCOUT, F, f2, StructNode::GetRCurr(), StructNode::GetRRef(), StructDispNode::GetXCurr(), StructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), M, MatCross, MatCrossCross, pNode1, pNode2, FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), R1h, R1hr, FullSubMatrixHandler::ResizeReset(), VariableSubMatrixHandler::SetFull(), FullSubMatrixHandler::Sub(), and WorkSpaceDim().

3799 {
3800  DEBUGCOUT("Entering TotalForce::AssJac()" << std::endl);
3801 
3802  FullSubMatrixHandler& WM = WorkMat.SetFull();
3803 
3804  /* Ridimensiona la sottomatrice in base alle esigenze */
3805  integer iNumRows = 0;
3806  integer iNumCols = 0;
3807  WorkSpaceDim(&iNumRows, &iNumCols);
3808  WM.ResizeReset(iNumRows, iNumCols);
3809 
3810  /* Recupera gli indici delle varie incognite */
3811  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
3812  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
3813  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
3814  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
3815 
3816  /* Setta gli indici delle equazioni */
3817  for (int iCnt = 1; iCnt <= 6; iCnt++) {
3818  WM.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
3819  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
3820  WM.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
3821  WM.PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
3822  }
3823 
3824  /* Recupera i dati che servono */
3825  Mat3x3 R1(pNode1->GetRRef()*R1h);
3826  Mat3x3 R1r(pNode1->GetRRef()*R1hr);
3827  Vec3 b2(pNode2->GetRCurr()*f2);
3828  Vec3 b1(pNode2->GetXCurr() + b2 - pNode1->GetXCurr());
3829 
3830  /* Moltiplica il momento e la forza per il coefficiente del metodo */
3831  Vec3 FTmp(R1*(F*dCoef));
3832  Vec3 MTmp(R1r*(M*dCoef));
3833 
3834  /* Equilibrium: ((Phi/q)^T*F)/q */
3835 
3836  Mat3x3 Tmp;
3837 
3838  /* [ F x ] */
3839  Tmp = Mat3x3(MatCross, FTmp);
3840 
3841  /* Lines 1->3: */
3842  WM.Add(1, 3 + 1, Tmp);
3843 
3844  /* Lines 4->6: */
3845  WM.Sub(3 + 1, 1, Tmp);
3846 
3847  WM.Add(3 + 1, 6 + 1, Tmp);
3848 
3849  /* Lines 7->9: */
3850  WM.Sub(6 + 1, 3 + 1, Tmp);
3851 
3852  /* [ F x ] [ b2 x ] */
3853  Tmp = Mat3x3(MatCrossCross, FTmp, b2);
3854 
3855  /* Lines 4->6: */
3856  WM.Sub(3 + 1, 9 + 1, Tmp);
3857 
3858  /* Lines 10->12: */
3859  WM.Add(9 + 1, 9 + 1, Tmp);
3860 
3861  /* [ b1 x ] [ F x ] + [ M x ] */
3862 
3863  /* Lines 4->6: */
3864  WM.Add(3 + 1, 3 + 1, Mat3x3(MatCrossCross, b1, FTmp) + Mat3x3(MatCross, MTmp));
3865 
3866  /* [ b2 x ] [ F x ] + [ M x ] */
3867 
3868  /* Lines 10->12: */
3869  WM.Sub(9 + 1, 3 + 1, Mat3x3(MatCrossCross, b2, FTmp) + Mat3x3(MatCross, MTmp));
3870 
3871  return WorkMat;
3872 }
Mat3x3 R1hr
Definition: totalj.h:488
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
Definition: matvec3.h:98
const MatCross_Manip MatCross
Definition: matvec3.cc:639
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: totalj.h:521
const StructNode * pNode2
Definition: totalj.h:485
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
Vec3 f2
Definition: totalj.h:489
Vec3 F
Definition: totalj.h:498
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
long int integer
Definition: colamd.c:51
Vec3 M
Definition: totalj.h:497
const StructNode * pNode1
Definition: totalj.h:484
Mat3x3 R1h
Definition: totalj.h:487

Here is the call graph for this function:

SubVectorHandler & TotalForce::AssRes ( SubVectorHandler WorkVec,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 3877 of file totalj.cc.

References VectorHandler::Add(), Vec3::Cross(), DEBUGCOUT, F, f2, FDrv, TplDriveOwner< T >::Get(), StructNode::GetRCurr(), StructDispNode::GetXCurr(), StructDispNode::iGetFirstMomentumIndex(), M, MDrv, pNode1, pNode2, SubVectorHandler::PutRowIndex(), R1h, R1hr, R2hr, VectorHandler::ResizeReset(), VectorHandler::Sub(), and WorkSpaceDim().

3881 {
3882  DEBUGCOUT("Entering TotalForce::AssRes()" << std::endl);
3883 
3884  /* Dimensiona e resetta la matrice di lavoro */
3885  integer iNumRows = 0;
3886  integer iNumCols = 0;
3887  WorkSpaceDim(&iNumRows, &iNumCols);
3888  WorkVec.ResizeReset(iNumRows);
3889 
3890  /* Indici */
3891  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
3892  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
3893 
3894  /* Indici dei nodi */
3895  for (int iCnt = 1; iCnt <= 6; iCnt++) {
3896  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
3897  WorkVec.PutRowIndex(6+iCnt, iNode2FirstMomIndex + iCnt);
3898  }
3899 
3900  /* Get Forces */
3901 
3902  F = FDrv.Get();
3903  M = MDrv.Get();
3904 
3905  Vec3 b2(pNode2->GetRCurr()*f2);
3906  Vec3 b1(pNode2->GetXCurr() + b2 - pNode1->GetXCurr());
3907 
3908  Mat3x3 R1 = pNode1->GetRCurr()*R1h;
3909  Mat3x3 R1r = pNode1->GetRCurr()*R1hr;
3910  Mat3x3 R2r = pNode2->GetRCurr()*R2hr;
3911 
3912  Vec3 FTmp(R1*F);
3913  Vec3 MTmp(R1r*M);
3914 
3915  /* Equilibrium, node 1 */
3916  WorkVec.Add(1, FTmp);
3917  WorkVec.Add(3 + 1, MTmp + b1.Cross(FTmp));
3918 
3919  /* Equilibrium, node 2 */
3920  WorkVec.Sub(6 + 1, FTmp);
3921  WorkVec.Sub(9 + 1, MTmp + b2.Cross(FTmp));
3922 
3923  return WorkVec;
3924 }
Mat3x3 R2hr
Definition: totalj.h:491
Mat3x3 R1hr
Definition: totalj.h:488
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
TplDriveOwner< Vec3 > MDrv
Definition: totalj.h:495
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: totalj.h:521
const StructNode * pNode2
Definition: totalj.h:485
#define DEBUGCOUT(msg)
Definition: myassert.h:232
T Get(const doublereal &dVar) const
Definition: tpldrive.h:109
virtual integer iGetFirstMomentumIndex(void) const =0
Vec3 f2
Definition: totalj.h:489
Vec3 F
Definition: totalj.h:498
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
long int integer
Definition: colamd.c:51
Vec3 M
Definition: totalj.h:497
const StructNode * pNode1
Definition: totalj.h:484
TplDriveOwner< Vec3 > FDrv
Definition: totalj.h:493
Mat3x3 R1h
Definition: totalj.h:487

Here is the call graph for this function:

SubVectorHandler & TotalForce::AssRes ( SubVectorHandler WorkVec,
const VectorHandler ,
const VectorHandler ,
const VectorHandler ,
InverseDynamics::Order  iOrder = InverseDynamics::INVERSE_DYNAMICS 
)
virtual

Reimplemented from Elem.

Definition at line 3935 of file totalj.cc.

References VectorHandler::Add(), ASSERT, Vec3::Cross(), DEBUGCOUT, F, f2, FDrv, TplDriveOwner< T >::Get(), StructNode::GetRCurr(), StructDispNode::GetXCurr(), StructDispNode::iGetFirstPositionIndex(), invdyn2str(), InverseDynamics::INVERSE_DYNAMICS, M, MDrv, pNode1, pNode2, SubVectorHandler::PutRowIndex(), R1h, R1hr, R2hr, VectorHandler::ResizeReset(), VectorHandler::Sub(), and WorkSpaceDim().

3940 {
3941  DEBUGCOUT("Entering TotalForce::AssRes(" << invdyn2str(iOrder) << ")" << std::endl);
3942 
3944 
3945  /* Dimensiona e resetta la matrice di lavoro */
3946  integer iNumRows = 0;
3947  integer iNumCols = 0;
3948  WorkSpaceDim(&iNumRows, &iNumCols);
3949  WorkVec.ResizeReset(iNumRows);
3950 
3951  /* Indici */
3952  integer iNode1FirstMomIndex = pNode1->iGetFirstPositionIndex();
3953  integer iNode2FirstMomIndex = pNode2->iGetFirstPositionIndex();
3954 
3955  /* Indici dei nodi */
3956  for (int iCnt = 1; iCnt <= 6; iCnt++) {
3957  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
3958  WorkVec.PutRowIndex(6+iCnt, iNode2FirstMomIndex + iCnt);
3959  }
3960 
3961  /* Get Forces */
3962 
3963  F = FDrv.Get();
3964  M = MDrv.Get();
3965 
3966  Vec3 b2(pNode2->GetRCurr()*f2);
3967  Vec3 b1(pNode2->GetXCurr() + b2 - pNode1->GetXCurr());
3968 
3969  Mat3x3 R1 = pNode1->GetRCurr()*R1h;
3970  Mat3x3 R1r = pNode1->GetRCurr()*R1hr;
3971  Mat3x3 R2r = pNode2->GetRCurr()*R2hr;
3972 
3973  Vec3 FTmp(R1*F);
3974  Vec3 MTmp(R1r*M);
3975 
3976  /* Equilibrium, node 1 */
3977  WorkVec.Add(1, FTmp);
3978  WorkVec.Add(3 + 1, MTmp + b1.Cross(FTmp));
3979 
3980  /* Equilibrium, node 2 */
3981  WorkVec.Sub(6 + 1, FTmp);
3982  WorkVec.Sub(9 + 1, MTmp + b2.Cross(FTmp));
3983 
3984  return WorkVec;
3985 }
Mat3x3 R2hr
Definition: totalj.h:491
Mat3x3 R1hr
Definition: totalj.h:488
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
TplDriveOwner< Vec3 > MDrv
Definition: totalj.h:495
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: totalj.h:521
const StructNode * pNode2
Definition: totalj.h:485
#define DEBUGCOUT(msg)
Definition: myassert.h:232
T Get(const doublereal &dVar) const
Definition: tpldrive.h:109
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
Vec3 f2
Definition: totalj.h:489
#define ASSERT(expression)
Definition: colamd.c:977
Vec3 F
Definition: totalj.h:498
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
const char * invdyn2str(InverseDynamics::Order iOrder)
Definition: invdyn.cc:36
long int integer
Definition: colamd.c:51
Vec3 M
Definition: totalj.h:497
const StructNode * pNode1
Definition: totalj.h:484
TplDriveOwner< Vec3 > FDrv
Definition: totalj.h:493
Mat3x3 R1h
Definition: totalj.h:487

Here is the call graph for this function:

bool TotalForce::bInverseDynamics ( void  ) const
virtual

Reimplemented from Elem.

Definition at line 3928 of file totalj.cc.

3929 {
3930  return true;
3931 }
virtual Force::Type TotalForce::GetForceType ( void  ) const
inlinevirtual

Implements Force.

Definition at line 515 of file totalj.h.

References Force::TOTALINTERNALFORCE.

515  {
517  };
VariableSubMatrixHandler & TotalForce::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
virtual

Reimplemented from Force.

Definition at line 3989 of file totalj.cc.

References FullSubMatrixHandler::Add(), Vec3::Cross(), F, f2, StructNode::GetRCurr(), StructNode::GetRRef(), StructDispNode::GetVCurr(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), StructDispNode::iGetFirstPositionIndex(), InitialWorkSpaceDim(), M, MatCross, MatCrossCross, pNode1, pNode2, FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), R1h, R1hr, FullSubMatrixHandler::ResizeReset(), VariableSubMatrixHandler::SetFull(), and FullSubMatrixHandler::Sub().

3991 {
3992 
3993  /* Per ora usa la matrice piena; eventualmente si puo'
3994  * passare a quella sparsa quando si ottimizza */
3995  FullSubMatrixHandler& WM = WorkMat.SetFull();
3996 
3997  /* Dimensiona e resetta la matrice di lavoro */
3998  integer iNumRows = 0;
3999  integer iNumCols = 0;
4000  InitialWorkSpaceDim(&iNumRows, &iNumCols);
4001  WM.ResizeReset(iNumRows, iNumCols);
4002 
4003  /* Indici */
4004  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
4005  integer iNode1FirstVelIndex = iNode1FirstPosIndex + 6;
4006  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
4007  integer iNode2FirstVelIndex = iNode2FirstPosIndex + 6;
4008 
4009 
4010  /* Setta gli indici dei nodi */
4011  for (int iCnt = 1; iCnt <= 6; iCnt++) {
4012  WM.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
4013  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
4014  WM.PutRowIndex(6 + iCnt, iNode1FirstVelIndex + iCnt);
4015  WM.PutColIndex(6 + iCnt, iNode1FirstVelIndex + iCnt);
4016  WM.PutRowIndex(12 + iCnt, iNode2FirstPosIndex + iCnt);
4017  WM.PutColIndex(12 + iCnt, iNode2FirstPosIndex + iCnt);
4018  WM.PutRowIndex(18 + iCnt, iNode2FirstVelIndex + iCnt);
4019  WM.PutColIndex(18 + iCnt, iNode2FirstVelIndex + iCnt);
4020  }
4021 
4022  /* Recupera i dati che servono */
4023  Mat3x3 R1(pNode1->GetRRef()*R1h);
4024  Mat3x3 R1r(pNode1->GetRRef()*R1hr);
4025 
4026  Vec3 b2(pNode2->GetRCurr()*f2);
4027  Vec3 b1(pNode2->GetXCurr() + b2 - pNode1->GetXCurr());
4028 
4029  Vec3 Omega1(pNode1->GetWCurr());
4030  Vec3 Omega2(pNode2->GetWCurr());
4031 
4032  Vec3 b1Prime(pNode2->GetVCurr() + Omega2.Cross(b2) - pNode1->GetVCurr());
4033 
4034  Vec3 FTmp(R1*F);
4035  Vec3 MTmp(R1r*M);
4036 
4037  Mat3x3 Tmp;
4038 
4039  /* [ F x ] */
4040  Tmp = Mat3x3(MatCross, FTmp);
4041 
4042  /* Force, Node 1, Lines 1->3: */
4043  WM.Add(1, 3 + 1, Tmp); // * Delta_g1
4044 
4045  /* Moment, Node 1, Lines 4->6: */
4046  WM.Sub(3 + 1, 1, Tmp); // * Delta_x1
4047 
4048  WM.Add(3 + 1, 12 + 1, Tmp); // * Delta_x2
4049 
4050  /* Force, Node 2, Lines 13->15: */
4051  WM.Sub(12 + 1, 3 + 1, Tmp); // * Delta_g1
4052 
4053  /* [ F x ] [ b2 x ] */
4054  Tmp = Mat3x3(MatCrossCross, FTmp, b2);
4055 
4056  /* Moment, Node1, Lines 4->6: */
4057  WM.Sub(3 + 1, 15 + 1, Tmp); // * Delta_g2
4058 
4059  /* Moment, Node2, Lines 16->18: */
4060  WM.Add(15 + 1, 15 + 1, Tmp); // * Delta_g2
4061 
4062  /* [ b1 x ] [ F x ] + [ M x ] */
4063 
4064  /* Moment, Node1, Lines 4->6: */
4065  WM.Add(3 + 1, 3 + 1, Mat3x3(MatCrossCross, b1, FTmp) + Mat3x3(MatCross, MTmp)); // *Delta_g1
4066 
4067  /* [ b2 x ] [ F x ] + [ M x ] */
4068 
4069  /* Moment, Node2, Lines 16->18: */
4070  WM.Sub(15 + 1, 3 + 1, Mat3x3(MatCrossCross, b2, FTmp) + Mat3x3(MatCross, MTmp)); // * Delta_g1
4071 
4072  /* d/dt(Moment), Node2, Lines 22->24: */
4073  WM.Sub(21 + 1, 9 + 1, Mat3x3(MatCrossCross, b2, FTmp) + Mat3x3(MatCross, MTmp)); // * Delta_W1
4074 
4075  return WorkMat;
4076 }
Mat3x3 R1hr
Definition: totalj.h:488
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
Definition: matvec3.h:98
const MatCross_Manip MatCross
Definition: matvec3.cc:639
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: totalj.h:548
const StructNode * pNode2
Definition: totalj.h:485
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
Vec3 f2
Definition: totalj.h:489
Vec3 F
Definition: totalj.h:498
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
long int integer
Definition: colamd.c:51
Vec3 M
Definition: totalj.h:497
const StructNode * pNode1
Definition: totalj.h:484
Mat3x3 R1h
Definition: totalj.h:487

Here is the call graph for this function:

SubVectorHandler & TotalForce::InitialAssRes ( SubVectorHandler WorkVec,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 4081 of file totalj.cc.

References VectorHandler::Add(), Vec3::Cross(), DEBUGCOUT, F, f2, FDrv, TplDriveOwner< T >::Get(), StructNode::GetRCurr(), StructNode::GetRRef(), StructDispNode::GetVCurr(), StructNode::GetWCurr(), StructDispNode::GetXCurr(), StructDispNode::iGetFirstPositionIndex(), InitialWorkSpaceDim(), M, MDrv, pNode1, pNode2, SubVectorHandler::PutRowIndex(), R1h, R1hr, R2hr, VectorHandler::ResizeReset(), and VectorHandler::Sub().

4083 {
4084 
4085  DEBUGCOUT("Entering TotalForce::InitialAssRes()" << std::endl);
4086 
4087  /* Dimensiona e resetta la matrice di lavoro */
4088  integer iNumRows = 0;
4089  integer iNumCols = 0;
4090  InitialWorkSpaceDim(&iNumRows, &iNumCols);
4091  WorkVec.ResizeReset(iNumRows);
4092 
4093  /* Indici */
4094  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
4095  integer iNode1FirstVelIndex = iNode1FirstPosIndex + 6;
4096  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
4097  integer iNode2FirstVelIndex = iNode2FirstPosIndex + 6;
4098 
4099  /* Setta gli indici */
4100  for (int iCnt = 1; iCnt <= 6; iCnt++) {
4101  WorkVec.PutRowIndex(iCnt, iNode1FirstPosIndex+iCnt);
4102  WorkVec.PutRowIndex(6 + iCnt, iNode1FirstVelIndex + iCnt);
4103  WorkVec.PutRowIndex(12 + iCnt, iNode2FirstPosIndex + iCnt);
4104  WorkVec.PutRowIndex(18 + iCnt, iNode2FirstVelIndex + iCnt);
4105  }
4106 
4107  /* Recupera i dati */
4108  /* Recupera i dati che servono */
4109  Mat3x3 R1(pNode1->GetRRef()*R1h);
4110  Mat3x3 R1r(pNode1->GetRRef()*R1hr);
4111  Mat3x3 R2r(pNode2->GetRCurr()*R2hr);
4112 
4113  Vec3 b2(pNode2->GetRCurr()*f2);
4114  Vec3 b1(pNode2->GetXCurr() + b2 - pNode1->GetXCurr());
4115 
4116  Vec3 Omega1(pNode1->GetWCurr());
4117  Vec3 Omega2(pNode2->GetWCurr());
4118 
4119  Vec3 b1Prime(pNode2->GetVCurr() + Omega2.Cross(b2) - pNode1->GetVCurr());
4120 
4121  /* Aggiorna F ed M, che restano anche per InitialAssJac */
4122 
4123  F = FDrv.Get();
4124  M = MDrv.Get();
4125 
4126  Vec3 FTmp(R1*F);
4127  Vec3 MTmp(R1r*M);
4128 
4129  /* Equilibrium, node 1 */
4130  WorkVec.Add(1, FTmp);
4131  WorkVec.Add(3 + 1, b1.Cross(FTmp) + MTmp);
4132 
4133  /* Equilibrium, node 2 */
4134  WorkVec.Sub(12 + 1, FTmp);
4135  WorkVec.Sub(15 + 1, b2.Cross(FTmp) + MTmp);
4136 
4137  return WorkVec;
4138 }
Mat3x3 R2hr
Definition: totalj.h:491
Mat3x3 R1hr
Definition: totalj.h:488
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: totalj.h:548
TplDriveOwner< Vec3 > MDrv
Definition: totalj.h:495
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
const StructNode * pNode2
Definition: totalj.h:485
#define DEBUGCOUT(msg)
Definition: myassert.h:232
T Get(const doublereal &dVar) const
Definition: tpldrive.h:109
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
Vec3 f2
Definition: totalj.h:489
Vec3 F
Definition: totalj.h:498
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
long int integer
Definition: colamd.c:51
Vec3 M
Definition: totalj.h:497
const StructNode * pNode1
Definition: totalj.h:484
TplDriveOwner< Vec3 > FDrv
Definition: totalj.h:493
Mat3x3 R1h
Definition: totalj.h:487

Here is the call graph for this function:

virtual void TotalForce::InitialWorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 548 of file totalj.h.

Referenced by InitialAssJac(), and InitialAssRes().

548  {
549  *piNumRows = 24;
550  *piNumCols = 12;
551  };
void TotalForce::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 3767 of file totalj.cc.

References ToBeOutput::bToBeOutput(), F, OutputHandler::Forces(), WithLabel::GetLabel(), and M.

3768 {
3769  if (bToBeOutput()) {
3770  OH.Forces() << std::setw(8) << GetLabel()
3771  << " " << F << " " << M << std::endl;
3772  }
3773 }
virtual bool bToBeOutput(void) const
Definition: output.cc:890
Vec3 F
Definition: totalj.h:498
Vec3 M
Definition: totalj.h:497
unsigned int GetLabel(void) const
Definition: withlab.cc:62
std::ostream & Forces(void) const
Definition: output.h:450

Here is the call graph for this function:

std::ostream & TotalForce::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 3776 of file totalj.cc.

References f1, f2, FDrv, WithLabel::GetLabel(), MDrv, TplDriveOwner< T >::pGetDriveCaller(), pNode1, pNode2, R1h, R1hr, R2h, R2hr, TplDriveCaller< T >::Restart(), Force::Restart(), Vec3::Write(), and Mat3x3::Write().

3777 {
3778  Force::Restart(out) << ", total internal, "
3779  << pNode1->GetLabel() << ", "
3780  "position, ", f1.Write(out, ", ") << ", "
3781  "force orientation, ", R1h.Write(out, ", ") << ", "
3782  "moment orientation, ", R1hr.Write(out, ", ") << ", "
3783  << pNode2->GetLabel() << ", "
3784  "position, ", f2.Write(out, ", ") << ", "
3785  "force orientation, ", R2h.Write(out, ", ") << ", "
3786  "moment orientation, ", R2hr.Write(out, ", ") << ", "
3787  "force, ", FDrv.pGetDriveCaller()->Restart(out) << ", "
3788  "moment , ", MDrv.pGetDriveCaller()->Restart(out) << ";"
3789  << std::endl;
3790  return out;
3791 }
Mat3x3 R2hr
Definition: totalj.h:491
Mat3x3 R1hr
Definition: totalj.h:488
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
virtual std::ostream & Restart(std::ostream &out) const
Definition: force.cc:52
TplDriveOwner< Vec3 > MDrv
Definition: totalj.h:495
TplDriveCaller< T > * pGetDriveCaller(void) const
Definition: tpldrive.h:105
const StructNode * pNode2
Definition: totalj.h:485
Vec3 f2
Definition: totalj.h:489
virtual std::ostream & Restart(std::ostream &out) const =0
Mat3x3 R2h
Definition: totalj.h:490
std::ostream & Write(std::ostream &out, const char *sFill=" ", const char *sFill2=NULL) const
Definition: matvec3.cc:722
unsigned int GetLabel(void) const
Definition: withlab.cc:62
const StructNode * pNode1
Definition: totalj.h:484
TplDriveOwner< Vec3 > FDrv
Definition: totalj.h:493
Mat3x3 R1h
Definition: totalj.h:487
Vec3 f1
Definition: totalj.h:486

Here is the call graph for this function:

void TotalForce::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
inlinevirtual

Implements Elem.

Definition at line 521 of file totalj.h.

Referenced by AssJac(), and AssRes().

521  {
522  *piNumRows = 12;
523  *piNumCols = 6;
524  };

Member Data Documentation

Vec3 TotalForce::F
mutableprivate

Definition at line 498 of file totalj.h.

Referenced by AssJac(), AssRes(), InitialAssJac(), InitialAssRes(), and Output().

Vec3 TotalForce::f1
private

Definition at line 486 of file totalj.h.

Referenced by Restart().

Vec3 TotalForce::f2
private

Definition at line 489 of file totalj.h.

Referenced by AssJac(), AssRes(), InitialAssJac(), InitialAssRes(), and Restart().

TplDriveOwner<Vec3> TotalForce::FDrv
private

Definition at line 493 of file totalj.h.

Referenced by AssRes(), InitialAssRes(), and Restart().

Vec3 TotalForce::M
mutableprivate

Definition at line 497 of file totalj.h.

Referenced by AssJac(), AssRes(), InitialAssJac(), InitialAssRes(), and Output().

TplDriveOwner<Vec3> TotalForce::MDrv
private

Definition at line 495 of file totalj.h.

Referenced by AssRes(), InitialAssRes(), and Restart().

const StructNode* TotalForce::pNode1
private

Definition at line 484 of file totalj.h.

Referenced by AssJac(), AssRes(), InitialAssJac(), InitialAssRes(), and Restart().

const StructNode* TotalForce::pNode2
private

Definition at line 485 of file totalj.h.

Referenced by AssJac(), AssRes(), InitialAssJac(), InitialAssRes(), and Restart().

Mat3x3 TotalForce::R1h
private

Definition at line 487 of file totalj.h.

Referenced by AssJac(), AssRes(), InitialAssJac(), InitialAssRes(), and Restart().

Mat3x3 TotalForce::R1hr
private

Definition at line 488 of file totalj.h.

Referenced by AssJac(), AssRes(), InitialAssJac(), InitialAssRes(), and Restart().

Mat3x3 TotalForce::R2h
private

Definition at line 490 of file totalj.h.

Referenced by Restart().

Mat3x3 TotalForce::R2hr
private

Definition at line 491 of file totalj.h.

Referenced by AssRes(), InitialAssRes(), and Restart().


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