52 pNode1(pN1), pNode2(pN2),
56 d1(dTmp1), R1h(RTmp1h),
57 d2(dTmp2), R2h(RTmp2h),
77 d1.
Write(out,
", ") <<
", hinge, reference, node, 1, ", (
R1h.
GetVec(1)).
Write(out,
", ")
80 d2.
Write(out,
", ") <<
", hinge, reference, node, 1, ", (
R2h.
GetVec(1)).
Write(out,
", ")
94 DEBUGCOUT(
"Entering SphericalHingeJoint::AssJac()" << std::endl);
138 WM.
PutDiag(1, iNode1FirstMomIndex, iFirstReactionIndex, 1.);
139 WM.
PutCross(4, iNode1FirstMomIndex+3, iFirstReactionIndex, dTmp1);
145 WM.
PutDiag(19, iNode2FirstMomIndex, iFirstReactionIndex, -1.);
146 WM.
PutCross(22, iNode2FirstMomIndex+3, iFirstReactionIndex, -dTmp2);
154 WM.
PutDiag(37, iFirstReactionIndex, iNode1FirstPosIndex, -1.);
155 WM.
PutCross(40, iFirstReactionIndex, iNode1FirstPosIndex+3, dTmp1);
158 WM.
PutDiag(46, iFirstReactionIndex, iNode2FirstPosIndex, 1.);
159 WM.
PutCross(49, iFirstReactionIndex, iNode2FirstPosIndex+3, -dTmp2);
171 DEBUGCOUT(
"Entering SphericalHingeJoint::AssRes()" << std::endl);
184 for (
int iCnt = 1; iCnt <= 6; iCnt++) {
185 WorkVec.
PutRowIndex(iCnt, iNode1FirstMomIndex+iCnt);
186 WorkVec.
PutRowIndex(6+iCnt, iNode2FirstMomIndex+iCnt);
190 for (
int iCnt = 1; iCnt <= 3; iCnt++) {
191 WorkVec.
PutRowIndex(12+iCnt, iFirstReactionIndex+iCnt);
194 F =
Vec3(XCurr, iFirstReactionIndex+1);
203 WorkVec.
Sub(4, dTmp1.Cross(
F));
205 WorkVec.
Add(10, dTmp2.Cross(
F));
209 WorkVec.
Add(13, (x1+dTmp1-x2-dTmp2)/dCoef);
217 "INDEX ERROR in SphericalHingeJoint::GetEqType");
230 Var_Phi = OH.CreateRotationVar(name,
"",
od,
"global");
326 for (
unsigned i = 0; i < ph->size(); i++) {
345 }
else if (dynamic_cast<Joint::ReactionsHint *>(pjh)) {
355 if (strncasecmp(s,
"offset{" ,
STRLENOF(
"offset{" )) == 0) {
358 if (strcmp(&s[1],
"}") != 0) {
379 DEBUGCOUT(
"Entering SphericalHingeJoint::InitialAssJac()" << std::endl);
393 integer iNode1FirstVelIndex = iNode1FirstPosIndex+6;
395 integer iNode2FirstVelIndex = iNode2FirstPosIndex+6;
397 integer iReactionPrimeIndex = iFirstReactionIndex+3;
400 for (
int iCnt = 1; iCnt <= 6; iCnt++) {
415 for (
int iCnt = 1; iCnt <= 3; iCnt++) {
420 WM.
PutCoef(6+iCnt, 27+iCnt, 1.);
423 WM.
PutCoef(12+iCnt, 24+iCnt, -1.);
426 WM.
PutCoef(18+iCnt, 27+iCnt, -1.);
429 WM.
PutCoef(24+iCnt, iCnt, -1.);
432 WM.
PutCoef(27+iCnt, 6+iCnt, -1.);
435 WM.
PutCoef(24+iCnt, 12+iCnt, 1.);
438 WM.
PutCoef(27+iCnt, 18+iCnt, 1.);
447 Vec3 FPrime(XCurr, iReactionPrimeIndex+1);
462 WM.
Add(4, 4, FWedged1Wedge);
466 WM.
Add(16, 16, FWedged2Wedge);
471 WM.
Add(10, 10, FWedged1Wedge);
472 WM.
Add(10, 25, O1Wedged1Wedge);
477 WM.
Add(22, 22, FWedged2Wedge);
478 WM.
Add(22, 25, O2Wedged2Wedge);
486 WM.
Add(28, 4, O1Wedged1Wedge);
488 WM.
Add(28, 16, O2Wedged2Wedge);
500 DEBUGCOUT(
"Entering SphericalHingeJoint::InitialAssRes()" << std::endl);
510 integer iNode1FirstVelIndex = iNode1FirstPosIndex+6;
512 integer iNode2FirstVelIndex = iNode2FirstPosIndex+6;
514 integer iReactionPrimeIndex = iFirstReactionIndex+3;
517 for (
int iCnt = 1; iCnt <= 6; iCnt++) {
518 WorkVec.
PutRowIndex(iCnt, iNode1FirstPosIndex+iCnt);
519 WorkVec.
PutRowIndex(6+iCnt, iNode1FirstVelIndex+iCnt);
520 WorkVec.
PutRowIndex(12+iCnt, iNode2FirstPosIndex+iCnt);
521 WorkVec.
PutRowIndex(18+iCnt, iNode2FirstVelIndex+iCnt);
522 WorkVec.
PutRowIndex(24+iCnt, iFirstReactionIndex+iCnt);
534 F =
Vec3(XCurr, iFirstReactionIndex+1);
535 Vec3 FPrime(XCurr, iReactionPrimeIndex+1);
542 Vec3 O1Wedged1(Omega1.Cross(d1Tmp));
543 Vec3 O2Wedged2(Omega2.Cross(d2Tmp));
547 WorkVec.
Add(4, F.Cross(d1Tmp));
550 WorkVec.
Sub(7, FPrime);
558 WorkVec.
Add(19, FPrime);
562 WorkVec.
Add(25, x1+d1Tmp-x2-d2Tmp);
565 WorkVec.
Add(28, v1+O1Wedged1-v2-O2Wedged2);
579 Joint(uL, pDO, fOut), pNode(pN), X0(X0Tmp), d(dTmp), F(
Zero3)
597 d.
Write(out,
", ") <<
", reference, global, ",
598 X0.
Write(out,
", ") <<
';' << std::endl;
611 DEBUGCOUT(
"Entering PinJoint::AssJac()" << std::endl);
644 for (
int iCnt = 1; iCnt <= 3; iCnt++) {
645 WM.
PutItem(iCnt, iFirstMomentumIndex+iCnt,
646 iFirstReactionIndex+iCnt, 1.);
648 WM.
PutCross(4, iFirstMomentumIndex+3,
649 iFirstReactionIndex, dTmp);
661 for (
int iCnt = 1; iCnt <= 3; iCnt++) {
662 WM.
PutItem(18+iCnt, iFirstReactionIndex+iCnt,
663 iFirstPositionIndex+iCnt, -1.);
665 WM.
PutCross(22, iFirstReactionIndex,
666 iFirstPositionIndex+3, dTmp);
678 DEBUGCOUT(
"Entering PinJoint::AssRes()" << std::endl);
690 for (
int iCnt = 1; iCnt <= 6; iCnt++) {
691 WorkVec.
PutRowIndex(iCnt, iFirstMomentumIndex+iCnt);
696 for(
int iCnt = 1; iCnt <= 3; iCnt++) {
697 WorkVec.
PutRowIndex(6+iCnt, iFirstReactionIndex+iCnt);
700 F =
Vec3(XCurr, iFirstReactionIndex+1);
712 WorkVec.
Add(7, (x+dTmp-
X0)/dCoef);
719 "INDEX ERROR in PinJoint::GetEqType");
738 DEBUGCOUT(
"Entering PinJoint::InitialAssJac()" << std::endl);
752 integer iFirstVelocityIndex = iFirstPositionIndex+6;
754 integer iReactionPrimeIndex = iFirstReactionIndex+3;
757 for (
int iCnt = 1; iCnt <= 6; iCnt++) {
767 for (
int iCnt = 1; iCnt <= 3; iCnt++) {
772 WM.
PutCoef(6+iCnt, 15+iCnt, 1.);
775 WM.
PutCoef(12+iCnt, iCnt, -1.);
778 WM.
PutCoef(15+iCnt, 6+iCnt, -1.);
785 Vec3 FPrime(XCurr, iReactionPrimeIndex+1);
797 WM.
Add(4, 4, FWedgedWedge);
802 WM.
Add(10, 10, FWedgedWedge);
803 WM.
Add(10, 13, OWedgedWedge);
810 WM.
Add(16, 4, OWedgedWedge);
822 DEBUGCOUT(
"Entering PinJoint::InitialAssRes()" << std::endl);
832 integer iFirstVelocityIndex = iFirstPositionIndex+6;
834 integer iReactionPrimeIndex = iFirstReactionIndex+3;
837 for (
int iCnt = 1; iCnt <= 6; iCnt++) {
838 WorkVec.
PutRowIndex(iCnt, iFirstPositionIndex+iCnt);
839 WorkVec.
PutRowIndex(6+iCnt, iFirstVelocityIndex+iCnt);
840 WorkVec.
PutRowIndex(12+iCnt, iFirstReactionIndex+iCnt);
848 F =
Vec3(XCurr, iFirstReactionIndex+1);
849 Vec3 FPrime(XCurr, iReactionPrimeIndex+1);
855 Vec3 OWedged(Omega.Cross(dTmp));
859 WorkVec.
Add(4, F.Cross(dTmp));
862 WorkVec.
Sub(7, FPrime);
866 WorkVec.
Add(13, x+dTmp-
X0);
869 WorkVec.
Add(16, v+OWedged);
virtual void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
void PutColIndex(integer iSubCol, integer iCol)
void PutMat3x3(integer iSubIt, integer iFirstRow, integer iFirstCol, const Mat3x3 &m)
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
#define ASSERTMSGBREAK(expr, msg)
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
virtual const Mat3x3 & GetRRef(void) const
virtual bool bToBeOutput(void) const
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
virtual void ResizeReset(integer)
const MatCross_Manip MatCross
bool UseNetCDF(int out) const
FullSubMatrixHandler & SetFull(void)
virtual const Mat3x3 & GetRCurr(void) const
const StructNode * pNode1
void Add(integer iRow, integer iCol, const Vec3 &v)
VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
std::ostream & Write(std::ostream &out, const FullMatrixHandler &m, const char *s, const char *s2)
VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
virtual void Sub(integer iRow, const Vec3 &v)
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
virtual void Output(OutputHandler &OH) const
virtual std::ostream & Restart(std::ostream &out) const
void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
void ResizeReset(integer iNewRow, integer iNewCol)
virtual unsigned int iGetNumDof(void) const
DofOrder::Order GetEqType(unsigned int i) const
virtual const Vec3 & GetWRef(void) const
void PutCross(integer iSubIt, integer iFirstRow, integer iFirstCol, const Vec3 &v)
std::vector< Hint * > Hints
Vec3 GetVec(unsigned short int i) const
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Vec3 VecRot(const Mat3x3 &Phi)
OrientationDescription od
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
const StructNode * pNode2
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Vec3 MatR2EulerAngles313(const Mat3x3 &R)
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
long GetCurrentStep(void) const
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
virtual std::ostream & Restart(std::ostream &out) const
Vec3 MatR2EulerAngles123(const Mat3x3 &R)
SphericalHingeJoint(unsigned int uL, const DofOwner *pDO, const StructNode *pN1, const StructNode *pN2, const Vec3 &dTmp1, const Mat3x3 &RTmp1h, const Vec3 &dTmp2, const Mat3x3 &RTmp2h, const OrientationDescription &od, flag fOut)
PinJoint(unsigned int uL, const DofOwner *pDO, const StructNode *pN, const Vec3 &X0Tmp, const Vec3 &dTmp, flag fOut)
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
virtual const Vec3 & GetWCurr(void) const
virtual std::ostream & Restart(std::ostream &out) const
std::ostream & Joints(void) const
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
#define ASSERT(expression)
virtual void OutputPrepare_int(const std::string &type, OutputHandler &OH, std::string &name)
Vec3 MatR2EulerAngles(const Mat3x3 &R)
virtual const Vec3 & GetXCurr(void) const
virtual void Add(integer iRow, const Vec3 &v)
virtual void ResizeReset(integer, integer)
virtual void Output(OutputHandler &OH) const
const MatCrossCross_Manip MatCrossCross
void PutRowIndex(integer iSubRow, integer iRow)
void PutDiag(integer iSubIt, integer iFirstRow, integer iFirstCol, const Vec3 &v)
const doublereal * pGetVec(void) const
Vec3 MatR2EulerAngles321(const Mat3x3 &R)
DofOrder::Order GetEqType(unsigned int i) const
~SphericalHingeJoint(void)
virtual const Vec3 & GetVCurr(void) const
void Sub(integer iRow, integer iCol, const Vec3 &v)
SparseSubMatrixHandler & SetSparse(void)
virtual integer iGetFirstIndex(void) const
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
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
unsigned int GetLabel(void) const
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
void OutputPrepare(OutputHandler &OH)
bool UseText(int out) const
virtual Hint * ParseHint(DataManager *pDM, const char *s) const
virtual unsigned int iGetNumDof(void) const