MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
LoadIncForce Class Reference
Inheritance diagram for LoadIncForce:
Collaboration diagram for LoadIncForce:

Public Member Functions

 LoadIncForce (unsigned uLabel, const DofOwner *pDO, DataManager *pDM, MBDynParser &HP)
 
virtual ~LoadIncForce (void)
 
virtual void Output (OutputHandler &OH) const
 
virtual 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)
 
unsigned int iGetNumPrivData (void) const
 
int iGetNumConnectedNodes (void) const
 
void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph)
 
std::ostream & Restart (std::ostream &out) 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)
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
virtual unsigned int iGetNumDof (void) const
 
virtual std::ostream & DescribeDof (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeDof (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual std::ostream & DescribeEq (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeEq (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual DofOrder::Order GetDofType (unsigned int) const
 
virtual void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
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 DofOrder::Order GetEqType (unsigned int i) const
 
virtual HintParseHint (DataManager *pDM, const char *s) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void DerivativesUpdate (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH, const VectorHandler &X, const VectorHandler &XP) const
 
virtual flag fToBeOutput (void) const
 
virtual bool bToBeOutput (void) const
 
virtual void SetOutputFlag (flag f=flag(1))
 
- Public Member Functions inherited from UserDefinedElem
 UserDefinedElem (unsigned uLabel, const DofOwner *pDO)
 
virtual ~UserDefinedElem (void)
 
bool NeedsAirProperties (void) const
 
void NeedsAirProperties (bool yesno)
 
virtual Elem::Type GetElemType (void) const
 
virtual AerodynamicElem::Type GetAerodynamicElemType (void) const
 
- Public Member Functions inherited from InitialAssemblyElem
 InitialAssemblyElem (unsigned int uL, flag fOut)
 
virtual ~InitialAssemblyElem (void)
 
- Public Member Functions inherited from SubjectToInitialAssembly
 SubjectToInitialAssembly (void)
 
virtual ~SubjectToInitialAssembly (void)
 
- Public Member Functions inherited from AerodynamicElem
 AerodynamicElem (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~AerodynamicElem (void)
 
virtual const InducedVelocitypGetInducedVelocity (void) 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
 
virtual void SetInitialValue (VectorHandler &X)
 
- Public Member Functions inherited from AirPropOwner
 AirPropOwner (void)
 
virtual ~AirPropOwner (void)
 
virtual void PutAirProperties (const AirProperties *pAP)
 
virtual flag fGetAirVelocity (Vec3 &Velocity, const Vec3 &X) const
 
virtual doublereal dGetAirDensity (const Vec3 &X) const
 
virtual doublereal dGetAirPressure (const Vec3 &X) const
 
virtual doublereal dGetAirTemperature (const Vec3 &X) const
 
virtual doublereal dGetSoundSpeed (const Vec3 &X) const
 
virtual bool GetAirProps (const Vec3 &X, doublereal &rho, doublereal &c, doublereal &p, doublereal &T) const
 
- Public Member Functions inherited from ElemGravityOwner
 ElemGravityOwner (unsigned int uL, flag fOut)
 
virtual ~ElemGravityOwner (void)
 
virtual doublereal dGetM (void) const
 
Vec3 GetS (void) const
 
Mat3x3 GetJ (void) const
 
Vec3 GetB (void) const
 
Vec3 GetG (void) const
 
- Public Member Functions inherited from GravityOwner
 GravityOwner (void)
 
virtual ~GravityOwner (void)
 
void PutGravity (const Gravity *pG)
 
virtual bool bGetGravity (const Vec3 &X, Vec3 &Acc) const
 

Private Attributes

bool m_bCouple
 
bool m_bFollower
 
const LoadIncNormm_pLoadIncNorm
 
const DrivenElemm_pDrivenLoadIncNorm
 
const StructDispNodem_pDNode
 
const StructNodem_pNode
 
Vec3 m_o
 
Vec3 m_Dir
 
Vec3 m_F
 
Vec3 m_M
 

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 AerodynamicElem
enum  Type {
  UNKNOWN = -1, INDUCEDVELOCITY = 0, AEROMODAL, AERODYNAMICBODY,
  AERODYNAMICBEAM, AERODYNAMICEXTERNAL, AERODYNAMICEXTERNALMODAL, AERODYNAMICLOADABLE,
  AIRCRAFTINSTRUMENTS, GENERICFORCE, LASTAEROTYPE
}
 
- Protected Member Functions inherited from ElemGravityOwner
virtual Vec3 GetS_int (void) const
 
virtual Mat3x3 GetJ_int (void) const
 
virtual Vec3 GetB_int (void) const
 
virtual Vec3 GetG_int (void) const
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from UserDefinedElem
bool needsAirProperties
 
- Protected Attributes inherited from AirPropOwner
const AirPropertiespAirProperties
 
- Protected Attributes inherited from GravityOwner
GravitypGravity
 

Detailed Description

Definition at line 571 of file module-loadinc.cc.

Constructor & Destructor Documentation

LoadIncForce::LoadIncForce ( unsigned  uLabel,
const DofOwner pDO,
DataManager pDM,
MBDynParser HP 
)

Definition at line 620 of file module-loadinc.cc.

References ASSERT, DataManager::fReadOutput(), WithLabel::GetLabel(), IncludeParser::GetLineData(), MBDynParser::GetPosRel(), MBDynParser::GetVec3(), MBDynParser::GetVecAbs(), MBDynParser::GetVecRel(), HighParser::IsArg(), HighParser::IsKeyWord(), Vec3::IsNull(), Elem::LOADABLE, m_bCouple, m_bFollower, m_Dir, m_o, m_pDNode, m_pDrivenLoadIncNorm, m_pLoadIncNorm, m_pNode, MBDYN_EXCEPT_ARGS, NestedElem::pGetElem(), DataManager::ReadElem(), DataManager::ReadNode(), ToBeOutput::SetOutputFlag(), Node::STRUCTURAL, and Zero3.

623 : Elem(uLabel, flag(0)),
624 UserDefinedElem(uLabel, pDO),
626 {
627  // help
628  if (HP.IsKeyWord("help")) {
629  silent_cout(
630 "\n"
631 "Module: loadinc - load increment force\n"
632 "Author: Pierangelo Masarati <masarati@aero.polimi.it>\n"
633 "Organization: Dipartimento di Ingegneria Aerospaziale\n"
634 " Politecnico di Milano\n"
635 " http://www.aero.polimi.it/\n"
636 "\n"
637 " All rights reserved\n"
638 "\n"
639 "Usage:\n"
640 "\n"
641 "user defined : <label> , load increment force ,\n"
642 " { force | couple } ,\n"
643 " { absolute | follower } ,\n"
644 " <node_label> ,\n"
645 " [ position , (Vec3) <position> , ] # meaningless for couple\n"
646 " (Vec3) <direction> , \n"
647 " load increment normalization , <lin_label> ;\n"
648 "\n"
649 "# output:\n"
650 "# 1: <label>@<node_label>\n"
651 "# if type ::= \"force\":\n"
652 "# 2,3,4: fx fy fz\n"
653 "# if node is not displacement-only:\n"
654 "# 5,6,7: mx my mz\n"
655 "# else\n"
656 "# 2,3,4: mx my mz\n"
657  << std::endl);
658 
659  if (!HP.IsArg()) {
660  /*
661  * Exit quietly if nothing else is provided
662  */
663  throw NoErr(MBDYN_EXCEPT_ARGS);
664  }
665  }
666 
667  if (HP.IsKeyWord("force")) {
668  m_bCouple = false;
669 
670  } else if (HP.IsKeyWord("couple")) {
671  m_bCouple = true;
672 
673  } else {
674  silent_cerr("LoadIncForce(" << uLabel << "): missing { force | couple } or unexpected type at line " << HP.GetLineData() << std::endl);
676  }
677 
678  if (HP.IsKeyWord("absolute")) {
679  m_bFollower = false;
680 
681  } else if (HP.IsKeyWord("follower")) {
682  m_bFollower = true;
683 
684  } else {
685  silent_cerr("LoadIncForce(" << uLabel << "): missing { absolute | follower } or unexpected type at line " << HP.GetLineData() << std::endl);
687  }
688 
690  ASSERT(m_pDNode != 0);
691  m_pNode = dynamic_cast<const StructNode *>(m_pDNode);
692 
693  m_o = ::Zero3;
694  if (m_pNode != 0) {
696 
697  if (HP.IsKeyWord("position")) {
698  m_o = HP.GetPosRel(rf);
699  }
700 
701  if (m_bFollower) {
702  m_Dir = HP.GetVecRel(rf);
703 
704  } else {
705  m_Dir = HP.GetVecAbs(rf);
706  }
707 
708  } else {
709  m_Dir = HP.GetVec3();
710  }
711 
712  if (m_Dir.IsNull()) {
713  silent_cerr("LoadIncForce(" << uLabel << "): null direction at line " << HP.GetLineData() << std::endl);
715  }
716 
717  if (!HP.IsKeyWord("load" "increment" "normalization")) {
718  silent_cerr("LoadIncForce(" << uLabel << "): missing \"load increment normalization\" keyword at line " << HP.GetLineData() << std::endl);
720  }
721 
722  // if m_pLoadIncNorm is driven, make sure the LoadIncForce
723  // and the LoadIncNorm are simultaneously active
724  Elem *pEl = pDM->ReadElem(HP, Elem::LOADABLE);
725  m_pLoadIncNorm = dynamic_cast<const LoadIncNorm *>(pEl);
726  if (m_pLoadIncNorm == 0) {
727  m_pDrivenLoadIncNorm = dynamic_cast<const DrivenElem *>(pEl);
728  if (m_pDrivenLoadIncNorm == 0) {
729  silent_cerr("LoadIncForce(" << uLabel << "): invalid \"load increment normalization\" UseDefined(" << pEl->GetLabel() << ") element at line " << HP.GetLineData() << std::endl);
731  }
732 
733  m_pLoadIncNorm = dynamic_cast<const LoadIncNorm *>(m_pDrivenLoadIncNorm->pGetElem());
734  if (m_pLoadIncNorm == 0) {
735  silent_cerr("LoadIncForce(" << uLabel << "): invalid \"load increment normalization\" UseDefined(" << pEl->GetLabel() << ") element at line " << HP.GetLineData() << std::endl);
737  }
738  }
739 
741 }
flag fReadOutput(MBDynParser &HP, const T &t) const
Definition: dataman.h:1064
const Vec3 Zero3(0., 0., 0.)
const StructDispNode * m_pDNode
long int flag
Definition: mbdyn.h:43
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Elem * ReadElem(MBDynParser &HP, Elem::Type type) const
Definition: dataman3.cc:2334
const StructNode * m_pNode
bool IsNull(void) const
Definition: matvec3.h:472
Vec3 GetPosRel(const ReferenceFrame &rf)
Definition: mbpar.cc:1331
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
unsigned int uLabel
Definition: withlab.h:44
#define ASSERT(expression)
Definition: colamd.c:977
Definition: except.h:79
Vec3 GetVecRel(const ReferenceFrame &rf)
Definition: mbpar.cc:1584
Vec3 GetVecAbs(const ReferenceFrame &rf)
Definition: mbpar.cc:1641
virtual bool IsArg(void)
Definition: parser.cc:807
Definition: elem.h:75
UserDefinedElem(unsigned uLabel, const DofOwner *pDO)
Definition: userelem.cc:152
const DrivenElem * m_pDrivenLoadIncNorm
virtual void SetOutputFlag(flag f=flag(1))
Definition: output.cc:896
const LoadIncNorm * m_pLoadIncNorm
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
virtual Elem * pGetElem(void) const
Definition: nestedelem.cc:60
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
unsigned int GetLabel(void) const
Definition: withlab.cc:62
Node * ReadNode(MBDynParser &HP, Node::Type type) const
Definition: dataman3.cc:2309
virtual Vec3 GetVec3(void)
Definition: mbpar.cc:2220

Here is the call graph for this function:

LoadIncForce::~LoadIncForce ( void  )
virtual

Definition at line 743 of file module-loadinc.cc.

References NO_OP.

744 {
745  NO_OP;
746 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

void LoadIncForce::AfterPredict ( VectorHandler X,
VectorHandler XP 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 766 of file module-loadinc.cc.

References NO_OP.

767 {
768  NO_OP;
769 }
#define NO_OP
Definition: myassert.h:74
VariableSubMatrixHandler & LoadIncForce::AssJac ( VariableSubMatrixHandler WorkMat,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 790 of file module-loadinc.cc.

References FullSubMatrixHandler::Add(), ASSERT, DrivenElem::bIsActive(), Vec3::Cross(), WithLabel::GetLabel(), StructNode::GetRRef(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), m_bCouple, m_bFollower, m_Dir, m_F, m_M, m_o, m_pDNode, m_pDrivenLoadIncNorm, m_pLoadIncNorm, m_pNode, MatCross, MatCrossCross, MBDYN_EXCEPT_ARGS, FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), R, FullSubMatrixHandler::ResizeReset(), VariableSubMatrixHandler::SetFull(), FullSubMatrixHandler::Sub(), and WorkSpaceDim().

794 {
795  // if m_pLoadIncNorm is driven, make sure the LoadIncForce
796  // and the LoadIncNorm are simultaneously active
798  silent_cerr("LoadIncForce(" << GetLabel() << "): LoadIncNorm(" << m_pLoadIncNorm->GetLabel() << ") inactive" << std::endl);
800  }
801 
802  FullSubMatrixHandler& WM = WorkMat.SetFull();
803 
804  integer iNumRows, iNumCols;
805  WorkSpaceDim(&iNumRows, &iNumCols);
806  WM.ResizeReset(iNumRows, iNumCols);
807 
808  // std::cerr << "### " << __PRETTY_FUNCTION__ << " iNumRows=" << iNumRows << " iNumCols=" << iNumCols << std::endl;
809 
810  if (m_bCouple) {
811  ASSERT(m_pNode != 0);
812  integer iFirstPositionIndex = m_pNode->iGetFirstPositionIndex() + 3;
813  integer iFirstMomentumIndex = m_pNode->iGetFirstMomentumIndex() + 3;
814  integer iNormIndex = m_pLoadIncNorm->iGetFirstIndex() + 1;
815 
816  for (integer iCnt = 1; iCnt <= 3; iCnt++) {
817  WM.PutRowIndex(iCnt, iFirstMomentumIndex + iCnt);
818  }
819 
820  if (m_bFollower) {
821  for (integer iCnt = 1; iCnt <= 3; iCnt++) {
822  WM.PutColIndex(iCnt, iFirstPositionIndex + iCnt);
823  }
824  WM.PutColIndex(4, iNormIndex);
825 
826  WM.Add(1, 1, Mat3x3(MatCross, m_M*dCoef));
827  WM.Sub(1, 4, m_pNode->GetRRef()*m_Dir);
828 
829  } else {
830  WM.PutColIndex(1, iNormIndex);
831  WM.Sub(1, 1, m_Dir);
832  }
833 
834  } else if (m_pNode == 0) {
835  // structural displacement node
836  integer iFirstMomentumIndex = m_pDNode->iGetFirstMomentumIndex();
837  integer iNormIndex = m_pLoadIncNorm->iGetFirstIndex() + 1;
838 
839  WM.PutColIndex(1, iNormIndex);
840 
841  for (integer iCnt = 1; iCnt <= 3; iCnt++) {
842  WM.PutRowIndex(iCnt, iFirstMomentumIndex + iCnt);
843  }
844 
845  WM.Sub(1, 1, m_Dir);
846 
847  } else {
848  integer iFirstPositionIndex = m_pNode->iGetFirstPositionIndex() + 3;
849  integer iFirstMomentumIndex = m_pNode->iGetFirstMomentumIndex();
850  integer iNormIndex = m_pLoadIncNorm->iGetFirstIndex() + 1;
851 
852  for (integer iCnt = 1; iCnt <= 3; iCnt++) {
853  WM.PutColIndex(iCnt, iFirstPositionIndex + iCnt);
854  }
855  WM.PutColIndex(4, iNormIndex);
856 
857  for (integer iCnt = 1; iCnt <= 6; iCnt++) {
858  WM.PutRowIndex(iCnt, iFirstMomentumIndex + iCnt);
859  }
860 
861  const Mat3x3& R(m_pNode->GetRRef());
862 
863  if (m_bFollower) {
864  WM.Add(1, 1, Mat3x3(MatCross, m_F*dCoef));
865  WM.Add(3 + 1, 1, Mat3x3(MatCross, m_M*dCoef));
866 
867  WM.Sub(1, 4, R*m_Dir);
868  WM.Sub(3 + 1, 4, R*m_o.Cross(m_Dir));
869 
870  } else {
871  Vec3 TmpArm(R*m_o);
872 
873  WM.Sub(3 + 1, 1, Mat3x3(MatCrossCross, m_F, TmpArm*dCoef));
874 
875  WM.Sub(1, 4, m_Dir);
876  WM.Sub(3 + 1, 4, TmpArm.Cross(m_Dir));
877  }
878  }
879 
880  return WorkMat;
881 }
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
const StructDispNode * m_pDNode
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
#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 StructNode * m_pNode
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
#define ASSERT(expression)
Definition: colamd.c:977
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
const DrivenElem * m_pDrivenLoadIncNorm
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
const LoadIncNorm * m_pLoadIncNorm
long int integer
Definition: colamd.c:51
unsigned int GetLabel(void) const
Definition: withlab.cc:62
virtual bool bIsActive(void) const
Definition: driven.cc:74
Mat3x3 R

Here is the call graph for this function:

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

Implements Elem.

Definition at line 884 of file module-loadinc.cc.

References VectorHandler::Add(), ASSERT, DrivenElem::bIsActive(), Vec3::Cross(), grad::Cross(), LoadIncNorm::dGetP(), WithLabel::GetLabel(), StructNode::GetRCurr(), StructDispNode::iGetFirstMomentumIndex(), m_bCouple, m_bFollower, m_Dir, m_F, m_M, m_o, m_pDNode, m_pDrivenLoadIncNorm, m_pLoadIncNorm, m_pNode, MBDYN_EXCEPT_ARGS, SubVectorHandler::PutRowIndex(), R, VectorHandler::ResizeReset(), and WorkSpaceDim().

888 {
889  // if m_pLoadIncNorm is driven, make sure the LoadIncForce
890  // and the LoadIncNorm are simultaneously active
892  silent_cerr("LoadIncForce(" << GetLabel() << "): LoadIncNorm(" << m_pLoadIncNorm->GetLabel() << ") inactive" << std::endl);
894  }
895 
896  integer iNumRows, iNumCols;
897  WorkSpaceDim(&iNumRows, &iNumCols);
898  WorkVec.ResizeReset(iNumRows);
899 
901 
902  if (m_bCouple) {
903  ASSERT(m_pNode != 0);
904  integer iFirstMomentumIndex = m_pNode->iGetFirstMomentumIndex() + 3;
905  for (integer iCnt = 1; iCnt <= 3; iCnt++) {
906  WorkVec.PutRowIndex(iCnt, iFirstMomentumIndex + iCnt);
907  }
908 
909  if (m_bFollower) {
910  const Mat3x3& R(m_pNode->GetRCurr());
911  m_M = R*(m_Dir*dp);
912 
913  } else {
914  m_M = m_Dir*dp;
915  }
916 
917  WorkVec.Add(1, m_M);
918 
919  } else if (m_pNode == 0) {
920  // structural displacement node
921  integer iFirstMomentumIndex = m_pDNode->iGetFirstMomentumIndex();
922  for (integer iCnt = 1; iCnt <= 3; iCnt++) {
923  WorkVec.PutRowIndex(iCnt, iFirstMomentumIndex + iCnt);
924  }
925 
926  m_F = m_Dir*dp;
927  WorkVec.Add(1, m_F);
928 
929  } else {
930  integer iFirstMomentumIndex = m_pNode->iGetFirstMomentumIndex();
931  for (integer iCnt = 1; iCnt <= 6; iCnt++) {
932  WorkVec.PutRowIndex(iCnt, iFirstMomentumIndex + iCnt);
933  }
934 
935  const Mat3x3& R(m_pNode->GetRCurr());
936 
937  if (m_bFollower) {
938  Vec3 FTmp(m_Dir*dp);
939 
940  m_F = R*FTmp;
941  m_M = R*m_o.Cross(FTmp);
942 
943  } else {
944  m_F = m_Dir*dp;
945  m_M = (R*m_o).Cross(m_F);
946  }
947 
948  WorkVec.Add(1, m_F);
949  WorkVec.Add(4, m_M);
950  }
951 
952  return WorkVec;
953 }
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
const StructDispNode * m_pDNode
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
const StructNode * m_pNode
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
virtual integer iGetFirstMomentumIndex(void) const =0
#define ASSERT(expression)
Definition: colamd.c:977
VectorExpression< VectorCrossExpr< VectorLhsExpr, VectorRhsExpr >, 3 > Cross(const VectorExpression< VectorLhsExpr, 3 > &u, const VectorExpression< VectorRhsExpr, 3 > &v)
Definition: matvec.h:3248
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
const DrivenElem * m_pDrivenLoadIncNorm
const LoadIncNorm * m_pLoadIncNorm
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
unsigned int GetLabel(void) const
Definition: withlab.cc:62
doublereal dGetP(void) const
virtual bool bIsActive(void) const
Definition: driven.cc:74
Mat3x3 R

Here is the call graph for this function:

void LoadIncForce::GetConnectedNodes ( std::vector< const Node * > &  connectedNodes) const
virtual

Reimplemented from Elem.

Definition at line 968 of file module-loadinc.cc.

References m_pDNode.

969 {
970  connectedNodes.resize(1);
971 
972  connectedNodes[0] = m_pDNode;
973 }
const StructDispNode * m_pDNode
unsigned int LoadIncForce::iGetInitialNumDof ( void  ) const
virtual

Implements SubjectToInitialAssembly.

Definition at line 990 of file module-loadinc.cc.

991 {
992  return 0;
993 }
int LoadIncForce::iGetNumConnectedNodes ( void  ) const

Definition at line 962 of file module-loadinc.cc.

963 {
964  return 1;
965 }
unsigned int LoadIncForce::iGetNumPrivData ( void  ) const
virtual

Reimplemented from SimulationEntity.

Definition at line 956 of file module-loadinc.cc.

957 {
958  return 0;
959 }
VariableSubMatrixHandler & LoadIncForce::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 1005 of file module-loadinc.cc.

References ASSERT, and VariableSubMatrixHandler::SetNullMatrix().

1008 {
1009  // should not be called, since initial workspace is empty
1010  ASSERT(0);
1011 
1012  WorkMat.SetNullMatrix();
1013 
1014  return WorkMat;
1015 }
void SetNullMatrix(void)
Definition: submat.h:1159
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 1018 of file module-loadinc.cc.

References ASSERT, and VectorHandler::ResizeReset().

1021 {
1022  // should not be called, since initial workspace is empty
1023  ASSERT(0);
1024 
1025  WorkVec.ResizeReset(0);
1026 
1027  return WorkVec;
1028 }
virtual void ResizeReset(integer)
Definition: vh.cc:55
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 996 of file module-loadinc.cc.

999 {
1000  *piNumRows = 0;
1001  *piNumCols = 0;
1002 }
void LoadIncForce::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 749 of file module-loadinc.cc.

References ToBeOutput::bToBeOutput(), WithLabel::GetLabel(), OutputHandler::Loadable(), m_bCouple, m_F, m_M, m_pDNode, and m_pNode.

750 {
751  if (bToBeOutput()) {
752  std::ostream& out = OH.Loadable();
753 
754  out << GetLabel() << "@" << m_pDNode->GetLabel();
755  if (!m_bCouple) {
756  out << " " << m_F;
757  }
758  if (m_pNode != 0) {
759  out << " " << m_M;
760  }
761  out << std::endl;
762  }
763 }
const StructDispNode * m_pDNode
virtual bool bToBeOutput(void) const
Definition: output.cc:890
const StructNode * m_pNode
std::ostream & Loadable(void) const
Definition: output.h:506
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Implements Elem.

Definition at line 984 of file module-loadinc.cc.

985 {
986  return out << "# LoadIncForce: not implemented" << std::endl;
987 }
void LoadIncForce::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints ph 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 976 of file module-loadinc.cc.

References NO_OP.

979 {
980  NO_OP;
981 }
#define NO_OP
Definition: myassert.h:74
void LoadIncForce::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
virtual

Implements Elem.

Definition at line 772 of file module-loadinc.cc.

References m_bCouple, m_bFollower, and m_pNode.

Referenced by AssJac(), and AssRes().

773 {
774  if (m_bCouple || m_pNode == 0) {
775  *piNumRows = 3;
776 
777  } else {
778  *piNumRows = 6;
779  }
780 
781  if (m_pNode != 0 && (m_bFollower || !m_bCouple)) {
782  *piNumCols = 3 + 1;
783 
784  } else {
785  *piNumCols = 1;
786  }
787 }
const StructNode * m_pNode

Member Data Documentation

bool LoadIncForce::m_bCouple
private

Definition at line 574 of file module-loadinc.cc.

Referenced by AssJac(), AssRes(), LoadIncForce(), Output(), and WorkSpaceDim().

bool LoadIncForce::m_bFollower
private

Definition at line 575 of file module-loadinc.cc.

Referenced by AssJac(), AssRes(), LoadIncForce(), and WorkSpaceDim().

Vec3 LoadIncForce::m_Dir
private

Definition at line 582 of file module-loadinc.cc.

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

Vec3 LoadIncForce::m_F
private

Definition at line 583 of file module-loadinc.cc.

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

Vec3 LoadIncForce::m_M
private

Definition at line 584 of file module-loadinc.cc.

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

Vec3 LoadIncForce::m_o
private

Definition at line 581 of file module-loadinc.cc.

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

const StructDispNode* LoadIncForce::m_pDNode
private

Definition at line 579 of file module-loadinc.cc.

Referenced by AssJac(), AssRes(), GetConnectedNodes(), LoadIncForce(), and Output().

const DrivenElem* LoadIncForce::m_pDrivenLoadIncNorm
private

Definition at line 578 of file module-loadinc.cc.

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

const LoadIncNorm* LoadIncForce::m_pLoadIncNorm
private

Definition at line 577 of file module-loadinc.cc.

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

const StructNode* LoadIncForce::m_pNode
private

Definition at line 580 of file module-loadinc.cc.

Referenced by AssJac(), AssRes(), LoadIncForce(), Output(), and WorkSpaceDim().


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