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

#include <rodj.h>

Inheritance diagram for RodWithOffset:
Collaboration diagram for RodWithOffset:

Public Member Functions

 RodWithOffset (unsigned int uL, const DofOwner *pDO, const ConstitutiveLaw1D *pCL, const StructNode *pN1, const StructNode *pN2, const Vec3 &f1Tmp, const Vec3 &f2Tmp, doublereal dLength, flag fOut)
 
virtual ~RodWithOffset (void)
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
void AssVec (SubVectorHandler &WorkVec)
 
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 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
 
void SetInverseDynamicsFlags (unsigned uIDF)
 
unsigned GetInverseDynamicsFlags (void) const
 
bool bIsErgonomy (void) const
 
bool bIsRightHandSide (void) const
 
virtual int GetNumConnectedNodes (void) 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 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 ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
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 Rod
 Rod (unsigned int uL, const DofOwner *pDO, const ConstitutiveLaw1D *pCL, const StructDispNode *pN1, const StructDispNode *pN2, doublereal dLength, flag fOut, bool bHasOffsets=0)
 
virtual ~Rod (void)
 
virtual Joint::Type GetJointType (void) const
 
virtual unsigned int iGetNumDof (void) const
 
virtual void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH) const
 
virtual unsigned int iGetInitialNumDof (void) const
 
virtual bool bInverseDynamics (void) const
 
VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
SubVectorHandlerAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, const VectorHandler &XPrimePrimeCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
void Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
- Public Member Functions inherited from Joint
 Joint (unsigned int uL, const DofOwner *pD, flag fOut)
 
virtual ~Joint (void)
 
virtual Elem::Type GetElemType (void) const
 
std::ostream & Output (std::ostream &out, const char *sJointName, unsigned int uLabel, const Vec3 &FLocal, const Vec3 &MLocal, const Vec3 &FGlobal, const Vec3 &MGlobal) const
 
virtual void SetInitialValue (VectorHandler &)
 
virtual void SetValue (DataManager *pDM, VectorHandler &, VectorHandler &, SimulationEntity::Hints *ph=0)
 
bool bIsPrescribedMotion (void) const
 
bool bIsTorque (void) const
 
- Public Member Functions inherited from ElemGravityOwner
 ElemGravityOwner (unsigned int uL, flag fOut)
 
virtual ~ElemGravityOwner (void)
 
virtual doublereal dGetM (void) const
 
Vec3 GetS (void) const
 
Mat3x3 GetJ (void) const
 
Vec3 GetB (void) const
 
Vec3 GetG (void) const
 
- Public Member Functions inherited from GravityOwner
 GravityOwner (void)
 
virtual ~GravityOwner (void)
 
void PutGravity (const Gravity *pG)
 
virtual bool bGetGravity (const Vec3 &X, Vec3 &Acc) const
 
- Public Member Functions inherited from ElemWithDofs
 ElemWithDofs (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~ElemWithDofs (void)
 
- Public Member Functions inherited from DofOwnerOwner
 DofOwnerOwner (const DofOwner *pDO)
 
virtual ~DofOwnerOwner ()
 
virtual const DofOwnerpGetDofOwner (void) const
 
virtual integer iGetFirstIndex (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)
 
- Public Member Functions inherited from ConstitutiveLawOwner< T, Tder >
 ConstitutiveLawOwner (const ConstitutiveLaw< T, Tder > *pCL)
 
virtual ~ConstitutiveLawOwner (void)
 
ConstitutiveLaw< T, Tder > * pGetConstLaw (void) const
 
void Update (const T &Eps, const T &EpsPrime=mb_zero< T >())
 
void AfterConvergence (const T &Eps, const T &EpsPrime=mb_zero< T >())
 
const T & GetF (void) const
 
const Tder & GetFDE (void) const
 
const Tder & GetFDEPrime (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 i) const
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 

Protected Attributes

Vec3 f1
 
Vec3 f2
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from Rod
const StructDispNodepNode1
 
const StructDispNodepNode2
 
doublereal dL0
 
Vec3 v
 
doublereal dElle
 
doublereal dEpsilon
 
doublereal dEpsilonPrime
 
- Protected Attributes inherited from GravityOwner
GravitypGravity
 
- Protected Attributes inherited from ConstitutiveLawOwner< T, Tder >
ConstitutiveLaw< T, Tder > * pConstLaw
 

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 Joint
enum  Type {
  UNKNOWN = -1, DISTANCE = 0, DISTANCEWITHOFFSET, CLAMP,
  SPHERICALHINGE, PIN, UNIVERSALHINGE, UNIVERSALROTATION,
  UNIVERSALPIN, PLANEHINGE, PLANEROTATION, PLANEPIN,
  AXIALROTATION, PLANEDISP, PLANEDISPPIN, INPLANE,
  INPLANECONTACT, J_INLINE, ROD, RODBEZIER,
  DEFORMABLEHINGE, DEFORMABLEDISPJOINT, DEFORMABLEJOINT, DEFORMABLEAXIALJOINT,
  VISCOUSBODY, LINEARVELOCITY, ANGULARVELOCITY, LINEARACCELERATION,
  ANGULARACCELERATION, PRISMATIC, DRIVEHINGE, DRIVEDISP,
  DRIVEDISPPIN, IMPOSEDORIENTATION, IMPOSEDDISP, IMPOSEDDISPPIN,
  IMPOSEDKINEMATICS, BEAMSLIDER, BRAKE, GIMBAL,
  POINT_SURFACE_CONTACT, TOTALJOINT, TOTALPINJOINT, TOTALEQUATION,
  TOTALREACTION, MODAL, SCREWJOINT, LASTJOINTTYPE
}
 
- Protected Member Functions inherited from Rod
virtual doublereal dCalcEpsilon (void)
 
void AssMat (FullSubMatrixHandler &WorkMat, doublereal dCoef=1.)
 
void AssVec (SubVectorHandler &WorkVec)
 
- Protected Member Functions inherited from Joint
virtual void OutputPrepare_int (const std::string &type, OutputHandler &OH, std::string &name)
 
- Protected Member Functions inherited from ElemGravityOwner
virtual Vec3 GetS_int (void) const
 
virtual Mat3x3 GetJ_int (void) const
 
virtual Vec3 GetB_int (void) const
 
virtual Vec3 GetG_int (void) const
 

Detailed Description

Definition at line 268 of file rodj.h.

Constructor & Destructor Documentation

RodWithOffset::RodWithOffset ( unsigned int  uL,
const DofOwner pDO,
const ConstitutiveLaw1D pCL,
const StructNode pN1,
const StructNode pN2,
const Vec3 f1Tmp,
const Vec3 f2Tmp,
doublereal  dLength,
flag  fOut 
)

Definition at line 827 of file rodj.cc.

References ASSERT, Rod::dElle, Vec3::Dot(), WithLabel::GetLabel(), StructDispNode::GetNodeType(), StructDispNode::GetXCurr(), MBDYN_EXCEPT_ARGS, Rod::pNode1, Rod::pNode2, grad::sqrt(), Node::STRUCTURAL, and Rod::v.

836 : Elem(uL, fOut),
837 Rod(uL, pDO, pCL, pN1, pN2, dLength, fOut, true),
838 f1(f1Tmp),
839 f2(f2Tmp)
840 {
841  /* Verifica di consistenza dei dati iniziali */
842  ASSERT(pNode1 != 0);
843  ASSERT(dynamic_cast<const StructNode *>(pNode1) != 0);
845  ASSERT(pNode2 != 0);
846  ASSERT(dynamic_cast<const StructNode *>(pNode2) != 0);
848 
849  v = pNode2->GetXCurr() + dynamic_cast<const StructNode *>(pNode2)->GetRCurr()*f2Tmp
850  - pNode1->GetXCurr() - dynamic_cast<const StructNode *>(pNode1)->GetRCurr()*f1Tmp;
851 
852  doublereal dDot = v.Dot();
853  if (dDot <= std::numeric_limits<doublereal>::epsilon()) {
854  silent_cerr("RodWithOffset(" << GetLabel() << "): "
855  "inital length must be non-null" << std::endl);
857  }
858 
859  dElle = sqrt(dDot);
860 
861  ASSERT(dLength > std::numeric_limits<doublereal>::epsilon());
862 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Vec3 f1
Definition: rodj.h:272
virtual Node::Type GetNodeType(void) const
Definition: strnode.cc:145
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
doublereal dElle
Definition: rodj.h:53
const StructDispNode * pNode2
Definition: rodj.h:49
Vec3 v
Definition: rodj.h:52
#define ASSERT(expression)
Definition: colamd.c:977
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
Rod(unsigned int uL, const DofOwner *pDO, const ConstitutiveLaw1D *pCL, const StructDispNode *pN1, const StructDispNode *pN2, doublereal dLength, flag fOut, bool bHasOffsets=0)
Definition: rodj.cc:46
Vec3 f2
Definition: rodj.h:273
const StructDispNode * pNode1
Definition: rodj.h:48
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
double doublereal
Definition: colamd.c:52
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

RodWithOffset::~RodWithOffset ( void  )
virtual

Definition at line 865 of file rodj.cc.

References NO_OP.

866 {
867  NO_OP;
868 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

void RodWithOffset::AfterConvergence ( const VectorHandler X,
const VectorHandler XP 
)
virtual

Reimplemented from Rod.

Definition at line 884 of file rodj.cc.

References ConstitutiveLawOwner< T, Tder >::AfterConvergence(), Rod::dEpsilon, and Rod::dEpsilonPrime.

886 {
888 }
doublereal dEpsilonPrime
Definition: rodj.h:56
doublereal dEpsilon
Definition: rodj.h:55
void AfterConvergence(const T &Eps, const T &EpsPrime=mb_zero< T >())
Definition: constltp.h:288

Here is the call graph for this function:

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

Implements Elem.

Definition at line 891 of file rodj.cc.

References FullSubMatrixHandler::Add(), Vec3::Cross(), DEBUGCOUT, Rod::dElle, Rod::dEpsilonPrime, Rod::dL0, f1, f2, ConstitutiveLawOwner< T, Tder >::GetF(), ConstitutiveLawOwner< T, Tder >::GetFDE(), ConstitutiveLawOwner< T, Tder >::GetFDEPrime(), StructDispNode::GetVCurr(), StructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), MatCross, MatCrossCross, Rod::pNode1, Rod::pNode2, FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), FullSubMatrixHandler::ResizeReset(), VariableSubMatrixHandler::SetFull(), FullSubMatrixHandler::Sub(), Vec3::Tens(), Rod::v, and WorkSpaceDim().

895 {
896  DEBUGCOUT("Entering RodWithOffset::AssJac()" << std::endl);
897 
898  FullSubMatrixHandler& WM = WorkMat.SetFull();
899 
900  /* Dimensiona e resetta la matrice di lavoro */
901  integer iNumRows = 0;
902  integer iNumCols = 0;
903  WorkSpaceDim(&iNumRows, &iNumCols);
904  WM.ResizeReset(iNumRows, iNumCols);
905 
906  /* Recupera gli indici */
907  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
908  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
909  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
910  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
911 
912  /* Setta gli indici della matrice */
913  for (int iCnt = 1; iCnt <= 6; iCnt++) {
914  WM.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
915  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
916  WM.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
917  WM.PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
918  }
919 
920  const Mat3x3& R1(dynamic_cast<const StructNode *>(pNode1)->GetRRef());
921  const Mat3x3& R2(dynamic_cast<const StructNode *>(pNode2)->GetRRef());
922  Vec3 f1Tmp(R1*f1);
923  Vec3 f2Tmp(R2*f2);
924 
925  const Vec3& v1(pNode1->GetVCurr());
926  const Vec3& v2(pNode2->GetVCurr());
927  const Vec3& Omega1(dynamic_cast<const StructNode *>(pNode1)->GetWRef());
928  const Vec3& Omega2(dynamic_cast<const StructNode *>(pNode2)->GetWRef());
929 
930  /* Velocita' di deformazione */
931  Vec3 vPrime(v2 + Omega2.Cross(f2Tmp) - v1 - Omega1.Cross(f1Tmp));
932 
933  /* Forza e slopes */
934  doublereal dF = GetF();
935  doublereal dFDE = GetFDE();
936  doublereal dFDEPrime = GetFDEPrime();
937 
938  /* Vettore forza */
939  Vec3 F = v*(dF/dElle);
940 
941  Mat3x3 K(v.Tens(v*(dCoef*(dFDE/dL0 - (dEpsilonPrime*dFDEPrime + dF)/dElle)/(dElle*dElle))));
942  if (dFDEPrime != 0.) {
943  K += v.Tens(vPrime*(dCoef*dFDEPrime/(dElle*dElle*dL0)));
944  }
945  doublereal d = dCoef*dF/dElle;
946  for (unsigned iCnt = 1; iCnt <= 3; iCnt++) {
947  K(iCnt, iCnt) += d;
948  }
949 
950  Mat3x3 KPrime;
951  if (dFDEPrime != 0.) {
952  KPrime = v.Tens(v*((dFDEPrime)/(dL0*dElle*dElle)));
953  }
954 
955  /* Termini di forza diagonali */
956  Mat3x3 Tmp1(K);
957  if (dFDEPrime != 0.) {
958  Tmp1 += KPrime;
959  }
960  WM.Add(1, 1, Tmp1);
961  WM.Add(6 + 1, 6 + 1, Tmp1);
962 
963  /* Termini di coppia, nodo 1 */
964  Mat3x3 Tmp2 = f1Tmp.Cross(Tmp1);
965  WM.Add(3 + 1, 1, Tmp2);
966  WM.Sub(3 + 1, 6 + 1, Tmp2);
967 
968  /* Termini di coppia, nodo 2 */
969  Tmp2 = f2Tmp.Cross(Tmp1);
970  WM.Add(9 + 1, 6 + 1, Tmp2);
971  WM.Sub(9 + 1, 1, Tmp2);
972 
973  /* termini di forza extradiagonali */
974  WM.Sub(1, 6 + 1, Tmp1);
975  WM.Sub(6 + 1, 1, Tmp1);
976 
977  /* Termini di rotazione, Delta g1 */
978  Mat3x3 Tmp3 = Tmp1*Mat3x3(MatCross, -f1Tmp);
979  if (dFDEPrime != 0.) {
980  Tmp3 += KPrime*Mat3x3(MatCross, f1Tmp.Cross(Omega1*dCoef));
981  }
982  WM.Add(1, 3 + 1, Tmp3);
983  WM.Sub(6 + 1, 3 + 1, Tmp3);
984 
985  /* Termini di coppia, Delta g1 */
986  Tmp2 = f1Tmp.Cross(Tmp3) + Mat3x3(MatCrossCross, F, f1Tmp*dCoef);
987  WM.Add(3 + 1, 3 + 1, Tmp2);
988  Tmp2 = f2Tmp.Cross(Tmp3);
989  WM.Sub(9 + 1, 3 + 1, Tmp2);
990 
991  /* Termini di rotazione, Delta g2 */
992  Tmp3 = Tmp1*Mat3x3(MatCross, -f2Tmp);
993  if (dFDEPrime != 0.) {
994  Tmp3 += KPrime*Mat3x3(MatCross, f2Tmp.Cross(Omega2*dCoef));
995  }
996  WM.Add(6 + 1, 9 + 1, Tmp3);
997  WM.Sub(1, 9 + 1, Tmp3);
998 
999  /* Termini di coppia, Delta g2 */
1000  Tmp2 = f2Tmp.Cross(Tmp3) + Mat3x3(MatCrossCross, F, f2Tmp*dCoef);
1001  WM.Add(9 + 1, 9 + 1, Tmp2);
1002  Tmp2 = f1Tmp.Cross(Tmp3);
1003  WM.Sub(3 + 1, 9 + 1, Tmp2);
1004 
1005  return WorkMat;
1006 }
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
doublereal dEpsilonPrime
Definition: rodj.h:56
Definition: matvec3.h:98
const MatCross_Manip MatCross
Definition: matvec3.cc:639
Vec3 f1
Definition: rodj.h:272
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
doublereal dElle
Definition: rodj.h:53
const Tder & GetFDE(void) const
Definition: constltp.h:298
doublereal dL0
Definition: rodj.h:50
const StructDispNode * pNode2
Definition: rodj.h:49
#define DEBUGCOUT(msg)
Definition: myassert.h:232
Vec3 v
Definition: rodj.h:52
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
Mat3x3 Tens(const Vec3 &v) const
Definition: matvec3.cc:53
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: rodj.h:293
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
const T & GetF(void) const
Definition: constltp.h:293
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
Vec3 f2
Definition: rodj.h:273
const StructDispNode * pNode1
Definition: rodj.h:48
double doublereal
Definition: colamd.c:52
const Tder & GetFDEPrime(void) const
Definition: constltp.h:303
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Implements Elem.

Definition at line 1009 of file rodj.cc.

References AssVec(), DEBUGCOUT, StructDispNode::iGetFirstMomentumIndex(), Rod::pNode1, Rod::pNode2, SubVectorHandler::PutRowIndex(), VectorHandler::ResizeReset(), and WorkSpaceDim().

1013 {
1014  DEBUGCOUT("RodWithOffset::AssRes()" << std::endl);
1015 
1016  /* Dimensiona e resetta la matrice di lavoro */
1017  integer iNumRows = 0;
1018  integer iNumCols = 0;
1019  WorkSpaceDim(&iNumRows, &iNumCols);
1020  WorkVec.ResizeReset(iNumRows);
1021 
1022  /* Indici */
1023  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
1024  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
1025 
1026  /* Setta gli indici */
1027  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1028  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
1029  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
1030  }
1031 
1032  AssVec(WorkVec);
1033 
1034  return WorkVec;
1035 }
virtual void ResizeReset(integer)
Definition: vh.cc:55
void AssVec(SubVectorHandler &WorkVec)
Definition: rodj.cc:1038
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
const StructDispNode * pNode2
Definition: rodj.h:49
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstMomentumIndex(void) const =0
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: rodj.h:293
const StructDispNode * pNode1
Definition: rodj.h:48
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void RodWithOffset::AssVec ( SubVectorHandler WorkVec)

Definition at line 1038 of file rodj.cc.

References VectorHandler::Add(), Vec3::Cross(), Rod::dCalcEpsilon(), DEBUGCOUT, Rod::dElle, Rod::dEpsilon, Rod::dEpsilonPrime, Rod::dL0, Vec3::Dot(), f1, f2, ConstitutiveLawOwner< T, Tder >::GetF(), WithLabel::GetLabel(), StructDispNode::GetVCurr(), StructDispNode::GetXCurr(), MBDYN_EXCEPT_ARGS, Rod::pNode1, Rod::pNode2, grad::sqrt(), VectorHandler::Sub(), ConstitutiveLawOwner< T, Tder >::Update(), and Rod::v.

Referenced by AssRes(), and InitialAssRes().

1039 {
1040  DEBUGCOUT("RodWithOffset::AssVec()" << std::endl);
1041 
1042  /* Dati */
1043  const Mat3x3& R1(dynamic_cast<const StructNode *>(pNode1)->GetRCurr());
1044  const Mat3x3& R2(dynamic_cast<const StructNode *>(pNode2)->GetRCurr());
1045  Vec3 f1Tmp(R1*f1);
1046  Vec3 f2Tmp(R2*f2);
1047  const Vec3& x1(pNode1->GetXCurr());
1048  const Vec3& x2(pNode2->GetXCurr());
1049 
1050  const Vec3& v1(pNode1->GetVCurr());
1051  const Vec3& v2(pNode2->GetVCurr());
1052  const Vec3& Omega1(dynamic_cast<const StructNode *>(pNode1)->GetWCurr());
1053  const Vec3& Omega2(dynamic_cast<const StructNode *>(pNode2)->GetWCurr());
1054 
1055  /* v = x2-x1 */
1056  v = x2 + f2Tmp - x1 - f1Tmp;
1057  doublereal dCross = v.Dot();
1058 
1059  /* Verifica che la distanza non sia nulla */
1060  if (dCross <= std::numeric_limits<doublereal>::epsilon()) {
1061  silent_cerr("RodWithOffset(" << GetLabel() << "): "
1062  "null distance between nodes " << pNode1->GetLabel()
1063  << " and " << pNode2->GetLabel() << std::endl);
1065  }
1066 
1067  /* Lunghezza corrente */
1068  dElle = sqrt(dCross);
1069 
1070  /* Deformazione */
1071  dEpsilon = dCalcEpsilon();
1072 
1073  /* Velocita' di deformazione */
1074  Vec3 vPrime(v2 + Omega2.Cross(f2Tmp) - v1 - Omega1.Cross(f1Tmp));
1075  dEpsilonPrime = (v.Dot(vPrime))/(dElle*dL0);
1076 
1077  /* Ampiezza della forza */
1078  bool ChangeJac(false);
1079  try {
1080  ConstitutiveLaw1DOwner::Update(dEpsilon, dEpsilonPrime);
1081 
1082  } catch (Elem::ChangedEquationStructure) {
1083  ChangeJac = true;
1084  }
1085 
1086  doublereal dF = GetF();
1087 
1088  /* Vettore forza */
1089  Vec3 F(v*(dF/dElle));
1090 
1091  WorkVec.Add(1, F);
1092  WorkVec.Add(3 + 1, f1Tmp.Cross(F));
1093  WorkVec.Sub(6 + 1, F);
1094  WorkVec.Sub(9 + 1, f2Tmp.Cross(F));
1095 
1096  if (ChangeJac) {
1098  }
1099 }
virtual doublereal dCalcEpsilon(void)
Definition: rodj.cc:97
doublereal dEpsilonPrime
Definition: rodj.h:56
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
Vec3 f1
Definition: rodj.h:272
doublereal Dot(const Vec3 &v) const
Definition: matvec3.h:243
doublereal dElle
Definition: rodj.h:53
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
doublereal dL0
Definition: rodj.h:50
const StructDispNode * pNode2
Definition: rodj.h:49
doublereal dEpsilon
Definition: rodj.h:55
#define DEBUGCOUT(msg)
Definition: myassert.h:232
Vec3 v
Definition: rodj.h:52
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
const T & GetF(void) const
Definition: constltp.h:293
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
Vec3 f2
Definition: rodj.h:273
const StructDispNode * pNode1
Definition: rodj.h:48
double doublereal
Definition: colamd.c:52
void Update(const T &Eps, const T &EpsPrime=mb_zero< T >())
Definition: constltp.h:283
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

VariableSubMatrixHandler & RodWithOffset::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
virtual

Reimplemented from Rod.

Definition at line 1103 of file rodj.cc.

References FullSubMatrixHandler::Add(), Vec3::Cross(), DEBUGCOUT, Rod::dElle, Rod::dEpsilonPrime, Rod::dL0, f1, f2, ConstitutiveLawOwner< T, Tder >::GetF(), ConstitutiveLawOwner< T, Tder >::GetFDE(), ConstitutiveLawOwner< T, Tder >::GetFDEPrime(), StructDispNode::GetVCurr(), StructDispNode::iGetFirstPositionIndex(), InitialWorkSpaceDim(), MatCross, MatCrossCross, Rod::pNode1, Rod::pNode2, FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), FullSubMatrixHandler::ResizeReset(), VariableSubMatrixHandler::SetFull(), FullSubMatrixHandler::Sub(), Vec3::Tens(), and Rod::v.

1105 {
1106  DEBUGCOUT("Entering RodWithOffset::InitialAssJac()" << std::endl);
1107 
1108  FullSubMatrixHandler& WM = WorkMat.SetFull();
1109 
1110  /* Dimensiona e resetta la matrice di lavoro */
1111  integer iNumRows = 0;
1112  integer iNumCols = 0;
1113  InitialWorkSpaceDim(&iNumRows, &iNumCols);
1114  WM.ResizeReset(iNumRows, iNumCols);
1115 
1116  /* Recupera gli indici */
1117  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
1118  integer iNode1FirstVelIndex = iNode1FirstPosIndex + 6;
1119  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
1120  integer iNode2FirstVelIndex = iNode2FirstPosIndex + 6;
1121 
1122  /* Setta gli indici della matrice */
1123  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1124  WM.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
1125  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
1126  WM.PutColIndex(6 + iCnt, iNode1FirstVelIndex + iCnt);
1127 
1128  WM.PutRowIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
1129  WM.PutColIndex(12 + iCnt, iNode2FirstPosIndex + iCnt);
1130  WM.PutColIndex(18 + iCnt, iNode2FirstVelIndex + iCnt);
1131  }
1132 
1133  const Mat3x3& R1(dynamic_cast<const StructNode *>(pNode1)->GetRRef());
1134  const Mat3x3& R2(dynamic_cast<const StructNode *>(pNode2)->GetRRef());
1135  Vec3 f1Tmp(R1*f1);
1136  Vec3 f2Tmp(R2*f2);
1137 
1138  const Vec3& v1(pNode1->GetVCurr());
1139  const Vec3& v2(pNode2->GetVCurr());
1140  const Vec3& Omega1(dynamic_cast<const StructNode *>(pNode1)->GetWRef());
1141  const Vec3& Omega2(dynamic_cast<const StructNode *>(pNode2)->GetWRef());
1142 
1143  /* Velocita' di deformazione */
1144  Vec3 vPrime(v2 + Omega2.Cross(f2Tmp) - v1 - Omega1.Cross(f1Tmp));
1145 
1146  /* Forza e slopes */
1147  doublereal dF = GetF();
1148  doublereal dFDE = GetFDE();
1149  doublereal dFDEPrime = GetFDEPrime();
1150 
1151  /* Vettore forza */
1152  Vec3 F = v*(dF/dElle);
1153 
1154  Mat3x3 K(v.Tens(v*((dFDE/dL0 - (dEpsilonPrime*dFDEPrime + dF)/dElle)/(dElle*dElle))));
1155  if (dFDEPrime != 0.) {
1156  K += v.Tens(vPrime*(dFDEPrime/(dElle*dElle*dL0)));
1157  }
1158  doublereal d = dF/dElle;
1159  for (unsigned iCnt = 1; iCnt <= 3; iCnt++) {
1160  K(iCnt, iCnt) += d;
1161  }
1162 
1163  Mat3x3 KPrime;
1164  if (dFDEPrime != 0.) {
1165  KPrime = v.Tens(v*((dFDEPrime)/(dL0*dElle*dElle)));
1166  }
1167 
1168  /* Termini di forza diagonali */
1169  WM.Add(1, 1, K);
1170  WM.Add(6 + 1, 12 + 1, K);
1171 
1172  /* Termini di coppia, nodo 1 */
1173  Mat3x3 Tmp2 = f1Tmp.Cross(K);
1174  WM.Add(3 + 1, 1, Tmp2);
1175  WM.Sub(3 + 1, 12 + 1, Tmp2);
1176 
1177  /* Termini di coppia, nodo 2 */
1178  Tmp2 = f2Tmp.Cross(K);
1179  WM.Add(9 + 1, 12 + 1, Tmp2);
1180  WM.Sub(9 + 1, 1, Tmp2);
1181 
1182  /* termini di forza extradiagonali */
1183  WM.Sub(1, 12 + 1, K);
1184  WM.Sub(6 + 1, 1, K);
1185 
1186  if (dFDEPrime != 0.) {
1187  /* Termini di forza diagonali */
1188  WM.Add(1, 6 + 1, KPrime);
1189  WM.Add(6 + 1, 18 + 1, KPrime);
1190 
1191  /* Termini di coppia, nodo 1 */
1192  Tmp2 = f1Tmp.Cross(KPrime);
1193  WM.Add(3 + 1, 6 + 1, Tmp2);
1194  WM.Sub(3 + 1, 18 + 1, Tmp2);
1195 
1196  /* Termini di coppia, nodo 2 */
1197  Tmp2 = f2Tmp.Cross(KPrime);
1198  WM.Add(9 + 1, 18 + 1, Tmp2);
1199  WM.Sub(9 + 1, 6 + 1, Tmp2);
1200 
1201  /* termini di forza extradiagonali */
1202  WM.Sub(1, 18 + 1, KPrime);
1203  WM.Sub(6 + 1, 6 + 1, KPrime);
1204  }
1205 
1206  /* Termini di rotazione, Delta g1 */
1207  Mat3x3 Tmp3 = K*Mat3x3(MatCross, -f1Tmp);
1208  if (dFDEPrime != 0.) {
1209  Tmp3 -= KPrime*Mat3x3(MatCrossCross, Omega1, f1Tmp);
1210  }
1211  WM.Add(1, 3 + 1, Tmp3);
1212  WM.Sub(6 + 1, 3 + 1, Tmp3);
1213 
1214  /* Termini di coppia, Delta g1 */
1215  Tmp2 = f1Tmp.Cross(Tmp3) + Mat3x3(MatCrossCross, F, f1Tmp);
1216  WM.Add(3 + 1, 3 + 1, Tmp2);
1217  Tmp2 = f2Tmp.Cross(Tmp3);
1218  WM.Sub(9 + 1, 3 + 1, Tmp2);
1219 
1220  /* Termini di rotazione, Delta g2 */
1221  Tmp3 = K*Mat3x3(MatCross, -f2Tmp);
1222  if (dFDEPrime != 0.) {
1223  Tmp3 -= KPrime*Mat3x3(MatCrossCross, Omega2, f2Tmp);
1224  }
1225  WM.Add(6 + 1, 15 + 1, Tmp3);
1226  WM.Sub(1, 15 + 1, Tmp3);
1227 
1228  /* Termini di coppia, Delta g2 */
1229  Tmp2 = f2Tmp.Cross(Tmp3) + Mat3x3(MatCrossCross, F, f2Tmp);
1230  WM.Add(9 + 1, 15 + 1, Tmp2);
1231  Tmp2 = f1Tmp.Cross(Tmp3);
1232  WM.Sub(3 + 1, 15 + 1, Tmp2);
1233 
1234  if (dFDEPrime != 0.) {
1235  /* Termini di rotazione, Delta w1 */
1236  Tmp3 = KPrime*Mat3x3(MatCross, -f1Tmp);
1237  WM.Add(1, 9 + 1, Tmp3);
1238  WM.Sub(6 + 1, 9 + 1, Tmp3);
1239 
1240  /* Termini di coppia, Delta w1 */
1241  Tmp2 = f1Tmp.Cross(Tmp3);
1242  WM.Add(3 + 1, 9 + 1, Tmp2);
1243  Tmp2 = f2Tmp.Cross(Tmp3);
1244  WM.Sub(9 + 1, 9 + 1, Tmp2);
1245 
1246  /* Termini di rotazione, Delta w2 */
1247  Tmp3 = KPrime*Mat3x3(MatCross, -f2Tmp);
1248  WM.Add(6 + 1, 21 + 1, Tmp3);
1249  WM.Sub(1, 21 + 1, Tmp3);
1250 
1251  /* Termini di coppia, Delta w2 */
1252  Tmp2 = f2Tmp.Cross(Tmp3);
1253  WM.Add(9 + 1, 21 + 1, Tmp2);
1254  Tmp2 = f1Tmp.Cross(Tmp3);
1255  WM.Sub(3 + 1, 21 + 1, Tmp2);
1256  }
1257 
1258  return WorkMat;
1259 }
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
doublereal dEpsilonPrime
Definition: rodj.h:56
Definition: matvec3.h:98
const MatCross_Manip MatCross
Definition: matvec3.cc:639
Vec3 f1
Definition: rodj.h:272
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: rodj.h:318
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
doublereal dElle
Definition: rodj.h:53
const Tder & GetFDE(void) const
Definition: constltp.h:298
doublereal dL0
Definition: rodj.h:50
const StructDispNode * pNode2
Definition: rodj.h:49
#define DEBUGCOUT(msg)
Definition: myassert.h:232
Vec3 v
Definition: rodj.h:52
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
Mat3x3 Tens(const Vec3 &v) const
Definition: matvec3.cc:53
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
const T & GetF(void) const
Definition: constltp.h:293
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
Vec3 f2
Definition: rodj.h:273
const StructDispNode * pNode1
Definition: rodj.h:48
double doublereal
Definition: colamd.c:52
const Tder & GetFDEPrime(void) const
Definition: constltp.h:303
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Reimplemented from Rod.

Definition at line 1263 of file rodj.cc.

References AssVec(), DEBUGCOUT, StructDispNode::iGetFirstPositionIndex(), InitialWorkSpaceDim(), Rod::pNode1, Rod::pNode2, SubVectorHandler::PutRowIndex(), and VectorHandler::ResizeReset().

1265 {
1266  DEBUGCOUT("RodWithOffset::InitialAssRes()" << std::endl);
1267 
1268  /* Dimensiona e resetta la matrice di lavoro */
1269  integer iNumRows = 0;
1270  integer iNumCols = 0;
1271  InitialWorkSpaceDim(&iNumRows, &iNumCols);
1272  WorkVec.ResizeReset(iNumRows);
1273 
1274  /* Indici */
1275  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
1276  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
1277 
1278  /* Setta gli indici */
1279  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1280  WorkVec.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
1281  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
1282  }
1283 
1284  AssVec(WorkVec);
1285 
1286  return WorkVec;
1287 }
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: rodj.h:318
void AssVec(SubVectorHandler &WorkVec)
Definition: rodj.cc:1038
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
const StructDispNode * pNode2
Definition: rodj.h:49
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
const StructDispNode * pNode1
Definition: rodj.h:48
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Reimplemented from Rod.

Definition at line 318 of file rodj.h.

Referenced by InitialAssJac(), and InitialAssRes().

318  {
319  *piNumRows = 12;
320  *piNumCols = 24;
321  };
std::ostream & RodWithOffset::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 872 of file rodj.cc.

References Rod::dL0, f1, f2, WithLabel::GetLabel(), ConstitutiveLawOwner< T, Tder >::pGetConstLaw(), Rod::pNode1, Rod::pNode2, Joint::Restart(), and Vec3::Write().

873 {
874  Joint::Restart(out) << ", rod, "
875  << pNode1->GetLabel() << ", "
876  "position, reference, node, ", f1.Write(out, ", ") << ", "
877  << pNode2->GetLabel() << ", "
878  "position, reference, node, ", f2.Write(out, ", ") << ", "
879  << dL0;
880  return pGetConstLaw()->Restart(out) << ';' << std::endl;
881 }
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
ConstitutiveLaw< T, Tder > * pGetConstLaw(void) const
Definition: constltp.h:278
Vec3 f1
Definition: rodj.h:272
doublereal dL0
Definition: rodj.h:50
const StructDispNode * pNode2
Definition: rodj.h:49
virtual std::ostream & Restart(std::ostream &out) const
Definition: joint.h:195
Vec3 f2
Definition: rodj.h:273
const StructDispNode * pNode1
Definition: rodj.h:48
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

virtual void RodWithOffset::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
inlinevirtual

Implements Elem.

Definition at line 293 of file rodj.h.

Referenced by AssJac(), and AssRes().

293  {
294  *piNumRows = 12;
295  *piNumCols = 12;
296  };

Member Data Documentation

Vec3 RodWithOffset::f1
protected

Definition at line 272 of file rodj.h.

Referenced by AssJac(), AssVec(), InitialAssJac(), and Restart().

Vec3 RodWithOffset::f2
protected

Definition at line 273 of file rodj.h.

Referenced by AssJac(), AssVec(), InitialAssJac(), and Restart().


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