20 #ifndef _RIGID_LINE_PRESSURELOSS_H_
21 #define _RIGID_LINE_PRESSURELOSS_H_
23 #include "mbsim/link.h"
26 class GeneralizedForceLaw;
27 class GeneralizedImpactLaw;
30 namespace MBSimHydraulics {
34 class LinePressureLoss;
35 class ClosablePressureLoss;
36 class LeakagePressureLoss;
37 class UnidirectionalPressureLoss;
44 virtual std::string getType()
const {
return "RigidLinePressureLoss"; }
45 void plot(
double t,
double dt);
47 bool hasSmoothPart()
const {
return (bilateral || (unilateral && (fabs(dpMin)>1e-6))); }
49 void init(MBSim::InitStage stage);
53 bool isSetValued()
const {
return (unilateral || bilateral); }
54 void calcgdSize(
int j) {gdSize=active?1:0; }
55 void calcsvSize() {svSize=isSetValued()?1:0; }
56 void updatehRef(
const fmatvec::Vec& hRef,
int i=0);
57 void updaterRef(
const fmatvec::Vec& rRef,
int i=0);
58 void updatedhdqRef(
const fmatvec::Mat& dhdqRef,
int i=0) {};
59 void updatedhduRef(
const fmatvec::SqrMat& dhduRef,
int i=0);
60 void updatedhdtRef(
const fmatvec::Vec& dhdtRef,
int i=0);
61 void updaterRef(
const fmatvec::Vec& rRef);
62 void updateWRef(
const fmatvec::Mat& WRef,
int i=0);
63 void updateVRef(
const fmatvec::Mat& VRef,
int i=0);
69 void updateg(
double t);
70 void checkActive(
int j);
72 bool gActiveChanged();
73 bool isActive()
const {
return active; }
75 void calclaSize(
int j) {laSize=active?1:0; }
77 void calcrFactorSize(
int j) {rFactorSize=active?1:0; }
78 void updategd(
double t);
79 void updateStopVector(
double t);
80 void updateh(
double t,
int j);
81 void updateW(
double t,
int j);
82 void updatedhdz(
double t);
89 void updaterFactors();
90 void solveImpactsFixpointSingle(
double dt);
91 void solveConstraintsFixpointSingle();
92 void solveImpactsGaussSeidel(
double dt);
93 void solveConstraintsGaussSeidel();
94 void solveImpactsRootFinding(
double dt);
95 void solveConstraintsRootFinding();
96 void jacobianImpacts();
97 void jacobianConstraints();
98 void checkImpactsForTermination(
double dt);
99 void checkConstraintsForTermination();
105 bool active, active0;
106 bool unilateral, bilateral;
116 MBSim::GeneralizedForceLaw * gfl;
117 MBSim::GeneralizedImpactLaw * gil;