All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
rigid_line_pressureloss.h
1 /* Copyright (C) 2004-2009 MBSim Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Contact: markus.ms.schneider@gmail.com
18  */
19 
20 #ifndef _RIGID_LINE_PRESSURELOSS_H_
21 #define _RIGID_LINE_PRESSURELOSS_H_
22 
23 #include "mbsim/link.h"
24 
25 namespace MBSim {
26  class GeneralizedForceLaw;
27  class GeneralizedImpactLaw;
28 }
29 
30 namespace MBSimHydraulics {
31 
32  class RigidHLine;
33  class PressureLoss;
34  class LinePressureLoss;
35  class ClosablePressureLoss;
36  class LeakagePressureLoss;
37  class UnidirectionalPressureLoss;
38 
41  public:
42  RigidLinePressureLoss(const std::string &name, RigidHLine * line_, PressureLoss * pressureLoss, bool bilateral_=false, bool unilateral_=false);
44  virtual std::string getType() const { return "RigidLinePressureLoss"; }
45  void plot(double t, double dt);
46 
47  bool hasSmoothPart() const {return (bilateral || (unilateral && (fabs(dpMin)>1e-6))); }
48 
49  void init(InitStage stage);
50  // ================================
51  // Methods from init-Process
52  // ================================
53  bool isSetValued() const {return (unilateral || bilateral); }
54  bool isSingleValued() const { return not isSetValued(); }
55  void calcgdSize(int j) {gdSize=active?1:0; }
56  void calcsvSize() {svSize=isSetValued()?1:0; }
57  void updatehRef(const fmatvec::Vec& hRef, int i=0);
58  void updaterRef(const fmatvec::Vec& rRef, int i=0);
59  void updatedhdqRef(const fmatvec::Mat& dhdqRef, int i=0) {};
60  void updatedhduRef(const fmatvec::SqrMat& dhduRef, int i=0);
61  void updatedhdtRef(const fmatvec::Vec& dhdtRef, int i=0);
62  void updaterRef(const fmatvec::Vec& rRef);
63  void updateWRef(const fmatvec::Mat& WRef, int i=0);
64  void updateVRef(const fmatvec::Mat& VRef, int i=0);
65  // ==== END Methods for init-Process ===
66 
67  // ================================
68  // Methods for update-Process
69  // ================================
70  void updateg(double t); /* zdotStandard */
71  void checkActive(int j); /* update */
72  //void checkActivegdn(); // event-driven
73  bool gActiveChanged(); /* update */
74  bool isActive() const {return active; }
75  //void calcgdSizeActive() {gdSize=1; }
76  void calclaSize(int j) {laSize=active?1:0; }
77  //void calclaSizeForActiveg() {laSize=0; } // event-driven
78  void calcrFactorSize(int j) {rFactorSize=active?1:0; }
79  void updategd(double t); /* zdotStandard */
80  void updateStopVector(double t); // event-driven
81  void updateh(double t, int j); /* zdotStandard */
82  void updateW(double t, int j); /* zdotStandard */
83  void updatedhdz(double t);
84  // ==== END Methods for update-Process ===
85 
86  // ================================
87  // Methods for solve-Process
88  // ================================
89  void checkRoot();
90  void updaterFactors();
91  void solveImpactsFixpointSingle(double dt);
92  void solveConstraintsFixpointSingle();
93  void solveImpactsGaussSeidel(double dt);
94  void solveConstraintsGaussSeidel();
95  void solveImpactsRootFinding(double dt);
96  void solveConstraintsRootFinding();
97  void jacobianImpacts();
98  void jacobianConstraints();
99  void checkImpactsForTermination(double dt);
100  void checkConstraintsForTermination();
101  // ==== END Methods for solve-Process ===
102 
103 
104  private:
105  RigidHLine * line;
106  bool active, active0;
107  bool unilateral, bilateral;
108  double gdn, gdd;
109  double dpMin;
110  double laSmooth;
111 
112  LinePressureLoss * linePressureLoss;
113  ClosablePressureLoss * closablePressureLoss;
114  LeakagePressureLoss * leakagePressureLoss;
115  UnidirectionalPressureLoss * unidirectionalPressureLoss;
116 
119  };
120 
121 }
122 
123 #endif /* ----- #ifndef _HYDLINE_PRESSURELOSS_H_ ----- */
124 
Definition: pressure_loss.h:322
Definition: pressure_loss.h:50
Definition: hline.h:88
Definition: pressure_loss.h:168
Definition: pressure_loss.h:39
Definition: pressure_loss.h:273
Definition: rigid_line_pressureloss.h:40

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML