70 const std::vector<doublereal>&
c,
110 for (
unsigned iCnt = 1; iCnt <= iNumDofs; iCnt++) {
111 WorkVec.
PutItem(iCnt, iFirstIndex + iCnt,
112 dC[iCnt - 1]*XCurr(iFirstIndex + iCnt)/dCoef);
132 for (
unsigned iCnt = 1; iCnt <= iNumDofs; iCnt++) {
133 WM.
PutItem(iCnt, iFirstIndex + iCnt, iFirstIndex + iCnt,
134 -
dC[iCnt - 1]/dCoef);
152 return AssJac(WorkMat, 1., XCurr, XCurr);
175 for (
unsigned iCnt = 1; iCnt <= iNumDofs; iCnt++) {
176 WM.
PutItem(iCnt, iFirstIndex + iCnt, iFirstIndex + iCnt,
204 for (
unsigned iCnt = 1; iCnt <= iNumDofs; iCnt++) {
205 WorkVec.
PutItem(iCnt, iFirstIndex + iCnt,
206 dC[tmp2]*XCurr(iFirstIndex + iCnt));
226 const std::vector<doublereal>&
c,
258 for (std::vector<doublereal>::iterator i =
dLambda.begin();
277 for (
unsigned iCnt = 1; iCnt <= iNumDofs; iCnt++) {
278 unsigned iCntm1 = iCnt - 1;
279 WorkVec.
PutItem(iCnt, iFirstIndex + iCnt,
281 dLambda[iCntm1] = XCurr(iFirstIndex + iCnt);
300 for (
unsigned iCnt = 1; iCnt <= iNumDofs; iCnt++) {
301 WM.
PutItem(iCnt, iFirstIndex + iCnt, iFirstIndex + iCnt,
302 -
dC[iCnt - 1]/dCoef);
330 for (
unsigned iCnt = 1; iCnt <= iNumDofs; iCnt++) {
331 WM.
PutItem(iCnt, iFirstIndex + iCnt, iFirstIndex + iCnt,
353 std::vector<doublereal> dInitialLambda(iNumDofs);
355 for (std::vector<doublereal>::iterator i = dInitialLambda.begin();
356 i != dInitialLambda.end(); ++i )
364 for (
unsigned iCnt = 1; iCnt <= iNumDofs; iCnt++) {
365 unsigned iCntm1 = iCnt - 1;
366 WorkVec.
PutItem(iCnt, iFirstIndex + iCnt,
367 dC[tmp2]*dInitialLambda[iCntm1]);
375 dInitialLambda[iCntm1] = XCurr(iFirstIndex + iCnt);
386 const std::vector<doublereal>&
c,
449 for (
unsigned iCnt = 1; iCnt <= iNumDofs; iCnt++) {
450 WM.
PutItem(iCnt, iFirstIndex + iCnt, iFirstIndex + iCnt,
451 -
dC[iCnt - 1]/dCoef);
477 for (
unsigned iCnt = 1; iCnt <= iNumDofs; iCnt++) {
478 WM.
PutItem(iCnt, iFirstIndex + iCnt, iFirstIndex + iCnt,
533 const char* sKeyWords[] = {
559 if (CurrKeyWord >= 0) {
560 std::cout <<
"joint regularization type: " << sKeyWords[CurrKeyWord] << std::endl;
566 switch (CurrKeyWord) {
583 <<
"(" << uLabel <<
"): "
586 <<
"(" << uLabel <<
") "
595 <<
"(" << uLabel <<
"): "
598 <<
"(" << uLabel <<
") "
605 std::vector<doublereal> dC(iNumDofs);
607 for (
unsigned iCnt = 0; iCnt < iNumDofs; iCnt++) {
611 }
else if (HP.
IsArg()) {
614 for (
unsigned iCnt = 0; iCnt < iNumDofs; iCnt++) {
619 for (
unsigned iCnt = 0; iCnt < iNumDofs; iCnt++) {
624 switch (CurrKeyWord) {
658 silent_cerr(
"error in allocation of "
660 <<
"(" << uLabel <<
")" << std::endl);
666 silent_cerr(
"semicolon expected at line " << HP.
GetLineData()
Elem * ReadJointRegularization(DataManager *pDM, MBDynParser &HP, unsigned int uLabel)
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
#define MBDYN_EXCEPT_ARGS
virtual unsigned int iGetInitialNumDof(void) const =0
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
#define DEBUGCOUTFNAME(fname)
virtual void ResizeReset(integer)
virtual ~DynamicRegularization(void)
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
std::vector< doublereal > dC
JacobianRegularization(unsigned int uL, const Joint *j, const std::vector< doublereal > &c, flag fOut)
void ResizeReset(integer iNewRow, integer iNewCol)
std::vector< doublereal > dLambda
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
virtual ~TikhonovRegularization(void)
virtual void PutItem(integer iSubRow, integer iRow, const doublereal &dCoef)
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
virtual bool bInverseDynamics(void) const
TikhonovRegularization(unsigned int uL, const Joint *j, const std::vector< doublereal > &c, flag fOut)
Elem * pFindElem(Elem::Type Typ, unsigned int uElem, unsigned int iDeriv) const
virtual ~JacobianRegularization(void)
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
virtual JointRegularization::Type GetJointRegularizationType(void) const
virtual bool IsKeyWord(const char *sKeyWord)
DynamicRegularization(unsigned int uL, const Joint *j, const std::vector< doublereal > &c, flag fOut)
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
virtual JointRegularization::Type GetJointRegularizationType(void) const
std::vector< doublereal > dC
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
virtual unsigned int iGetNumDof(void) const
JointRegularization(unsigned int uL, const Joint *j, flag fOut)
static std::stack< cleanup * > c
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
const char * psElemNames[]
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
SparseSubMatrixHandler & SetSparse(void)
virtual ~JointRegularization(void)
virtual integer iGetFirstIndex(void) const
virtual Elem * pGetElem(void) const
virtual JointRegularization::Type GetJointRegularizationType(void) const
virtual HighParser::ErrOut GetLineData(void) const
virtual unsigned int iGetInitialNumDof(void) const
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
std::vector< doublereal > dC
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
virtual doublereal GetReal(const doublereal &dDefval=0.0)