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

#include <modal.h>

Inheritance diagram for Modal:
Collaboration diagram for Modal:

Classes

struct  StrNodeData
 

Public Member Functions

 Modal (unsigned int uL, const ModalNode *pModalNodeTmp, const Vec3 &x0, const Mat3x3 &R0, const DofOwner *pDO, unsigned int N, unsigned int NS, unsigned int NFN, doublereal dMass, const Vec3 &STmp, const Mat3x3 &JTmp, const std::vector< unsigned int > &uModeNumber, MatNxN *pGenMass, MatNxN *pGenStiff, MatNxN *pGenDamp, const std::vector< std::string > &IdFEMNodes, Mat3xN *pN, const std::vector< Modal::StrNodeData > &snd, Mat3xN *pPHIt, Mat3xN *pPHIr, Mat3xN *pModeShapest, Mat3xN *pModeShapesr, Mat3xN *pInv3, Mat3xN *pInv4, Mat3xN *pInv5, Mat3xN *pInv8, Mat3xN *pInv9, Mat3xN *pInv10, Mat3xN *pInv11, VecN *a, VecN *aP, flag fOut)
 
 ~Modal (void)
 
virtual Joint::Type GetJointType (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
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
 
DofOrder::Order GetDofType (unsigned int i) const
 
DofOrder::Order GetEqType (unsigned int i) 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)
 
void Output (OutputHandler &OH) const
 
virtual unsigned int iGetInitialNumDof (void) const
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
void SetInitialValue (VectorHandler &)
 
void SetValue (DataManager *pDM, VectorHandler &, VectorHandler &, SimulationEntity::Hints *ph=0)
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
const Mat3xNpGetPHIt (void) const
 
const Mat3xNpGetPHIr (void) const
 
const Mat3xNGetCurrFEMNodesPosition (void)
 
const Mat3xNGetCurrFEMNodesVelocity (void)
 
integer uGetNModes (void) const
 
const std::vector< unsigned int > & GetModeList (void) const
 
const VecNGetA (void) const
 
const VecNGetAP (void) const
 
const VecNGetB (void) const
 
const VecNGetBP (void) const
 
integer uGetNFEMNodes (void)
 
integer iGetModalIndex (void) const
 
const ModalNodepGetModalNode (void) const
 
doublereal dGetM (void) const
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
virtual void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual bool bInverseDynamics (void) const
 
void SetInverseDynamicsFlags (unsigned uIDF)
 
unsigned GetInverseDynamicsFlags (void) const
 
bool bIsErgonomy (void) const
 
bool bIsRightHandSide (void) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, const VectorHandler &XPrimePrimeCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
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 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 AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
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 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 Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
bool bIsPrescribedMotion (void) const
 
bool bIsTorque (void) const
 
- Public Member Functions inherited from ElemGravityOwner
 ElemGravityOwner (unsigned int uL, flag fOut)
 
virtual ~ElemGravityOwner (void)
 
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)
 

Protected Member Functions

Vec3 GetS_int (void) const
 
Mat3x3 GetJ_int (void) const
 
Vec3 GetB_int (void) const
 
Vec3 GetG_int (void) const
 
- Protected Member Functions inherited from Joint
virtual void OutputPrepare_int (const std::string &type, OutputHandler &OH, std::string &name)
 

Protected Attributes

const ModalNode *const pModalNode
 
const unsigned iRigidOffset
 
Vec3 x
 
Mat3x3 R
 
Mat3x3 RT
 
const unsigned int NModes
 
const unsigned int NStrNodes
 
const unsigned int NFEMNodes
 
const std::vector< std::string > IdFEMNodes
 
const Mat3xNpXYZFEMNodes
 
const doublereal dMass
 
const Vec3 Inv2
 
const Mat3x3 Inv7
 
const std::vector< unsigned intuModeNumber
 
const MatNxNpModalMass
 
const MatNxNpModalStiff
 
const MatNxNpModalDamp
 
const Mat3xNpPHIt
 
const Mat3xNpPHIr
 
const Mat3xNpModeShapest
 
const Mat3xNpModeShapesr
 
Mat3xNpCurrXYZ
 
Mat3xNpCurrXYZVel
 
const Mat3xNpInv3
 
const Mat3xNpInv4
 
const Mat3xNpInv5
 
const Mat3xNpInv8
 
const Mat3xNpInv9
 
const Mat3xNpInv10
 
const Mat3xNpInv11
 
Vec3 Inv3jaj
 
Vec3 Inv3jaPj
 
Mat3x3 Inv8jaj
 
Mat3x3 Inv8jaPj
 
Mat3xN Inv5jaj
 
Mat3xN Inv5jaPj
 
Mat3x3 Inv9jkajak
 
Mat3x3 Inv9jkajaPk
 
VecN a
 
VecN a0
 
VecN aPrime
 
VecN aPrime0
 
VecN b
 
VecN bPrime
 
std::vector< StrNodeDataSND
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from GravityOwner
GravitypGravity
 

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
}
 

Detailed Description

Definition at line 74 of file modal.h.

Constructor & Destructor Documentation

Modal::Modal ( unsigned int  uL,
const ModalNode pModalNodeTmp,
const Vec3 x0,
const Mat3x3 R0,
const DofOwner pDO,
unsigned int  N,
unsigned int  NS,
unsigned int  NFN,
doublereal  dMass,
const Vec3 STmp,
const Mat3x3 JTmp,
const std::vector< unsigned int > &  uModeNumber,
MatNxN pGenMass,
MatNxN pGenStiff,
MatNxN pGenDamp,
const std::vector< std::string > &  IdFEMNodes,
Mat3xN pN,
const std::vector< Modal::StrNodeData > &  snd,
Mat3xN pPHIt,
Mat3xN pPHIr,
Mat3xN pModeShapest,
Mat3xN pModeShapesr,
Mat3xN pInv3,
Mat3xN pInv4,
Mat3xN pInv5,
Mat3xN pInv8,
Mat3xN pInv9,
Mat3xN pInv10,
Mat3xN pInv11,
VecN a,
VecN aP,
flag  fOut 
)

Definition at line 123 of file modal.cc.

References ASSERT, ModalNode::GetStructNodeType(), StructNode::MODAL, and pModalNode.

Referenced by ReadModal().

155 : Elem(uL, fOut),
156 Joint(uL, pDO, fOut),
157 pModalNode(pR),
158 iRigidOffset(pModalNode ? 12 : 0),
159 x(x0),
160 R(R0),
161 RT(R0.Transpose()),
162 NModes(NM),
163 NStrNodes(NI),
164 NFEMNodes(NF),
166 pXYZFEMNodes(pN),
167 dMass(dMassTmp),
168 Inv2(STmp),
169 Inv7(JTmp),
171 pModalMass(pGenMass),
172 pModalStiff(pGenStiff),
173 pModalDamp(pGenDamp),
174 pPHIt(pPHItStrNode),
175 pPHIr(pPHIrStrNode),
176 pModeShapest(pModeShapest),
177 pModeShapesr(pModeShapesr),
178 pCurrXYZ(0),
179 pCurrXYZVel(0),
180 pInv3(pInv3),
181 pInv4(pInv4),
182 pInv5(pInv5),
183 pInv8(pInv8),
184 pInv9(pInv9),
185 pInv10(pInv10),
186 pInv11(pInv11),
187 Inv3jaj(::Zero3),
188 #if !(USE_AUTODIFF && MODAL_USE_AUTODIFF) || MODAL_DEBUG_AUTODIFF
189 Inv3jaPj(::Zero3),
190 #endif
191 Inv8jaj(::Zero3x3),
192 #if !(USE_AUTODIFF && MODAL_USE_AUTODIFF) || MODAL_DEBUG_AUTODIFF
193 Inv8jaPj(::Zero3x3),
194 Inv5jaj(NModes, 0.),
195 Inv5jaPj(NModes, 0.),
196 #endif
197 Inv9jkajak(::Eye3),
198 #if !(USE_AUTODIFF && MODAL_USE_AUTODIFF) || MODAL_DEBUG_AUTODIFF
199 Inv9jkajaPk(::Eye3),
200 #endif
201 a(*aa), a0(*aa),
202 aPrime(NModes, 0.), aPrime0(*bb),
203 b(*bb),
204 bPrime(NModes, 0.),
205 SND(snd)
206 {
208 }
Vec3 Inv3jaPj
Definition: modal.h:174
const Mat3xN * pModeShapesr
Definition: modal.h:157
const Vec3 Zero3(0., 0., 0.)
const Mat3xN * pModeShapest
Definition: modal.h:156
Mat3x3 Inv8jaPj
Definition: modal.h:180
const MatNxN * pModalMass
Definition: modal.h:149
Mat3xN Inv5jaj
Definition: modal.h:181
const doublereal dMass
Definition: modal.h:144
Vec3 x
Definition: modal.h:134
const Mat3xN * pPHIr
Definition: modal.h:154
const std::vector< unsigned int > uModeNumber
Definition: modal.h:148
Joint(unsigned int uL, const DofOwner *pD, flag fOut)
Definition: joint.cc:83
const Mat3xN * pInv4
Definition: modal.h:163
VecN bPrime
Definition: modal.h:193
VecN aPrime0
Definition: modal.h:191
const Mat3x3 Eye3(1., 0., 0., 0., 1., 0., 0., 0., 1.)
VecN aPrime
Definition: modal.h:191
const Vec3 Inv2
Definition: modal.h:145
Mat3x3 Inv8jaj
Definition: modal.h:177
const Mat3xN * pInv3
Definition: modal.h:162
const Mat3x3 Zero3x3(0., 0., 0., 0., 0., 0., 0., 0., 0.)
virtual StructNode::Type GetStructNodeType(void) const
Definition: strnode.cc:3334
Mat3xN * pCurrXYZVel
Definition: modal.h:160
const ModalNode *const pModalNode
Definition: modal.h:76
Mat3x3 RT
Definition: modal.h:136
const Mat3xN * pPHIt
Definition: modal.h:153
Mat3x3 Inv9jkajaPk
Definition: modal.h:187
VecN b
Definition: modal.h:192
std::vector< StrNodeData > SND
Definition: modal.h:217
#define ASSERT(expression)
Definition: colamd.c:977
const std::vector< std::string > IdFEMNodes
Definition: modal.h:142
const unsigned int NModes
Definition: modal.h:138
const Mat3xN * pInv5
Definition: modal.h:164
VecN a0
Definition: modal.h:190
Mat3x3 Transpose(void) const
Definition: matvec3.h:816
const unsigned iRigidOffset
Definition: modal.h:130
const MatNxN * pModalDamp
Definition: modal.h:151
Mat3xN * pCurrXYZ
Definition: modal.h:159
Mat3x3 Inv9jkajak
Definition: modal.h:184
Vec3 Inv3jaj
Definition: modal.h:171
const Mat3xN * pXYZFEMNodes
Definition: modal.h:143
const Mat3xN * pInv9
Definition: modal.h:166
const MatNxN * pModalStiff
Definition: modal.h:150
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
const Mat3xN * pInv11
Definition: modal.h:169
Mat3xN Inv5jaPj
Definition: modal.h:182
const Mat3xN * pInv8
Definition: modal.h:165
VecN a
Definition: modal.h:190
const unsigned int NFEMNodes
Definition: modal.h:141
const unsigned int NStrNodes
Definition: modal.h:139
Mat3x3 R
Definition: modal.h:135
const Mat3xN * pInv10
Definition: modal.h:168
const Mat3x3 Inv7
Definition: modal.h:146

Here is the call graph for this function:

Modal::~Modal ( void  )

Definition at line 210 of file modal.cc.

References pInv10, pInv11, pInv3, pInv4, pInv5, pInv8, pInv9, pModalDamp, pModalMass, pModalStiff, pModeShapesr, pModeShapest, pPHIr, pPHIt, pXYZFEMNodes, and SAFEDELETE.

211 {
212  if (pXYZFEMNodes) {
214  }
215  if (pModalMass) {
217  }
218  if (pModalStiff) {
220  }
221  if (pModalDamp) {
223  }
224  if (pModeShapest) {
226  }
227  if (pModeShapesr) {
229  }
230  if (pPHIt) {
231  SAFEDELETE(pPHIt);
232  }
233  if (pPHIr) {
234  SAFEDELETE(pPHIr);
235  }
236  if (pInv3) {
237  SAFEDELETE(pInv3);
238  }
239  if (pInv4) {
240  SAFEDELETE(pInv4);
241  }
242  if (pInv5) {
243  SAFEDELETE(pInv5);
244  }
245  if (pInv8) {
246  SAFEDELETE(pInv8);
247  }
248  if (pInv9) {
249  SAFEDELETE(pInv9);
250  }
251  if (pInv10) {
253  }
254  if (pInv11) {
256  }
257 
258  /* FIXME: destroy all the other data ... */
259 }
const Mat3xN * pModeShapesr
Definition: modal.h:157
const Mat3xN * pModeShapest
Definition: modal.h:156
const MatNxN * pModalMass
Definition: modal.h:149
const Mat3xN * pPHIr
Definition: modal.h:154
const Mat3xN * pInv4
Definition: modal.h:163
const Mat3xN * pInv3
Definition: modal.h:162
const Mat3xN * pPHIt
Definition: modal.h:153
const Mat3xN * pInv5
Definition: modal.h:164
const MatNxN * pModalDamp
Definition: modal.h:151
const Mat3xN * pXYZFEMNodes
Definition: modal.h:143
const Mat3xN * pInv9
Definition: modal.h:166
const MatNxN * pModalStiff
Definition: modal.h:150
const Mat3xN * pInv11
Definition: modal.h:169
const Mat3xN * pInv8
Definition: modal.h:165
const Mat3xN * pInv10
Definition: modal.h:168
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

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

Implements Elem.

Definition at line 543 of file modal.cc.

References a, FullSubMatrixHandler::Add(), FullSubMatrixHandler::AddT(), Vec3::Cross(), DEBUGCOUT, FullSubMatrixHandler::DecCoef(), VecN::dGet(), Vec3::dGet(), MatNxN::dGet(), dMass, Mat3xN::GetMat3x3(), Mat3xN::GetMat3x3ScalarMult(), Mat3xN::GetVec(), StructNode::GetWRef(), DofOwnerOwner::iGetFirstIndex(), iGetNumDof(), FullSubMatrixHandler::IncCoef(), Inv2, Inv3jaj, Inv3jaPj, Inv5jaj, Inv5jaPj, Inv7, Inv8jaj, Inv8jaPj, Inv9jkajaPk, iRigidOffset, Mat3xN::LeftMult(), MatCross, MatCrossCross, NModes, NStrNodes, pInv3, pInv4, pInv5, pInv8, pInv9, pModalDamp, pModalMass, pModalNode, pModalStiff, pPHIr, pPHIt, FullSubMatrixHandler::PutCoef(), FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), Mat3xN::PutVec(), R, grad::REGULAR_JAC, FullSubMatrixHandler::ResizeReset(), MatNx3::RightMult(), RT, VariableSubMatrixHandler::SetFull(), VariableSubMatrixHandler::SetSparse(), SND, FullSubMatrixHandler::Sub(), FullSubMatrixHandler::SubT(), Mat3x3::Symm2(), MatNx3::Transpose(), grad::Transpose(), WorkSpaceDim(), Zero3, and Zero3x3.

547 {
548  DEBUGCOUT("Entering Modal::AssJac()" << std::endl);
549 #if USE_AUTODIFF && MODAL_USE_AUTODIFF && !MODAL_DEBUG_AUTODIFF
550  SparseSubMatrixHandler& WorkMatSp = WorkMat.SetSparse();
551 
553  WorkMatSp,
554  dCoef,
555  XCurr,
556  XPrimeCurr,
558  &dofMap);
559 #else
560  FullSubMatrixHandler& WM = WorkMat.SetFull();
561  integer iNumRows = 0;
562  integer iNumCols = 0;
563  WorkSpaceDim(&iNumRows, &iNumCols);
564  WM.ResizeReset(iNumRows, iNumCols);
565 
566  /* gli indici sono ordinati cosi': i primi 6 sono le equazioni
567  * per abbassare di grado il sistema,
568  * quindi le 6 equazioni del moto rigido, quindi le 2*M modali,
569  * quindi le eq. vincolari */
570 
571  /* FIXME: by now, I add a test everywhere it's needed;
572  * later, I'll try to group conditional parts in separate tests */
573 
574  /* indici della parte rigida */
575 
576  if (pModalNode) {
577  integer iRigidIndex = pModalNode->iGetFirstIndex();
578 
579  for (unsigned int iCnt = 1; iCnt <= iRigidOffset; iCnt++) {
580  WM.PutRowIndex(iCnt, iRigidIndex + iCnt);
581  WM.PutColIndex(iCnt, iRigidIndex + iCnt);
582  }
583  }
584 
585  /* indici della parte deformabile e delle reazioni vincolari */
586  integer iFlexIndex = iGetFirstIndex();
587  unsigned int iNumDof = iGetNumDof();
588 
589  for (unsigned int iCnt = 1; iCnt <= iNumDof; iCnt++) {
590  WM.PutRowIndex(iRigidOffset + iCnt, iFlexIndex + iCnt);
591  WM.PutColIndex(iRigidOffset + iCnt, iFlexIndex + iCnt);
592  }
593 
594  /* indici delle equazioni vincolari (solo per il nodo 2) */
595  for (unsigned int iStrNodem1 = 0; iStrNodem1 < NStrNodes; iStrNodem1++) {
596  integer iNodeFirstMomIndex =
597  SND[iStrNodem1].pNode->iGetFirstMomentumIndex();
598  integer iNodeFirstPosIndex =
599  SND[iStrNodem1].pNode->iGetFirstPositionIndex();
600 
601  integer iOffset = iRigidOffset + iNumDof + 6*iStrNodem1;
602  for (integer iCnt = 1; iCnt <= 6; iCnt++) {
603  WM.PutRowIndex(iOffset + iCnt, iNodeFirstMomIndex + iCnt);
604  WM.PutColIndex(iOffset + iCnt, iNodeFirstPosIndex + iCnt);
605  }
606  }
607 
608  /* Assemblaggio dello Jacobiano */
609 
610  Vec3 wr(::Zero3);
611  Mat3x3 J(::Zero3x3);
612  Vec3 S(::Zero3);
613  if (pModalNode) {
614  /* recupera e aggiorna i dati necessari */
615  /* i prodotti Inv3j*aj ecc. sono gia' stati fatti da AssRes() */
616 
617  wr = pModalNode->GetWRef();
618  /* R and RT are updated by AssRes() */
619  Mat3x3 JTmp = Inv7;
620  if (pInv8 != 0) {
621  JTmp += Inv8jaj.Symm2();
622  }
623  J = R*JTmp*RT;
624  Vec3 STmp = Inv2;
625  if (pInv3 != 0) {
626  STmp += Inv3jaj;
627  }
628  S = R*STmp;
629 
630  /* matrice di massa: J[1,1] = Mtot */
631  for (int iCnt = 6 + 1; iCnt <= 6 + 3; iCnt++) {
632  WM.PutCoef(iCnt, iCnt, dMass);
633  }
634 
635  /* momenti statici J[1,2] = -[S/\] + c[-2w/\S/\ + S/\w/\] */
636  WM.Add(6 + 1, 9 + 1, Mat3x3(MatCrossCross, S, wr*dCoef)
637  - Mat3x3(MatCrossCross, wr, S*(2.*dCoef))
638  - Mat3x3(MatCross, S));
639 
640  /* J[2,1] = [S/\] */
641  WM.Add(9 + 1, 6 + 1, Mat3x3(MatCross, S));
642 
643  /* momenti d'inerzia: J[2,2] = J + c[ - (Jw)/\ + (w/\)J]; */
644  WM.Add(9 + 1, 9 + 1, J + ((wr.Cross(J) - Mat3x3(MatCross, J*wr))*dCoef));
645 
646  /* completa lo Jacobiano con l'aggiunta delle equazioni {xP} = {v}
647  {gP} - [wr/\]{g} = {w} */
648  for (int iCnt = 1; iCnt <= 6; iCnt++) {
649  WM.IncCoef(iCnt, iCnt, 1.);
650  WM.DecCoef(iCnt, 6 + iCnt, dCoef);
651  }
652  WM.Sub(3 + 1, 3 + 1, Mat3x3(MatCross, wr*dCoef));
653  }
654 
655  /* parte deformabile :
656  *
657  * | I -cI ||aP|
658  * | || |
659  * |cK M + cC ||bP|
660  */
661 
662  for (unsigned int iCnt = 1; iCnt <= NModes; iCnt++) {
663  unsigned int iiCnt = iRigidOffset + iCnt;
664 
665  WM.PutCoef(iiCnt, iiCnt, 1.);
666  WM.PutCoef(iiCnt, iiCnt + NModes, -dCoef);
667  for (unsigned int jCnt = 1; jCnt <= NModes; jCnt++) {
668  unsigned int jjCnt = iRigidOffset + jCnt;
669 
670  WM.PutCoef(iiCnt + NModes, jjCnt,
671  dCoef*pModalStiff->dGet(iCnt, jCnt));
672  WM.PutCoef(iiCnt + NModes, jjCnt + NModes,
673  pModalMass->dGet(iCnt, jCnt)
674  + dCoef*pModalDamp->dGet(iCnt, jCnt));
675  }
676  }
677 
678  if (pModalNode) {
679 
680  /* termini di accoppiamento moto rigido-deformabile;
681  * eventualmente l'utente potra' scegliere
682  * se trascurarli tutti, una parte o considerarli tutti */
683 
684  /* linearizzazione delle OmegaPrime:
685  * J13 = R*Inv3jaj
686  * J23 = R*Inv4 + Inv5jaj
687  * (questi termini ci vogliono sempre)
688  */
689 
690  if (pInv3 != 0) {
691  Mat3xN Jac13(NModes, 0.);
692  WM.Add(6 + 1, iRigidOffset + NModes + 1, Jac13.LeftMult(R, *pInv3));
693 
694  WM.AddT(iRigidOffset + NModes + 1, 6 + 1, Jac13);
695 
696  Mat3x3 Inv3jaPjWedge(MatCross, R*(Inv3jaPj*(2.*dCoef)));
697  WM.Sub(6 + 1, 9 + 1, Inv3jaPjWedge);
698  }
699 
700  if (pInv4 != 0) {
701  Mat3xN Jac23(NModes, 0.);
702  Jac23.LeftMult(R, *pInv4);
703  if (pInv5 != 0) {
704  Mat3xN Inv5jajRef(NModes, 0.);
705 
706  Jac23 += Inv5jajRef.LeftMult(R, Inv5jaj);
707  }
708  WM.Add(9 + 1, iRigidOffset + NModes + 1, Jac23);
709 
710  WM.AddT(iRigidOffset + NModes + 1, 9 + 1, Jac23);
711  }
712 
713 
714  /* termini di Coriolis: linearizzazione delle Omega
715  * (si puo' evitare se non ho grosse vel. angolari):
716  * J13 = -2*R*[Inv3jaPj/\]*RT
717  * J23 = 2*R*[Inv8jaPj - Inv9jkajaPk]*RT */
718 
719  if (pInv8 != 0 ) {
720  Mat3x3 JTmp = Inv8jaPj;
721  if (pInv9 != 0) {
722  JTmp -= Inv9jkajaPk;
723  }
724  WM.Add(9 + 1, 9 + 1, R*(JTmp*(RT*(2.*dCoef))));
725  }
726 
727  /* termini di Coriolis: linearizzazione delle b;
728  * si puo' evitare 'quasi' sempre: le velocita'
729  * di deformazione dovrebbero essere sempre piccole
730  * rispetto ai termini rigidi
731  * Jac13 = 2*[Omega/\]*R*PHI
732  */
733 #if 0
734  Jac13.LeftMult(wrWedge*R*2*dCoef, *pInv3);
735  WM.Add(6 + 1, iRigidOffset + NModes + 1, Jac13);
736 #endif
737  /* nota: non riesco a tirar fuori la Omega dall'equazione
738  * dei momenti:
739  * 2*[ri/\]*[Omega/\]*R*PHIi*{DeltaaP}, i = 1,...nnodi
740  * quindi questa equazione non si puo' linearizzare
741  * a meno di ripetere la sommatoria estesa a tutti i nodi
742  * a ogni passo del Newton-Rapson... */
743 
744  /* linearizzazione delle forze centrifughe e di Coriolis
745  * in base modale (anche questi termini dovrebbero essere
746  * trascurabili) */
747 #if 0
748  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
749  Inv4j = pInv4->GetVec(jMode);
750  VInv5jaj = Inv5jaj.GetVec(jMode);
751  VInv5jaPj = Inv5jaPj.GetVec(jMode);
752  unsigned int jOffset = (jMode - 1)*3 + 1;
753  Inv8jTranspose = (pInv8->GetMat3x3(jOffset)).Transpose();
754  if (pInv9 != 0 ) {
755  Inv9jkak = 0.;
756  for (unsigned int kModem1 = 0; kModem1 < NModes; kModem1++) {
757  doublereal a_kMode = a.dGet(kModem1 + 1);
758  integer iOffset = (jMode - 1)*3*NModes + kModem1*3 + 1;
759  Inv9jkak += pInv9->GetMat3x3ScalarMult(iOffset, a_kMode);
760  }
761  }
762  for (int iCnt = 1; iCnt <= 3; iCnt++) {
763  doublereal temp1 = 0., temp2 = 0.;
764  for (int jCnt = 1; jCnt<=3; jCnt++) {
765  if (pInv9 != 0) {
766  temp1 += -2*wr.dGet(jCnt)*(R*(Inv8jTranspose - Inv9jkak)*RT).dGet(iCnt, jCnt);
767  } else {
768  temp1 += -2*wr.dGet(jCnt)*(R*(Inv8jTranspose)*RT).dGet(iCnt, jCnt);
769  }
770  temp2 += -(R*(Inv4j + VInv5jaj)).dGet(jCnt)*wrWedge.dGet(iCnt, jCnt);
771  }
772  WM.IncCoef(iRigidOffset + NModes + jMode, 9 + iCnt,
773  dCoef*(temp1 + temp2));
774  }
775  for (int iCnt = 1; iCnt<=3; iCnt++) {
776  doublereal temp1 = 0.;
777  for (int jCnt = 1; jCnt<=3; jCnt++) {
778  temp1 += (R*VInv5jaPj*2).dGet(jCnt);
779  }
780  WM.IncCoef(iRigidOffset + NModes + jMode, 9 + iCnt,
781  dCoef*temp1);
782  }
783  }
784 #endif
785  }
786 
787  /* ciclo esteso a tutti i nodi d'interfaccia */
788  for (unsigned int iStrNode = 1; iStrNode <= NStrNodes; iStrNode++) {
789  unsigned int iStrNodem1 = iStrNode - 1;
790 
791  /* recupero le forme modali del nodo vincolato */
792  Mat3xN PHIt(NModes), PHIr(NModes);
793  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
794  integer iOffset = (jMode - 1)*NStrNodes + iStrNode;
795 
796  PHIt.PutVec(jMode, pPHIt->GetVec(iOffset));
797  PHIr.PutVec(jMode, pPHIr->GetVec(iOffset));
798  }
799 
800  MatNx3 PHItT(NModes), PHIrT(NModes);
801  PHItT.Transpose(PHIt);
802  PHIrT.Transpose(PHIr);
803 
804  /* nota: le operazioni
805  * d1tot = d1 + PHIt*a, R1tot = R*[I + (PHIr*a)/\]
806  * sono gia' state fatte da AssRes */
807 
808  Mat3xN SubMat1(NModes), SubMat2(NModes);
809  MatNx3 SubMat3(NModes);
810  MatNxN SubMat4(NModes);
811 
812  /* cerniera sferica */
813  /* F e' aggiornata da AssRes */
814 
815  integer iReactionIndex = iRigidOffset + 2*NModes + 6*iStrNodem1;
816  integer iStrNodeIndex = iRigidOffset + iNumDof + 6*iStrNodem1;
817 
818  Mat3x3 FTmpWedge(MatCross, SND[iStrNodem1].F*dCoef);
819 
820  Mat3xN PHItR(NModes);
821  PHItR.LeftMult(R, PHIt);
822 
823  for (int iCnt = 1; iCnt <= 3; iCnt++) {
824  /* termini di reazione sui nodi */
825  WM.DecCoef(iStrNodeIndex + iCnt, iReactionIndex + iCnt, 1.);
826 
827  /* termini di vincolo dovuti ai nodi */
828  WM.DecCoef(iReactionIndex + iCnt, iStrNodeIndex + iCnt, 1.);
829  }
830 
831  if (pModalNode) {
832  for (int iCnt = 1; iCnt <= 3; iCnt++) {
833  /* termini di reazione sul nodo modale */
834  WM.IncCoef(6 + iCnt, iReactionIndex + iCnt, 1.);
835 
836  /* termini di vincolo dovuti al nodo modale */
837  WM.IncCoef(iReactionIndex + iCnt, iCnt, 1.);
838  }
839 
840  /* pd1Tot e' il puntatore all'array
841  * che contiene le posizioni del nodi FEM */
842  Mat3x3 dTmp1Wedge(MatCross, SND[iStrNodem1].d1tot);
843 
844  WM.Add(9 + 1, iReactionIndex + 1, dTmp1Wedge);
845 
846  /* termini del tipo: c*F/\*d/\*Deltag */
847  WM.Add(9 + 1, 3 + 1, FTmpWedge*dTmp1Wedge);
848 
849  /* termini di vincolo dovuti ai nodi */
850  WM.Sub(iReactionIndex + 1, 3 + 1, dTmp1Wedge);
851 
852  /* termini aggiuntivi dovuti alla deformabilita' */
853  SubMat3.RightMult(PHItT, RT*FTmpWedge);
854  WM.Add(iRigidOffset + NModes + 1, 3 + 1, SubMat3);
855 
856  SubMat1.LeftMult(FTmpWedge, PHItR);
857  WM.Sub(9 + 1, iRigidOffset + 1, SubMat1);
858  }
859 
860  /* contributo dovuto alla flessibilita' */
861  WM.Add(iReactionIndex + 1, iRigidOffset + 1, PHItR);
862 
863  /* idem per pd2 e pR2 */
864  Mat3x3 dTmp2Wedge(MatCross, SND[iStrNodem1].R2*SND[iStrNodem1].OffsetMB);
865  WM.Sub(iStrNodeIndex + 3 + 1, iReactionIndex + 1, dTmp2Wedge);
866 
867  /* termini del tipo: c*F/\*d/\*Deltag */
868  WM.Sub(iStrNodeIndex + 3 + 1, iStrNodeIndex + 3 + 1,
869  FTmpWedge*dTmp2Wedge);
870 
871  /* termini aggiuntivi dovuti alla deformabilita' */
872  SubMat3.RightMult(PHItT, RT);
873  WM.Add(iRigidOffset + NModes + 1, iReactionIndex + 1, SubMat3);
874 
875  /* modifica: divido le equazioni di vincolo per dCoef */
876 
877  /* termini di vincolo dovuti al nodo 2 */
878  WM.Add(iReactionIndex + 1, iStrNodeIndex + 3 + 1, dTmp2Wedge);
879 
880  /* fine cerniera sferica */
881 
882  /* equazioni di vincolo : giunto prismatico */
883 
884  /* Vec3 M(XCurr, iModalIndex + 2*NModes + 6*iStrNodem1 + 3 + 1); */
885  Vec3 MTmp = SND[iStrNodem1].R2*(SND[iStrNodem1].M*dCoef);
886  Mat3x3 MTmpWedge(MatCross, MTmp);
887 
888  /* Eq. dei momenti */
889  if (pModalNode) {
890  WM.Sub(9 + 1, iStrNodeIndex + 3 + 1, MTmpWedge);
891  }
892  WM.Add(iStrNodeIndex + 3 + 1, iStrNodeIndex + 3 + 1, MTmpWedge);
893 
894  /* Eq. d'equilibrio ai modi */
895  SubMat3.RightMult(PHIrT, R*MTmpWedge);
896  if (pModalNode) {
897  WM.Add(iRigidOffset + NModes + 1, 3 + 1, SubMat3);
898  }
899  WM.Sub(iRigidOffset + NModes + 1, iStrNodeIndex + 3 + 1, SubMat3);
900 
901  /* */
902  if (pModalNode) {
903  WM.AddT(iReactionIndex + 3 + 1, 3 + 1, SND[iStrNodem1].R2);
904  WM.Add(9 + 1, iReactionIndex + 3 + 1, SND[iStrNodem1].R2);
905  }
906  WM.SubT(iReactionIndex + 3 + 1, iStrNodeIndex + 3 + 1, SND[iStrNodem1].R2);
907  WM.Sub(iStrNodeIndex + 3 + 1, iReactionIndex + 3 + 1, SND[iStrNodem1].R2);
908 
909  /* */
910  SubMat3.RightMult(PHIrT, RT*SND[iStrNodem1].R2);
911  WM.Add(iRigidOffset + NModes + 1, iReactionIndex + 3 + 1, SubMat3);
912  for (unsigned iMode = 1; iMode <= NModes; iMode++) {
913  for (unsigned jIdx = 1; jIdx <= 3; jIdx++) {
914  WM.IncCoef(iReactionIndex + 3 + jIdx, iRigidOffset + iMode,
915  SubMat3(iMode, jIdx));
916  }
917  }
918  }
919 #endif
920  return WorkMat;
921 }
Vec3 Inv3jaPj
Definition: modal.h:174
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
const Vec3 Zero3(0., 0., 0.)
MatrixExpression< TransposedMatrix< MatrixDirectExpr< Matrix< T, N_rows, N_cols > > >, N_cols, N_rows > Transpose(const Matrix< T, N_rows, N_cols > &A)
Definition: matvec.h:2206
Mat3x3 Inv8jaPj
Definition: modal.h:180
Definition: matvec3.h:98
const MatCross_Manip MatCross
Definition: matvec3.cc:639
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
const MatNxN * pModalMass
Definition: modal.h:149
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: modal.cc:529
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
Mat3xN Inv5jaj
Definition: modal.h:181
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: modal.cc:543
const doublereal dMass
Definition: modal.h:144
const Mat3xN * pPHIr
Definition: modal.h:154
Mat3x3 GetMat3x3(integer iFirstCol) const
Definition: matvec3n.cc:607
const Mat3xN * pInv4
Definition: modal.h:163
void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:672
const doublereal & dGet(integer i, integer j) const
Definition: matvec3n.h:612
virtual const Vec3 & GetWRef(void) const
Definition: strnode.h:1024
const Vec3 Inv2
Definition: modal.h:145
Mat3x3 Inv8jaj
Definition: modal.h:177
const Mat3xN * pInv3
Definition: modal.h:162
void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:683
void AddT(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:227
void DecCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:694
Mat3x3 Symm2(void) const
Definition: matvec3.h:852
const Mat3x3 Zero3x3(0., 0., 0., 0., 0., 0., 0., 0., 0.)
Vec3 GetVec(integer iCol) const
Definition: matvec3n.cc:553
const ModalNode *const pModalNode
Definition: modal.h:76
Mat3x3 RT
Definition: modal.h:136
#define DEBUGCOUT(msg)
Definition: myassert.h:232
const Mat3xN * pPHIt
Definition: modal.h:153
Mat3x3 Inv9jkajaPk
Definition: modal.h:187
std::vector< StrNodeData > SND
Definition: modal.h:217
Mat3x3 GetMat3x3ScalarMult(integer iFirstCol, const doublereal &d) const
Definition: matvec3n.cc:700
const unsigned int NModes
Definition: modal.h:138
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const Mat3xN * pInv5
Definition: modal.h:164
const unsigned iRigidOffset
Definition: modal.h:130
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
void SubT(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:233
const MatNxN * pModalDamp
Definition: modal.h:151
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
Vec3 Inv3jaj
Definition: modal.h:171
const Mat3xN * pInv9
Definition: modal.h:166
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
const MatNxN * pModalStiff
Definition: modal.h:150
virtual unsigned int iGetNumDof(void) const
Definition: modal.cc:274
SparseSubMatrixHandler & SetSparse(void)
Definition: submat.h:1178
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
Mat3xN Inv5jaPj
Definition: modal.h:182
long int integer
Definition: colamd.c:51
const Mat3xN * pInv8
Definition: modal.h:165
const doublereal & dGet(integer i) const
Definition: matvec3n.h:188
VecN a
Definition: modal.h:190
const unsigned int NStrNodes
Definition: modal.h:139
Mat3x3 R
Definition: modal.h:135
const Mat3x3 Inv7
Definition: modal.h:146

Here is the call graph for this function:

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

Implements Elem.

Definition at line 924 of file modal.cc.

References a, VectorHandler::Add(), Mat3xN::AddVec(), aPrime, ASSERT, b, GravityOwner::bGetGravity(), bPrime, VecN::Copy(), Vec3::Cross(), DEBUGCOUT, VectorHandler::DecCoef(), VectorHandler::dGetCoef(), MySubVectorHandler::dGetCoef(), dMass, Vec3::Dot(), grad::Dot(), grad::fabs(), StructNode::GetgCurr(), StructNode::GetgPCurr(), Mat3xN::GetMat3x3(), Mat3xN::GetMat3x3ScalarMult(), StructNode::GetRCurr(), StructDispNode::GetVCurr(), Mat3xN::GetVec(), StructNode::GetWPCurr(), StructNode::GetWRef(), StructDispNode::GetXCurr(), StructDispNode::GetXPPCurr(), GRADIENT_ASSERT, DofOwnerOwner::iGetFirstIndex(), iGetNumDof(), SubVectorHandler::iGetRowIndex(), MySubVectorHandler::iGetRowIndex(), VectorHandler::iGetSize(), MySubVectorHandler::iGetSize(), VectorHandler::IncCoef(), Inv2, Inv3jaj, Inv3jaPj, Inv5jaj, Inv5jaPj, Inv7, Inv8jaj, Inv8jaPj, Inv9jkajak, Inv9jkajaPk, iRigidOffset, Mat3xN::LeftMult(), CGR_Rot::MatG, CGR_Rot::MatR, VecN::Mult(), NModes, NStrNodes, pInv10, pInv11, pInv3, pInv4, pInv5, pInv8, pInv9, pModalDamp, pModalMass, pModalNode, pModalStiff, pPHIr, pPHIt, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), Mat3xN::PutVec(), Mat3x3::PutVec(), R, grad::REGULAR_RES, Mat3xN::Reset(), Mat3x3::Reset(), MySubVectorHandler::Reset(), MySubVectorHandler::Resize(), VectorHandler::ResizeReset(), RT, SND, grad::sqrt(), VectorHandler::Sub(), Mat3x3::Symm2(), Mat3x3::Transpose(), grad::Transpose(), RotManip::VecRot(), WorkSpaceDim(), x, Zero3, and Zero3x3.

928 {
929  DEBUGCOUT("Entering Modal::AssRes()" << std::endl);
930 #if USE_AUTODIFF && MODAL_USE_AUTODIFF && !MODAL_DEBUG_AUTODIFF
932  WorkVec,
933  dCoef,
934  XCurr,
935  XPrimeCurr,
937 #else
938  integer iNumRows;
939  integer iNumCols;
940 
941  WorkSpaceDim(&iNumRows, &iNumCols);
942  WorkVec.ResizeReset(iNumRows);
943 
944 #if USE_AUTODIFF && MODAL_USE_AUTODIFF && MODAL_DEBUG_AUTODIFF
945  static integer iResidual = 0;
946  silent_cerr("Residual: #" << ++iResidual << std::endl);
947 
948  MySubVectorHandler WorkVecAD(iNumRows);
949  WorkVecAD.Resize(iNumRows);
950  WorkVecAD.Reset();
952  WorkVecAD,
953  dCoef,
954  XCurr,
955  XPrimeCurr,
957 #endif
958 
959  /*
960  * Equations:
961  *
962  * 1 -> 12: rigid body eq.
963  *
964  * 13 -> 12 + 2*NM: modes eq. (\dot{a}=b); m\dot{b} + ka=f)
965  *
966  * 12 + 2*NM -> 12 + 2*NM + 6*NN: node constraints
967  *
968  * 12 + 2*NM + 6*NN -> 12 + 2*NM + 6*NN + 6*NN: constr. nodes eq.
969  *
970  *
971  * Unknowns:
972  *
973  * rigid body: from modal node
974  * modes: iGetFirstIndex()
975  * node reactions: iGetFirstIndex() + 2*NM
976  * nodes: from constraint nodes
977  */
978 
979  /* modal dofs and node constraints indices */
980  integer iModalIndex = iGetFirstIndex();
981  unsigned int iNumDof = iGetNumDof();
982  for (unsigned int iCnt = 1; iCnt <= iNumDof; iCnt++) {
983  WorkVec.PutRowIndex(iRigidOffset + iCnt, iModalIndex + iCnt);
984  }
985 
986  /* interface nodes equilibrium indices */
987  integer iOffset = iRigidOffset + iNumDof;
988  for (unsigned iStrNodem1 = 0; iStrNodem1 < NStrNodes; iStrNodem1++) {
989  integer iNodeFirstMomIndex =
990  SND[iStrNodem1].pNode->iGetFirstMomentumIndex();
991 
992  for (unsigned int iCnt = 1; iCnt <= 6; iCnt++) {
993  WorkVec.PutRowIndex(iOffset + iCnt,
994  iNodeFirstMomIndex + iCnt);
995  }
996 
997  iOffset += 6;
998  }
999 
1000  a.Copy(XCurr, iModalIndex + 1);
1001  aPrime.Copy(XPrimeCurr, iModalIndex + 1);
1002  b.Copy(XCurr, iModalIndex + NModes + 1);
1003  bPrime.Copy(XPrimeCurr, iModalIndex + NModes + 1);
1004 
1005  VecN Ka(NModes), CaP(NModes), MaPP(NModes);
1006 
1007  /*
1008  * aggiornamento invarianti
1009  */
1010  Ka.Mult(*pModalStiff, a);
1011  CaP.Mult(*pModalDamp, b);
1012  MaPP.Mult(*pModalMass, bPrime);
1013 
1014 #if 0
1015  std::cerr << "### Stiff" << std::endl;
1016  for (unsigned int i = 1; i <= NModes; i++) {
1017  for (unsigned int j = 1; j <= NModes; j++) {
1018  std::cerr << std::setw(2) << i << ", "
1019  << std::setw(2) << j << " "
1020  << std::setw(20) << (*pModalStiff)(i,j)
1021  << std::endl;
1022 
1023  }
1024  }
1025  std::cerr << "### Damp" << std::endl;
1026  for (unsigned int i = 1; i <= NModes; i++) {
1027  for (unsigned int j = 1; j <= NModes; j++) {
1028  std::cerr << std::setw(2) << i << ", "
1029  << std::setw(2) << j << " "
1030  << std::setw(20) << (*pModalDamp)(i,j)
1031  << std::endl;
1032  }
1033  }
1034  std::cerr << "### Mass" << std::endl;
1035  for (unsigned int i = 1; i <= NModes; i++) {
1036  for (unsigned int j = 1; j <= NModes; j++) {
1037  std::cerr << std::setw(2) << i << ", "
1038  << std::setw(2) << j << " "
1039  << std::setw(20) << (*pModalMass)(i,j)
1040  << std::endl;
1041  }
1042  }
1043  std::cerr << "### a" << std::endl;
1044  for (unsigned int i = 1; i <= NModes; i++) {
1045  std::cerr << std::setw(2) << i << " "
1046  << std::setw(20) << a(i) << std::endl;
1047  }
1048  std::cerr << "### b" << std::endl;
1049  for (unsigned int i = 1; i <= NModes; i++) {
1050  std::cerr << std::setw(2) << i << " "
1051  << std::setw(20) << b(i) << std::endl;
1052  }
1053  std::cerr << "### bP" << std::endl;
1054  for (unsigned int i = 1; i <= NModes; i++) {
1055  std::cerr << std::setw(2) << i << " "
1056  << std::setw(20) << bPrime(i) << std::endl;
1057  }
1058 #endif
1059 
1060  Vec3 Inv3jaPPj(::Zero3);
1061  if (pInv3 != 0) {
1062  Inv3jaj = *pInv3 * a;
1063  Inv3jaPj = *pInv3 * b;
1064  Inv3jaPPj = *pInv3 * bPrime;
1065  }
1066 
1067  /* invarianti rotazionali */
1068  if (pInv8 != 0) {
1069  Inv8jaj.Reset();
1070  Inv8jaPj.Reset();
1071  }
1072  if (pInv5 != 0) {
1073  Inv5jaj.Reset(0.);
1074  Inv5jaPj.Reset(0.);
1075  }
1076 
1077  // Mat3x3 MatTmp1(::Zero3x3), MatTmp2(::Zero3x3);
1078 
1079  if (pInv9) {
1080  Inv9jkajak.Reset();
1081  Inv9jkajaPk.Reset();
1082  }
1083  Mat3x3 Inv10jaPj(::Zero3x3);
1084 
1085  if (pInv5 != 0 || pInv8 != 0 || pInv9 != 0 || pInv10 != 0) {
1086  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
1087  doublereal a_jMode = a(jMode);
1088  doublereal aP_jMode = b(jMode);
1089 
1090  if (pInv5 != 0) {
1091  for (unsigned int kMode = 1; kMode <= NModes; kMode++) {
1092  Vec3 v = pInv5->GetVec((jMode - 1)*NModes + kMode);
1093 
1094  Inv5jaj.AddVec(kMode, v*a_jMode);
1095  Inv5jaPj.AddVec(kMode, v*aP_jMode);
1096  }
1097  }
1098 
1099  if (pInv8 != 0) {
1100  Mat3x3 Inv8jajTmp;
1101 
1102  for (unsigned int jCnt = 1; jCnt <= 3; jCnt++) {
1103  unsigned int iMjC = (jMode - 1)*3 + jCnt;
1104 
1105  Inv8jajTmp.PutVec(jCnt, pInv8->GetVec(iMjC));
1106  }
1107 
1108  Inv8jaj += Inv8jajTmp * a_jMode;
1109  Inv8jaPj += Inv8jajTmp * aP_jMode;
1110 
1111  if (pInv9 != 0) {
1112  /*
1113  * questi termini si possono commentare perche' sono
1114  * (sempre ?) piccoli (termini del tipo a*a o a*b)
1115  * eventualmente dare all'utente la possibilita'
1116  * di scegliere se trascurarli o no
1117  */
1118  for (unsigned int kMode = 1; kMode <= NModes; kMode++) {
1119  doublereal a_kMode = a(kMode);
1120  doublereal aP_kMode = b(kMode);
1121  unsigned int iOffset = (jMode - 1)*3*NModes + (kMode - 1)*3 + 1;
1122  Inv9jkajak += pInv9->GetMat3x3ScalarMult(iOffset, a_jMode*a_kMode);
1123  Inv9jkajaPk += pInv9->GetMat3x3ScalarMult(iOffset, a_jMode*aP_kMode);
1124  }
1125  }
1126  }
1127 
1128  if (pInv10 != 0) {
1129  Mat3x3 Inv10jaPjTmp;
1130 
1131  for (unsigned int jCnt = 1; jCnt <= 3; jCnt++) {
1132  unsigned int iMjC = (jMode - 1)*3 + jCnt;
1133 
1134  Inv10jaPjTmp.PutVec(jCnt, pInv10->GetVec(iMjC)*aP_jMode);
1135  }
1136 
1137 
1138  Inv10jaPj += Inv10jaPjTmp;
1139  }
1140  }
1141  } /* fine ciclo sui modi */
1142 
1143 #ifdef MODAL_USE_GRAVITY
1144  /* forza di gravita' (decidere come inserire g) */
1145  /* FIXME: use a reasonable reference point where compute gravity */
1146  Vec3 GravityAcceleration(::Zero3);
1147  bool bGravity = GravityOwner::bGetGravity(x, GravityAcceleration);
1148 #endif /* MODAL_USE_GRAVITY */
1149 
1150  Vec3 vP(::Zero3);
1151  Vec3 wP(::Zero3);
1152  Vec3 w(::Zero3);
1153  Vec3 RTw(::Zero3);
1154  if (pModalNode) {
1155  /* rigid body indices */
1156  integer iRigidIndex = pModalNode->iGetFirstIndex();
1157  for (unsigned int iCnt = 1; iCnt <= iRigidOffset; iCnt++) {
1158  WorkVec.PutRowIndex(iCnt, iRigidIndex + iCnt);
1159  }
1160 
1161  /* recupera i dati necessari */
1162  x = pModalNode->GetXCurr();
1163  const Vec3& xP = pModalNode->GetVCurr();
1164  const Vec3& g = pModalNode->GetgCurr();
1165  const Vec3& gP = pModalNode->GetgPCurr();
1166  vP = pModalNode->GetXPPCurr();
1167  const Vec3& wr = pModalNode->GetWRef();
1168  wP = pModalNode->GetWPCurr();
1169 
1170  Vec3 v(XCurr, iRigidIndex + 6 + 1);
1171  w = Vec3(XCurr, iRigidIndex + 9 + 1);
1172 
1173  R = pModalNode->GetRCurr();
1174  RT = R.Transpose();
1175  RTw = RT*w;
1176 
1177  Mat3x3 JTmp = Inv7;
1178  if (pInv8 != 0) {
1179  JTmp += Inv8jaj.Symm2();
1180  if (pInv9 != 0) {
1181  JTmp -= Inv9jkajak;
1182  }
1183  }
1184  Mat3x3 J = R*JTmp*RT;
1185  Vec3 STmp = Inv2;
1186  if (pInv3 != 0) {
1187  STmp += Inv3jaj;
1188  }
1189  Vec3 S = R*STmp;
1190 
1191  /*
1192  * fine aggiornamento invarianti
1193  */
1194 
1195  /* forze d'inerzia */
1196  Vec3 FTmp = vP*dMass - S.Cross(wP) + w.Cross(w.Cross(S));
1197  if (pInv3 != 0) {
1198  FTmp += R*Inv3jaPPj + (w.Cross(R*Inv3jaPj))*2.;
1199  }
1200  WorkVec.Sub(6 + 1, FTmp);
1201 #if 0
1202  std::cerr << "m=" << dMass << "; S=" << S
1203  << "; a=" << a << "; aPrime =" << aPrime
1204  << "; b=" << b << "; bPrime= " << bPrime
1205  << "; tot=" << vP*dMass - S.Cross(wP) + w.Cross(w.Cross(S))
1206  + (w.Cross(R*Inv3jaPj))*2 + R*Inv3jaPPj << std::endl;
1207 #endif
1208 
1209  Vec3 MTmp = S.Cross(vP) + J*wP + w.Cross(J*w);
1210  if (pInv4 != 0) {
1211  Mat3xN Inv4Curr(NModes, 0);
1212  Inv4Curr.LeftMult(R, *pInv4);
1213  MTmp += Inv4Curr*bPrime;
1214  }
1215  if (pInv5 != 0) {
1216  Mat3xN Inv5jajCurr(NModes, 0);
1217  Inv5jajCurr.LeftMult(R, Inv5jaj);
1218  MTmp += Inv5jajCurr*bPrime;
1219  }
1220  if (pInv8 != 0) {
1221  Mat3x3 Tmp = Inv8jaPj;
1222  if (pInv9 != 0) {
1223  Tmp -= Inv9jkajaPk;
1224  }
1225  MTmp += R*Tmp*(RTw*2.);
1226  }
1227  /* termini dovuti alle inerzie rotazionali */
1228  if (pInv10 != 0) {
1229  Vec3 VTmp = Inv10jaPj.Symm2()*RTw;
1230  if (pInv11 != 0) {
1231  VTmp += w.Cross(R*(*pInv11*b));
1232  }
1233  MTmp += R*VTmp;
1234  }
1235  WorkVec.Sub(9 + 1, MTmp);
1236 
1237 #ifdef MODAL_USE_GRAVITY
1238  /* forza di gravita' (decidere come inserire g) */
1239  if (bGravity) {
1240  WorkVec.Add(6 + 1, GravityAcceleration*dMass);
1241  WorkVec.Add(9 + 1, S.Cross(GravityAcceleration));
1242  }
1243 #endif /* MODAL_USE_GRAVITY */
1244 
1245  /* equazioni per abbassare di grado il sistema */
1246  WorkVec.Add(1, v - xP);
1247  WorkVec.Add(3 + 1, w - Mat3x3(CGR_Rot::MatG, g)*gP
1248  - Mat3x3(CGR_Rot::MatR, g)*wr);
1249  }
1250 
1251  /* forze modali */
1252  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
1253  unsigned int jOffset = (jMode - 1)*3 + 1;
1254  doublereal d = - MaPP(jMode) - CaP(jMode) - Ka(jMode);
1255 
1256  if (pInv3 != 0) {
1257  Vec3 Inv3j = pInv3->GetVec(jMode);
1258 
1259  d -= (R*Inv3j).Dot(vP);
1260 
1261 #ifdef MODAL_USE_GRAVITY
1262  /* forza di gravita': */
1263  if (bGravity) {
1264  WorkVec.IncCoef(iRigidOffset + NModes + jMode,
1265  (R*Inv3j).Dot(GravityAcceleration));
1266  }
1267 #endif /* MODAL_USE_GRAVITY */
1268  }
1269 
1270  if (pInv4 != 0) {
1271  Vec3 Inv4j = pInv4->GetVec(jMode);
1272  if (pInv5 != 0) {
1273  Inv4j += Inv5jaj.GetVec(jMode);
1274 
1275  d -= ((R*Inv5jaPj.GetVec(jMode)).Dot(w))*2.;
1276  }
1277 
1278  d -= (R*Inv4j).Dot(wP);
1279  }
1280 
1281  if (pInv8 != 0 || pInv9 != 0 || pInv10 != 0) {
1282  Mat3x3 MTmp(::Zero3x3);
1283 
1284  if (pInv8 != 0) {
1285  MTmp += (pInv8->GetMat3x3(jOffset)).Transpose();
1286  if (pInv9 != 0) {
1287  for (unsigned int kModem1 = 0; kModem1 < NModes; kModem1++) {
1288  doublereal a_kMode = a(kModem1 + 1);
1289  integer kOffset = (jMode - 1)*3*NModes + kModem1*3 + 1;
1290 
1291  MTmp -= pInv9->GetMat3x3ScalarMult(kOffset, a_kMode);
1292  }
1293  }
1294  }
1295 
1296  if (pInv10 != 0) {
1297  MTmp += pInv10->GetMat3x3(jOffset);
1298  }
1299 
1300  d += w.Dot(R*(MTmp*RTw));
1301  }
1302 
1303  WorkVec.IncCoef(iRigidOffset + NModes + jMode, d);
1304 
1305 #if 0
1306  std::cerr << "(R*Inv3j).Dot(vP)=" << (R*Inv3j).Dot(vP)
1307  << std::endl
1308  << "(R*(Inv4j + VInv5jaj)).Dot(wP)="
1309  << (R*(Inv4j + VInv5jaj)).Dot(wP) << std::endl
1310  << "w.Dot(R*((Inv8jTranspose + Inv10j)*RTw))"
1311  << w.Dot(R*((Inv8jTranspose + Inv10j)*RTw)) << std::endl
1312  << " -(R*VInv5jaPj).Dot(w)*2."
1313  << -(R*VInv5jaPj).Dot(w)*2.<< std::endl
1314  << " -CaP.dGet(jMode)" << -CaP.dGet(jMode)<< std::endl
1315  << "-Ka.dGet(jMode) "
1316  << -CaP.dGet(jMode) - Ka.dGet(jMode) << std::endl;
1317 #endif
1318  }
1319 
1320  /* equazioni per abbassare di grado il sistema */
1321  for (unsigned int iCnt = 1; iCnt <= NModes; iCnt++) {
1322  WorkVec.PutCoef(iRigidOffset + iCnt, b(iCnt) - aPrime(iCnt));
1323  }
1324 
1325  /* equazioni di vincolo */
1326  for (unsigned int iStrNode = 1; iStrNode <= NStrNodes; iStrNode++) {
1327  unsigned int iStrNodem1 = iStrNode - 1;
1328  integer iReactionIndex = iRigidOffset + 2*NModes + 6*iStrNodem1;
1329  integer iStrNodeIndex = iReactionIndex + 6*NStrNodes;
1330 
1331  /* recupero le forme modali del nodo vincolato */
1332  /* FIXME: what about using Blitz++ ? :) */
1333  Mat3xN PHIt(NModes), PHIr(NModes);
1334  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
1335  integer iOffset = (jMode - 1)*NStrNodes + iStrNode;
1336  PHIt.PutVec(jMode, pPHIt->GetVec(iOffset));
1337  PHIr.PutVec(jMode, pPHIr->GetVec(iOffset));
1338  }
1339 
1340  /*
1341  * aggiorno d1 e R con il contributo dovuto
1342  * alla flessibilita':
1343  * d1tot = R*[d1 + PHIt*a], R1tot = R*[I + (PHIr*a)/\]
1344  */
1345  SND[iStrNodem1].d1tot = R*(SND[iStrNodem1].OffsetFEM + PHIt*a);
1346  SND[iStrNodem1].R1tot = R*Mat3x3(1., PHIr*a);
1347 
1348  /* constraint reaction (force) */
1349  SND[iStrNodem1].F = Vec3(XCurr,
1350  iModalIndex + 2*NModes + 6*iStrNodem1 + 1);
1351  const Vec3& x2 = SND[iStrNodem1].pNode->GetXCurr();
1352 
1353  /* FIXME: R2??? */
1354  SND[iStrNodem1].R2 = SND[iStrNodem1].pNode->GetRCurr();
1355 
1356  /* cerniera sferica */
1357  Vec3 dTmp1(SND[iStrNodem1].d1tot);
1358  Vec3 dTmp2(SND[iStrNodem1].R2*SND[iStrNodem1].OffsetMB);
1359 
1360  /* Eq. d'equilibrio, nodo 1 */
1361  if (pModalNode) {
1362  WorkVec.Sub(6 + 1, SND[iStrNodem1].F);
1363  WorkVec.Sub(9 + 1, dTmp1.Cross(SND[iStrNodem1].F));
1364  }
1365 
1366  /* termine aggiuntivo dovuto alla deformabilita':
1367  * -PHItiT*RT*F */
1368  Vec3 vtemp = RT*SND[iStrNodem1].F;
1369  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
1370  /* PHItTranspose(jMode) * vtemp */
1371  WorkVec.DecCoef(iRigidOffset + NModes + jMode,
1372  PHIt.GetVec(jMode)*vtemp);
1373  }
1374 
1375  /* Eq. d'equilibrio, nodo 2 */
1376  WorkVec.Add(iStrNodeIndex + 1, SND[iStrNodem1].F);
1377  WorkVec.Add(iStrNodeIndex + 3 + 1, dTmp2.Cross(SND[iStrNodem1].F));
1378 
1379  /* Eq. di vincolo */
1380  ASSERT(dCoef != 0.);
1381  WorkVec.Add(iReactionIndex + 1, (x2 + dTmp2 - x - dTmp1)/dCoef);
1382 
1383  /* constraint reaction (moment) */
1384  SND[iStrNodem1].M = Vec3(XCurr,
1385  iModalIndex + 2*NModes + 6*iStrNodem1 + 3 + 1);
1386 
1387  /* giunto prismatico */
1388  Vec3 ThetaCurr = RotManip::VecRot(SND[iStrNodem1].R2.MulTM(SND[iStrNodem1].R1tot));
1389  Vec3 MTmp = SND[iStrNodem1].R2*SND[iStrNodem1].M;
1390 
1391  /* Equazioni di equilibrio, nodo 1 */
1392  if (pModalNode) {
1393  WorkVec.Sub(9 + 1, MTmp);
1394  }
1395 
1396  /* Equazioni di equilibrio, nodo 2 */
1397  WorkVec.Add(iStrNodeIndex + 3 + 1, MTmp);
1398 
1399  /* Contributo dovuto alla flessibilita' :-PHIrT*RtotT*M */
1400  vtemp = RT*MTmp;
1401  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
1402  /* PHIrTranspose(jMode) * vtemp */
1403  WorkVec.DecCoef(iRigidOffset + NModes + jMode,
1404  PHIr.GetVec(jMode)*vtemp);
1405  }
1406 
1407  /* Modifica: divido le equazioni di vincolo per dCoef */
1408  ASSERT(dCoef != 0.);
1409  /* Equazioni di vincolo di rotazione */
1410  WorkVec.Sub(iReactionIndex + 3 + 1, ThetaCurr/dCoef);
1411  }
1412 
1413 #if 0
1414  std::cerr << "###" << std::endl;
1415  for (int i = 1; i <= WorkVec.iGetSize(); i++) {
1416  std::cerr << std::setw(2) << i << "("
1417  << std::setw(2) << WorkVec.iGetRowIndex(i) << ")"
1418  << std::setw(20) << WorkVec(i) << std::endl;
1419  }
1420 #endif
1421 #endif
1422 
1423 #if USE_AUTODIFF && MODAL_USE_AUTODIFF && MODAL_DEBUG_AUTODIFF
1424  doublereal dTol = 1.;
1425 
1426  for (integer i = 1; i <= WorkVec.iGetSize(); ++i) {
1427  dTol = std::max(dTol, fabs(WorkVec.dGetCoef(i)));
1428  }
1429 
1430  dTol *= sqrt(std::numeric_limits<doublereal>::epsilon());
1431  bool bOK = true;
1432  for (integer i = 1; i <= WorkVec.iGetSize(); ++i) {
1433  const doublereal dVal = WorkVec.dGetCoef(i);
1434  const integer iRow = WorkVec.iGetRowIndex(i);
1435  doublereal dValAD = 0.;
1436 
1437  for (integer j = 1; j <= WorkVecAD.iGetSize(); ++j) {
1438  if (iRow == WorkVecAD.iGetRowIndex(j)) {
1439  dValAD += WorkVecAD.dGetCoef(j);
1440  }
1441  }
1442 
1443  if (fabs(dVal - dValAD) > dTol) {
1444  silent_cerr("\tRowIndex: " << iRow << " WorkVec(" << i << ")=" << dVal << ", WorkVecAD(" << i << ")=" << dValAD << std::endl);
1445  bOK = false;
1446  }
1447  }
1448  if (!bOK) {
1449  silent_cerr("Residual #" << iResidual << ": NOK" << std::endl);
1450  }
1451  GRADIENT_ASSERT(bOK);
1452 #endif
1453  return WorkVec;
1454 }
Vec3 Inv3jaPj
Definition: modal.h:174
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
MatrixExpression< TransposedMatrix< MatrixDirectExpr< Matrix< T, N_rows, N_cols > > >, N_cols, N_rows > Transpose(const Matrix< T, N_rows, N_cols > &A)
Definition: matvec.h:2206
Mat3x3 Inv8jaPj
Definition: modal.h:180
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
const VecN & Copy(const VectorHandler &vh, integer iFirstIndex=1)
Definition: matvec3n.cc:116
virtual const Vec3 & GetgCurr(void) const
Definition: strnode.h:982
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const MatNxN * pModalMass
Definition: modal.h:149
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: modal.cc:529
Mat3xN Inv5jaj
Definition: modal.h:181
const doublereal dMass
Definition: modal.h:144
Vec3 x
Definition: modal.h:134
const Mat3xN * pPHIr
Definition: modal.h:154
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
virtual void IncCoef(integer iRow, const doublereal &dCoef)=0
Mat3x3 GetMat3x3(integer iFirstCol) const
Definition: matvec3n.cc:607
const Mat3xN * pInv4
Definition: modal.h:163
VecN bPrime
Definition: modal.h:193
VecN aPrime
Definition: modal.h:191
virtual bool bGetGravity(const Vec3 &X, Vec3 &Acc) const
Definition: gravity.cc:208
virtual const doublereal & dGetCoef(integer iRow) const =0
virtual const Vec3 & GetWRef(void) const
Definition: strnode.h:1024
const Vec3 Inv2
Definition: modal.h:145
Mat3x3 Inv8jaj
Definition: modal.h:177
virtual integer iGetSize(void) const =0
const Mat3xN * pInv3
Definition: modal.h:162
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
Mat3x3 Symm2(void) const
Definition: matvec3.h:852
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
virtual void DecCoef(integer iRow, const doublereal &dCoef)=0
const Mat3x3 Zero3x3(0., 0., 0., 0., 0., 0., 0., 0., 0.)
Vec3 GetVec(integer iCol) const
Definition: matvec3n.cc:553
void Reset(void)
Definition: matvec3.cc:613
void PutVec(unsigned short int i, const Vec3 &v)
Definition: matvec3.h:918
const ModalNode *const pModalNode
Definition: modal.h:76
Mat3x3 RT
Definition: modal.h:136
const MatG_Manip MatG
Definition: matvec3.cc:646
void Reset(const doublereal &d=0.)
Definition: matvec3n.cc:334
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetRowIndex(integer iSubRow) const =0
const Mat3xN * pPHIt
Definition: modal.h:153
Mat3x3 Inv9jkajaPk
Definition: modal.h:187
VecN b
Definition: modal.h:192
std::vector< StrNodeData > SND
Definition: modal.h:217
DotTraits< VectorExprLhs, VectorExprRhs, N_rows, N_rows >::ExpressionType Dot(const VectorExpression< VectorExprLhs, N_rows > &u, const VectorExpression< VectorExprRhs, N_rows > &v)
Definition: matvec.h:3133
virtual const Vec3 & GetWPCurr(void) const
Definition: strnode.h:1042
Mat3x3 GetMat3x3ScalarMult(integer iFirstCol, const doublereal &d) const
Definition: matvec3n.cc:700
const MatR_Manip MatR
Definition: matvec3.cc:645
#define ASSERT(expression)
Definition: colamd.c:977
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
const unsigned int NModes
Definition: modal.h:138
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
const Mat3xN * pInv5
Definition: modal.h:164
void AddVec(integer iCol, const Vec3 &v)
Definition: matvec3n.cc:579
Mat3x3 Transpose(void) const
Definition: matvec3.h:816
const unsigned iRigidOffset
Definition: modal.h:130
const MatNxN * pModalDamp
Definition: modal.h:151
Mat3x3 Inv9jkajak
Definition: modal.h:184
Vec3 Inv3jaj
Definition: modal.h:171
virtual const Vec3 & GetgPCurr(void) const
Definition: strnode.h:994
const Mat3xN * pInv9
Definition: modal.h:166
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
Definition: matvec3n.h:76
const MatNxN * pModalStiff
Definition: modal.h:150
virtual unsigned int iGetNumDof(void) const
Definition: modal.cc:274
virtual const Vec3 & GetXPPCurr(void) const
Definition: strnode.h:334
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
const Mat3xN * pInv11
Definition: modal.h:169
Mat3xN Inv5jaPj
Definition: modal.h:182
long int integer
Definition: colamd.c:51
#define GRADIENT_ASSERT(expr)
Definition: gradient.h:74
const Mat3xN * pInv8
Definition: modal.h:165
VecN a
Definition: modal.h:190
const unsigned int NStrNodes
Definition: modal.h:139
Mat3x3 R
Definition: modal.h:135
const Mat3xN * pInv10
Definition: modal.h:168
const Mat3x3 Inv7
Definition: modal.h:146

Here is the call graph for this function:

std::ostream & Modal::DescribeDof ( std::ostream &  out,
const char *  prefix = "",
bool  bInitial = false 
) const
virtual

Reimplemented from Elem.

Definition at line 283 of file modal.cc.

References DofOwnerOwner::iGetFirstIndex(), NModes, NStrNodes, and SND.

284 {
285  integer iModalIndex = iGetFirstIndex();
286 
287  out
288  << prefix << iModalIndex + 1 << "->" << iModalIndex + NModes
289  << ": modal displacements [q(1.." << NModes << ")]" << std::endl
290  << prefix << iModalIndex + NModes + 1 << "->" << iModalIndex + 2*NModes
291  << ": modal velocities [qP(1.." << NModes << ")]" << std::endl;
292  iModalIndex += 2*NModes;
293  for (unsigned iStrNodem1 = 0; iStrNodem1 < NStrNodes; iStrNodem1++, iModalIndex += 6) {
294  out
295  << prefix << iModalIndex + 1 << "->" << iModalIndex + 3 << ": "
296  "StructNode(" << SND[iStrNodem1].pNode->GetLabel() << ") "
297  "reaction forces [Fx,Fy,Fz]" << std::endl
298  << prefix << iModalIndex + 4 << "->" << iModalIndex + 6 << ": "
299  "StructNode(" << SND[iStrNodem1].pNode->GetLabel() << ") "
300  "reaction couples [Mx,My,Mz]" << std::endl;
301  if (bInitial) {
302  iModalIndex += 6;
303  out
304  << prefix << iModalIndex + 1 << "->" << iModalIndex + 3 << ": "
305  "StructNode(" << SND[iStrNodem1].pNode->GetLabel() << ") "
306  "reaction force derivatives [FPx,FPy,FPz]" << std::endl
307  << prefix << iModalIndex + 4 << "->" << iModalIndex + 6 << ": "
308  "StructNode(" << SND[iStrNodem1].pNode->GetLabel() << ") "
309  "reaction couple derivatives [MPx,MPy,MPz]" << std::endl;
310  }
311  }
312 
313  return out;
314 }
std::vector< StrNodeData > SND
Definition: modal.h:217
const unsigned int NModes
Definition: modal.h:138
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
const unsigned int NStrNodes
Definition: modal.h:139

Here is the call graph for this function:

void Modal::DescribeDof ( std::vector< std::string > &  desc,
bool  bInitial = false,
int  i = -1 
) const
virtual

Reimplemented from Elem.

Definition at line 339 of file modal.cc.

References WithLabel::GetLabel(), MBDYN_EXCEPT_ARGS, mdof, NModes, NStrNodes, rdof, SND, and xyz.

340 {
341  int iend = 1;
342  if (i == -1) {
343  iend = 2*NModes + 6*NStrNodes;
344  if (bInitial) {
345  iend += 6*NStrNodes;
346  }
347  }
348  desc.resize(iend);
349 
350  unsigned modulo = 6;
351  if (bInitial) {
352  modulo = 12;
353  }
354 
355  std::ostringstream os;
356  os << "Modal(" << GetLabel() << ")";
357 
358  if (i < -1 ) {
359  // error
361 
362  } else if (i == -1) {
363  std::string name(os.str());
364 
365  for (unsigned i = 0; i < 2*NModes; i++) {
366  os.str(name);
367  os.seekp(0, std::ios_base::end);
368  os << ": " << mdof[i/NModes] << "(" << i%NModes + 1 << ")";
369  desc[i] = os.str();
370  }
371 
372  for (unsigned i = 0; i < modulo*NStrNodes; i++) {
373  os.str(name);
374  os.seekp(0, std::ios_base::end);
375  os << ": StructNode(" << SND[i/modulo].pNode->GetLabel() << ") "
376  << rdof[(i/3)%(modulo/3)] << xyz[i%3];
377  desc[2*NModes + i] = os.str();
378  }
379 
380  } else {
381  if (unsigned(i) < 2*NModes) {
382  // modes
383  os << ": " << mdof[i/NModes] << "(" << i%NModes + 1 << ")";
384 
385  } else {
386  // reactions
387  i -= 2*NModes;
388 
389  if (unsigned(i) >= modulo*NStrNodes) {
390  // error
392  }
393 
394  os << ": StructNode(" << SND[i/modulo].pNode->GetLabel() << ") "
395  << rdof[(i/3)%(modulo/3)] << xyz[i%3];
396  }
397  desc[0] = os.str();
398  }
399 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
std::vector< StrNodeData > SND
Definition: modal.h:217
const unsigned int NModes
Definition: modal.h:138
unsigned int GetLabel(void) const
Definition: withlab.cc:62
const unsigned int NStrNodes
Definition: modal.h:139

Here is the call graph for this function:

std::ostream & Modal::DescribeEq ( std::ostream &  out,
const char *  prefix = "",
bool  bInitial = false 
) const
virtual

Reimplemented from Elem.

Definition at line 402 of file modal.cc.

References DofOwnerOwner::iGetFirstIndex(), NModes, NStrNodes, and SND.

403 {
404  integer iModalIndex = iGetFirstIndex();
405 
406  out
407  << prefix << iModalIndex + 1 << "->" << iModalIndex + NModes
408  << ": modal velocity definitions [q(1.." << NModes << ")=qP(1.." << NModes << ")]" << std::endl
409  << prefix << iModalIndex + NModes + 1 << "->" << iModalIndex + 2*NModes
410  << ": modal equilibrium equations [1.." << NModes << "]" << std::endl;
411  iModalIndex += 2*NModes;
412  for (unsigned iStrNodem1 = 0; iStrNodem1 < NStrNodes; iStrNodem1++, iModalIndex += 6) {
413  out
414  << prefix << iModalIndex + 1 << "->" << iModalIndex + 3 << ": "
415  "StructNode(" << SND[iStrNodem1].pNode->GetLabel() << ") "
416  "position constraints [Px=PxN,Py=PyN,Pz=PzN]" << std::endl
417  << prefix << iModalIndex + 4 << "->" << iModalIndex + 6 << ": "
418  "StructNode(" << SND[iStrNodem1].pNode->GetLabel() << ") "
419  "orientation constraints [gx=gxN,gy=gyN,gz=gzN]" << std::endl;
420  if (bInitial) {
421  iModalIndex += 6;
422  out
423  << prefix << iModalIndex + 1 << "->" << iModalIndex + 3 << ": "
424  "StructNode(" << SND[iStrNodem1].pNode->GetLabel() << ") "
425  "velocity constraints [vx=vxN,vy=vyN,vz=vzN]" << std::endl
426  << prefix << iModalIndex + 4 << "->" << iModalIndex + 6 << ": "
427  "StructNode(" << SND[iStrNodem1].pNode->GetLabel() << ") "
428  "angular velocity constraints [wx=wxN,wy=wyN,wz=wzN]" << std::endl;
429  }
430  }
431 
432  return out;
433 }
std::vector< StrNodeData > SND
Definition: modal.h:217
const unsigned int NModes
Definition: modal.h:138
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
const unsigned int NStrNodes
Definition: modal.h:139

Here is the call graph for this function:

void Modal::DescribeEq ( std::vector< std::string > &  desc,
bool  bInitial = false,
int  i = -1 
) const
virtual

Reimplemented from Elem.

Definition at line 436 of file modal.cc.

References WithLabel::GetLabel(), MBDYN_EXCEPT_ARGS, meq, NModes, NStrNodes, req, SND, and xyz.

437 {
438  int iend = 1;
439  if (i == -1) {
440  iend = 2*NModes + 6*NStrNodes;
441  if (bInitial) {
442  iend += 6*NStrNodes;
443  }
444  }
445  desc.resize(iend);
446 
447  unsigned modulo = 6;
448  if (bInitial) {
449  modulo = 12;
450  }
451 
452  std::ostringstream os;
453  os << "Modal(" << GetLabel() << ")";
454 
455  if (i < -1 ) {
456  // error
458 
459  } else if (i == -1) {
460  std::string name(os.str());
461 
462  for (unsigned i = 0; i < 2*NModes; i++) {
463  os.str(name);
464  os.seekp(0, std::ios_base::end);
465  os << ": " << meq[i/NModes] << "(" << i%NModes + 1 << ")";
466  desc[i] = os.str();
467  }
468 
469  for (unsigned i = 0; i < modulo*NStrNodes; i++) {
470  os.str(name);
471  os.seekp(0, std::ios_base::end);
472  os << ": StructNode(" << SND[i/modulo].pNode->GetLabel() << ") "
473  << req[(i/3)%(modulo/3)] << xyz[i%3];
474  desc[2*NModes + i] = os.str();
475  }
476 
477  } else {
478  if (unsigned(i) < 2*NModes) {
479  // modes
480  os << ": " << meq[i/NModes] << "(" << i%NModes + 1 << ")";
481 
482  } else {
483  // reactions
484  i -= 2*NModes;
485 
486  if (unsigned(i) >= modulo*NStrNodes) {
487  // error
489  }
490 
491  os << ": StructNode(" << SND[i/modulo].pNode->GetLabel() << ") "
492  << req[(i/3)%(modulo/3)] << xyz[i%3];
493  }
494  desc[0] = os.str();
495  }
496 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
std::vector< StrNodeData > SND
Definition: modal.h:217
const unsigned int NModes
Definition: modal.h:138
unsigned int GetLabel(void) const
Definition: withlab.cc:62
const unsigned int NStrNodes
Definition: modal.h:139

Here is the call graph for this function:

doublereal Modal::dGetM ( void  ) const
virtual

Reimplemented from ElemGravityOwner.

Definition at line 3118 of file modal.cc.

References dMass.

3119 {
3120  return dMass;
3121 }
const doublereal dMass
Definition: modal.h:144
doublereal Modal::dGetPrivData ( unsigned int  i) const
virtual

Reimplemented from SimulationEntity.

Definition at line 2903 of file modal.cc.

References a, ASSERT, b, bPrime, c, Vec3::Cross(), StructNode::GetRCurr(), StructDispNode::GetVCurr(), Mat3xN::GetVec(), StructNode::GetWCurr(), StructNode::GetWPCurr(), StructDispNode::GetXCurr(), StructDispNode::GetXPPCurr(), iGetNumPrivData(), MBDYN_EXCEPT_ARGS, NFEMNodes, NModes, pModalNode, pModeShapesr, pModeShapest, pXYZFEMNodes, R, x, and Zero3.

2904 {
2905  ASSERT(i > 0 && i < iGetNumPrivData());
2906 
2907  if (i <= NModes) {
2908  return a(i);
2909  }
2910 
2911  i -= NModes;
2912  if (i <= NModes) {
2913  return b(i);
2914  }
2915 
2916  i -= NModes;
2917  if (i <= NModes) {
2918  return bPrime(i);
2919  }
2920 
2921  i -= NModes;
2922  unsigned int n = (i - 1) / 18;
2923  unsigned int index = (i - 1) % 18 + 1;
2924  unsigned int p = (index - 1) / 6;
2925  unsigned int c = (index - 1) % 6 + 1;
2926  unsigned int w = (c - 1) / 3;
2927  if (w) {
2928  c -= 3;
2929  }
2930 
2931  switch (p) {
2932  case 0:
2933  if (w) {
2934  // TODO: orientation, somehow?
2936 
2937  } else {
2938  // x == 0, R == eye otherwise
2939  if (pModalNode) {
2940  R = pModalNode->GetRCurr();
2941  x = pModalNode->GetXCurr();
2942  }
2943  Vec3 Xn(pXYZFEMNodes->GetVec(n + 1));
2944  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
2945  integer iOffset = (jMode - 1)*NFEMNodes + n + 1;
2946  Xn += pModeShapest->GetVec(iOffset)*a(jMode);
2947  }
2948 
2949  Vec3 X(x + R*Xn);
2950  return X(c);
2951  }
2952  break;
2953 
2954  case 1:
2955  if (w) {
2956  if (pModalNode) {
2957  R = pModalNode->GetRCurr();
2958  }
2959  Vec3 Wn(::Zero3);
2960  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
2961  integer iOffset = (jMode - 1)*NFEMNodes + n + 1;
2962  Wn += pModeShapesr->GetVec(iOffset)*b(jMode);
2963  }
2964 
2965  Vec3 W(R*Wn);
2966  if (pModalNode) {
2967  W += pModalNode->GetWCurr();
2968  }
2969  return W(c);
2970 
2971  } else {
2972  if (pModalNode) {
2973  R = pModalNode->GetRCurr();
2974  }
2975  Vec3 Vn(::Zero3);
2976  Vec3 Xn(pXYZFEMNodes->GetVec(n + 1));
2977  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
2978  integer iOffset = (jMode - 1)*NFEMNodes + n + 1;
2979  Vec3 v = pModeShapest->GetVec(iOffset);
2980  Vn += v*b(jMode);
2981  Xn += v*a(jMode);
2982  }
2983  Vec3 V(R*Vn);
2984  if (pModalNode) {
2985  V += pModalNode->GetWCurr().Cross(R*Xn);
2986  V += pModalNode->GetVCurr();
2987  }
2988  return V(c);
2989  }
2990  break;
2991 
2992  case 2:
2993  if (w) {
2994  if (pModalNode) {
2995  R = pModalNode->GetRCurr();
2996  }
2997  Vec3 WPn(::Zero3);
2998  Vec3 Wn(::Zero3);
2999  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
3000  integer iOffset = (jMode - 1)*NFEMNodes + n + 1;
3001  Vec3 v = pModeShapesr->GetVec(iOffset);
3002  WPn += v*bPrime(jMode);
3003  Wn += v*b(jMode);
3004  }
3005 
3006  Vec3 WP(R*WPn);
3007  if (pModalNode) {
3008  WP += pModalNode->GetWCurr().Cross(R*Wn);
3009  WP += pModalNode->GetWPCurr();
3010  }
3011  return WP(c);
3012 
3013  } else {
3014  if (pModalNode) {
3015  R = pModalNode->GetRCurr();
3016  }
3017  Vec3 XPPn(::Zero3);
3018  Vec3 XPn(::Zero3);
3019  Vec3 Xn(pXYZFEMNodes->GetVec(n + 1));
3020  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
3021  integer iOffset = (jMode - 1)*NFEMNodes + n + 1;
3022  Vec3 v = pModeShapest->GetVec(iOffset);
3023  XPPn += v*bPrime(jMode);
3024  XPn += v*b(jMode);
3025  Xn += v*a(jMode);
3026  }
3027  Vec3 XPP(R*XPPn);
3028  if (pModalNode) {
3029  const Vec3& W0 = pModalNode->GetWCurr();
3030  XPP += W0.Cross(R*(XPn*2.));
3031 
3032  Vec3 X(R*Xn);
3033  XPP += W0.Cross(W0.Cross(X));
3034  XPP += pModalNode->GetWPCurr().Cross(X);
3035  XPP += pModalNode->GetXPPCurr();
3036  }
3037  return XPP(c);
3038  }
3039  break;
3040  }
3041 
3043 }
const Mat3xN * pModeShapesr
Definition: modal.h:157
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
const Mat3xN * pModeShapest
Definition: modal.h:156
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
Vec3 x
Definition: modal.h:134
VecN bPrime
Definition: modal.h:193
Vec3 GetVec(integer iCol) const
Definition: matvec3n.cc:553
const ModalNode *const pModalNode
Definition: modal.h:76
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
VecN b
Definition: modal.h:192
virtual const Vec3 & GetWPCurr(void) const
Definition: strnode.h:1042
#define ASSERT(expression)
Definition: colamd.c:977
const unsigned int NModes
Definition: modal.h:138
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
static std::stack< cleanup * > c
Definition: cleanup.cc:59
const Mat3xN * pXYZFEMNodes
Definition: modal.h:143
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
virtual const Vec3 & GetXPPCurr(void) const
Definition: strnode.h:334
long int integer
Definition: colamd.c:51
VecN a
Definition: modal.h:190
const unsigned int NFEMNodes
Definition: modal.h:141
Mat3x3 R
Definition: modal.h:135
virtual unsigned int iGetNumPrivData(void) const
Definition: modal.cc:2737

Here is the call graph for this function:

const VecN& Modal::GetA ( void  ) const
inline

Definition at line 371 of file modal.h.

References a.

Referenced by ModalExt::Send().

371  {
372  return a;
373  };
VecN a
Definition: modal.h:190
const VecN& Modal::GetAP ( void  ) const
inline

Definition at line 375 of file modal.h.

References aPrime.

375  {
376  return aPrime;
377  };
VecN aPrime
Definition: modal.h:191
const VecN& Modal::GetB ( void  ) const
inline

Definition at line 379 of file modal.h.

References b.

Referenced by ModalExt::Send().

379  {
380  return b;
381  };
VecN b
Definition: modal.h:192
Vec3 Modal::GetB_int ( void  ) const
protectedvirtual

Reimplemented from ElemGravityOwner.

Definition at line 3171 of file modal.cc.

References dMass, StructDispNode::GetVCurr(), pModalNode, and Zero3.

3172 {
3173  // FIXME: gross estimate
3174  if (pModalNode != 0) {
3175  return pModalNode->GetVCurr()*dMass;
3176  }
3177 
3179 }
const Vec3 Zero3(0., 0., 0.)
const doublereal dMass
Definition: modal.h:144
const ModalNode *const pModalNode
Definition: modal.h:76
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322

Here is the call graph for this function:

const VecN& Modal::GetBP ( void  ) const
inline

Definition at line 383 of file modal.h.

References bPrime.

Referenced by ModalExt::Send().

383  {
384  return bPrime;
385  };
VecN bPrime
Definition: modal.h:193
virtual void Modal::GetConnectedNodes ( std::vector< const Node * > &  connectedNodes) const
inlinevirtual

Reimplemented from Elem.

Definition at line 407 of file modal.h.

References NStrNodes, pModalNode, and SND.

407  {
408  connectedNodes.resize(NStrNodes + (pModalNode ? 1 : 0));
409  for (unsigned int j = 0; j < NStrNodes; j++) {
410  connectedNodes[j] = SND[j].pNode;
411  }
412  if (pModalNode) {
413  connectedNodes[NStrNodes] = pModalNode;
414  }
415  };
const ModalNode *const pModalNode
Definition: modal.h:76
std::vector< StrNodeData > SND
Definition: modal.h:217
const unsigned int NStrNodes
Definition: modal.h:139
const Mat3xN & Modal::GetCurrFEMNodesPosition ( void  )

Definition at line 3046 of file modal.cc.

References a, Mat3xN::Add(), Mat3xN::dGet(), StructNode::GetRCurr(), StructDispNode::GetXCurr(), Mat3xN::LeftMult(), NFEMNodes, NModes, pCurrXYZ, pModalNode, pModeShapest, pXYZFEMNodes, R, SAFENEWWITHCONSTRUCTOR, and x.

3047 {
3048  if (pCurrXYZ == 0) {
3050  }
3051 
3052  if (pModalNode) {
3053  R = pModalNode->GetRCurr();
3054  x = pModalNode->GetXCurr();
3055  }
3056 
3057  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
3058  for (unsigned int iNode = 1; iNode <= NFEMNodes; iNode++) {
3059  for (unsigned int iCnt = 1; iCnt <= 3; iCnt++) {
3060  pCurrXYZ->Add(iCnt, iNode,
3061  pXYZFEMNodes->dGet(iCnt, iNode) + pModeShapest->dGet(iCnt, (jMode - 1)*NFEMNodes + iNode) * a(jMode) );
3062  }
3063  }
3064  }
3065 
3066  pCurrXYZ->LeftMult(R);
3067  for (unsigned int iNode = 1; iNode <= NFEMNodes; iNode++) {
3068  for (unsigned int iCnt = 1; iCnt <= 3; iCnt++) {
3069  pCurrXYZ->Add(iCnt, iNode, x(iCnt));
3070  }
3071  }
3072 
3073  return *pCurrXYZ;
3074 }
const Mat3xN * pModeShapest
Definition: modal.h:156
const Mat3xN & LeftMult(const Mat3x3 &m)
Definition: matvec3n.cc:348
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
Vec3 x
Definition: modal.h:134
void Add(int i, integer j, const doublereal &d)
Definition: matvec3n.h:316
const ModalNode *const pModalNode
Definition: modal.h:76
const unsigned int NModes
Definition: modal.h:138
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
const doublereal & dGet(int i, integer j) const
Definition: matvec3n.h:336
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
Mat3xN * pCurrXYZ
Definition: modal.h:159
const Mat3xN * pXYZFEMNodes
Definition: modal.h:143
VecN a
Definition: modal.h:190
const unsigned int NFEMNodes
Definition: modal.h:141
Mat3x3 R
Definition: modal.h:135

Here is the call graph for this function:

const Mat3xN & Modal::GetCurrFEMNodesVelocity ( void  )

Definition at line 3077 of file modal.cc.

References a, Mat3xN::Add(), b, Mat3xN::dGet(), StructNode::GetRCurr(), StructDispNode::GetVCurr(), StructNode::GetWCurr(), Mat3xN::LeftMult(), MatCross, NFEMNodes, NModes, pCurrXYZ, pCurrXYZVel, pModalNode, pModeShapest, pXYZFEMNodes, R, SAFENEWWITHCONSTRUCTOR, and Zero3.

3078 {
3079  if (pCurrXYZ == 0) {
3081  }
3082 
3083  Vec3 w(::Zero3);
3084  Vec3 v(::Zero3);
3085 
3086  if (pModalNode) {
3087  R = pModalNode->GetRCurr();
3088  w = pModalNode->GetWCurr();
3089  v = pModalNode->GetVCurr();
3090  }
3091 
3092  Mat3x3 wWedge(MatCross, w);
3093 
3094  Mat3xN CurrXYZTmp(NFEMNodes, 0.);
3095  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
3096  for (unsigned int iNode = 1; iNode <= NFEMNodes; iNode++) {
3097  for (unsigned int iCnt = 1; iCnt <= 3; iCnt++) {
3098  doublereal d = pModeShapest->dGet(iCnt,(jMode - 1)*NFEMNodes + iNode);
3099  pCurrXYZVel->Add(iCnt, iNode, pXYZFEMNodes->dGet(iCnt,iNode) + d * a(jMode) );
3100  CurrXYZTmp.Add(iCnt, iNode,d * b(jMode) );
3101  }
3102  }
3103  }
3104  pCurrXYZVel->LeftMult(wWedge*R);
3105  CurrXYZTmp.LeftMult(R);
3106  for (unsigned int iNode = 1; iNode <= NFEMNodes; iNode++) {
3107  for (unsigned int iCnt = 1; iCnt <= 3; iCnt++) {
3108  pCurrXYZVel->Add(iCnt, iNode, CurrXYZTmp(iCnt, iNode) + v(iCnt));
3109  }
3110  }
3111 
3112  return *pCurrXYZVel;
3113 }
const Vec3 Zero3(0., 0., 0.)
const Mat3xN * pModeShapest
Definition: modal.h:156
const Mat3xN & LeftMult(const Mat3x3 &m)
Definition: matvec3n.cc:348
Definition: matvec3.h:98
const MatCross_Manip MatCross
Definition: matvec3.cc:639
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
Mat3xN * pCurrXYZVel
Definition: modal.h:160
void Add(int i, integer j, const doublereal &d)
Definition: matvec3n.h:316
const ModalNode *const pModalNode
Definition: modal.h:76
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
VecN b
Definition: modal.h:192
const unsigned int NModes
Definition: modal.h:138
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
const doublereal & dGet(int i, integer j) const
Definition: matvec3n.h:336
Mat3xN * pCurrXYZ
Definition: modal.h:159
const Mat3xN * pXYZFEMNodes
Definition: modal.h:143
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
VecN a
Definition: modal.h:190
const unsigned int NFEMNodes
Definition: modal.h:141
Mat3x3 R
Definition: modal.h:135

Here is the call graph for this function:

DofOrder::Order Modal::GetDofType ( unsigned int  i) const
virtual

Reimplemented from Elem.

Definition at line 499 of file modal.cc.

References DofOrder::ALGEBRAIC, ASSERT, DofOrder::DIFFERENTIAL, iGetNumDof(), and NModes.

500 {
501  ASSERT(i < iGetNumDof());
502 
503  if (i < 2*NModes) {
504  /* gradi di liberta' differenziali (eq. modali) */
505  return DofOrder::DIFFERENTIAL;
506 
507  } /* else if (i >= 2*NModes && i < iGetNumDof()) { */
508  /* gradi di liberta' algebrici (eq. di vincolo) */
509  return DofOrder::ALGEBRAIC;
510  /* } */
511 }
#define ASSERT(expression)
Definition: colamd.c:977
const unsigned int NModes
Definition: modal.h:138
virtual unsigned int iGetNumDof(void) const
Definition: modal.cc:274

Here is the call graph for this function:

DofOrder::Order Modal::GetEqType ( unsigned int  i) const
virtual

Reimplemented from SimulationEntity.

Definition at line 514 of file modal.cc.

References DofOrder::ALGEBRAIC, ASSERT, DofOrder::DIFFERENTIAL, iGetNumDof(), and NModes.

515 {
516  ASSERT(i < iGetNumDof());
517 
518  if (i < 2*NModes) {
519  /* gradi di liberta' differenziali (eq. modali) */
520  return DofOrder::DIFFERENTIAL;
521 
522  } /* else if (i >= 2*NModes && i < iGetNumDof()) { */
523  /* gradi di liberta' algebrici (eq. di vincolo) */
524  return DofOrder::ALGEBRAIC;
525  /* } */
526 }
#define ASSERT(expression)
Definition: colamd.c:977
const unsigned int NModes
Definition: modal.h:138
virtual unsigned int iGetNumDof(void) const
Definition: modal.cc:274

Here is the call graph for this function:

Vec3 Modal::GetG_int ( void  ) const
protectedvirtual

Reimplemented from ElemGravityOwner.

Definition at line 3183 of file modal.cc.

References Zero3.

3184 {
3186 }
const Vec3 Zero3(0., 0., 0.)
Mat3x3 Modal::GetJ_int ( void  ) const
protectedvirtual

Reimplemented from ElemGravityOwner.

Definition at line 3142 of file modal.cc.

References dMass, StructNode::GetRCurr(), StructDispNode::GetXCurr(), Inv2, Inv3jaj, Inv7, Inv8jaj, Inv9jkajak, MatCrossCross, Mat3x3::MulMT(), pInv3, pInv8, pInv9, pModalNode, R, Mat3x3::Symm2(), and x.

3143 {
3144  if (pModalNode != 0) {
3145  x = pModalNode->GetXCurr();
3146  R = pModalNode->GetRCurr();
3147  }
3148 
3149  Vec3 STmp = Inv2;
3150  if (pInv3 != 0) {
3151  STmp += Inv3jaj;
3152  }
3153  Vec3 s(R*STmp);
3154 
3155  Mat3x3 JTmp = Inv7;
3156  if (pInv8 != 0) {
3157  JTmp += Inv8jaj.Symm2();
3158  if (pInv9 != 0) {
3159  JTmp -= Inv9jkajak;
3160  }
3161  }
3162 
3163  return R*JTmp.MulMT(R)
3165  - Mat3x3(MatCrossCross, x, s)
3166  - Mat3x3(MatCrossCross, s, x);
3167 }
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const doublereal dMass
Definition: modal.h:144
Vec3 x
Definition: modal.h:134
const Vec3 Inv2
Definition: modal.h:145
Mat3x3 Inv8jaj
Definition: modal.h:177
const Mat3xN * pInv3
Definition: modal.h:162
Mat3x3 Symm2(void) const
Definition: matvec3.h:852
const ModalNode *const pModalNode
Definition: modal.h:76
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
Mat3x3 Inv9jkajak
Definition: modal.h:184
Vec3 Inv3jaj
Definition: modal.h:171
const Mat3xN * pInv9
Definition: modal.h:166
Mat3x3 MulMT(const Mat3x3 &m) const
Definition: matvec3.cc:444
const Mat3xN * pInv8
Definition: modal.h:165
Mat3x3 R
Definition: modal.h:135
const Mat3x3 Inv7
Definition: modal.h:146

Here is the call graph for this function:

Joint::Type Modal::GetJointType ( void  ) const
virtual

Implements Joint.

Definition at line 262 of file modal.cc.

References Joint::MODAL.

263 {
264  return Joint::MODAL;
265 }
const std::vector<unsigned int>& Modal::GetModeList ( void  ) const
inline

Definition at line 367 of file modal.h.

References uModeNumber.

Referenced by ModalExt::Output(), and ReadModalForce().

367  {
368  return uModeNumber;
369  };
const std::vector< unsigned int > uModeNumber
Definition: modal.h:148
Vec3 Modal::GetS_int ( void  ) const
protectedvirtual

Reimplemented from ElemGravityOwner.

Definition at line 3125 of file modal.cc.

References dMass, StructNode::GetRCurr(), StructDispNode::GetXCurr(), Inv2, Inv3jaj, pInv3, pModalNode, R, and x.

3126 {
3127  if (pModalNode != 0) {
3128  x = pModalNode->GetXCurr();
3129  R = pModalNode->GetRCurr();
3130  }
3131 
3132  Vec3 STmp = Inv2;
3133  if (pInv3 != 0) {
3134  STmp += Inv3jaj;
3135  }
3136 
3137  return R*STmp + x*dMass;
3138 }
Definition: matvec3.h:98
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const doublereal dMass
Definition: modal.h:144
Vec3 x
Definition: modal.h:134
const Vec3 Inv2
Definition: modal.h:145
const Mat3xN * pInv3
Definition: modal.h:162
const ModalNode *const pModalNode
Definition: modal.h:76
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
Vec3 Inv3jaj
Definition: modal.h:171
Mat3x3 R
Definition: modal.h:135

Here is the call graph for this function:

unsigned int Modal::iGetInitialNumDof ( void  ) const
virtual

Implements SubjectToInitialAssembly.

Definition at line 1942 of file modal.cc.

References NStrNodes.

Referenced by InitialAssJac(), InitialAssRes(), and InitialWorkSpaceDim().

1943 {
1944  return 2*NModes + 12*NStrNodes;
1945 }
const unsigned int NModes
Definition: modal.h:138
const unsigned int NStrNodes
Definition: modal.h:139
integer Modal::iGetModalIndex ( void  ) const
inline

Definition at line 391 of file modal.h.

References DofOwnerOwner::iGetFirstIndex().

Referenced by AerodynamicModal::AssJac(), ModalForce::AssRes(), AerodynamicModal::AssRes(), ModalExt::AssRes(), and AerodynamicModal::InitialAssRes().

391  {
392  return iGetFirstIndex();
393  };
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127

Here is the call graph for this function:

unsigned int Modal::iGetNumDof ( void  ) const
virtual

Reimplemented from Elem.

Definition at line 274 of file modal.cc.

References NModes, and NStrNodes.

Referenced by AssJac(), AssRes(), GetDofType(), GetEqType(), and WorkSpaceDim().

275 {
276  /* i gradi di liberta' propri sono:
277  * 2*M per i modi
278  * 6*N per le reazioni vincolari dei nodi d'interfaccia */
279  return 2*NModes + 6*NStrNodes;
280 }
const unsigned int NModes
Definition: modal.h:138
const unsigned int NStrNodes
Definition: modal.h:139
unsigned int Modal::iGetNumPrivData ( void  ) const
virtual

Reimplemented from SimulationEntity.

Definition at line 2737 of file modal.cc.

References NFEMNodes.

Referenced by dGetPrivData().

2738 {
2739  return 3*NModes + 18*NFEMNodes;
2740 }
const unsigned int NModes
Definition: modal.h:138
const unsigned int NFEMNodes
Definition: modal.h:141
unsigned int Modal::iGetPrivDataIdx ( const char *  s) const
virtual

Reimplemented from SimulationEntity.

Definition at line 2743 of file modal.cc.

References ASSERT, buf, WithLabel::GetLabel(), IdFEMNodes, and uModeNumber.

2744 {
2745  /*
2746  * q[n] | qP[n] | qPP[n]
2747  *
2748  * where n is the 1-based mode number
2749  *
2750  * q[#i] | qP[#i] | qPP[#i]
2751  *
2752  * where i is the 1-based mode index (if only a subset of modes is used)
2753  *
2754  * x[n,i] | xP[n,i] | xPP[n,i]
2755  * w[n,i] | wP[n,i]
2756  *
2757  * where n is the FEM node label and i is the index number (1-3)
2758  */
2759 
2760  unsigned p = 0;
2761  char what = s[0];
2762 
2763  /* che cosa e' richiesto? */
2764  switch (what) {
2765  case 'q':
2766  /* modal dofs */
2767  break;
2768 
2769  case 'x':
2770  /* structural nodes positions */
2771  break;
2772 
2773  case 'w':
2774  /* structural nodes angular velocities */
2775  p = 1;
2776  break;
2777 
2778  default:
2779  /* unknown priv data */
2780  return 0;
2781  }
2782 
2783  while ((++s)[0] == 'P') {
2784  p++;
2785  if (p > 2) {
2786  /* no more than two derivative levels allowed */
2787  return 0;
2788  }
2789  }
2790 
2791  if (s[0] != '[') {
2792  return 0;
2793  }
2794  s++;
2795 
2796  /* trova la parentesi chiusa (e il terminatore di stringa) */
2797  const char *end = std::strchr(s, ']');
2798  if (end == 0 || end[1] != '\0') {
2799  return 0;
2800  }
2801 
2802  if (what == 'q') {
2803  bool bIdx(false);
2804 
2805  if (s[0] == '#') {
2806  bIdx = true;
2807  s++;
2808  }
2809 
2810  /* buffer per numero (dimensione massima: 32 bit) */
2811  char buf[sizeof("18446744073709551615") + 1];
2812  size_t len = end - s;
2813 
2814  ASSERT(len < sizeof(buf));
2815 
2816  strncpy(buf, s, len);
2817  buf[len] = '\0';
2818 
2819  /* leggi il numero */
2820  if (buf[0] == '-') {
2821  return 0;
2822  }
2823 
2824  errno = 0;
2825  char *next;
2826  unsigned long n = strtoul(buf, &next, 10);
2827  int save_errno = errno;
2828  end = next;
2829  if (end == buf) {
2830  return 0;
2831 
2832  } else if (end[0] != '\0') {
2833  return 0;
2834 
2835  } else if (save_errno == ERANGE) {
2836  silent_cerr("Modal(" << GetLabel() << "): "
2837  "warning, private data mode index "
2838  << std::string(buf, end - buf)
2839  << " overflows" << std::endl);
2840  return 0;
2841  }
2842 
2843  if (bIdx) {
2844  if (n > NModes) {
2845  return 0;
2846  }
2847 
2848  } else {
2849  std::vector<unsigned int>::const_iterator iv
2850  = std::find(uModeNumber.begin(), uModeNumber.end(), n);
2851  if (iv == uModeNumber.end()) {
2852  return 0;
2853  }
2854 
2855  n = iv - uModeNumber.begin() + 1;
2856  }
2857 
2858  return p*NModes + n;
2859  }
2860 
2861  end = std::strchr(s, ',');
2862  if (end == 0) {
2863  return 0;
2864  }
2865 
2866  std::string FEMLabel(s, end - s);
2867 
2868  end++;
2869  if (end[0] == '-') {
2870  return 0;
2871  }
2872 
2873  char *next;
2874  errno = 0;
2875  unsigned int index = strtoul(end, &next, 10);
2876  int save_errno = errno;
2877  if (next == end || next[0] != ']') {
2878  return 0;
2879 
2880  } else if (save_errno == ERANGE) {
2881  silent_cerr("Modal(" << GetLabel() << "): "
2882  "warning, private data FEM node component "
2883  << std::string(end, next - end)
2884  << " overflows" << std::endl);
2885  return 0;
2886  }
2887 
2888  if (index == 0 || index > 3) {
2889  return 0;
2890  }
2891 
2892  std::vector<std::string>::const_iterator ii = find(IdFEMNodes.begin(), IdFEMNodes.end(), FEMLabel);
2893  if (ii == IdFEMNodes.end()) {
2894  return 0;
2895  }
2896  unsigned int i = ii - IdFEMNodes.begin();
2897 
2898  return 3*NModes + 18*i + (what == 'w' ? 3 : 0) + 6*p + index;
2899 }
const std::vector< unsigned int > uModeNumber
Definition: modal.h:148
#define ASSERT(expression)
Definition: colamd.c:977
const std::vector< std::string > IdFEMNodes
Definition: modal.h:142
const unsigned int NModes
Definition: modal.h:138
static doublereal buf[BUFSIZE]
Definition: discctrl.cc:333
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 1955 of file modal.cc.

References a, FullSubMatrixHandler::Add(), FullSubMatrixHandler::AddT(), b, Vec3::Cross(), DEBUGCOUT, FullSubMatrixHandler::DecCoef(), MatNxN::dGet(), WithLabel::GetLabel(), Mat3xN::GetVec(), Mat3x3::GetVec(), StructNode::GetWRef(), DofOwnerOwner::iGetFirstIndex(), iGetInitialNumDof(), FullSubMatrixHandler::IncCoef(), InitialWorkSpaceDim(), iRigidOffset, Mat3xN::LeftMult(), MatCross, MatCrossCross, MBDYN_EXCEPT_ARGS, MatNxN::Mult(), NModes, NStrNodes, pModalDamp, pModalNode, pModalStiff, pPHIr, pPHIt, FullSubMatrixHandler::PutCoef(), FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), Mat3xN::PutVec(), R, FullSubMatrixHandler::ResizeReset(), MatNx3::RightMult(), RT, VariableSubMatrixHandler::SetFull(), SND, FullSubMatrixHandler::Sub(), FullSubMatrixHandler::SubT(), MatNx3::Transpose(), grad::Transpose(), and Zero3.

1957 {
1958  DEBUGCOUT("Entering Modal::InitialAssJac()" << std::endl);
1959 
1960  FullSubMatrixHandler& WM = WorkMat.SetFull();
1961  integer iNumRows = 0;
1962  integer iNumCols = 0;
1963  InitialWorkSpaceDim(&iNumRows, &iNumCols);
1964  WM.ResizeReset(iNumRows, iNumCols);
1965 
1966  if (pModalNode) {
1967  integer iRigidIndex = pModalNode->iGetFirstIndex();
1968 
1969  for (unsigned int iCnt = 1; iCnt <= iRigidOffset; iCnt++) {
1970  WM.PutRowIndex(iCnt, iRigidIndex + iCnt);
1971  WM.PutColIndex(iCnt, iRigidIndex + iCnt);
1972  }
1973  }
1974 
1975  integer iFlexIndex = iGetFirstIndex();
1976 
1977  for (unsigned int iCnt = 1; iCnt <= iGetInitialNumDof(); iCnt++) {
1978  WM.PutRowIndex(iRigidOffset + iCnt, iFlexIndex + iCnt);
1979  WM.PutColIndex(iRigidOffset + iCnt, iFlexIndex + iCnt);
1980  }
1981 
1982  for (unsigned iStrNodem1 = 0; iStrNodem1 < NStrNodes; iStrNodem1++) {
1983  integer iNodeFirstPosIndex =
1984  SND[iStrNodem1].pNode->iGetFirstPositionIndex();
1985  integer iNodeFirstVelIndex = iNodeFirstPosIndex + 6;
1986 
1987  integer iOffset = iRigidOffset + iGetInitialNumDof() + 12*iStrNodem1;
1988  for (unsigned int iCnt = 1; iCnt <= 6; iCnt++) {
1989  WM.PutRowIndex(iOffset + iCnt,
1990  iNodeFirstPosIndex + iCnt);
1991  WM.PutColIndex(iOffset + iCnt,
1992  iNodeFirstPosIndex + iCnt);
1993  WM.PutRowIndex(iOffset + 6 + iCnt,
1994  iNodeFirstVelIndex + iCnt);
1995  WM.PutColIndex(iOffset + 6 + iCnt,
1996  iNodeFirstVelIndex + iCnt);
1997  }
1998  }
1999 
2000  /* comincia l'assemblaggio dello Jacobiano */
2001 
2002  /* nota: nelle prime iRigidOffset + 2*M equazioni
2003  * metto dei termini piccoli per evitare singolarita'
2004  * quando non ho vincoli esterni o ho azzerato i modi */
2005  for (unsigned int iCnt = 1; iCnt <= iRigidOffset + 2*NModes; iCnt++) {
2006  WM.PutCoef(iCnt, iCnt, 1.e-12);
2007  }
2008 
2009  /* forze elastiche e viscose */
2010  for (unsigned int iCnt = 1; iCnt <= NModes; iCnt++) {
2011  for (unsigned int jCnt = 1; jCnt <= NModes; jCnt++) {
2012  WM.PutCoef(iRigidOffset + iCnt, iRigidOffset + jCnt,
2013  pModalStiff->dGet(iCnt, jCnt));
2014  WM.PutCoef(iRigidOffset + iCnt, iRigidOffset + NModes + jCnt,
2015  pModalDamp->dGet(iCnt, jCnt));
2016  }
2017  }
2018 
2019  /* equazioni di vincolo */
2020 
2021  /* cerniera sferica */
2022  for (unsigned int iStrNode = 1; iStrNode <= NStrNodes; iStrNode++) {
2023  unsigned int iStrNodem1 = iStrNode - 1;
2024 
2025  /* recupera i dati */
2026  const Mat3x3& R2(SND[iStrNodem1].pNode->GetRRef());
2027  Vec3 Omega1(::Zero3);
2028  if (pModalNode) {
2029  Omega1 = pModalNode->GetWRef();
2030  }
2031  const Vec3& Omega2(SND[iStrNodem1].pNode->GetWRef());
2032  Vec3 F(XCurr, iFlexIndex + 2*NModes + 12*iStrNodem1 + 1);
2033  Vec3 FPrime(XCurr, iFlexIndex + 2*NModes + 12*iStrNodem1 + 6 + 1);
2034 
2035  Mat3xN PHIt(NModes, 0), PHIr(NModes, 0);
2036  MatNx3 PHItT(NModes, 0), PHIrT(NModes, 0);
2037 
2038  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
2039  PHIt.PutVec(jMode, pPHIt->GetVec((jMode - 1)*NStrNodes + iStrNode));
2040  PHIr.PutVec(jMode, pPHIr->GetVec((jMode - 1)*NStrNodes + iStrNode));
2041  }
2042 
2043  PHItT.Transpose(PHIt);
2044  PHIrT.Transpose(PHIr);
2045 
2046  Vec3 d1tot = R*(SND[iStrNodem1].OffsetFEM + PHIt*a);
2047  Mat3x3 R1tot = R*Mat3x3(1., PHIr*a);
2048  Mat3xN SubMat1(NModes, 0.);
2049  MatNx3 SubMat2(NModes, 0.);
2050 
2051  integer iOffset1 = iRigidOffset + 2*NModes + 12*iStrNodem1;
2052  integer iOffset2 = iRigidOffset + iGetInitialNumDof() + 12*iStrNodem1;
2053  if (pModalNode) {
2054  for (unsigned int iCnt = 1; iCnt <= 3; iCnt++) {
2055  /* Contributo di forza all'equazione
2056  * della forza, nodo 1 */
2057  WM.IncCoef(iCnt, iOffset1 + iCnt, 1.);
2058 
2059  /* Contrib. di der. di forza all'eq. della der.
2060  * della forza, nodo 1 */
2061  WM.IncCoef(6 + iCnt, iOffset1 + 6 + iCnt, 1.);
2062 
2063  /* Equazione di vincolo, nodo 1 */
2064  WM.DecCoef(iOffset1 + iCnt, iCnt, 1.);
2065 
2066  /* Derivata dell'equazione di vincolo, nodo 1 */
2067  WM.DecCoef(iOffset1 + 6 + iCnt, 6 + iCnt, 1.);
2068  }
2069  }
2070 
2071  for (unsigned int iCnt = 1; iCnt <= 3; iCnt++) {
2072  /* Equazione di vincolo, nodo 2 */
2073  WM.IncCoef(iOffset1 + iCnt, iOffset2 + iCnt, 1.);
2074 
2075  /* Derivata dell'equazione di vincolo, nodo 2 */
2076  WM.IncCoef(iOffset1 + 6 + iCnt, iOffset2 + 6 + iCnt, 1.);
2077 
2078  /* Contributo di forza all'equazione della forza,
2079  * nodo 2 */
2080  WM.DecCoef(iOffset2 + iCnt, iOffset1 + iCnt, 1.);
2081 
2082  /* Contrib. di der. di forza all'eq. della der.
2083  * della forza, nodo 2 */
2084  WM.DecCoef(iOffset2 + 6 + iCnt, iOffset1 + 6 + iCnt, 1.);
2085  }
2086 
2087  /* Distanza nel sistema globale */
2088  const Vec3& d1Tmp(d1tot);
2089  Vec3 d2Tmp(R2*SND[iStrNodem1].OffsetMB);
2090 
2091  /* Matrici F/\d1/\, -F/\d2/\ , F/\omega1/\ */
2092  Mat3x3 FWedged1Wedge(MatCrossCross, F, d1Tmp);
2093  Mat3x3 FWedged2Wedge(MatCrossCross, F, d2Tmp);
2094  Mat3x3 FWedgeO1Wedge(MatCrossCross, F, Omega1);
2095 
2096  /* Matrici (omega1/\d1)/\, -(omega2/\d2)/\ */
2097  Mat3x3 O1Wedged1Wedge(MatCross, Omega1.Cross(d1Tmp));
2098  Mat3x3 O2Wedged2Wedge(MatCross, d2Tmp.Cross(Omega2));
2099 
2100  /* d1Prime= w1/\d1 + R*PHIt*b */
2101  Mat3xN R1PHIt(NModes);
2102  R1PHIt.LeftMult(R, PHIt);
2103  Vec3 d1Prime(Omega1.Cross(d1Tmp) + R1PHIt*b);
2104 
2105  Mat3x3 FWedge(MatCross, F);
2106  if (pModalNode) {
2107  /* Equazione di momento, nodo 1 */
2108  WM.Add(3 + 1, 3 + 1, FWedged1Wedge);
2109  WM.Add(3 + 1, iOffset1 + 1, Mat3x3(MatCross, d1Tmp));
2110 
2111  /* Equazione di momento, contributo modale */
2112  SubMat1.LeftMult(FWedge*R, PHIt);
2113  WM.Sub(3 + 1, iRigidOffset + 1, SubMat1);
2114 
2115  /* Eq. di equilibrio ai modi */
2116  SubMat2.RightMult(PHItT, RT*FWedge);
2117  WM.Add(iRigidOffset + 1, 3 + 1, SubMat2);
2118  }
2119 
2120  /* Equazione di momento, nodo 2 */
2121  WM.Sub(iOffset2 + 3 + 1,iOffset2 + 3 + 1, FWedged2Wedge);
2122  WM.Sub(iOffset2 + 3 + 1,iOffset1 + 1, Mat3x3(MatCross, d2Tmp));
2123 
2124  /* Eq. di equilibrio ai modi */
2125  SubMat2.RightMult(PHItT, RT);
2126  WM.Add(iRigidOffset + 1, iRigidOffset + 2*NModes + 1, SubMat2);
2127 
2128  if (pModalNode) {
2129  /* derivata dell'equazione di momento, nodo 1 */
2130  WM.Add(9 + 1, 3 + 1,
2131  Mat3x3(MatCrossCross, FPrime, d1Tmp) + F.Cross(Mat3x3(MatCrossCross, Omega1, d1Tmp))
2132  + Mat3x3(MatCrossCross, F, R*(PHIt*b)));
2133  WM.Add(9 + 1, 9 + 1, FWedged1Wedge);
2134  WM.Add(9 + 1, iOffset1 + 1, O1Wedged1Wedge + Mat3x3(MatCross, R*(PHIt*b)));
2135  WM.Add(9 + 1, iOffset1 + 6 + 1, Mat3x3(MatCross, d1Tmp));
2136 
2137  /* derivata dell'equazione di momento, contributo modale */
2138  SubMat1.LeftMult((-FWedgeO1Wedge - Mat3x3(MatCross, FPrime))*R, PHIt);
2139  WM.Add(9 + 1, iRigidOffset + 1, SubMat1);
2140  SubMat1.LeftMult(-FWedge*R, PHIt);
2141  WM.Add(9 + 1, iRigidOffset + NModes + 1, SubMat1);
2142 
2143  /* derivata dell'eq. di equilibrio ai modi */
2144  SubMat2.RightMult(PHItT, RT*FWedge);
2145  WM.Add(iRigidOffset + NModes + 1, 9 + 1, SubMat2);
2146  SubMat2.RightMult(PHItT, RT*FWedgeO1Wedge);
2147  WM.Add(iRigidOffset + NModes + 1, 3 + 1, SubMat2);
2148  }
2149 
2150  SubMat2.RightMult(PHItT, RT);
2151  WM.Add(iRigidOffset + NModes + 1, iRigidOffset + 2*NModes + 6 + 1, SubMat2);
2152 
2153  /* Derivata dell'equazione di momento, nodo 2 */
2154  WM.Sub(iOffset2 + 9 + 1, iOffset2 + 3 + 1,
2155  Mat3x3(MatCrossCross, FPrime, d2Tmp)
2156  + F.Cross(Mat3x3(MatCrossCross, Omega2, d2Tmp)));
2157  WM.Sub(iOffset2 + 9 + 1, iOffset2 + 9 + 1, FWedged2Wedge);
2158  WM.Add(iOffset2 + 9 + 1, iOffset1 + 1, O2Wedged2Wedge);
2159  WM.Sub(iOffset2 + 9 + 1, iOffset1 + 6 + 1, Mat3x3(MatCross, d2Tmp));
2160 
2161  /* Equazione di vincolo */
2162  if (pModalNode) {
2163  WM.Add(iOffset1 + 1, 3 + 1, Mat3x3(MatCross, d1Tmp));
2164  }
2165  WM.Sub(iOffset1 + 1, iOffset2 + 3 + 1, Mat3x3(MatCross, d2Tmp));
2166 
2167  /* Equazione di vincolo, contributo modale */
2168  SubMat1.LeftMult(R, PHIt);
2169  WM.Sub(iOffset1 + 1, iRigidOffset + 1, SubMat1);
2170 
2171  /* Derivata dell'equazione di vincolo */
2172  if (pModalNode) {
2173  WM.Add(iOffset1 + 6 + 1, 3 + 1, O1Wedged1Wedge + Mat3x3(MatCross, R*(PHIt*b)));
2174  WM.Add(iOffset1 + 6 + 1, 9 + 1, Mat3x3(MatCross, d1Tmp));
2175  }
2176  WM.Add(iOffset1 + 6 + 1, iOffset2 + 3 + 1, O2Wedged2Wedge);
2177  WM.Sub(iOffset1 + 6 + 1, iOffset2 + 9 + 1, Mat3x3(MatCross, d2Tmp));
2178 
2179  /* Derivata dell'equazione di vincolo, contributo modale */
2180  SubMat1.LeftMult(Omega1.Cross(R), PHIt);
2181  WM.Sub(iOffset1 + 6 + 1, iRigidOffset + 1, SubMat1);
2182  SubMat1.LeftMult(R, PHIt);
2183  WM.Sub(iOffset1 + 6 + 1, iRigidOffset + NModes + 1, SubMat1);
2184 
2185  /* giunto prismatico */
2186  Vec3 M(XCurr, iFlexIndex + 2*NModes + 12*iStrNodem1 + 3 + 1);
2187  Vec3 MPrime(XCurr, iFlexIndex + 2*NModes + 12*iStrNodem1 + 9 + 1);
2188  Vec3 e1tota(R1tot.GetVec(1));
2189  Vec3 e2tota(R1tot.GetVec(2));
2190  Vec3 e3tota(R1tot.GetVec(3));
2191  Vec3 e1b(R2.GetVec(1));
2192  Vec3 e2b(R2.GetVec(2));
2193  Vec3 e3b(R2.GetVec(3));
2194 
2195  /* */
2196  Mat3x3 MWedge(Mat3x3(MatCrossCross, e3b, e2tota*M(1))
2197  + Mat3x3(MatCrossCross, e1b, e3tota*M(2))
2198  + Mat3x3(MatCrossCross, e2b, e1tota*M(3)));
2199 
2200  /* Equilibrio */
2201  if (pModalNode) {
2202  WM.Add(3 + 1, 3 + 1, MWedge);
2203  WM.SubT(3 + 1, iOffset2 + 3 + 1, MWedge);
2204 
2205  WM.AddT(iOffset2 + 3 + 1, 3 + 1, MWedge);
2206  }
2207  WM.Sub(iOffset2 + 3 + 1, iOffset2 + 3 + 1, MWedge);
2208 
2209  /* Equilibrio dei momenti, termini aggiuntivi modali */
2210  Vec3 e1ra(R.GetVec(1));
2211  Vec3 e2ra(R.GetVec(2));
2212  Vec3 e3ra(R.GetVec(3));
2213  Mat3x3 M1Wedge(Mat3x3(MatCrossCross, e3b, e2ra*M(1))
2214  + Mat3x3(MatCrossCross, e1b, e3ra*M(2))
2215  + Mat3x3(MatCrossCross, e2b, e1ra*M(3)));
2216 
2217  SubMat1.LeftMult(M1Wedge, PHIr);
2218  if (pModalNode) {
2219  WM.Add(3 + 1, iRigidOffset + 1, SubMat1);
2220  }
2221  WM.Sub(iOffset2 + 3 + 1, iRigidOffset + 1, SubMat1);
2222 
2223  /* Equilibrio ai modi */
2224  if (pModalNode) {
2225  SubMat2.RightMult(PHIrT, R1tot.MulTM(MWedge));
2226  WM.Add(iRigidOffset + 1, 3 + 1, SubMat2);
2227  }
2228  SubMat2.RightMult(PHIrT, R1tot.MulTMT(MWedge));
2229  WM.Sub(iRigidOffset + 1, iOffset2 + 3 + 1, SubMat2);
2230 
2231  Vec3 MA(Mat3x3(e2tota.Cross(e3b), e3tota.Cross(e1b),
2232  e1tota.Cross(e2b))*M);
2233  if (pModalNode) {
2234  SubMat2.RightMult(PHIrT, R1tot.MulTM(Mat3x3(MatCross, MA)));
2235  WM.Add(iRigidOffset + 1, 3 + 1, SubMat2);
2236  }
2237 
2238  Mat3x3 R1TMAWedge(MatCross, RT*MA);
2239  SubMat1.LeftMult(R1TMAWedge, PHIr);
2240  Mat3xN SubMat3(NModes);
2241  MatNxN SubMat4(NModes);
2242  SubMat3.LeftMult(R1tot.MulTM(M1Wedge), PHIr);
2243  SubMat1 += SubMat3;
2244  SubMat4.Mult(PHIrT, SubMat1);
2245  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
2246  for (unsigned int kMode = 1; kMode <= NModes; kMode++) {
2247  WM.IncCoef(iRigidOffset + jMode, iRigidOffset + kMode,
2248  SubMat4(jMode, kMode));
2249  }
2250  }
2251 
2252  /* Derivate dell'equilibrio */
2253  if (pModalNode) {
2254  WM.Add(9 + 1, 9 + 1, MWedge);
2255  WM.SubT(9 + 1, iOffset2 + 9 + 1, MWedge);
2256 
2257  WM.AddT(iOffset2 + 9 + 1, 9 + 1, MWedge);
2258  }
2259  WM.Sub(iOffset2 + 9 + 1, iOffset2 + 9 + 1, MWedge);
2260 
2261  MWedge = ((Mat3x3(MatCrossCross, e3b, Omega1) + Mat3x3(MatCross, Omega2.Cross(e3b*M(1))))
2262  + Mat3x3(MatCross, e3b*MPrime(1)))*Mat3x3(MatCross, e2tota)
2263  + ((Mat3x3(MatCrossCross, e1b, Omega1) + Mat3x3(MatCross, Omega2.Cross(e1b*M(2))))
2264  + Mat3x3(MatCross, e1b*MPrime(2)))*Mat3x3(MatCross, e3tota)
2265  + ((Mat3x3(MatCrossCross, e2b, Omega1) + Mat3x3(MatCross, Omega2.Cross(e2b*M(3))))
2266  + Mat3x3(MatCross, e2b*MPrime(3)))*Mat3x3(MatCross, e1tota);
2267 
2268  if (pModalNode) {
2269  WM.Add(9 + 1, 3 + 1, MWedge);
2270  WM.Sub(iOffset2 + 9 + 1, 3 + 1, MWedge);
2271  }
2272 
2273  MWedge = ((Mat3x3(MatCrossCross, e2tota, Omega2) + Mat3x3(MatCross, Omega1.Cross(e2tota*M(1))))
2274  + Mat3x3(MatCross, e2tota*MPrime(1)))*Mat3x3(MatCross, e3b)
2275  + ((Mat3x3(MatCrossCross, e3tota, Omega2) + Mat3x3(MatCross, Omega1.Cross(e3tota*M(2))))
2276  + Mat3x3(MatCross, e3tota*MPrime(2)))*Mat3x3(MatCross, e1b)
2277  + ((Mat3x3(MatCrossCross, e1tota, Omega2) + Mat3x3(MatCross, Omega1.Cross(e1tota*M(3))))
2278  + Mat3x3(MatCross, e1tota*MPrime(3)))*Mat3x3(MatCross, e2b);
2279 
2280  if (pModalNode) {
2281  WM.Sub(9 + 1, iOffset2 + 3 + 1, MWedge);
2282  }
2283  WM.Add(iOffset2 + 9 + 1, iOffset2 + 3 + 1, MWedge);
2284 
2285  /* Derivate dell'equilibrio, termini aggiuntivi modali */
2286  SubMat1.LeftMult(M1Wedge, PHIr);
2287  if (pModalNode) {
2288  WM.Add(9 + 1, iRigidOffset + NModes + 1, SubMat1);
2289  }
2290  WM.Sub(iOffset2 + 9 + 1, iRigidOffset + NModes + 1, SubMat1);
2291 
2292  Vec3 v1(e2tota.Cross(e3b));
2293  Vec3 v2(e3tota.Cross(e1b));
2294  Vec3 v3(e1tota.Cross(e2b));
2295 
2296  /* Error handling: il programma si ferma,
2297  * pero' segnala dov'e' l'errore */
2298  if (v1.Dot() < std::numeric_limits<doublereal>::epsilon()
2299  || v2.Dot() < std::numeric_limits<doublereal>::epsilon()
2300  || v3.Dot() < std::numeric_limits<doublereal>::epsilon())
2301  {
2302  silent_cerr("Modal(" << GetLabel() << "):"
2303  << "warning, first node hinge axis "
2304  "and second node hinge axis "
2305  "are (nearly) orthogonal; aborting..."
2306  << std::endl);
2308  }
2309 
2310  MWedge = Mat3x3(v1, v2, v3);
2311 
2312  /* Equilibrio */
2313  if (pModalNode) {
2314  WM.Add(3 + 1, iOffset1 + 3 + 1, MWedge);
2315  }
2316  WM.Sub(iOffset2 + 3 + 1, iOffset1 + 3 + 1, MWedge);
2317 
2318  SubMat2.RightMult(PHIrT, R1tot.MulTM(MWedge));
2319  WM.Add(iRigidOffset + 1, iOffset1 + 3 + 1, SubMat2);
2320 
2321  /* Derivate dell'equilibrio */
2322  if (pModalNode) {
2323  WM.Add(9 + 1, iOffset1 + 9 + 1, MWedge);
2324  }
2325  WM.Sub(iOffset2 + 9 + 1, iOffset1 + 9 + 1, MWedge);
2326 
2327  // NOTE: from this point on, MWedge = MWedge.Transpose();
2328 
2329  /* Equaz. di vincolo */
2330  if (pModalNode) {
2331  WM.AddT(iOffset1 + 3 + 1, 3 + 1, MWedge);
2332  }
2333  WM.SubT(iOffset1 + 3 + 1, iOffset2 + 3 + 1, MWedge);
2334 
2335  /* Equaz. di vincolo: termine aggiuntivo
2336  * dovuto alla flessibilita' */
2337  Vec3 u1(e2ra.Cross(e3b));
2338  Vec3 u2(e3ra.Cross(e1b));
2339  Vec3 u3(e1ra.Cross(e2b));
2340 
2341  M1Wedge = (Mat3x3(u1, u2, u3)).Transpose();
2342  SubMat1.LeftMult(M1Wedge, PHIr);
2343  WM.Add(iOffset1 + 3 + 1, iRigidOffset + 1, SubMat1);
2344 
2345  /* Derivate delle equaz. di vincolo */
2346  if (pModalNode) {
2347  WM.AddT(iOffset1 + 9 + 1, 9 + 1, MWedge);
2348  }
2349  WM.SubT(iOffset1 + 9 + 1, iOffset2 + 9 + 1, MWedge);
2350 
2351  v1 = e3b.Cross(e2tota.Cross(Omega1))
2352  + e2tota.Cross(Omega2.Cross(e3b));
2353  v2 = e1b.Cross(e3tota.Cross(Omega1))
2354  + e3tota.Cross(Omega2.Cross(e1b));
2355  v3 = e2b.Cross(e1tota.Cross(Omega1))
2356  + e1tota.Cross(Omega2.Cross(e2b));
2357 
2358  MWedge = Mat3x3(v1, v2, v3);
2359 
2360  /* Derivate dell'equilibrio */
2361  if (pModalNode) {
2362  WM.Add(9 + 1, iOffset1 + 3 + 1, MWedge);
2363  }
2364  WM.Sub(iOffset2 + 9 + 1, iOffset1 + 3 + 1, MWedge);
2365 
2366  /* Derivate delle equaz. di vincolo */
2367  Omega1 = Omega1 - Omega2;
2368 
2369  v1 = e2tota.Cross(e3b.Cross(Omega1));
2370  Vec3 v1p(e3b.Cross(Omega1.Cross(e2tota)));
2371  v2 = e3tota.Cross(e1b.Cross(Omega1));
2372  Vec3 v2p(e1b.Cross(Omega1.Cross(e3tota)));
2373  v3 = e1tota.Cross(e2b.Cross(Omega1));
2374  Vec3 v3p(e2b.Cross(Omega1.Cross(e1tota)));
2375 
2376  if (pModalNode) {
2377  for (unsigned int iCnt = 1; iCnt <= 3; iCnt++) {
2378  doublereal d;
2379 
2380  d = v1(iCnt);
2381  WM.IncCoef(iOffset1 + 9 + 1, 3 + iCnt, d);
2382 
2383  d = v2(iCnt);
2384  WM.IncCoef(iOffset1 + 9 + 2, 3 + iCnt, d);
2385 
2386  d = v3(iCnt);
2387  WM.IncCoef(iOffset1 + 9 + 3, 3 + iCnt, d);
2388  }
2389  }
2390 
2391  for (unsigned int iCnt = 1; iCnt <= 3; iCnt++) {
2392  doublereal d;
2393 
2394  d = v1p(iCnt);
2395  WM.IncCoef(iOffset1 + 9 + 1, iOffset2 + 3 + iCnt, d);
2396 
2397  d = v2p(iCnt);
2398  WM.IncCoef(iOffset1 + 9 + 2, iOffset2 + 3 + iCnt, d);
2399 
2400  d = v3p(iCnt);
2401  WM.IncCoef(iOffset1 + 9 + 3, iOffset2 + 3 + iCnt, d);
2402  }
2403 
2404  } /* fine ciclo sui nodi vincolati */
2405 
2406  return WorkMat;
2407 }
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
const Vec3 Zero3(0., 0., 0.)
MatrixExpression< TransposedMatrix< MatrixDirectExpr< Matrix< T, N_rows, N_cols > > >, N_cols, N_rows > Transpose(const Matrix< T, N_rows, N_cols > &A)
Definition: matvec.h:2206
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
const MatCross_Manip MatCross
Definition: matvec3.cc:639
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
const Mat3xN * pPHIr
Definition: modal.h:154
void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:672
const doublereal & dGet(integer i, integer j) const
Definition: matvec3n.h:612
virtual const Vec3 & GetWRef(void) const
Definition: strnode.h:1024
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: modal.cc:1948
void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:683
void AddT(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:227
void DecCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:694
Vec3 GetVec(integer iCol) const
Definition: matvec3n.cc:553
const ModalNode *const pModalNode
Definition: modal.h:76
Mat3x3 RT
Definition: modal.h:136
#define DEBUGCOUT(msg)
Definition: myassert.h:232
const Mat3xN * pPHIt
Definition: modal.h:153
VecN b
Definition: modal.h:192
std::vector< StrNodeData > SND
Definition: modal.h:217
const unsigned int NModes
Definition: modal.h:138
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const unsigned iRigidOffset
Definition: modal.h:130
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
void SubT(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:233
const MatNxN * pModalDamp
Definition: modal.h:151
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
virtual unsigned int iGetInitialNumDof(void) const
Definition: modal.cc:1942
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
const MatNxN * pModalStiff
Definition: modal.h:150
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
unsigned int GetLabel(void) const
Definition: withlab.cc:62
VecN a
Definition: modal.h:190
const unsigned int NStrNodes
Definition: modal.h:139
Mat3x3 R
Definition: modal.h:135

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 2411 of file modal.cc.

References a, VectorHandler::Add(), b, Vec3::Cross(), grad::Cross(), DEBUGCOUT, VectorHandler::DecCoef(), Mat3xN::dGet(), MatNxN::dGet(), StructNode::GetRCurr(), StructDispNode::GetVCurr(), MatNx3::GetVec(), Mat3x3::GetVec(), StructNode::GetWCurr(), DofOwnerOwner::iGetFirstIndex(), iGetInitialNumDof(), VectorHandler::IncCoef(), InitialWorkSpaceDim(), iRigidOffset, MatCross, NModes, NStrNodes, pModalDamp, pModalNode, pModalStiff, pPHIr, pPHIt, VecN::Put(), Mat3xN::Put(), SubVectorHandler::PutRowIndex(), R, VectorHandler::ResizeReset(), MatNx3::RightMult(), RT, SND, VectorHandler::Sub(), MatNx3::Transpose(), Mat3x3::Transpose(), x, and Zero3.

2413 {
2414  DEBUGCOUT("Entering Modal::InitialAssRes()" << std::endl);
2415 
2416  integer iNumRows;
2417  integer iNumCols;
2418  InitialWorkSpaceDim(&iNumRows, &iNumCols);
2419  WorkVec.ResizeReset(iNumRows);
2420 
2421  VecN Ka(NModes);
2422 
2423  if (pModalNode) {
2424  integer iRigidIndex = pModalNode->iGetFirstIndex();
2425 
2426  for (unsigned int iCnt = 1; iCnt <= iRigidOffset; iCnt++) {
2427  WorkVec.PutRowIndex(iCnt, iRigidIndex + iCnt);
2428  }
2429  }
2430 
2431  integer iFlexIndex = iGetFirstIndex();
2432 
2433  for (unsigned int iCnt = 1; iCnt <= iGetInitialNumDof(); iCnt++) {
2434  WorkVec.PutRowIndex(iRigidOffset + iCnt, iFlexIndex + iCnt);
2435  }
2436 
2437  for (unsigned iStrNodem1 = 0; iStrNodem1 < NStrNodes; iStrNodem1++) {
2438  integer iNodeFirstPosIndex =
2439  SND[iStrNodem1].pNode->iGetFirstPositionIndex();
2440  integer iNodeFirstVelIndex = iNodeFirstPosIndex + 6;
2441 
2442  integer iOffset2 = iRigidOffset + iGetInitialNumDof() + 12*iStrNodem1;
2443  for (unsigned int iCnt = 1; iCnt <= 6; iCnt++) {
2444  WorkVec.PutRowIndex(iOffset2 + iCnt,
2445  iNodeFirstPosIndex + iCnt);
2446  WorkVec.PutRowIndex(iOffset2 + 6 + iCnt,
2447  iNodeFirstVelIndex + iCnt);
2448  }
2449  }
2450 
2451  /* updates modal displacements and velocities: a, b (== aP) */
2452  for (unsigned int iCnt = 1; iCnt <= NModes; iCnt++) {
2453  a.Put(iCnt, XCurr(iFlexIndex + iCnt));
2454  b.Put(iCnt, XCurr(iFlexIndex + NModes + iCnt));
2455  }
2456 
2457  /* updates modal forces: K*a + C*aP */
2458  for (unsigned int iCnt = 1; iCnt <= NModes; iCnt++) {
2459  doublereal temp = 0.;
2460 
2461  for (unsigned int jCnt = 1; jCnt <= NModes; jCnt++) {
2462  temp += pModalStiff->dGet(iCnt, jCnt)*a(jCnt)
2463  + pModalDamp->dGet(iCnt, jCnt)*b(jCnt);
2464  }
2465  WorkVec.DecCoef(iRigidOffset + iCnt, temp);
2466  }
2467 
2468  /* equazioni di vincolo */
2469 
2470  /* Recupera i dati */
2471  Vec3 v1;
2472  Vec3 Omega1;
2473 
2474  if (pModalNode) {
2475  v1 = pModalNode->GetVCurr();
2476  R = pModalNode->GetRCurr();
2477  RT = R.Transpose();
2478  Omega1 = pModalNode->GetWCurr();
2479 
2480  } else {
2481  v1 = ::Zero3;
2482  Omega1 = ::Zero3;
2483  }
2484 
2485  for (unsigned int iStrNode = 1; iStrNode <= NStrNodes; iStrNode++) {
2486  unsigned int iStrNodem1 = iStrNode - 1;
2487  Mat3xN PHIt(NModes,0), PHIr(NModes,0);
2488 
2489  integer iOffset1 = iRigidOffset + 2*NModes + 12*iStrNodem1;
2490  integer iOffset2 = iRigidOffset + iGetInitialNumDof() + 12*iStrNodem1;
2491 
2492  for (unsigned int iCnt = 1; iCnt <= 3; iCnt++) {
2493  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
2494  PHIt.Put(iCnt, jMode, pPHIt->dGet(iCnt, (jMode - 1)*NStrNodes + iStrNode));
2495  PHIr.Put(iCnt, jMode, pPHIr->dGet(iCnt, (jMode - 1)*NStrNodes + iStrNode));
2496  }
2497  }
2498 
2499  MatNx3 PHItT(NModes), PHIrT(NModes);
2500  PHItT.Transpose(PHIt);
2501  PHIrT.Transpose(PHIr);
2502 
2503  Vec3 d1tot = R*(SND[iStrNodem1].OffsetFEM + PHIt*a);
2504  Mat3x3 R1tot = R*Mat3x3(1., PHIr*a);
2505 
2506  const Vec3& x2(SND[iStrNodem1].pNode->GetXCurr());
2507  const Vec3& v2(SND[iStrNodem1].pNode->GetVCurr());
2508  const Mat3x3& R2(SND[iStrNodem1].pNode->GetRCurr());
2509  const Vec3& Omega2(SND[iStrNodem1].pNode->GetWCurr());
2510  Vec3 F(XCurr, iFlexIndex + 2*NModes + 12*iStrNodem1 + 1);
2511  Vec3 FPrime(XCurr, iFlexIndex + 2*NModes + 12*iStrNodem1 + 6 + 1);
2512 
2513  /* cerniera sferica */
2514 
2515  /* Distanza nel sistema globale */
2516  const Vec3& d1Tmp(d1tot);
2517  Vec3 d2Tmp(R2*SND[iStrNodem1].OffsetMB);
2518 
2519  /* Vettori omega1/\d1, -omega2/\d2 */
2520  Vec3 O1Wedged1(Omega1.Cross(d1Tmp));
2521  Vec3 O2Wedged2(Omega2.Cross(d2Tmp));
2522 
2523  /* d1Prime= w1/\d1 + R*PHIt*b */
2524  Mat3xN R1PHIt(NModes);
2525  R1PHIt.LeftMult(R, PHIt);
2526  Vec3 d1Prime(O1Wedged1 + R1PHIt*b);
2527 
2528  /* Equazioni di equilibrio, nodo 1 */
2529  if (pModalNode) {
2530  WorkVec.Sub(1, F);
2531  WorkVec.Add(3 + 1, F.Cross(d1Tmp)); /* F/\d = -d/\F */
2532  }
2533 
2534  /* Eq. d'equilibrio ai modi */
2535  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
2536  doublereal temp = 0.;
2537  for (unsigned int iCnt = 1; iCnt <= 3; iCnt++) {
2538  temp += PHIt(iCnt, jMode)*(RT*F).dGet(iCnt);
2539  }
2540  WorkVec.DecCoef(iRigidOffset + jMode, temp);
2541  }
2542 
2543  /* Derivate delle equazioni di equilibrio, nodo 1 */
2544  if (pModalNode) {
2545  WorkVec.Sub(6 + 1, FPrime);
2546  WorkVec.Add(9 + 1, FPrime.Cross(d1Tmp) - d1Prime.Cross(F));
2547  }
2548 
2549  /* Derivata dell'eq. di equilibrio ai modi */
2550  MatNx3 PHItTR1T(NModes);
2551  PHItTR1T.RightMult(PHItT, RT);
2552  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
2553  doublereal temp = 0.;
2554 
2555  for (unsigned int iCnt = 1; iCnt <= 3; iCnt++) {
2556  temp += PHItTR1T(jMode, iCnt)*(Omega1.Cross(F) - FPrime).dGet(iCnt);
2557  }
2558  WorkVec.IncCoef(iRigidOffset + NModes + jMode, temp);
2559  }
2560 
2561  /* Equazioni di equilibrio, nodo 2 */
2562  WorkVec.Add(iOffset2 + 1, F);
2563  WorkVec.Add(iOffset2 + 3 + 1, d2Tmp.Cross(F));
2564 
2565  /* Derivate delle equazioni di equilibrio, nodo 2 */
2566  WorkVec.Add(iOffset2 + 6 + 1, FPrime);
2567  WorkVec.Add(iOffset2 + 9 + 1, d2Tmp.Cross(FPrime) + O2Wedged2.Cross(F));
2568 
2569  /* Equazione di vincolo */
2570  WorkVec.Add(iOffset1 + 1, x + d1Tmp - x2 - d2Tmp);
2571 
2572  /* Derivata dell'equazione di vincolo */
2573  WorkVec.Add(iOffset1 + 6 + 1, v1 + d1Prime - v2 - O2Wedged2);
2574 
2575  /* giunto prismatico */
2576  Vec3 M(XCurr, iFlexIndex + 2*NModes + 12*iStrNodem1 + 3 + 1);
2577  Vec3 MPrime(XCurr, iFlexIndex + 2*NModes + 12*iStrNodem1 + 9 + 1);
2578 
2579  Vec3 e1a(R1tot.GetVec(1));
2580  Vec3 e2a(R1tot.GetVec(2));
2581  Vec3 e3a(R1tot.GetVec(3));
2582  Vec3 e1b(R2.GetVec(1));
2583  Vec3 e2b(R2.GetVec(2));
2584  Vec3 e3b(R2.GetVec(3));
2585 
2586  Vec3 MTmp(e2a.Cross(e3b*M(1))
2587  + e3a.Cross(e1b*M(2))
2588  + e1a.Cross(e2b*M(3)));
2589 
2590  /* Equazioni di equilibrio, nodo 1 */
2591  if (pModalNode) {
2592  WorkVec.Sub(3 + 1, MTmp);
2593  }
2594 
2595  /* Equazioni di equilibrio, nodo 2 */
2596  WorkVec.Add(iOffset2 + 3 + 1, MTmp);
2597 
2598  /* Equazioni di equilibrio, contributo modale */
2599  Vec3 MTmpRel(R1tot.MulTV(MTmp));
2600  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
2601  WorkVec.DecCoef(iRigidOffset + jMode, PHIrT.GetVec(jMode)*MTmpRel);
2602  }
2603 
2604  /* eaPrime = w/\ea + R*[(PHIr*b)/\]ia */
2605  Mat3x3 Tmp = R*Mat3x3(MatCross, PHIr*b);
2606  Vec3 e1aPrime = Omega1.Cross(e1a) + Tmp.GetVec(1);
2607  Vec3 e2aPrime = Omega1.Cross(e2a) + Tmp.GetVec(2);
2608  Vec3 e3aPrime = Omega1.Cross(e3a) + Tmp.GetVec(3);
2609  Vec3 MTmpPrime(::Zero3);
2610  // FIXME: check (always M(1)?)
2611  MTmpPrime =
2612  (e2a.Cross(Omega2.Cross(e3b)) - e3b.Cross(e2aPrime))*M(1)
2613  + (e3a.Cross(Omega2.Cross(e1b)) - e1b.Cross(e3aPrime))*M(2)
2614  + (e1a.Cross(Omega2.Cross(e2b)) - e2b.Cross(e1aPrime))*M(3)
2615  + e2a.Cross(e3b*MPrime(1))
2616  + e3a.Cross(e1b*MPrime(2))
2617  + e1a.Cross(e2b*MPrime(3));
2618 
2619  /* Derivate delle equazioni di equilibrio, nodo 1 */
2620  if (pModalNode) {
2621  WorkVec.Sub(9 + 1, MTmpPrime);
2622  }
2623 
2624  /* Derivate delle equazioni di equilibrio, nodo 2 */
2625  WorkVec.Add(iOffset2 + 9 + 1, MTmpPrime);
2626 
2627  /* Derivate delle equazioni di equilibrio, contributo modale */
2628  MatNx3 SubMat1(NModes);
2629  SubMat1.RightMult(PHIrT, R1tot.Transpose());
2630 
2631  /* FIXME: temporary ((PHIr*b).Cross(RT*MTmp)) */
2632  Vec3 T1 = MTmpPrime - Omega1.Cross(MTmp);
2633  Vec3 T2 = (PHIr*b).Cross(RT*MTmp);
2634 
2635  for (unsigned int jMode = 1; jMode <= NModes; jMode++) {
2636  doublereal temp = 0;
2637 
2638  for (unsigned int iCnt = 1; iCnt <= 3; iCnt++) {
2639  temp += SubMat1(jMode, iCnt)*T1(iCnt)
2640  - PHIrT(jMode, iCnt)*T2(iCnt);
2641  }
2642  WorkVec.DecCoef(iRigidOffset + NModes + jMode, temp);
2643  }
2644 
2645  /* Equazioni di vincolo di rotazione */
2646  WorkVec.DecCoef(iOffset1 + 3 + 1, e3b.Dot(e2a));
2647  WorkVec.DecCoef(iOffset1 + 3 + 2, e1b.Dot(e3a));
2648  WorkVec.DecCoef(iOffset1 + 3 + 3, e2b.Dot(e1a));
2649 
2650  /* Derivate delle equazioni di vincolo di rotazione */
2651  WorkVec.IncCoef(iOffset1 + 9 + 1,
2652  e3b.Dot(Omega2.Cross(e2a) - e2aPrime));
2653  WorkVec.IncCoef(iOffset1 + 9 + 2,
2654  e1b.Dot(Omega2.Cross(e3a) - e3aPrime));
2655  WorkVec.IncCoef(iOffset1 + 9 + 3,
2656  e2b.Dot(Omega2.Cross(e1a) - e1aPrime));
2657 
2658  } /* fine equazioni di vincolo */
2659 
2660  return WorkVec;
2661 }
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
const MatCross_Manip MatCross
Definition: matvec3.cc:639
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
Vec3 x
Definition: modal.h:134
const Mat3xN * pPHIr
Definition: modal.h:154
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
virtual void IncCoef(integer iRow, const doublereal &dCoef)=0
const doublereal & dGet(integer i, integer j) const
Definition: matvec3n.h:612
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: modal.cc:1948
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
virtual void DecCoef(integer iRow, const doublereal &dCoef)=0
void Put(integer i, const doublereal &d)
Definition: matvec3n.h:159
const ModalNode *const pModalNode
Definition: modal.h:76
Mat3x3 RT
Definition: modal.h:136
#define DEBUGCOUT(msg)
Definition: myassert.h:232
const Mat3xN * pPHIt
Definition: modal.h:153
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
VecN b
Definition: modal.h:192
std::vector< StrNodeData > SND
Definition: modal.h:217
const unsigned int NModes
Definition: modal.h:138
VectorExpression< VectorCrossExpr< VectorLhsExpr, VectorRhsExpr >, 3 > Cross(const VectorExpression< VectorLhsExpr, 3 > &u, const VectorExpression< VectorRhsExpr, 3 > &v)
Definition: matvec.h:3248
const doublereal & dGet(int i, integer j) const
Definition: matvec3n.h:336
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
Mat3x3 Transpose(void) const
Definition: matvec3.h:816
const unsigned iRigidOffset
Definition: modal.h:130
const MatNxN * pModalDamp
Definition: modal.h:151
virtual unsigned int iGetInitialNumDof(void) const
Definition: modal.cc:1942
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
Definition: matvec3n.h:76
const MatNxN * pModalStiff
Definition: modal.h:150
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
VecN a
Definition: modal.h:190
const unsigned int NStrNodes
Definition: modal.h:139
Mat3x3 R
Definition: modal.h:135

Here is the call graph for this function:

void Modal::InitialWorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
virtual

Implements SubjectToInitialAssembly.

Definition at line 1948 of file modal.cc.

References iGetInitialNumDof(), iRigidOffset, and NStrNodes.

Referenced by InitialAssJac(), and InitialAssRes().

1949 {
1950  *piNumRows = *piNumCols = iRigidOffset + iGetInitialNumDof() + 12*NStrNodes;
1951 }
const unsigned iRigidOffset
Definition: modal.h:130
virtual unsigned int iGetInitialNumDof(void) const
Definition: modal.cc:1942
const unsigned int NStrNodes
Definition: modal.h:139

Here is the call graph for this function:

void Modal::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 1914 of file modal.cc.

References a, b, bPrime, ToBeOutput::bToBeOutput(), WithLabel::GetLabel(), OutputHandler::Modal(), NModes, SND, and uModeNumber.

1915 {
1916  if (bToBeOutput()) {
1917  /* stampa sul file di output i modi */
1918  std::ostream& out = OH.Modal();
1919 
1920  for (unsigned int iCnt = 1; iCnt <= NModes; iCnt++) {
1921  out << std::setw(8) << GetLabel() << '.' << uModeNumber[iCnt - 1]
1922  << " " << a(iCnt)
1923  << " " << b(iCnt)
1924  << " " << bPrime(iCnt)
1925  << std::endl;
1926  }
1927 
1928  std::vector<StrNodeData>::const_iterator i = SND.begin();
1929  std::vector<StrNodeData>::const_iterator end = SND.end();
1930  for (; i != end; ++i) {
1931  if (i->bOut) {
1932  out << std::setw(8) << GetLabel() << "@" << i->pNode->GetLabel()
1933  << " ", i->F.Write(out, " ")
1934  << " ", i->M.Write(out, " ")
1935  << std::endl;
1936  }
1937  }
1938  }
1939 }
virtual bool bToBeOutput(void) const
Definition: output.cc:890
std::ostream & Modal(void) const
Definition: output.h:573
const std::vector< unsigned int > uModeNumber
Definition: modal.h:148
VecN bPrime
Definition: modal.h:193
VecN b
Definition: modal.h:192
std::vector< StrNodeData > SND
Definition: modal.h:217
const unsigned int NModes
Definition: modal.h:138
unsigned int GetLabel(void) const
Definition: withlab.cc:62
VecN a
Definition: modal.h:190

Here is the call graph for this function:

const ModalNode* Modal::pGetModalNode ( void  ) const
inline

Definition at line 395 of file modal.h.

References pModalNode.

Referenced by ModalForce::AssRes(), ModalForce::GetConnectedNodes(), ModalForce::Output(), ReadAerodynamicModal(), ReadModalExtForce(), ReadModalForce(), ModalExt::Send(), and ModalForce::WorkSpaceDim().

395  {
396  return pModalNode;
397  };
const ModalNode *const pModalNode
Definition: modal.h:76
const Mat3xN& Modal::pGetPHIr ( void  ) const
inline

Definition at line 355 of file modal.h.

References pModeShapesr.

355  {
356  return *pModeShapesr;
357  };
const Mat3xN * pModeShapesr
Definition: modal.h:157
const Mat3xN& Modal::pGetPHIt ( void  ) const
inline

Definition at line 351 of file modal.h.

References pModeShapest.

351  {
352  return *pModeShapest;
353  };
const Mat3xN * pModeShapest
Definition: modal.h:156
std::ostream & Modal::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 268 of file modal.cc.

269 {
270  return out << "modal; # not implemented yet" << std::endl;
271 }
void Modal::SetInitialValue ( VectorHandler X)
virtual

Initialize state vector used in initial assembly. May set internal states of the element. Do not rely on being always called, because initial assembly could be implicitly or explicitly skipped

Reimplemented from Joint.

Definition at line 2664 of file modal.cc.

References a, b, StructDispNode::GetVCurr(), StructNode::GetWCurr(), DofOwnerOwner::iGetFirstIndex(), NModes, pModalNode, VectorHandler::Put(), and VectorHandler::PutCoef().

2665 {
2666  /* inizializza la soluzione prima dell'assemblaggio iniziale */
2667 
2668  int iFlexIndex = iGetFirstIndex();
2669 
2670  for (unsigned int iCnt = 1; iCnt <= NModes; iCnt++) {
2671  /* modal multipliers */
2672  X.PutCoef(iFlexIndex + iCnt, a(iCnt));
2673 
2674  /* derivatives of modal multipliers */
2675  X.PutCoef(iFlexIndex + NModes + iCnt, b(iCnt));
2676  }
2677 
2678  if (pModalNode) {
2679  integer iRigidIndex = pModalNode->iGetFirstIndex();
2680 
2681  X.Put(iRigidIndex + 6 + 1, pModalNode->GetVCurr());
2682  X.Put(iRigidIndex + 9 + 1, pModalNode->GetWCurr());
2683  }
2684 }
const ModalNode *const pModalNode
Definition: modal.h:76
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
VecN b
Definition: modal.h:192
const unsigned int NModes
Definition: modal.h:138
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
virtual void Put(integer iRow, const Vec3 &v)
Definition: vh.cc:93
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
VecN a
Definition: modal.h:190

Here is the call graph for this function:

void Modal::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints ph = 0 
)
virtual

Reimplemented from Joint.

Definition at line 2687 of file modal.cc.

References a, b, StructDispNode::GetVCurr(), StructNode::GetWCurr(), StructNode::GetWPCurr(), StructDispNode::GetXPPCurr(), DofOwnerOwner::iGetFirstIndex(), NModes, pModalNode, VectorHandler::Put(), and VectorHandler::PutCoef().

2690 {
2691  /* inizializza la soluzione e la sua derivata
2692  * subito dopo l'assemblaggio iniziale
2693  * e prima del calcolo delle derivate */
2694 
2695  int iFlexIndex = iGetFirstIndex();
2696 
2697  for (unsigned int iCnt = 1; iCnt <= NModes; iCnt++) {
2698  /* modal multipliers */
2699  X.PutCoef(iFlexIndex + iCnt, a(iCnt));
2700 
2701  /* derivatives of modal multipliers */
2702  X.PutCoef(iFlexIndex + NModes + iCnt, b(iCnt));
2703  XP.PutCoef(iFlexIndex + iCnt, b(iCnt));
2704  }
2705 
2706  if (pModalNode) {
2707  integer iRigidIndex = pModalNode->iGetFirstIndex();
2708 
2709  X.Put(iRigidIndex + 6 + 1, pModalNode->GetVCurr());
2710  X.Put(iRigidIndex + 9 + 1, pModalNode->GetWCurr());
2711  XP.Put(iRigidIndex + 6 + 1, pModalNode->GetXPPCurr());
2712  XP.Put(iRigidIndex + 9 + 1, pModalNode->GetWPCurr());
2713  }
2714 }
const ModalNode *const pModalNode
Definition: modal.h:76
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
VecN b
Definition: modal.h:192
virtual const Vec3 & GetWPCurr(void) const
Definition: strnode.h:1042
const unsigned int NModes
Definition: modal.h:138
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
virtual void Put(integer iRow, const Vec3 &v)
Definition: vh.cc:93
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
virtual const Vec3 & GetXPPCurr(void) const
Definition: strnode.h:334
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
VecN a
Definition: modal.h:190

Here is the call graph for this function:

integer Modal::uGetNFEMNodes ( void  )
inline

Definition at line 387 of file modal.h.

References NFEMNodes.

387  {
388  return NFEMNodes;
389  };
const unsigned int NFEMNodes
Definition: modal.h:141
integer Modal::uGetNModes ( void  ) const
inline

Definition at line 363 of file modal.h.

References NModes.

Referenced by ModalForce::AssRes(), ModalExt::AssRes(), ModalExt::ModalExt(), ModalExt::Prepare(), ReadAerodynamicModal(), ReadModalForce(), ModalExt::Send(), and ModalExt::WorkSpaceDim().

363  {
364  return NModes;
365  };
const unsigned int NModes
Definition: modal.h:138
void Modal::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
virtual

Implements Elem.

Definition at line 529 of file modal.cc.

References iGetNumDof(), iRigidOffset, NModes, NStrNodes, and pModalNode.

Referenced by AssJac(), and AssRes().

530 {
531 #if USE_AUTODIFF && MODAL_USE_AUTODIFF && !MODAL_DEBUG_AUTODIFF
532  const integer iNumRows = (pModalNode ? 12 : 0) + 2 * NModes + 2 * NModes * NStrNodes + 12 * NStrNodes;
533  const integer iNumCols = (pModalNode ? 6 : 0) + 2 * NModes + NStrNodes * 12;
534  *piNumRows = -iNumRows;
535  *piNumCols = iNumCols;
536 #else
537  /* la matrice e' gestita come piena (c'e' un po' di spreco...) */
538  *piNumCols = *piNumRows = iRigidOffset + iGetNumDof() + 6*NStrNodes;
539 #endif
540 }
const ModalNode *const pModalNode
Definition: modal.h:76
const unsigned int NModes
Definition: modal.h:138
const unsigned iRigidOffset
Definition: modal.h:130
virtual unsigned int iGetNumDof(void) const
Definition: modal.cc:274
long int integer
Definition: colamd.c:51
const unsigned int NStrNodes
Definition: modal.h:139

Here is the call graph for this function:

Member Data Documentation

VecN Modal::a0
protected

Definition at line 190 of file modal.h.

VecN Modal::aPrime
protected

Definition at line 191 of file modal.h.

Referenced by AssRes(), and GetAP().

VecN Modal::aPrime0
protected

Definition at line 191 of file modal.h.

VecN Modal::bPrime
protected

Definition at line 193 of file modal.h.

Referenced by AssRes(), dGetPrivData(), GetBP(), and Output().

const doublereal Modal::dMass
protected

Definition at line 144 of file modal.h.

Referenced by AssJac(), AssRes(), dGetM(), GetB_int(), GetJ_int(), GetS_int(), and ReadModal().

const std::vector<std::string> Modal::IdFEMNodes
protected

Definition at line 142 of file modal.h.

Referenced by iGetPrivDataIdx(), and ReadModal().

const Vec3 Modal::Inv2
protected

Definition at line 145 of file modal.h.

Referenced by AssJac(), AssRes(), GetJ_int(), and GetS_int().

Vec3 Modal::Inv3jaj
protected

Definition at line 171 of file modal.h.

Referenced by AssJac(), AssRes(), GetJ_int(), and GetS_int().

Vec3 Modal::Inv3jaPj
protected

Definition at line 174 of file modal.h.

Referenced by AssJac(), and AssRes().

Mat3xN Modal::Inv5jaj
protected

Definition at line 181 of file modal.h.

Referenced by AssJac(), and AssRes().

Mat3xN Modal::Inv5jaPj
protected

Definition at line 182 of file modal.h.

Referenced by AssJac(), and AssRes().

const Mat3x3 Modal::Inv7
protected

Definition at line 146 of file modal.h.

Referenced by AssJac(), AssRes(), and GetJ_int().

Mat3x3 Modal::Inv8jaj
protected

Definition at line 177 of file modal.h.

Referenced by AssJac(), AssRes(), and GetJ_int().

Mat3x3 Modal::Inv8jaPj
protected

Definition at line 180 of file modal.h.

Referenced by AssJac(), and AssRes().

Mat3x3 Modal::Inv9jkajak
protected

Definition at line 184 of file modal.h.

Referenced by AssRes(), and GetJ_int().

Mat3x3 Modal::Inv9jkajaPk
protected

Definition at line 187 of file modal.h.

Referenced by AssJac(), and AssRes().

const unsigned Modal::iRigidOffset
protected

Definition at line 130 of file modal.h.

Referenced by AssJac(), AssRes(), InitialAssJac(), InitialAssRes(), InitialWorkSpaceDim(), and WorkSpaceDim().

const unsigned int Modal::NFEMNodes
protected
Mat3xN* Modal::pCurrXYZ
protected

Definition at line 159 of file modal.h.

Referenced by GetCurrFEMNodesPosition(), and GetCurrFEMNodesVelocity().

Mat3xN* Modal::pCurrXYZVel
protected

Definition at line 160 of file modal.h.

Referenced by GetCurrFEMNodesVelocity().

const Mat3xN* Modal::pInv10
protected

Definition at line 168 of file modal.h.

Referenced by AssRes(), ReadModal(), and ~Modal().

const Mat3xN* Modal::pInv11
protected

Definition at line 169 of file modal.h.

Referenced by AssRes(), ReadModal(), and ~Modal().

const Mat3xN* Modal::pInv3
protected

Definition at line 162 of file modal.h.

Referenced by AssJac(), AssRes(), GetJ_int(), GetS_int(), ReadModal(), and ~Modal().

const Mat3xN* Modal::pInv4
protected

Definition at line 163 of file modal.h.

Referenced by AssJac(), AssRes(), ReadModal(), and ~Modal().

const Mat3xN* Modal::pInv5
protected

Definition at line 164 of file modal.h.

Referenced by AssJac(), AssRes(), ReadModal(), and ~Modal().

const Mat3xN* Modal::pInv8
protected

Definition at line 165 of file modal.h.

Referenced by AssJac(), AssRes(), GetJ_int(), ReadModal(), and ~Modal().

const Mat3xN* Modal::pInv9
protected

Definition at line 166 of file modal.h.

Referenced by AssJac(), AssRes(), GetJ_int(), ReadModal(), and ~Modal().

const MatNxN* Modal::pModalDamp
protected

Definition at line 151 of file modal.h.

Referenced by AssJac(), AssRes(), InitialAssJac(), InitialAssRes(), and ~Modal().

const MatNxN* Modal::pModalMass
protected

Definition at line 149 of file modal.h.

Referenced by AssJac(), AssRes(), and ~Modal().

const MatNxN* Modal::pModalStiff
protected

Definition at line 150 of file modal.h.

Referenced by AssJac(), AssRes(), InitialAssJac(), InitialAssRes(), and ~Modal().

const Mat3xN* Modal::pModeShapesr
protected

Definition at line 157 of file modal.h.

Referenced by dGetPrivData(), pGetPHIr(), ReadModal(), and ~Modal().

const Mat3xN* Modal::pModeShapest
protected
const Mat3xN* Modal::pPHIr
protected

Definition at line 154 of file modal.h.

Referenced by AssJac(), AssRes(), InitialAssJac(), InitialAssRes(), and ~Modal().

const Mat3xN* Modal::pPHIt
protected

Definition at line 153 of file modal.h.

Referenced by AssJac(), AssRes(), InitialAssJac(), InitialAssRes(), and ~Modal().

const Mat3xN* Modal::pXYZFEMNodes
protected
Mat3x3 Modal::RT
mutableprotected

Definition at line 136 of file modal.h.

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

const std::vector<unsigned int> Modal::uModeNumber
protected

Definition at line 148 of file modal.h.

Referenced by GetModeList(), iGetPrivDataIdx(), Output(), and ReadModal().

Vec3 Modal::x
mutableprotected

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