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

#include <jointreg.h>

Inheritance diagram for JacobianRegularization:
Collaboration diagram for JacobianRegularization:

Public Member Functions

 JacobianRegularization (unsigned int uL, const Joint *j, const std::vector< doublereal > &c, flag fOut)
 
virtual ~JacobianRegularization (void)
 
virtual JointRegularization::Type GetJointRegularizationType (void) const
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
virtual unsigned int iGetNumDof (void) const
 
virtual std::ostream & DescribeDof (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeDof (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual std::ostream & DescribeEq (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeEq (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual DofOrder::Order GetDofType (unsigned int) const
 
virtual void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
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
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
- Public Member Functions inherited from WithLabel
 WithLabel (unsigned int uL=0, const std::string &sN="")
 
virtual ~WithLabel (void)
 
void PutLabel (unsigned int uL)
 
void PutName (const std::string &sN)
 
unsigned int GetLabel (void) const
 
const std::string & GetName (void) const
 
- Public Member Functions inherited from SimulationEntity
 SimulationEntity (void)
 
virtual ~SimulationEntity (void)
 
virtual bool bIsValidIndex (unsigned int i) const
 
virtual DofOrder::Order GetEqType (unsigned int i) const
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
 
virtual HintParseHint (DataManager *pDM, const char *s) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void DerivativesUpdate (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH) const
 
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 JointRegularization
 JointRegularization (unsigned int uL, const Joint *j, flag fOut)
 
virtual ~JointRegularization (void)
 
virtual Elem::Type GetElemType (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual unsigned int iGetInitialNumDof (void) const
 
- Public Member Functions inherited from InitialAssemblyElem
 InitialAssemblyElem (unsigned int uL, flag fOut)
 
virtual ~InitialAssemblyElem (void)
 
- Public Member Functions inherited from SubjectToInitialAssembly
 SubjectToInitialAssembly (void)
 
virtual ~SubjectToInitialAssembly (void)
 

Protected Attributes

std::vector< doublerealdC
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from JointRegularization
const JointpJ
 

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 JointRegularization
enum  Type {
  UNKNOWN = -1, TIKHONOV_REGULARIZATION = 0, DYNAMIC_REGULARIZATION, JACOBIAN_REGULARIZATION,
  LASTJOINTREGTYPE
}
 

Detailed Description

Definition at line 197 of file jointreg.h.

Constructor & Destructor Documentation

JacobianRegularization::JacobianRegularization ( unsigned int  uL,
const Joint j,
const std::vector< doublereal > &  c,
flag  fOut 
)

Definition at line 384 of file jointreg.cc.

References NO_OP.

388 : Elem(uL, fOut),
389 JointRegularization(uL, j, fOut),
390 dC(c)
391 {
392  NO_OP;
393 }
#define NO_OP
Definition: myassert.h:74
std::vector< doublereal > dC
Definition: jointreg.h:201
JointRegularization(unsigned int uL, const Joint *j, flag fOut)
Definition: jointreg.cc:42
static std::stack< cleanup * > c
Definition: cleanup.cc:59
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
JacobianRegularization::~JacobianRegularization ( void  )
virtual

Definition at line 395 of file jointreg.cc.

References NO_OP.

396 {
397  NO_OP;
398 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

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

Implements Elem.

Definition at line 437 of file jointreg.cc.

References dC, DofOwnerOwner::iGetFirstIndex(), Elem::iGetNumDof(), JointRegularization::pJ, SparseSubMatrixHandler::PutItem(), SparseSubMatrixHandler::ResizeReset(), and VariableSubMatrixHandler::SetSparse().

441 {
442  SparseSubMatrixHandler& WM = WorkMat.SetSparse();
443 
444  integer iFirstIndex = pJ->iGetFirstIndex();
445  unsigned iNumDofs = pJ->iGetNumDof();
446 
447  WM.ResizeReset(iNumDofs, 0);
448 
449  for (unsigned iCnt = 1; iCnt <= iNumDofs; iCnt++) {
450  WM.PutItem(iCnt, iFirstIndex + iCnt, iFirstIndex + iCnt,
451  - dC[iCnt - 1]/dCoef);
452  }
453 
454  return WorkMat;
455 }
void ResizeReset(integer iNewRow, integer iNewCol)
Definition: submat.cc:1084
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:997
const Joint * pJ
Definition: jointreg.h:47
std::vector< doublereal > dC
Definition: jointreg.h:201
virtual unsigned int iGetNumDof(void) const
Definition: elem.cc:118
SparseSubMatrixHandler & SetSparse(void)
Definition: submat.h:1178
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Implements Elem.

Definition at line 416 of file jointreg.cc.

420 {
421 /*
422  integer iFirstIndex = pJ->iGetFirstIndex();
423  unsigned iNumDofs = pJ->iGetNumDof();
424 
425  WorkVec.ResizeReset(iNumDofs);
426 
427  for (unsigned iCnt = 1; iCnt <= iNumDofs; iCnt++) {
428  WorkVec.PutItem(iCnt, iFirstIndex + iCnt,
429  dC[iCnt - 1]*XCurr(iFirstIndex + iCnt)/dCoef);
430  }
431 */
432  return WorkVec;
433 }
JointRegularization::Type JacobianRegularization::GetJointRegularizationType ( void  ) const
virtual
VariableSubMatrixHandler & JacobianRegularization::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 465 of file jointreg.cc.

References dC, DofOwnerOwner::iGetFirstIndex(), SubjectToInitialAssembly::iGetInitialNumDof(), JointRegularization::pJ, SparseSubMatrixHandler::PutItem(), SparseSubMatrixHandler::ResizeReset(), and VariableSubMatrixHandler::SetSparse().

467 {
468  SparseSubMatrixHandler& WM = WorkMat.SetSparse();
469 
470  integer iFirstIndex = pJ->iGetFirstIndex();
471  unsigned iNumDofs = pJ->iGetInitialNumDof();
472 
473  WM.ResizeReset(iNumDofs, 0);
474  unsigned tmp1 = 0;
475  unsigned tmp2 = 0;
476 
477  for (unsigned iCnt = 1; iCnt <= iNumDofs; iCnt++) {
478  WM.PutItem(iCnt, iFirstIndex + iCnt, iFirstIndex + iCnt,
479  - dC[tmp2]);
480  if(tmp1 == 1) {
481  tmp1 = 0;
482  tmp2++;
483  } else {
484  tmp1++;
485  }
486  }
487 
488 
489 
490  return WorkMat;
491 }
virtual unsigned int iGetInitialNumDof(void) const =0
void ResizeReset(integer iNewRow, integer iNewCol)
Definition: submat.cc:1084
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:997
const Joint * pJ
Definition: jointreg.h:47
std::vector< doublereal > dC
Definition: jointreg.h:201
SparseSubMatrixHandler & SetSparse(void)
Definition: submat.h:1178
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 494 of file jointreg.cc.

496 {
497 /*
498  integer iFirstIndex = pJ->iGetFirstIndex();
499  unsigned iNumDofs = pJ->iGetInitialNumDof();
500 
501  WorkVec.ResizeReset(iNumDofs);
502 
503  unsigned tmp1 = 0;
504  unsigned tmp2 = 0;
505 
506  for (unsigned iCnt = 1; iCnt <= iNumDofs; iCnt++) {
507  WorkVec.PutItem(iCnt, iFirstIndex + iCnt,
508  dC[tmp2]*XCurr(iFirstIndex + iCnt));
509  if(tmp1 == 1) {
510  tmp1 = 0;
511  tmp2++;
512  } else {
513  tmp1++;
514  }
515  }
516 */
517 
518  return WorkVec;
519 }
void JacobianRegularization::InitialWorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
virtual

Implements SubjectToInitialAssembly.

Definition at line 458 of file jointreg.cc.

References SubjectToInitialAssembly::iGetInitialNumDof(), and JointRegularization::pJ.

460 {
461  *piNumRows = *piNumCols = pJ->iGetInitialNumDof();
462 }
virtual unsigned int iGetInitialNumDof(void) const =0
const Joint * pJ
Definition: jointreg.h:47

Here is the call graph for this function:

void JacobianRegularization::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
virtual

Implements Elem.

Definition at line 408 of file jointreg.cc.

References Elem::iGetNumDof(), and JointRegularization::pJ.

410 {
411  *piNumRows = *piNumCols = pJ->iGetNumDof();
412 }
const Joint * pJ
Definition: jointreg.h:47
virtual unsigned int iGetNumDof(void) const
Definition: elem.cc:118

Here is the call graph for this function:

Member Data Documentation

std::vector<doublereal> JacobianRegularization::dC
protected

Definition at line 201 of file jointreg.h.

Referenced by AssJac(), and InitialAssJac().


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