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 #ifdef HAVE_OPENMBVCPPINTERFACE
60 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVArrows, tag, (optional (size,(
double),1))) {
61 openMBVArrowSize=(size>.0)?size:.0;
65 void setInitialVolume(
double V0_) {V0=V0_; }
68 void setTransMecArea(
unsigned int i,
double area) {connectedTransFrames[i].area=area; }
70 void calcxSize() {xSize=1; }
72 void init(InitStage stage);
73 void initializeUsingXML(xercesc::DOMElement *element);
75 virtual void updateWRef(
const fmatvec::Mat& Wref,
int i=0);
76 virtual void updateVRef(
const fmatvec::Mat& Vref,
int i=0);
77 virtual void updatehRef(
const fmatvec::Vec& href,
int i=0);
78 virtual void updatedhdqRef(
const fmatvec::Mat& dhdqRef,
int i=0);
80 virtual void updatedhdtRef(
const fmatvec::Vec& dhdtRef,
int i=0);
81 virtual void updaterRef(
const fmatvec::Vec& ref,
int i=0);
83 void updateh(
double t,
int j=0);
84 void updatedhdz(
double t);
85 virtual void updater(
double t,
int j=0);
86 void updategd(
double t);
87 void updatexd(
double t);
88 void updatedx(
double t,
double dt);
90 void plot(
double t,
double dt);
93 std::vector<connectedTransFrameStruct> connectedTransFrames;
94 std::vector<connectedRotFrameStruct> connectedRotFrames;
95 double QMecTrans, QMecRot, QMec;
97 unsigned int nTrans, nRot;
98 #ifdef HAVE_OPENMBVCPPINTERFACE
99 std::vector<boost::shared_ptr<OpenMBV::Arrow> > openMBVArrows;
100 double openMBVArrowSize;
104 std::vector<std::string> saved_translatorial_frameOfReference, saved_rotatorial_frameOfReference, saved_rotatorial_frameOfRotationCenter;
105 std::vector<fmatvec::Vec> saved_translatorial_normal, saved_rotatorial_normal;
106 std::vector<double> saved_translatorial_area, saved_rotatorial_area;
107 std::vector<bool> saved_translatorial_noVolumeChange, saved_rotatorial_noVolumeChange;
115 virtual std::string getType()
const {
return "ConstrainedNodeMec"; }
117 void setpFunction(MBSim::Function<
double(
double)> * pFun_) {
119 pFun->setParent(
this);
123 void init(InitStage stage);
124 void initializeUsingXML(xercesc::DOMElement *element);
126 void updateg(
double t);
128 virtual bool isSingleValued()
const {
return true;}
131 MBSim::Function<double(double)> * pFun;
139 virtual std::string getType()
const {
return "EnvironmentNodeMec"; }
141 void init(InitStage stage);
143 virtual bool isSingleValued()
const {
return true;}
150 ElasticNodeMec(
const std::string &name=
"") :
HNodeMec(name), E(0), fracAir(0), p0(0), bulkModulus(NULL) {}
152 virtual std::string getType()
const {
return "ElasticNode"; }
154 void setFracAir(
double fracAir_) {fracAir=fracAir_; }
155 void setp0(
double p0_) {p0=p0_; }
157 void calcxSize() {xSize=2; }
159 void init(InitStage stage);
160 void initializeUsingXML(xercesc::DOMElement *element);
164 void updatexd(
double t);
165 void updatedx(
double t,
double dt);
167 void plot(
double t,
double dt);
169 virtual bool isSingleValued()
const {
return true;}
186 virtual std::string getType()
const {
return "RigidNodeMec"; }
188 bool isSetValued()
const {
return true; }
189 bool isActive()
const {
return true; }
191 void calclaSize(
int j) {laSize=1; }
193 void calcrFactorSize(
int j) {rFactorSize=1; }
195 void init(InitStage stage);
199 void updategd(
double t);
200 void updateW(
double t,
int j=0);
202 void updaterFactors();
203 void solveImpactsFixpointSingle(
double dt);
204 void solveConstraintsFixpointSingle();
205 void solveImpactsGaussSeidel(
double dt);
206 void solveConstraintsGaussSeidel();
207 void solveImpactsRootFinding(
double dt);
208 void solveConstraintsRootFinding();
209 void jacobianImpacts();
210 void jacobianConstraints();
211 void checkImpactsForTermination(
double dt);
212 void checkConstraintsForTermination();
Definition: hnode_mec.h:37
Definition: hnode_mec.h:136
Definition: environment.h:98
Definition: hnode_mec.h:44
Definition: hnode_mec.h:53
Definition: hnode_mec.h:111
Definition: hnode_mec.h:182
Definition: hnode_mec.h:148