105 std::ostream&
Restart(std::ostream& out)
const;
123 unsigned uLabel,
const DofOwner *pDO,
138 "Module: loadinc - load increment normalization\n"
139 "Author: Pierangelo Masarati <masarati@aero.polimi.it>\n"
140 "Organization: Dipartimento di Ingegneria Aerospaziale\n"
141 " Politecnico di Milano\n"
142 " http://www.aero.polimi.it/\n"
144 " All rights reserved\n"
148 "user defined : <label> , load increment normalization ,\n"
149 " [ max load , <max_load> , ] # bails out when p >= max_load\n"
150 " [ compliance , <compliance> , ] # compliance*p = length\n"
151 " [ reference length, <ref_length> , ] # multiplies DeltaTheta\n"
152 " (DriveCaller) <DeltaS> ; # arc length increment\n"
171 silent_cerr(
"LoadIncNorm(" << uLabel <<
"): invalid \"max load\" at line " << HP.
GetLineData() << std::endl);
178 if (
m_dCompliance <= std::numeric_limits<doublereal>::epsilon()) {
179 silent_cerr(
"LoadIncNorm(" << uLabel <<
"): invalid \"compliance\" at line " << HP.
GetLineData() << std::endl);
184 if (HP.
IsKeyWord(
"reference" "length")) {
187 silent_cerr(
"LoadIncNorm(" << uLabel <<
"): invalid \"reference length\" at line " << HP.
GetLineData() << std::endl);
205 DataManager::NodeContainerType::const_iterator i;
207 const StructDispNode *pDNode(dynamic_cast<const StructDispNode *>(i->second));
209 const StructNode *pNode(dynamic_cast<const StructNode *>(pDNode));
219 const StructDispNode *pDNode(dynamic_cast<const StructDispNode *>(i->second));
221 const StructNode *pNode(dynamic_cast<const StructNode *>(pDNode));
237 silent_cerr(
"LoadIncNorm(" << uLabel <<
"): DeltaS must be positive" << std::endl);
325 if (std::abs(d) <= 10.*std::numeric_limits<doublereal>::epsilon()) {
337 for (std::vector<NodeData>::const_iterator i =
m_Nodes.begin(); i !=
m_Nodes.end(); ++i) {
338 integer iFirstPositionIndex = i->pNode->iGetFirstIndex();
340 for (
integer iCnt = 1; iCnt <= 3; iCnt++) {
341 WM.
PutColIndex(iNodeOffset + iCnt, iFirstPositionIndex + iCnt);
342 WM.
PutCoef(1, iNodeOffset + iCnt, dCoefX*i->DX(iCnt));
345 if (m_dRefLen > 0.) {
346 const StructNode *pNode(dynamic_cast<const StructNode *>(i->pNode));
352 for (
integer iCnt = 1; iCnt <= 3; iCnt++) {
353 WM.
PutColIndex(iNodeOffset + 3 + iCnt, iFirstPositionIndex + 3 + iCnt);
354 WM.
PutCoef(1, iNodeOffset + 3 + iCnt, dCoefTheta*VTmp(iCnt));
383 m_dP = XCurr(iIndex);
390 silent_cerr(
"LoadIncNorm(" <<
uLabel <<
")::AssRes(): DeltaS must be positive" << std::endl);
406 for (std::vector<NodeData>::iterator i =
m_Nodes.begin(); i !=
m_Nodes.end(); ++i) {
407 i->DX = i->pNode->GetXCurr() - i->pNode->GetXPrev();
411 const StructNode *pNode(dynamic_cast<const StructNode *>(i->pNode));
439 if (strcmp(s,
"p") == 0) {
443 if (strcmp(s,
"S") == 0) {
447 if (strcmp(s,
"DeltaS") == 0) {
481 connectedNodes.resize(
m_Nodes.size());
483 for (
unsigned uCnt = 0; uCnt <
m_Nodes.size(); uCnt++) {
484 connectedNodes[uCnt] =
m_Nodes[uCnt].pNode;
521 return out <<
"# LoadIncNorm: not implemented" << std::endl;
608 std::ostream&
Restart(std::ostream& out)
const;
621 unsigned uLabel,
const DofOwner *pDO,
625 m_pDrivenLoadIncNorm(0)
631 "Module: loadinc - load increment force\n"
632 "Author: Pierangelo Masarati <masarati@aero.polimi.it>\n"
633 "Organization: Dipartimento di Ingegneria Aerospaziale\n"
634 " Politecnico di Milano\n"
635 " http://www.aero.polimi.it/\n"
637 " All rights reserved\n"
641 "user defined : <label> , load increment force ,\n"
642 " { force | couple } ,\n"
643 " { absolute | follower } ,\n"
645 " [ position , (Vec3) <position> , ] # meaningless for couple\n"
646 " (Vec3) <direction> , \n"
647 " load increment normalization , <lin_label> ;\n"
650 "# 1: <label>@<node_label>\n"
651 "# if type ::= \"force\":\n"
652 "# 2,3,4: fx fy fz\n"
653 "# if node is not displacement-only:\n"
654 "# 5,6,7: mx my mz\n"
656 "# 2,3,4: mx my mz\n"
674 silent_cerr(
"LoadIncForce(" << uLabel <<
"): missing { force | couple } or unexpected type at line " << HP.
GetLineData() << std::endl);
685 silent_cerr(
"LoadIncForce(" << uLabel <<
"): missing { absolute | follower } or unexpected type at line " << HP.
GetLineData() << std::endl);
713 silent_cerr(
"LoadIncForce(" << uLabel <<
"): null direction at line " << HP.
GetLineData() << std::endl);
717 if (!HP.
IsKeyWord(
"load" "increment" "normalization")) {
718 silent_cerr(
"LoadIncForce(" << uLabel <<
"): missing \"load increment normalization\" keyword at line " << HP.
GetLineData() << std::endl);
729 silent_cerr(
"LoadIncForce(" << uLabel <<
"): invalid \"load increment normalization\" UseDefined(" << pEl->
GetLabel() <<
") element at line " << HP.
GetLineData() << std::endl);
735 silent_cerr(
"LoadIncForce(" << uLabel <<
"): invalid \"load increment normalization\" UseDefined(" << pEl->
GetLabel() <<
") element at line " << HP.
GetLineData() << std::endl);
816 for (
integer iCnt = 1; iCnt <= 3; iCnt++) {
821 for (
integer iCnt = 1; iCnt <= 3; iCnt++) {
841 for (
integer iCnt = 1; iCnt <= 3; iCnt++) {
852 for (
integer iCnt = 1; iCnt <= 3; iCnt++) {
857 for (
integer iCnt = 1; iCnt <= 6; iCnt++) {
905 for (
integer iCnt = 1; iCnt <= 3; iCnt++) {
906 WorkVec.
PutRowIndex(iCnt, iFirstMomentumIndex + iCnt);
922 for (
integer iCnt = 1; iCnt <= 3; iCnt++) {
923 WorkVec.
PutRowIndex(iCnt, iFirstMomentumIndex + iCnt);
931 for (
integer iCnt = 1; iCnt <= 6; iCnt++) {
932 WorkVec.
PutRowIndex(iCnt, iFirstMomentumIndex + iCnt);
970 connectedNodes.resize(1);
986 return out <<
"# LoadIncForce: not implemented" << std::endl;
1036 if (!
SetUDE(
"load" "increment" "force", rf)) {
1039 silent_cerr(
"module-loadinc: "
1040 "module_init(" << module_name <<
") "
1041 "failed" << std::endl);
1047 if (!
SetUDE(
"load" "increment" "normalization", rf)) {
1050 silent_cerr(
"module-loadinc: "
1051 "module_init(" << module_name <<
") "
1052 "failed" << std::endl);
flag fReadOutput(MBDynParser &HP, const T &t) const
void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
void PutColIndex(integer iSubCol, integer iCol)
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph)
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
const StructDispNode * m_pDNode
virtual const Mat3x3 & GetRRef(void) const
virtual bool bToBeOutput(void) const
virtual DofOrder::Order GetDofType(unsigned int i) const
#define MBDYN_EXCEPT_ARGS
virtual void ResizeReset(integer)
const MatCross_Manip MatCross
virtual void Output(OutputHandler &OH) const
FullSubMatrixHandler & SetFull(void)
virtual const Mat3x3 & GetRCurr(void) const
int iGetNumConnectedNodes(void) const
virtual DofOrder::Order GetEqType(unsigned int i) const
Elem * ReadElem(MBDynParser &HP, Elem::Type type) const
void Add(integer iRow, integer iCol, const Vec3 &v)
unsigned int iGetPrivDataIdx(const char *s) const
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
const StructNode * m_pNode
doublereal dGetPrivData(unsigned int i) const
virtual ~LoadIncNorm(void)
const StructDispNode * pNode
void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
std::vector< Hint * > Hints
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
virtual void AfterPredict(VectorHandler &X, VectorHandler &XP)
int module_init(const char *module_name, void *pdm, void *php)
This function registers our user defined element for the math parser.
virtual void PutItem(integer iSubRow, integer iRow, const doublereal &dCoef)
Vec3 VecRot(const Mat3x3 &Phi)
std::ostream & Restart(std::ostream &out) const
std::ostream & Restart(std::ostream &out) const
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
virtual unsigned int iGetNumDof(void) const
Vec3 MulTV(const Vec3 &v) const
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph)
virtual void AfterPredict(VectorHandler &X, VectorHandler &XP)
virtual StructNode::Type GetStructNodeType(void) const =0
DataManager::ElemContainerType::const_iterator begin(Elem::Type t) const
Vec3 GetPosRel(const ReferenceFrame &rf)
virtual bool IsKeyWord(const char *sKeyWord)
std::ostream & Loadable(void) const
virtual const Mat3x3 & GetRPrev(void) const
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
virtual unsigned int iGetInitialNumDof(void) const
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
#define ASSERT(expression)
virtual unsigned int iGetInitialNumDof(void) const
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
VectorExpression< VectorCrossExpr< VectorLhsExpr, VectorRhsExpr >, 3 > Cross(const VectorExpression< VectorLhsExpr, 3 > &u, const VectorExpression< VectorRhsExpr, 3 > &v)
virtual void Add(integer iRow, const Vec3 &v)
unsigned int iGetNumPrivData(void) const
virtual void ResizeReset(integer, integer)
Vec3 GetVecRel(const ReferenceFrame &rf)
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Vec3 GetVecAbs(const ReferenceFrame &rf)
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
const MatCrossCross_Manip MatCrossCross
VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
void PutRowIndex(integer iSubRow, integer iRow)
bool SetUDE(const std::string &s, UserDefinedElemRead *rude)
void Set(const DriveCaller *pDC)
doublereal dGet(const doublereal &dVar) const
int iGetNumConnectedNodes(void) const
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
const DrivenElem * m_pDrivenLoadIncNorm
void Sub(integer iRow, integer iCol, const Vec3 &v)
DriveCaller * GetDriveCaller(bool bDeferred=false)
Mat3x3 MulMT(const Mat3x3 &m) const
virtual void SetOutputFlag(flag f=flag(1))
virtual integer iGetFirstIndex(void) const
std::vector< NodeData > m_Nodes
const LoadIncNorm * m_pLoadIncNorm
void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
virtual Elem * pGetElem(void) const
virtual HighParser::ErrOut GetLineData(void) const
virtual ~LoadIncForce(void)
LoadIncForce(unsigned uLabel, const DofOwner *pDO, DataManager *pDM, MBDynParser &HP)
unsigned int GetLabel(void) const
Node * ReadNode(MBDynParser &HP, Node::Type type) const
DataManager::ElemContainerType::const_iterator end(Elem::Type t) const
virtual Vec3 GetVec3(void)
void mbdyn_set_stop_at_end_of_time_step(void)
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
doublereal dGetP(void) const
LoadIncNorm(unsigned uLabel, const DofOwner *pDO, DataManager *pDM, MBDynParser &HP)
Mat3x3 DRot_I(const Vec3 &phi)
virtual bool bIsActive(void) const
unsigned int iGetNumPrivData(void) const
virtual void Output(OutputHandler &OH) const
virtual doublereal GetReal(const doublereal &dDefval=0.0)