128 for (
unsigned int i = 0; i <
NUMNODES; i++) {
129 xTmp[i] = pNode[i]->GetXCurr() + pNode[i]->GetRCurr()*
f[i];
156 if (dynamic_cast<const ViscoElasticBeam2 *>(
this)) {
188 return p.
dGet(i - 12);
201 silent_cerr(
"Beam2(" <<
GetLabel() <<
"): "
202 "illegal private data " << i << std::endl);
213 pv1[1]*dN2[0] + pv2[1]*dN2[1],
214 pv1[2]*dN2[0] + pv2[2]*dN2[1]);
224 (pv1[1]*dN2P[0] + pv2[1]*dN2P[1])*dsdxi,
225 (pv1[2]*dN2P[0] + pv2[2]*dN2P[1])*dsdxi);
236 for (
unsigned int i = 0; i <
NUMNODES; i++) {
239 xTmp[i] = xNod[i] + RNod[i]*
f[i];
246 if (d > std::numeric_limits<doublereal>::epsilon()) {
249 silent_cerr(
"warning, Beam2(" <<
GetLabel() <<
") "
250 "has singular metric; aborting..." << std::endl);
269 for (
unsigned int i = 0; i <
NUMNODES; i++) {
301 return Restart_(out)<<
';' << std::endl;
308 for (
unsigned int i = 0; i <
NUMNODES; i++) {
309 out <<
", " <<
pNode[i]->
GetLabel() <<
", reference, node, ",
312 out <<
", reference, global,"
345 for (
unsigned int i = 0; i <
NUMNODES; i++) {
351 for (
unsigned int i = 0; i <
NUMNODES; i++) {
359 AzTmp[i] =
DRef*AzTmp[i];
371 for (
unsigned int i = 0; i <
NUMNODES; i++) {
373 WMA.
Sub(1, 6*i + 1, AzTmp[i].GetMat11());
374 WMA.
Sub(1, 6*i + 4, AzTmp[i].GetMat12());
376 WMA.
Sub(3 + 1, 6*i + 1,
380 WMA.
Sub(3 + 1, 6*i + 4,
386 WMA.
Add(6 + 1, 6*i + 1, AzTmp[i].GetMat11());
387 WMA.
Add(6 + 1, 6*i + 4, AzTmp[i].GetMat12());
389 WMA.
Add(9 + 1, 6*i + 1,
393 WMA.
Add(9 + 1, 6*i + 4,
401 WMA.
Sub(3 + 1, 1, FTmp);
402 WMA.
Add(9 + 1, 6 + 1, FTmp);
432 for (
unsigned int i = 0; i <
NUMNODES; i++) {
502 for (
int iCnt = 1; iCnt <= 6; iCnt++) {
505 WM.
PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
506 WM.
PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
530 for (
unsigned int iCnt = 1; iCnt <= 6; iCnt++) {
531 WorkVec.
PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
532 WorkVec.
PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
576 for (
unsigned int i = 0; i <
NUMNODES; i++) {
632 const char *type = 0;
639 type =
"viscoelastic";
643 type =
"piezoelectric elastic";
647 type =
"piezoelectric viscoelastic";
655 std::ostringstream os;
658 (void)OH.CreateVar(os.str(), type);
661 std::string name(os.str());
666 Var_X = OH.CreateVar<
Vec3>(name +
"X",
"m",
667 "evaluation point global position vector (X, Y, Z)");
671 Var_Phi = OH.CreateRotationVar(name,
"",
od,
672 " evaluation point global orientation matrix");
676 Var_F = OH.CreateVar<
Vec3>(name +
"F",
"N",
677 "evaluation point internal force in local frame (F_X, F_Y, F_Z)");
681 Var_M = OH.CreateVar<
Vec3>(name +
"M",
"Nm",
682 "evaluation point internal force in local frame (M_X, M_Y, M_Z)");
686 Var_Nu = OH.CreateVar<
Vec3>(name +
"nu",
"-",
687 "evaluation point linear strain in local frame (nu_X, nu_Y, nu_Z)");
691 Var_K = OH.CreateVar<
Vec3>(name +
"k",
"1/m",
692 "evaluation point angular strain in local frame (K_X, K_Y, K_Z)");
696 Var_NuP = OH.CreateVar<
Vec3>(name +
"nuP",
"1/s",
697 "evaluation point linear strain rate in local frame (nuP_X, nuP_Y, nuP_Z)");
701 Var_KP = OH.CreateVar<
Vec3>(name +
"kP",
"1/ms",
702 "evaluation point angular strain rate in local frame (KP_X, KP_Y, KP_Z)");
816 for (
int iCnt = 1; iCnt <= 6; iCnt++) {
819 WM.
PutRowIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
820 WM.
PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
841 for (
int iCnt = 1; iCnt <= 6; iCnt++) {
842 WorkVec.
PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
843 WorkVec.
PutRowIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
880 DEBUGCOUT(
"Entering Beam2::[InverseDynamics]AssJac()" << std::endl);
888 return AssJac(WorkMat, 1., XCurr, XCurr);
901 DEBUGCOUT(
"Entering Beam2::[InverseDynamics]AssRes()" << std::endl);
912 const_cast<VectorHandler&>(XPrimeCurr));
919 return AssRes(WorkVec, 1., XCurr, XPrimeCurr);
957 Beam2(uL, pN1, pN2, F1, F2, R1, R2, r, pd, ood, fOut)
998 for (
unsigned int i = 0; i <
NUMNODES; i++) {
1005 for (
unsigned int i = 0; i <
NUMNODES; i++) {
1012 AzTmp[i] =
DRef*AzTmp[i]*dCoef;
1021 AzPrimeTmp[i] =
ERef*AzPrimeTmp[i];
1033 for (
unsigned int i = 0; i <
NUMNODES; i++) {
1035 WMA.
Sub(1, 6*i + 1, AzTmp[i].GetMat11());
1036 WMA.
Sub(1, 6*i + 4, AzTmp[i].GetMat12());
1048 WMA.
Add(7, 6*i + 1, AzTmp[i].GetMat11());
1049 WMA.
Add(7, 6*i + 4, AzTmp[i].GetMat12());
1051 WMA.
Add(10, 6*i + 1,
1055 WMA.
Add(10, 6*i + 4,
1061 WMB.
Sub(1, 6*i + 1, AzPrimeTmp[i].GetMat11());
1062 WMB.
Sub(1, 6*i + 4, AzPrimeTmp[i].GetMat12());
1065 AzPrimeTmp[i].GetMat21()
1066 + bTmp[
NODE1].
Cross(AzPrimeTmp[i].GetMat11()));
1068 AzPrimeTmp[i].GetMat22()
1069 + bTmp[
NODE1].
Cross(AzPrimeTmp[i].GetMat12()));
1072 WMB.
Add(7, 6*i + 1, AzPrimeTmp[i].GetMat11());
1073 WMB.
Add(7, 6*i + 4, AzPrimeTmp[i].GetMat12());
1075 WMB.
Add(10, 6*i + 1,
1076 AzPrimeTmp[i].GetMat21()
1077 + bTmp[
NODE2].
Cross(AzPrimeTmp[i].GetMat11()));
1078 WMB.
Add(10, 6*i + 4,
1079 AzPrimeTmp[i].GetMat22()
1080 + bTmp[
NODE2].
Cross(AzPrimeTmp[i].GetMat12()));
1085 WMA.
Sub(4, 1, FTmp);
1086 WMA.
Add(10, 7, FTmp);
1119 for (
unsigned int i = 0; i <
NUMNODES; i++) {
1160 gPrimeGrad =
InterpDeriv(gPrimeNod[NODE1], gPrimeNod[NODE2]);
1236 for (
unsigned int i = 0; i <
NUMNODES; i++) {
1272 gPrimeGrad =
InterpDeriv(gPrimeNod[NODE1], gPrimeNod[NODE2]);
1348 << f1 << std::endl <<
"(global frame): "
1354 Mat3x3 R2(pNode2->GetRCurr());
1366 << f2 << std::endl <<
"(global frame): "
1367 << pNode2->GetXCurr() + pNode2->GetRCurr()*f2 << std::endl);
1384 <<
": Beam2(" << uLabel <<
") does not support "
1385 "dynamic constitutive laws yet"
1399 Mat3x3 D11(MTmp.GetMat11());
1400 Mat3x3 D12(MTmp.GetMat12());
1401 Mat3x3 D21(MTmp.GetMat21());
1402 Mat3x3 D22(MTmp.GetMat22());
1405 "First point matrix D11: " << std::endl << D11 << std::endl
1406 <<
"First point matrix D12: " << std::endl << D12 << std::endl
1407 <<
"First point matrix D21: " << std::endl << D21 << std::endl
1408 <<
"First point matrix D22: " << std::endl << D22 << std::endl);
1415 if (HP.
IsKeyWord(
"piezoelectric" "actuator")) {
1418 "Piezoelectric actuator beam is expected"
1423 "piezo actuator " << uLabel
1424 <<
" has " << iNumElec
1425 <<
" electrodes" << std::endl);
1426 if (iNumElec <= 0) {
1427 silent_cerr(
"Beam2(" << uLabel <<
"): "
1428 "illegal number of electric nodes "
1437 for (
integer i = 0; i < iNumElec; i++) {
1441 PiezoMat[0].
Resize(iNumElec);
1442 PiezoMat[1].
Resize(iNumElec);
1445 HP.
GetMat6xN(PiezoMat[0], PiezoMat[1], iNumElec);
1449 << PiezoMat[0][0] << PiezoMat[1][0]);
1470 out <<
"beam2: " << uLabel
1472 <<
" ", f1.Write(out,
" ")
1473 <<
" " << pNode2->GetLabel()
1474 <<
" ", f2.Write(out,
" ")
1502 PiezoMat[0], PiezoMat[1],
1530 PiezoMat[0], PiezoMat[1],
1537 bool bIsErgonomy(
false);
1538 bool bIsRightHandSide(
true);
1540 if (HP.
IsKeyWord(
"inverse" "dynamics")) {
1542 silent_cerr(
"Beam2(" << uLabel <<
"): \"torque\" meaningless in this context "
1547 if (HP.
IsKeyWord(
"prescribed" "motion")) {
1548 silent_cerr(
"Beam2(" << uLabel <<
"): \"prescribed motion\" meaningless in this context "
1553 if (HP.
IsKeyWord(
"right" "hand" "side")) {
1562 silent_cerr(
"Beam2(" << uLabel <<
"): invalid constitutive law type (must be ELASTIC)" << std::endl);
1566 if (bIsRightHandSide) {
1567 silent_cerr(
"warning, Beam2(" << uLabel <<
") is both \"ergonomy\" and \"right hand side\"" << std::endl);
1576 if (bIsRightHandSide) {
1587 silent_cerr(
"semicolon expected at line "
ViscoElasticBeam2(unsigned int uL, const StructNode *pN1, const StructNode *pN2, const Vec3 &F1, const Vec3 &F2, const Mat3x3 &R1, const Mat3x3 &R2, const Mat3x3 &r, const ConstitutiveLaw6D *pd, OrientationDescription ood, flag fOut)
flag fReadOutput(MBDynParser &HP, const T &t) const
const MatGm1_Manip MatGm1
virtual unsigned int iGetPrivDataIdx(const char *s) const
virtual bool bInverseDynamics(void) const
Mat3x3 GetRotRel(const ReferenceFrame &rf)
Mat3x3 MultRMRt(const Mat3x3 &m, const Mat3x3 &R)
void Update(const VectorHandler &XCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
void PutColIndex(integer iSubCol, integer iCol)
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Vec3 MultRV(const Vec3 &v, const Mat3x3 &R)
virtual const Mat3x3 & GetRRef(void) const
virtual bool bToBeOutput(void) const
ConstitutiveLaw< T, Tder > * pGetConstLaw(void) const
#define MBDYN_EXCEPT_ARGS
virtual doublereal dGetPrivData(unsigned int i) const
#define DEBUGCOUTFNAME(fname)
virtual void ResizeReset(integer)
virtual integer GetInt(integer iDefval=0)
const Vec3 & GetVec2(void) const
const MatCross_Manip MatCross
bool UseNetCDF(int out) const
virtual const Vec3 & GetgCurr(void) const
FullSubMatrixHandler & SetFull(void)
virtual const Mat3x3 & GetRCurr(void) const
Mat3x3 GetRotAbs(const ReferenceFrame &rf)
virtual Node::Type GetNodeType(void) const
void SetValue(DataManager *pDM, VectorHandler &, VectorHandler &, SimulationEntity::Hints *ph=0)
doublereal Dot(const Vec3 &v) const
bool bIsErgonomy(void) const
void Add(integer iRow, integer iCol, const Vec3 &v)
ConstitutiveLawOwner< Vec6, Mat6x6 > ConstitutiveLaw6DOwner
std::ostream & Write(std::ostream &out, const FullMatrixHandler &m, const char *s, const char *s2)
virtual void GetMat6xN(Mat3xN &m1, Mat3xN &m2, integer iNumCols)
const StructNode * pNode[NUMNODES]
virtual const Tder & GetFDE(void) const
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
virtual void Sub(integer iRow, const Vec3 &v)
const Tder & GetFDE(void) const
const Mat3x3 Eye3(1., 0., 0., 0., 1., 0., 0., 0., 1.)
virtual const Vec3 & GetWRef(void) const
Mat3x3 mb_deye< Mat3x3 >(const doublereal d)
std::vector< Hint * > Hints
OrientationDescription od
void SetInverseDynamicsFlags(unsigned uIDF)
static const unsigned int iNumPrivData
Vec3 GetVec(unsigned short int i) const
Vec3 VecRot(const Mat3x3 &Phi)
virtual bool GetYesNoOrBool(bool bDefval=false)
virtual Beam::Type GetBeamType(void) const
Vec3 MulTV(const Vec3 &v) const
virtual Vec3 InterpState(const Vec3 &v1, const Vec3 &v2)
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
const Mat3x3 Zero3x3(0., 0., 0., 0., 0., 0., 0., 0., 0.)
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
virtual bool bInverseDynamics(void) const
const ReferenceFrame AbsRefFrame(0, Vec3(0., 0., 0), Mat3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), Vec3(0., 0., 0), Vec3(0., 0., 0), EULER_123)
const Vec3 & GetVec1(void) const
ConstitutiveLaw6DOwner * pD
Vec3 MatR2EulerAngles313(const Mat3x3 &R)
Elem * ReadBeam2(DataManager *pDM, MBDynParser &HP, unsigned int uLabel)
void SubMat12(const Mat3x3 &x)
Vec3 GetPosRel(const ReferenceFrame &rf)
virtual ConstLawType::Type GetConstLawType(void) const =0
void SubMat22(const Mat3x3 &x)
virtual bool IsKeyWord(const char *sKeyWord)
const Vec6 Zero6(0., 0., 0., 0., 0., 0.)
long GetCurrentStep(void) const
const doublereal & dGet(unsigned short int iRow) const
virtual void AssStiffnessMat(FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
virtual doublereal dGetPrivData(unsigned int i) const
Vec3 MatR2EulerAngles123(const Mat3x3 &R)
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
virtual void AfterPredict(VectorHandler &, VectorHandler &)
virtual void Omega0(void)
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
virtual const Vec3 & GetWCurr(void) const
virtual const StructNode * pGetNode(unsigned int i) const
bool IsOpen(int out) const
void AfterConvergence(const T &Eps, const T &EpsPrime=mb_zero< T >())
#define ASSERT(expression)
virtual unsigned int iGetNumPrivData(void) const
ConstitutiveLaw6D * GetConstLaw6D(ConstLawType::Type &clt)
static unsigned int iGetPrivDataIdx_int(const char *s, ConstLawType::Type type)
void SetValue(DataManager *pDM, VectorHandler &, VectorHandler &, SimulationEntity::Hints *ph=0)
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Mat3x3 MulTM(const Mat3x3 &m) const
VectorExpression< VectorCrossExpr< VectorLhsExpr, VectorRhsExpr >, 3 > Cross(const VectorExpression< VectorLhsExpr, 3 > &u, const VectorExpression< VectorRhsExpr, 3 > &v)
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
virtual const Vec3 & GetXCurr(void) const
virtual void Add(integer iRow, const Vec3 &v)
virtual void AssStiffnessMat(FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
virtual void ResizeReset(integer, integer)
void ReadOptionalBeamCustomOutput(DataManager *pDM, MBDynParser &HP, unsigned int uLabel, Beam::Type BT, unsigned &uFlags, OrientationDescription &od)
virtual unsigned int iGetNumDof(void) const
const MatCrossCross_Manip MatCrossCross
virtual void AssStiffnessVec(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
const doublereal * pGetMat(void) const
std::ostream & Beams(void) const
void PutRowIndex(integer iSubRow, integer iRow)
const T & GetF(void) const
const doublereal * pGetVec(void) const
virtual const Vec3 & GetgRef(void) const
std::ostream & GetLogFile(void) const
virtual flag fToBeOutput(void) const
Vec3 MatR2EulerAngles321(const Mat3x3 &R)
virtual const Vec3 & GetgPCurr(void) const
virtual std::ostream & Restart(std::ostream &out) const
virtual void AssStiffnessVec(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
virtual Vec3 InterpDeriv(const Vec3 &v1, const Vec3 &v2)
virtual const Vec3 & GetVCurr(void) const
virtual void AddInternalForces(Vec6 &)
void Sub(integer iRow, integer iCol, const Vec3 &v)
#define SAFENEWARR(pnt, item, sz)
virtual void Output(OutputHandler &OH) const
virtual const Vec3 & GetgPRef(void) const
virtual void AfterPredict(VectorHandler &, VectorHandler &)
const Tder & GetFDEPrime(void) const
virtual HighParser::ErrOut GetLineData(void) const
void Update(const T &Eps, const T &EpsPrime=mb_zero< T >())
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
unsigned int GetLabel(void) const
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Node * ReadNode(MBDynParser &HP, Node::Type type) const
const doublereal & dGet(unsigned short int i) const
#define DEBUGLCOUT(level, msg)
Beam2(unsigned int uL, const StructNode *pN1, const StructNode *pN2, const Vec3 &F1, const Vec3 &F2, const Mat3x3 &R1, const Mat3x3 &R2, const Mat3x3 &r, const ConstitutiveLaw6D *pd, OrientationDescription ood, flag fOut)
virtual std::ostream & Restart_(std::ostream &out) const
bool UseText(int out) const
bool bIsInverseDynamics(void) const
virtual void OutputPrepare(OutputHandler &OH)