Flow123d
abscissa.cpp
Go to the documentation of this file.
1 #include <cmath>
2 
4 #include "stdio.h"
5 
7 
10 }
11 
13  id = generateId();
14 }
15 
16 TAbscissa::TAbscissa(const TPoint& PP0, const TPoint& PP1)
17 : TBisector(PP0, PP1)
18 {
19  id = generateId();
20 
21  ComputeLength();
22 }
23 
24 
26 : TBisector(ele)
27 {
28  id = generateId();
29 
30  ComputeLength();
31 }
32 
33 
34 
36 
37  *U = *(a.U);
38  *X0 = *(a.X0);
39 
40  length = a.length;
41 
42  return *this;
43 }
44 
46 // delete P0;
47 // delete P1;
48 }
49 
50 void TAbscissa::SetPoints(const TPoint& PP0, const TPoint& PP1) {
51 // *P0 = PP0;
52 // *P1 = PP1;
53 
54  TBisector::SetPoints(PP0, PP1);
55  ComputeLength();
56 }
57 
59 
60  length = U->Length();
61 }
62 
64  return length;
65 }
66 
68  arma::vec3 minCoor;
69  arma::vec3 maxCoor;
70 
71  for (int i=0; i<3; ++i) {
72  minCoor(i) = GetMin(i+1);
73  maxCoor(i) = GetMax(i+1);
74  }
75 
76  boundingBox=BoundingBox(minCoor, maxCoor);
77 
78  return boundingBox;
79 }
80 
81 double TAbscissa::GetMin(int x) const {
82  if (U == NULL ) printf("U is null!");
83  if (U->Get(x) < 0 ) {
84  return U->Get(x)+X0->Get(x);
85  } else {
86  return X0->Get(x);
87  }
88 }
89 
90 double TAbscissa::GetMax(int x) const {
91  if (U->Get(x) > 0 ) {
92  return U->Get(x)+X0->Get(x);
93  } else {
94  return X0->Get(x);
95  }
96 }