24 #include <mbsim/functions/function.h>
28 class GeneralizedForceLaw;
29 class GeneralizedImpactLaw;
32 namespace MBSimHydraulics {
41 bool considerVolumeChange;
49 bool considerVolumeChange;
57 virtual std::string getType()
const {
return "HNodeMec"; }
59 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVArrows, tag, (optional (size,(
double),1))) {
60 openMBVArrowSize=(size>.0)?size:.0;
63 void setInitialVolume(
double V0_) {V0=V0_; }
66 void setTransMecArea(
unsigned int i,
double area) {connectedTransFrames[i].area=area; }
68 void calcxSize() {xSize=1; }
70 void init(InitStage stage);
71 void initializeUsingXML(xercesc::DOMElement *element);
73 virtual void updateWRef(
const fmatvec::Mat& Wref,
int i=0);
74 virtual void updateVRef(
const fmatvec::Mat& Vref,
int i=0);
75 virtual void updatehRef(
const fmatvec::Vec& href,
int i=0);
76 virtual void updatedhdqRef(
const fmatvec::Mat& dhdqRef,
int i=0);
78 virtual void updatedhdtRef(
const fmatvec::Vec& dhdtRef,
int i=0);
79 virtual void updaterRef(
const fmatvec::Vec& ref,
int i=0);
81 double evalQMec() {
if(updQMec) updateQMec();
return QMec; }
82 double evalQMecTrans() {
if(updQMec) updateQMec();
return QMecTrans; }
83 double evalQMecRot() {
if(updQMec) updateQMec();
return QMecRot; }
84 double getQMec(
bool check=
true)
const { assert((not check) or (not updQMec));
return QMec; }
85 double getQMecTrans(
bool check=
true)
const { assert((not check) or (not updQMec));
return QMecTrans; }
86 double getQMecRot(
bool check=
true)
const { assert((not check) or (not updQMec));
return QMecRot; }
87 virtual void updateQMec();
89 void updateh(
int j=0);
90 void updater(
int j=0);
98 void resetUpToDate() { HNode::resetUpToDate(); updQMec =
true; }
101 std::vector<connectedTransFrameStruct> connectedTransFrames;
102 std::vector<connectedRotFrameStruct> connectedRotFrames;
103 double QMecTrans, QMecRot, QMec;
105 unsigned int nTrans, nRot;
107 std::vector<std::shared_ptr<OpenMBV::Arrow> > openMBVArrows;
108 double openMBVArrowSize;
111 std::vector<std::string> saved_translatorial_frameOfReference, saved_rotatorial_frameOfReference, saved_rotatorial_frameOfRotationCenter;
112 std::vector<fmatvec::Vec> saved_translatorial_normal, saved_rotatorial_normal;
113 std::vector<double> saved_translatorial_area, saved_rotatorial_area;
114 std::vector<bool> saved_translatorial_noVolumeChange, saved_rotatorial_noVolumeChange;
122 virtual std::string getType()
const {
return "ConstrainedNodeMec"; }
126 pFun->setParent(
this);
130 void init(InitStage stage);
131 void initializeUsingXML(xercesc::DOMElement *element);
133 void updateGeneralizedForces();
135 virtual bool isSingleValued()
const {
return true;}
146 virtual std::string getType()
const {
return "EnvironmentNodeMec"; }
148 void init(InitStage stage);
150 virtual bool isSingleValued()
const {
return true;}
157 ElasticNodeMec(
const std::string &name=
"") :
HNodeMec(name), E(0), fracAir(0), p0(0), bulkModulus(NULL) {}
159 virtual std::string getType()
const {
return "ElasticNode"; }
161 void setFracAir(
double fracAir_) {fracAir=fracAir_; }
162 void setp0(
double p0_) {p0=p0_; }
164 void calcxSize() {xSize=2; }
166 void init(InitStage stage);
167 void initializeUsingXML(xercesc::DOMElement *element);
169 void updateGeneralizedForces();
176 virtual bool isSingleValued()
const {
return true;}
192 virtual std::string getType()
const {
return "RigidNodeMec"; }
194 bool isSetValued()
const {
return true; }
195 bool isActive()
const {
return true; }
197 void calclaSize(
int j) {laSize=1; }
199 void calcrFactorSize(
int j) {rFactorSize=1; }
201 void init(InitStage stage);
205 void updateGeneralizedForces();
208 void updateW(
int j=0);
210 void updaterFactors();
211 void solveImpactsFixpointSingle();
212 void solveConstraintsFixpointSingle();
213 void solveImpactsGaussSeidel();
214 void solveConstraintsGaussSeidel();
215 void solveImpactsRootFinding();
216 void solveConstraintsRootFinding();
217 void jacobianImpacts();
218 void jacobianConstraints();
219 void checkImpactsForTermination();
220 void checkConstraintsForTermination();
Definition: hnode_mec.h:37
Definition: hnode_mec.h:143
Definition: environment.h:98
Definition: hnode_mec.h:44
Definition: hnode_mec.h:53
Definition: hnode_mec.h:118
Definition: hnode_mec.h:188
Definition: hnode_mec.h:155