Carmen Code
 All Classes Files Functions Variables Macros Pages
Cell.h
Go to the documentation of this file.
1 /***************************************************************************
2  Cell.h - description
3  -------------------
4  begin : Thu Jun 7 2001
5  copyright : (C) 2001 by Olivier Roussel & Alexei Tsigulin
6  email : roussel@ict.uni-karlsruhe.de, lpsoft@mail.ru
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 /***************************************************************************
19  * An object Cell contains all the informations of a cell,
20  * for both multiresolution and finite volume computations.
21  *
22  * These data are:
23  *
24  * * the coordinates of the cell-center <i>X</i> ;<br>
25  * * the cell size <i>dX</i> ;<br>
26  * * the cell-average quantities <i>Q</i> ;<br>
27  * * the temporary cell-averages <i>Qs</i> ;<br>
28  * * the divergence vector <i>D</i> ;<br>
29  * * the velocity gradient <i>Grad</i> (only for Navier-Stokes).
30  *
31  * For the Navier-Stokes equations, some methods enable to compute derived quantities:
32  * pressure, temperature, velocity, vorticity, and energy.
33  *
34  */
35 
41 class Cell
42 {
43 /*
44 ______________________________________________________________________________________________
45 
46 PUBLIC METHODS
47 
48  Constructor and distructor
49 ______________________________________________________________________________________________
50 
51 */
52 public:
53 
54 /***************************************************************************
55  * Allocate memory for the vectors in function of
56  * the dimension of the problem <i>Dimension</i> and the number of
57  * physical quantities <i>QuantityNb</i>.
58  *
59  * The position of the cell-center <i>X</i> and the cell size <i>dX</i> have the
60  * dimension <i>Dimension</i>.
61  * The velocity gradient <i>Grad</i> has the dimension <i>Dimension*Dimension</i>. The vectors
62  * containing the cell-averages <i>Q</i>, the temporary cell-averages <i>Qs</i> and
63  * the divergence <i>D</i> have the dimension <i>QuantityNb</i>.
64  *
65  */
66  Cell ();
67 
68 /***************************************************************************
69  * Deallocate memory.
70  *
71  */
72  ~Cell ();
73 /*
74 ______________________________________________________________________________________________
75 
76  Operators
77 ______________________________________________________________________________________________
78 
79 */
80 void operator=(const Cell& C);
81 
82 /*
83 ______________________________________________________________________________________________
84 
85  Set procedures
86 ______________________________________________________________________________________________
87 
88 */
105 inline void setSize(const int AxisNo, const real UserSize);
106 
123 inline void setSize(const Vector& UserSize);
124 
144 inline void setCenter(const int AxisNo, const real UserX);
145 
162 inline void setCenter(const Vector& UserX);
163 
182 inline void setAverage(const int QuantityNo, const real UserAverage);
183 
200 inline void setAverage(const Vector& UserAverage);
201 
207 inline void setAverageZero();
208 
216  inline void setTempAverage(const int QuantityNo, const real UserAverage);
217 
224  inline void setTempAverage(const Vector& UserAverage);
225 
231 inline void setTempAverageZero();
232 
242  inline void setLowAverage(const int QuantityNo, const real UserAverage);
243 
253  inline void setLowAverage(const Vector& UserAverage);
254 
263  inline void setOldAverage(const int QuantityNo, const real UserAverage);
264 
272  inline void setOldAverage(const Vector& UserAverage);
273 
282  inline void setDivergence(const int QuantityNo, const real UserAverage);
283 
291  inline void setDivergence(const Vector& UserAverage);
292 
301  inline void setPsiGrad(const int Dimension, const real UserAverage);
302 
310  inline void setPsiGrad(const Vector& UserAverage);
311 
318  inline void setRes(const real UserAverage);
319 
325 inline void setDivergenceZero();
326 
327 /***************************************************************************
328  * Sets the component no. <i>i, j</i> of the quantity gradient to <i>UserAverage</i>.
329  *
330  * Example:
331  *
332  * <tt>
333  * #include "Carmen.h"
334  *
335  * <tt>QuantityNb = 2;<br>
336  * real Gxx=0., Gxy=1., Gyx=1., Gyy=0.;<br>
337  * Cell c;<br>
338  * c.setGradient(1,1,Gxx);<br>
339  * c.setGradient(1,2,Gxy);<br>
340  * c.setGradient(2,1,Gyx);<br>
341  * c.setGradient(2,2,Gyy);<br>
342  * </tt>
343  *
344  */
369 inline void setGradient(const int i, const int j, const real UserAverage);
370 
380  inline void setTempGradient(const int i, const int j, const real UserAverage);
381 
401 inline void setGradient(const Matrix& UserAverage);
402 
409  inline void setTempGradient(const Matrix& UserAverage);
410 
416 inline void setGradientZero();
417 
423 bool isInsideBoundary() const;
424 
430 bool isInFluid() const;
431 
432 /*
433 ______________________________________________________________________________________________
434 
435  Get procedures
436 ______________________________________________________________________________________________
437 
438 */
439 
446 inline real size(const int AxisNo) const;
447 
453 inline Vector size() const;
454 
461 inline real center(const int AxisNo) const;
462 
468 inline Vector center() const;
469 
476 inline real average(const int QuantityNo) const;
477 
483 inline Vector average() const;
484 
491 inline real tempAverage(const int QuantityNo) const;
492 
498 inline Vector tempAverage() const;
499 
506 inline real lowAverage(const int QuantityNo) const;
507 
513 inline Vector lowAverage() const;
514 
521 inline real oldAverage(const int QuantityNo) const;
522 
528 inline Vector oldAverage() const;
529 
536 inline real divergence(const int QuantityNo) const;
537 
543 inline Vector divergence() const;
544 
551 inline real PsiGrad(const int Dimension) const;
552 
558 inline Vector PsiGrad() const;
559 
568 inline real gradient(const int i, const int j) const;
569 
577  inline real tempGradient(const int i, const int j) const;
578 
584 inline Matrix gradient() const;
585 
591  inline Matrix tempGradient() const;
592 
598 inline real density() const;
599 
605  inline real tempDensity() const;
606 
612 inline real psi() const;
613 
619  inline real tempPsi() const;
620 
626 inline real etaConst() const;
627 
633 real pressure() const;
634 
640 real tempPressure() const;
641 
647 real oldPressure() const;
648 
655 real temperature() const;
656 
663  real tempTemperature() const;
664 
671 inline real concentration() const;
672 
678 inline real energy() const;
679 
685  inline real tempEnergy() const;
686 
693 inline real magField(const int AxisNo) const;
694 
701  inline real tempMagField(const int AxisNo) const;
702 
708 Vector magField() const;
709 
715  Vector tempMagField() const;
716 
723 inline real velocity(const int AxisNo) const;
724 
731  inline real tempVelocity(const int AxisNo) const;
732 
738 Vector velocity() const;
739 
745  Vector tempVelocity() const;
746 
752 inline real speedOfSound() const;
753 
760 inline real entropy() const;
761 
768 real fastSpeed(const int AxisNo) const;
769 
775 real volume() const;
776 
777 /*
778 ______________________________________________________________________________________________
779 
780  Test procedures
781 ______________________________________________________________________________________________
782 
783 */
784 
791 bool isOverflow() const;
792 /*
793 ______________________________________________________________________________________________
794 
795 PRIVATE VARIABLES
796 ______________________________________________________________________________________________
797 
798 */
799 //parallel modification
800 //private:
801 public:
802 
803 /***************************************************************************
804  * Position of the cell center. Its dimension is <i>Dimension</i>.
805  *
806  */
809 /***************************************************************************
810  * Cell size in each direction. Its dimension is <i>Dimension</i>.
811  *
812  */
815 /***************************************************************************
816  * Vector containing the cell-average values. Its dimension is <i>QuantityNb</i>.
817  *
818  */
821 /***************************************************************************
822  * Temporary cell-average values. This vector is used to store the
823  * intermediary value in a multi-step Runge-Kutta or McCormack time integration.
824  * Its dimension is <i>QuantityNb</i>.
825  *
826  */
830 /***************************************************************************
831  * Cell-average values with low precision. This vector is used to store the
832  * cell-averages computed with the N-stage Runge-Kutta-Fehlberg N(N+1)
833  * method.
834  * Its dimension is <i>QuantityNb</i>.
835  *
836  */
840 /***************************************************************************
841  * Cell-average values at the instant <i>n-1</i>.
842  * Its dimension is <i>QuantityNb</i>.
843  *
844  */
847 /***************************************************************************
848  * Divergence vector. Its dimension is <i>QuantityNb</i>.
849  *
850  */
853 /***************************************************************************
854  * Resistivity function
855  *
856  */
859 /***************************************************************************
860  * Gradient of psi. Its dimension is <i>Dimension</i>.
861  *
862  */
865 /***************************************************************************
866  * Quantity gradient. Only necessary for a Navier-Stokes computation.
867  * Its dimension is <i>Dimension*QuantityNb</i>.
868  *
869  */
872 /***************************************************************************
873  * Temporary quantity gradient. Only necessary for a Navier-Stokes computation.
874  * Its dimension is <i>Dimension*QuantityNb</i>.
875  *
876  */
879 };
880 
881 /*
882 ______________________________________________________________________________________________
883 
884 INLINE METHODS
885 ______________________________________________________________________________________________
886 
887 */
888 inline void Cell::setSize(const int AxisNo, const real UserSize)
889 {
890  dX.setValue(AxisNo, UserSize);
891 }
892 /*
893 ______________________________________________________________________________________________
894 
895 */
896 
897 inline void Cell::setSize(const Vector& UserSize)
898 {
899  dX = UserSize;
900 }
901 /*
902 ______________________________________________________________________________________________
903 
904 */
905 inline void Cell::setCenter(const int AxisNo, const real UserX)
906 {
907  X.setValue(AxisNo, UserX);
908 }
909 /*
910 ______________________________________________________________________________________________
911 
912 */
913 inline void Cell::setCenter(const Vector& UserX)
914 {
915  X = UserX;
916 }
917 /*
918 ______________________________________________________________________________________________
919 
920 */
921 inline void Cell::setAverage(const int QuantityNo, const real UserAverage)
922 {
923  Q.setValue(QuantityNo, UserAverage);
924 }
925 /*
926 ______________________________________________________________________________________________
927 
928 */
929 inline void Cell::setAverage(const Vector& UserAverage)
930 {
931  Q = UserAverage;
932 }
933 /*
934 ______________________________________________________________________________________________
935 
936 */
937 inline void Cell::setAverageZero()
938 {
939  Q.setZero();
940 }
941 /*
942 ______________________________________________________________________________________________
943 
944 */
945 inline void Cell::setTempAverage(const int QuantityNo, const real UserAverage)
946 {
947  Qs.setValue(QuantityNo, UserAverage);
948 }
949 /*
950 ______________________________________________________________________________________________
951 
952 */
953 inline void Cell::setTempAverage(const Vector& UserAverage)
954 {
955  Qs = UserAverage;
956 }
957 /*
958 ______________________________________________________________________________________________
959 
960 */
962 {
963  Qs.setZero();
964 }
965 /*
966 ______________________________________________________________________________________________
967 
968 */
969 inline void Cell::setLowAverage(const int QuantityNo, const real UserAverage)
970 {
971  Qlow.setValue(QuantityNo, UserAverage);
972 }
973 /*
974 ______________________________________________________________________________________________
975 
976 */
977 inline void Cell::setLowAverage(const Vector& UserAverage)
978 {
979  Qlow = UserAverage;
980 }
981 /*
982 ______________________________________________________________________________________________
983 
984 */
985 inline void Cell::setOldAverage(const int QuantityNo, const real UserAverage)
986 {
987  Qold.setValue(QuantityNo, UserAverage);
988 }
989 /*
990 ______________________________________________________________________________________________
991 
992 */
993 inline void Cell::setOldAverage(const Vector& UserAverage)
994 {
995  Qold = UserAverage;
996 }
997 
998 /*
999 ______________________________________________________________________________________________
1000 
1001 */
1002 inline void Cell::setPsiGrad(const int Dimension, const real UserAverage)
1003 {
1004  PGrad.setValue(Dimension, UserAverage);
1005 }
1006 
1007 /*
1008 ______________________________________________________________________________________________
1009 
1010 */
1011 inline void Cell::setRes(const real UserAverage)
1012 {
1013  Res = UserAverage;
1014 }
1015 /*
1016 ______________________________________________________________________________________________
1017 
1018 */
1019 inline void Cell::setDivergence(const int QuantityNo, const real UserAverage)
1020 {
1021  D.setValue(QuantityNo, UserAverage);
1022 }
1023 /*
1024 ______________________________________________________________________________________________
1025 
1026 */
1027 inline void Cell::setPsiGrad(const Vector& UserAverage)
1028 {
1029  PGrad = UserAverage;
1030 }
1031 /*
1032 ______________________________________________________________________________________________
1033 
1034 */
1035 inline void Cell::setDivergence(const Vector& UserAverage)
1036 {
1037  D = UserAverage;
1038 }
1039 /*
1040 ______________________________________________________________________________________________
1041 
1042 */
1044 {
1045  D.setZero();
1046 }
1047 /*
1048 ______________________________________________________________________________________________
1049 
1050 */
1051 inline void Cell::setGradient(const int i, const int j, const real UserAverage)
1052 {
1053  Grad.setValue(i, j, UserAverage);
1054 }
1055 /*
1056 ______________________________________________________________________________________________
1057 
1058 */
1059 inline void Cell::setTempGradient(const int i, const int j, const real UserAverage)
1060 {
1061  Grads.setValue(i, j, UserAverage);
1062 }
1063 /*
1064 ______________________________________________________________________________________________
1065 
1066 */
1067 inline void Cell::setGradient(const Matrix& UserAverage)
1068 {
1069  Grad = UserAverage;
1070 }
1071 /*
1072 ______________________________________________________________________________________________
1073 
1074 */
1075 inline void Cell::setTempGradient(const Matrix& UserAverage)
1076 {
1077  Grads = UserAverage;
1078 }
1079 
1080 /*
1081 ______________________________________________________________________________________________
1082 
1083 */
1085 {
1086  Grad.setZero();
1087 }
1088 /*
1089 ______________________________________________________________________________________________
1090 
1091  Get procedures
1092 ______________________________________________________________________________________________
1093 
1094 */
1095 inline real Cell::size(const int AxisNo) const
1096 {
1097  return dX.value(AxisNo);
1098 }
1099 /*
1100 ______________________________________________________________________________________________
1101 
1102 */
1103 
1104 inline Vector Cell::size() const
1105 {
1106  return dX;
1107 }
1108 /*
1109 ______________________________________________________________________________________________
1110 
1111 */
1112 inline real Cell::center(const int AxisNo) const
1113 {
1114  return X.value(AxisNo);
1115 }
1116 /*
1117 ______________________________________________________________________________________________
1118 
1119 */
1120 inline Vector Cell::center() const
1121 {
1122  return X;
1123 }
1124 /*
1125 ______________________________________________________________________________________________
1126 
1127 */
1128 inline real Cell::average(const int QuantityNo) const
1129 {
1130  return Q.value(QuantityNo);
1131 }
1132 /*
1133 ______________________________________________________________________________________________
1134 
1135 */
1136 inline Vector Cell::average() const
1137 {
1138  return Q;
1139 }
1140 /*
1141 ______________________________________________________________________________________________
1142 
1143 */
1144 inline real Cell::tempAverage(const int QuantityNo) const
1145 {
1146  return Qs.value(QuantityNo);
1147 }
1148 /*
1149 ______________________________________________________________________________________________
1150 
1151 */
1153 {
1154  return Qs;
1155 }
1156 /*
1157 ______________________________________________________________________________________________
1158 
1159 */
1160 inline real Cell::lowAverage(const int QuantityNo) const
1161 {
1162  return Qlow.value(QuantityNo);
1163 }
1164 /*
1165 ______________________________________________________________________________________________
1166 
1167 */
1168 inline Vector Cell::lowAverage() const
1169 {
1170  return Qlow;
1171 }
1172 /*
1173 ______________________________________________________________________________________________
1174 
1175 */
1176 inline real Cell::oldAverage(const int QuantityNo) const
1177 {
1178  return Qold.value(QuantityNo);
1179 }
1180 /*
1181 ______________________________________________________________________________________________
1182 
1183 */
1184 inline Vector Cell::oldAverage() const
1185 {
1186  return Qold;
1187 }
1188 /*
1189 ______________________________________________________________________________________________
1190 
1191 */
1192 inline real Cell::divergence(const int QuantityNo) const
1193 {
1194  return D.value(QuantityNo);
1195 }
1196 /*
1197 ______________________________________________________________________________________________
1198 
1199 */
1200 inline Vector Cell::divergence() const
1201 {
1202  return D;
1203 }
1204 /*
1205 ______________________________________________________________________________________________
1206 
1207 */
1208 inline real Cell::PsiGrad(const int Dimension) const
1209 {
1210  return PGrad.value(Dimension);
1211 }
1212 /*
1213 ______________________________________________________________________________________________
1214 
1215 */
1216 inline Vector Cell::PsiGrad() const
1217 {
1218  return PGrad;
1219 }
1220 /*
1221 ______________________________________________________________________________________________
1222 
1223 */
1224 
1225 inline real Cell::gradient(const int i, const int j) const
1226 {
1227  return Grad.value(i,j);
1228 }
1229 
1230 /*
1231 ______________________________________________________________________________________________
1232 
1233 */
1234 
1235 inline real Cell::tempGradient(const int i, const int j) const
1236 {
1237  return Grads.value(i,j);
1238 }
1239 
1240 /*
1241 ______________________________________________________________________________________________
1242 
1243 */
1244 
1245 inline Matrix Cell::gradient() const
1246 {
1247  return Grad;
1248 }
1249 
1250 /*
1251 ______________________________________________________________________________________________
1252 
1253 */
1255 {
1256  return Grads;
1257 }
1258 /*
1259 ______________________________________________________________________________________________
1260 
1261 */
1262 inline real Cell::density() const
1263 {
1264  return Q.value(1);
1265 }
1266 
1267 /*
1268 ______________________________________________________________________________________________
1269 
1270 */
1271 inline real Cell::tempDensity() const
1272 {
1273  return Qs.value(1);
1274 }
1275 
1276 /*
1277 ______________________________________________________________________________________________
1278 
1279 */
1280 inline real Cell::psi() const
1281 {
1282  return Q.value(6);
1283 }
1284 
1285 /*
1286 ______________________________________________________________________________________________
1287 
1288 */
1289 inline real Cell::tempPsi() const
1290 {
1291  return Qs.value(6);
1292 }
1293 
1294 /*
1295 ______________________________________________________________________________________________
1296 
1297 */
1298 inline real Cell::etaConst() const
1299 {
1300  return Res;
1301 }
1302 
1303 /*
1304 ______________________________________________________________________________________________
1305 
1306 */
1307 inline real Cell::energy() const
1308 {
1309  return Q.value(5);
1310 }
1311 
1312 /*
1313 ______________________________________________________________________________________________
1314 
1315 */
1316 inline real Cell::tempEnergy() const
1317 {
1318  return Qs.value(5);
1319 }
1320 
1321 /*
1322 ______________________________________________________________________________________________
1323 
1324 */
1326 {
1327  // Warning: only for flame ball, flame front and flame-vortex equations
1328 
1329  return Q.value(2);
1330 }
1331 
1332 /*
1333 ______________________________________________________________________________________________
1334 
1335 */
1336 inline real Cell::magField(const int AxisNo) const
1337 {
1338  return Q.value(6+AxisNo);
1339 }
1340 
1341 /*
1342 ______________________________________________________________________________________________
1343 
1344 */
1345 inline real Cell::tempMagField(const int AxisNo) const
1346 {
1347  return Qs.value(6+AxisNo);
1348 }
1349 
1350 /*
1351 ______________________________________________________________________________________________
1352 
1353 */
1354 inline real Cell::velocity(const int AxisNo) const
1355 {
1356  return Q.value(1+AxisNo)/Q.value(1);
1357 }
1358 
1359 /*
1360 ______________________________________________________________________________________________
1361 
1362 */
1363 inline real Cell::tempVelocity(const int AxisNo) const
1364 {
1365  return Qs.value(1+AxisNo)/Qs.value(1);
1366 }
1367 /*
1368 ______________________________________________________________________________________________
1369 
1370 */
1371 inline real Cell::speedOfSound() const
1372 {
1373  return sqrt(Gamma*pressure()/density());
1374 }
1375 /*
1376 ______________________________________________________________________________________________
1377 
1378 */
1379 inline real Cell::entropy() const
1380 {
1381  return pressure()*exp(-Gamma*log(density()));
1382 }
Matrix gradient() const
Returns the velocity gradient in matrix form.
Definition: Cell.h:1245
Vector dX
Definition: Cell.h:813
real speedOfSound() const
Returns the cell-average speed of sound.
Definition: Cell.h:1371
An object Cell contains all the informations of a cell for both multiresolution and finite volume com...
Definition: Cell.h:41
void setAverageZero()
Sets all the cell-average values to zero.
Definition: Cell.h:937
Vector average() const
Returns the cell-average value vector.
Definition: Cell.h:1136
bool isInFluid() const
Returns true if the cell is inside the fluid.
Definition: Cell.cpp:487
real tempPressure() const
Identical to the previous one for the temporary values.
Definition: Cell.cpp:117
real entropy() const
Returns the entropy (p/rho^Gamma). Does not work for MHD!
Definition: Cell.h:1379
real tempTemperature() const
Identical to the previous one for the temporary values. Does not work for MHD!
Definition: Cell.cpp:212
void setTempAverageZero()
Sets all the temmporary cell-average values to zero.
Definition: Cell.h:961
Standard class for every vector in Carmen.
Definition: Vector.h:29
Vector lowAverage() const
Returns the cell-average vector with low precision in the Runge-Kutta-Fehlberg method.
Definition: Cell.h:1168
real tempDensity() const
Identical to the previous one for the temporary values.
Definition: Cell.h:1271
real Res
Definition: Cell.h:857
real oldPressure() const
Identical to the previous one for the values at the instant n-1.
Definition: Cell.cpp:151
bool isInsideBoundary() const
Returns true if the cell is inside the boundary.
Definition: Cell.cpp:444
void setGradient(const int i, const int j, const real UserAverage)
Sets the component no. i, j of the quantity gradient to UserAverage.
Definition: Cell.h:1051
real temperature() const
Returns the cell-average temperature. Does not work for MHD!
Definition: Cell.cpp:184
real value(const int i, const int j) const
Returns the value of the component i, j.
Definition: Matrix.h:515
void setDivergence(const int QuantityNo, const real UserAverage)
Identical to void setAverage (int QuantityNo, real UserAverage), but for the divergence vector...
Definition: Cell.h:1019
void setOldAverage(const int QuantityNo, const real UserAverage)
Identical to setAverage (int QuantityNo, real UserAverage), but for the vector of the old cell-averag...
Definition: Cell.h:985
real concentration() const
Returns the cell-average concentration of the limiting reactant. Does not work for MHD! ...
Definition: Cell.h:1325
Vector tempVelocity() const
Identical to the previous one for the temporary values.
Definition: Cell.cpp:314
real density() const
Returns the cell-average density.
Definition: Cell.h:1262
Vector divergence() const
Returns the divergence vector.
Definition: Cell.h:1200
real fastSpeed(const int AxisNo) const
Returns the fast speed vector.
Definition: Cell.cpp:340
Vector size() const
Returns the vector cointaining the cell size in every direction.
Definition: Cell.h:1104
int Dimension
Definition: Parameters.cpp:74
void setZero()
Sets all the components to zero.
Definition: Matrix.cpp:127
Vector oldAverage() const
Returns the old cell-average values.
Definition: Cell.h:1184
real Gamma
Definition: Parameters.cpp:109
real volume() const
Returns the volume of the cell (length in 1D, area in 2D, volume in 3D).
Definition: Cell.cpp:363
real etaConst() const
Returns the cell-average resistivity.
Definition: Cell.h:1298
void setRes(const real UserAverage)
Set resistivity.
Definition: Cell.h:1011
Vector tempMagField() const
Identical to the previous one for the temporary values.
Definition: Cell.cpp:266
bool isOverflow() const
Return true if one of the cell-average quantities is greater than the maximum. This usually means the...
Definition: Cell.cpp:382
Vector PGrad
Definition: Cell.h:863
Matrix tempGradient() const
Identical to the previous one for the temporary values.
Definition: Cell.h:1254
real tempEnergy() const
Identical to the previous one for the temporary values.
Definition: Cell.h:1316
Matrix Grads
Definition: Cell.h:877
void setValue(const int n, const real a)
Sets the component n to value a.
Definition: Vector.h:545
Vector D
Definition: Cell.h:851
void setTempAverage(const int QuantityNo, const real UserAverage)
Identical to setAverage (int QuantityNo, real UserAverage), but for the vector of the temporary cell-...
Definition: Cell.h:945
~Cell()
Cell distructor.
Definition: Cell.cpp:61
Vector Qs
Definition: Cell.h:827
void setSize(const int AxisNo, const real UserSize)
Sets the size of the cell in the direction AxisNo to UserSize. Example:
Definition: Cell.h:888
void setTempGradient(const int i, const int j, const real UserAverage)
Identical to the previous one for the temporary values. Does not work for MHD!
Definition: Cell.h:1059
Standard class for every matrix in Carmen.
Definition: Matrix.h:28
void setLowAverage(const int QuantityNo, const real UserAverage)
Identical to setAverage (int QuantityNo, real UserAverage), but for the vector of the cell-average va...
Definition: Cell.h:969
real tempPsi() const
Identical to the previous one for the temporary values.
Definition: Cell.h:1289
Vector PsiGrad() const
Returns the PsiGrad vector.
Definition: Cell.h:1216
Vector velocity() const
Returns the cell-average velocity vector.
Definition: Cell.cpp:290
Vector Q
Definition: Cell.h:819
real pressure() const
Returns the cell-average pressure.
Definition: Cell.cpp:84
void setValue(const int i, const int j, const real a)
Sets the component i, j to value a.
Definition: Matrix.h:505
void setGradientZero()
Sets all the components of the velocity gradient to zero.
Definition: Cell.h:1084
real value(const int n) const
Returns the value of the component n.
Definition: Vector.h:565
Vector Qlow
Definition: Cell.h:837
void setPsiGrad(const int Dimension, const real UserAverage)
Identical to void setAverage (int QuantityNo, real UserAverage), but for the gradient of psi vector...
Definition: Cell.h:1002
void setDivergenceZero()
Sets all the components of the divergence vector to zero.
Definition: Cell.h:1043
Vector X
Definition: Cell.h:807
void setCenter(const int AxisNo, const real UserX)
Sets the coordinate of the cell-center in the direction AxisNo to UserX. Example: ...
Definition: Cell.h:905
Vector Qold
Definition: Cell.h:845
real psi() const
Returns the cell-average density.
Definition: Cell.h:1280
Matrix Grad
Definition: Cell.h:870
Cell()
Cell constructor.
Definition: Cell.cpp:34
Vector tempAverage() const
Returns the temporary cell-average value vector.
Definition: Cell.h:1152
real energy() const
Returns the cell-average energy per unit of volume.
Definition: Cell.h:1307
void setAverage(const int QuantityNo, const real UserAverage)
Sets the cell-average of the quantity QuantityNo to UserAverage. Example:
Definition: Cell.h:921
Vector magField() const
Returns the cell-average magnetic field vector.
Definition: Cell.cpp:243
void operator=(const Cell &C)
Defines the cell operators. It is possible to obtain the cell values as:
Definition: Cell.cpp:416
Vector center() const
Returns the cell-center position vector.
Definition: Cell.h:1120
void setZero()
Sets all the components to zero.
Definition: Vector.cpp:228
#define real
Definition: PreProcessor.h:31