143 unsigned int idx = 0;
216 silent_cerr(
"HBeam(" <<
GetLabel() <<
"): "
217 "not allowed to return shear strain" << std::endl);
222 silent_cerr(
"HBeam(" <<
GetLabel() <<
"): "
223 "not allowed to return shear force" << std::endl);
227 silent_cerr(
"HBeam(" <<
GetLabel() <<
"): "
228 "illegal private data " << i << std::endl);
240 for (
unsigned int i = 0; i <
NUMNODES; i++) {
255 if (d > std::numeric_limits<doublereal>::epsilon()) {
258 silent_cerr(
"HBeam(" <<
GetLabel() <<
") "
259 "has singular metric; aborting..." << std::endl);
291 for (
unsigned int i = 0; i <
NUMNODES; i++) {
314 for (
unsigned int i = 0; i <
NUMNODES; i++) {
327 return Restart_(out)<<
';' << std::endl;
334 for (
unsigned int i = 0; i <
NUMNODES; i++) {
335 out <<
", " <<
pNode[i]->
GetLabel() <<
", reference, node, ",
338 out <<
", reference, global,"
371 for (
unsigned int i = 0; i <
NUMNODES; i++) {
388 for (
unsigned int i = 0; i <
NUMNODES; i++) {
396 AzTmp[i] =
DRef*AzTmp[i];
408 for (
unsigned int i = 0; i <
NUMNODES; i++) {
410 WMA.
Sub(1, 6*i + 1, AzTmp[i].GetMat11());
418 + bTmp[0].
Cross(AzTmp[i].GetMat11()));
421 + bTmp[0].
Cross(AzTmp[i].GetMat12()));
424 WMA.
Add(7, 6*i + 1, AzTmp[i].GetMat11());
432 + bTmp[1].
Cross(AzTmp[i].GetMat11()));
435 + bTmp[1].
Cross(AzTmp[i].GetMat12()));
441 WMA.
Add(10, 7, FTmp);
463 for (
unsigned int i = 0; i <
NUMNODES; i++) {
514 for (
int iCnt = 1; iCnt <= 6; iCnt++) {
517 WM.
PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
518 WM.
PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
542 for (
unsigned int iCnt = 1; iCnt <= 6; iCnt++) {
543 WorkVec.
PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
544 WorkVec.
PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
588 for (
unsigned int i = 0; i <
NUMNODES; i++) {
602 g = InterpState(gNod[NODE1], gNod[NODE2]);
607 L =
LRef = InterpDeriv(xTmp[NODE1], xTmp[NODE2]);
610 gGrad = InterpDeriv(gNod[NODE1], gNod[NODE2]);
613 Mat3x3 RTmp(R.Transpose());
668 for (
int iCnt = 1; iCnt <= 6; iCnt++) {
693 for (
int iCnt = 1; iCnt <= 6; iCnt++) {
694 WorkVec.
PutRowIndex(iCnt, iNode1FirstPosIndex+iCnt);
695 WorkVec.
PutRowIndex(6+iCnt, iNode2FirstPosIndex+iCnt);
720 #ifdef VISCOELASTIC_BEAM
724 ViscoElasticHBeam::ViscoElasticHBeam(
unsigned int uL,
733 HBeam(uL, pN1, pN2, F1, F2, r, pd, fOut)
735 LPrimeRef = LPrime =
Zero3;
738 DefPrimeLoc = DefPrimeLocRef =
Zero6;
762 for (
unsigned int i = 0; i <
NUMNODES; i++) {
763 fTmp[i] = pNode[i]->GetRCurr()*f[i];
769 for (
unsigned int i = 0; i <
NUMNODES; i++) {
776 AzTmp[i] = DRef*AzTmp[i]*dCoef;
784 *(
dN2P[i]*dsdxi*dCoef))),
787 AzPrimeTmp[i] = ERef*AzPrimeTmp[i];
796 bTmp[0] = p-pNode[
NODE1]->GetXCurr();
797 bTmp[1] = p-pNode[
NODE2]->GetXCurr();
799 for (
unsigned int i = 0; i <
NUMNODES; i++) {
801 WMA.
Sub(1, 6*i+1, AzTmp[i].GetMat11());
802 WMA.
Sub(1, 6*i+4, AzTmp[i].GetMat12());
815 WMA.
Add(7, 6*i+1, AzTmp[i].GetMat11());
816 WMA.
Add(7, 6*i+4, AzTmp[i].GetMat12());
829 WMB.
Sub(1, 6*i+1, AzPrimeTmp[i].GetMat11());
830 WMB.
Sub(1, 6*i+4, AzPrimeTmp[i].GetMat12());
833 AzPrimeTmp[i].GetMat21()
834 +
Mat3x3(bTmp[0])*AzPrimeTmp[i].GetMat11());
836 AzPrimeTmp[i].GetMat22()
837 +
Mat3x3(bTmp[0])*AzPrimeTmp[i].GetMat12());
840 WMB.
Add(7, 6*i+1, AzPrimeTmp[i].GetMat11());
841 WMB.
Add(7, 6*i+4, AzPrimeTmp[i].GetMat12());
844 AzPrimeTmp[i].GetMat21()
845 +
Mat3x3(bTmp[1])*AzPrimeTmp[i].GetMat11());
847 AzPrimeTmp[i].GetMat22()
848 +
Mat3x3(bTmp[1])*AzPrimeTmp[i].GetMat12());
852 WMA.
Add(4, 1,
Mat3x3(AzRef.GetVec1()*(-dCoef)));
853 WMA.
Add(10, 7,
Mat3x3(AzRef.GetVec1()*dCoef));
879 for (
unsigned int i = 0; i <
NUMNODES; i++) {
880 xNod[i] = pNode[i]->GetXCurr();
893 for (
unsigned int i = 0; i <
NUMNODES; i++) {
894 gNod[i] = pNode[i]->GetgCurr();
895 Vec3 fTmp = pNode[i]->GetRCurr()*f[i];
896 xTmp[i] = xNod[i]+fTmp;
897 gPrimeNod[i] = pNode[i]->GetgPCurr();
898 xPrimeTmp[i] = pNode[i]->GetVCurr()
899 +pNode[i]->GetWCurr().
Cross(fTmp);
919 gPrime = InterpState(gPrimeNod[
NODE1], gPrimeNod[
NODE2]);
920 Omega =
Mat3x3(
MatG, g)*gPrime+RDelta*OmegaRef;
926 LPrime = InterpDeriv(xPrimeTmp[
NODE1], xPrimeTmp[
NODE2]);
929 gGrad = InterpDeriv(gNod[
NODE1], gNod[
NODE2]);
934 gPrimeGrad = InterpDeriv(gPrimeNod[
NODE1], gPrimeNod[
NODE2]);
944 +DefLocRef.GetVec2());
950 DefPrimeLoc =
Vec6(RTmp*(LPrime+L.Cross(Omega)),
953 +DefPrimeLocRef.GetVec2());
956 pD->Update(DefLoc, DefPrimeLoc);
960 AddInternalForces(AzLoc);
966 WorkVec.
Add(1, Az.GetVec1());
967 WorkVec.
Add(4, (p-xNod[
NODE1]).
Cross(Az.GetVec1())+Az.GetVec2());
968 WorkVec.
Sub(7, Az.GetVec1());
969 WorkVec.
Sub(10, Az.GetVec2()+(p-xNod[
NODE2]).
Cross(Az.GetVec1()));
982 (
Vec3&)OmegaRef = Omega;
983 (
Vec3&)LPrimeRef = LPrime;
984 (
Vec6&)DefPrimeLocRef = DefPrimeLoc;
992 ASSERT(bFirstRes ==
true);
1013 for (
unsigned int i = 0; i <
NUMNODES; i++) {
1014 gNod[i] = pNode[i]->GetgRef();
1015 Vec3 fTmp = pNode[i]->GetRRef()*f[i];
1016 xTmp[i] = pNode[i]->GetXCurr()+fTmp;
1017 gPrimeNod[i] = pNode[i]->GetgPRef();
1018 xPrimeTmp[i] = pNode[i]->GetVCurr()
1019 +pNode[i]->GetWRef().
Cross(fTmp);
1028 p = InterpState(xTmp[NODE1], xTmp[
NODE2]);
1031 g = InterpState(gNod[NODE1], gNod[
NODE2]);
1033 R = RRef = RDelta*
R;
1036 gPrime = InterpState(gPrimeNod[NODE1], gPrimeNod[
NODE2]);
1040 L = LRef = InterpDeriv(xTmp[NODE1], xTmp[
NODE2]);
1043 LPrime = LPrimeRef = InterpDeriv(xPrimeTmp[NODE1], xPrimeTmp[
NODE2]);
1046 gGrad = InterpDeriv(gNod[NODE1], gNod[
NODE2]);
1049 gPrimeGrad = InterpDeriv(gPrimeNod[NODE1], gPrimeNod[
NODE2]);
1052 Mat3x3 RTmp(R.Transpose());
1057 DefLoc = DefLocRef =
Vec6(RTmp*L-L0,
1058 RTmp*(
Mat3x3(
MatG, g)*gGrad)+DefLoc.GetVec2());
1064 DefPrimeLoc = DefPrimeLocRef =
Vec6(RTmp*(LPrime+L.Cross(Omega)),
1069 pD->Update(DefLoc, DefPrimeLoc);
1073 AddInternalForces(AzLoc);
1076 Az = AzRef =
MultRV(AzLoc, R);
1095 const char* sKeyWords[] = {
1127 << f1 << std::endl <<
"(global frame): "
1145 << f2 << std::endl <<
"(global frame): "
1146 << pNode2->GetXCurr()+pNode2->GetRCurr()*R2*f2 << std::endl);
1154 <<
": HBeam(" << uLabel <<
") does not support "
1155 "dynamic constitutive laws yet"
1162 Mat3x3 D11(MTmp.GetMat11());
1163 Mat3x3 D12(MTmp.GetMat12());
1164 Mat3x3 D21(MTmp.GetMat21());
1165 Mat3x3 D22(MTmp.GetMat22());
1168 "First point matrix D11: " << std::endl << D11 << std::endl
1169 <<
"First point matrix D12: " << std::endl << D12 << std::endl
1170 <<
"First point matrix D21: " << std::endl << D21 << std::endl
1171 <<
"First point matrix D22: " << std::endl << D22 << std::endl);
1179 if (HP.
IsKeyWord(
"piezoelectricactuator")) {
1182 "Piezoelectric actuator beam is expected"
1187 "piezo actuator " << uLabel
1188 <<
" has " << iNumElec
1189 <<
" electrodes" << std::endl);
1190 if (iNumElec <= 0) {
1191 silent_cerr(
"HBeam(" << uLabel <<
"): "
1192 "illegal number of electric nodes "
1201 for (
integer i = 0; i < iNumElec; i++) {
1205 PiezoMat[0].
Resize(iNumElec);
1206 PiezoMat[1].
Resize(iNumElec);
1209 HP.
GetMat6xN(PiezoMat[0], PiezoMat[1], iNumElec);
1213 << PiezoMat[0][0] << PiezoMat[1][0]);
1238 PiezoActuatorHBeam(uLabel,
1245 PiezoMat[0], PiezoMat[1],
1251 #ifdef VISCOELASTIC_BEAM
1257 ViscoElasticHBeam(uLabel,
1266 PiezoActuatorVEHBeam,
1267 PiezoActuatorVEHBeam(uLabel,
1274 PiezoMat[0], PiezoMat[1],
1280 silent_cerr(
"Sorry, the ViscoElasticHBeam element"
1281 " is not available yet" << std::endl);
1288 silent_cerr(
"semicolon expected at line "
flag fReadOutput(MBDynParser &HP, const T &t) const
const MatGm1_Manip MatGm1
Mat3x3 GetRotRel(const ReferenceFrame &rf)
void ComputeInterpolation(const Vec3 *const node_pos, const Mat3x3 *const node_or, const Vec3 *const node_f, const doublereal xi, const doublereal dexi_des, Vec3 &pos, Mat3x3 &orient, Vec3 &F, Vec3 &om)
Mat3x3 MultRMRt(const Mat3x3 &m, const Mat3x3 &R)
void PutColIndex(integer iSubCol, integer iCol)
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
HBeam(unsigned int uL, const StructNode *pN1, const StructNode *pN2, const Vec3 &F1, const Vec3 &F2, const Mat3x3 &R1, const Mat3x3 &R2, const ConstitutiveLaw6D *pd, flag fOut)
Vec3 MultRV(const Vec3 &v, const Mat3x3 &R)
virtual const Mat3x3 & GetRRef(void) const
virtual bool bToBeOutput(void) const
MatrixExpression< TransposedMatrix< MatrixDirectExpr< Matrix< T, N_rows, N_cols > > >, N_cols, N_rows > Transpose(const Matrix< T, N_rows, N_cols > &A)
virtual unsigned int iGetPrivDataIdx(const char *s) const
ConstitutiveLaw< T, Tder > * pGetConstLaw(void) const
#define MBDYN_EXCEPT_ARGS
#define DEBUGCOUTFNAME(fname)
virtual void ResizeReset(integer)
virtual integer GetInt(integer iDefval=0)
const Vec3 & GetVec2(void) const
const MatCross_Manip MatCross
FullSubMatrixHandler & SetFull(void)
virtual const Mat3x3 & GetRCurr(void) const
virtual Node::Type GetNodeType(void) const
doublereal Dot(const Vec3 &v) 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)
virtual const Tder & GetFDE(void) const
virtual void Sub(integer iRow, const Vec3 &v)
const Tder & GetFDE(void) const
virtual doublereal dGetPrivData(unsigned int i) const
std::vector< Hint * > Hints
virtual std::ostream & Restart(std::ostream &out) const
Vec3 GetVec(unsigned short int i) const
virtual unsigned int iGetNumPrivData(void) const
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
virtual void Omega0(void)
const Mat3x3 Zero3x3(0., 0., 0., 0., 0., 0., 0., 0., 0.)
virtual void AssStiffnessVec(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Vec3 MatR2gparam(const Mat3x3 &m)
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
const Vec3 & GetVec1(void) const
void SubMat12(const Mat3x3 &x)
Vec3 GetPosRel(const ReferenceFrame &rf)
void SubMat22(const Mat3x3 &x)
virtual void AfterPredict(VectorHandler &, VectorHandler &)
virtual bool IsKeyWord(const char *sKeyWord)
const Vec6 Zero6(0., 0., 0., 0., 0., 0.)
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
virtual const Vec3 & GetWCurr(void) const
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
virtual void Output(OutputHandler &OH) const
void AfterConvergence(const T &Eps, const T &EpsPrime=mb_zero< T >())
#define ASSERT(expression)
ConstitutiveLaw6DOwner * pD
ConstitutiveLaw6D * GetConstLaw6D(ConstLawType::Type &clt)
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
virtual void AddInternalForces(Vec6 &)
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 ResizeReset(integer, integer)
virtual void AssStiffnessMat(FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Mat3x3 Transpose(void) const
virtual unsigned int iGetNumDof(void) const
std::ostream & Beams(void) const
void PutRowIndex(integer iSubRow, integer iRow)
const T & GetF(void) const
virtual const Vec3 & GetgRef(void) const
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Elem * ReadHBeam(DataManager *pDM, MBDynParser &HP, unsigned int uLabel)
void Sub(integer iRow, integer iCol, const Vec3 &v)
#define SAFENEWARR(pnt, item, sz)
virtual HighParser::ErrOut GetLineData(void) const
void Update(const T &Eps, const T &EpsPrime=mb_zero< T >())
void SetValue(DataManager *pDM, VectorHandler &, VectorHandler &, SimulationEntity::Hints *ph=0)
virtual std::ostream & Restart_(std::ostream &out) const
unsigned int GetLabel(void) const
const StructNode * pNode[NUMNODES]
Node * ReadNode(MBDynParser &HP, Node::Type type) const
const doublereal & dGet(unsigned short int i) const
#define DEBUGLCOUT(level, msg)
void ComputeFullInterpolation(const Vec3 *const node_pos, const Mat3x3 *const node_or, const Vec3 *const node_f, const doublereal xi, const doublereal dexi_des, Vec3 &pos, Mat3x3 &orient, Mat3x3 *const or_delta_w_or, Mat3x3 *const delta_pos_w_or, Mat3x3 *const delta_pos_w_pos, Vec3 &F, Vec3 &om, Mat3x3 *const delta_om_ws_or, Mat3x3 *const delta_F_ws_or, Mat3x3 *const delta_F_ws_pos)
virtual const StructNode * pGetNode(unsigned int i) const