computational_cell_2d.hpp
1 
6 #ifndef COMPUTATIONAL_CELL_HPP
7 #define COMPUTATIONAL_CELL_HPP 1
8 
9 /*#include <boost/container/small_vector.hpp>
10 typedef boost::container::small_vector<double,0> tvector;
11 typedef boost::container::small_vector<bool,0> svector;*/
12 #include <vector>
13 typedef std::vector<double> tvector;
14 typedef std::vector<bool> svector;
15 #include <string>
16 #include "../../tessellation/geometry.hpp"
17 #ifdef RICH_MPI
18 #include "../../misc/serializable.hpp"
19 #endif // RICH_MPI
20 
23 #ifdef RICH_MPI
24  : public Serializable
25 #endif // RICH_MPI
26 
27 {
28 public:
29 
31  double density;
32 
34  double pressure;
35 
38 
41 
44 
53  ComputationalCell(void);
54 
65 
70  ComputationalCell& operator*=(double s);
71 
77 
78 #ifdef RICH_MPI
79  size_t getChunkSize(void) const;
80 
81  vector<double> serialize(void) const;
82 
83  void unserialize
84  (const vector<double>& data);
85 #endif // RICH_MPI
86 };
87 
94 
101 
107 ComputationalCell operator/(ComputationalCell const& p, double s);
108 
114 ComputationalCell operator*(ComputationalCell const& p, double s);
115 
121 ComputationalCell operator*(double s, ComputationalCell const& p);
122 
123 void ComputationalCellAddMult(ComputationalCell &res, ComputationalCell const& other, double scalar);
124 
125 void ReplaceComputationalCell(ComputationalCell &res, ComputationalCell const& other);
126 
127 void ReplaceComputationalCellDiff(ComputationalCell &res, ComputationalCell const& first, ComputationalCell const& second);
128 
130 class Slope
131 #ifdef RICH_MPI
132  : public Serializable
133 #endif // RICH_MPI
134 {
135 public:
138 
141 
147  Slope(ComputationalCell const& x, ComputationalCell const& y);
149  Slope(void);
150 #ifdef RICH_MPI
151  size_t getChunkSize(void) const;
152 
153  vector<double> serialize(void) const;
154 
155  void unserialize(const vector<double>& data);
156 #endif//RICH_MPI
157 };
160 {
161 public:
163  std::vector<std::string> tracer_names;
165  std::vector<std::string> sticker_names;
166 
168  TracerStickerNames(void);
180  (const std::vector<std::string>& tracers,
181  const std::vector<std::string>& stickers);
182 
188 
190  ~TracerStickerNames(void);
191 };
192 
193 #endif // COMPUTATIONAL_CELL_HPP
ComputationalCell & operator*=(double s)
Self multiplication operator.
std::vector< bool > svector
std::vector< double > tvector
std::vector< std::string > sticker_names
The names of the stickers.
Class for spatial interpolations.
size_t getChunkSize(void) const
Returns the size of array needed to store all data.
tvector tracers
Tracers (can transfer from one cell to another)
double pressure
Pressure.
Vector3D operator*(double d, Vector3D const &v)
Scalar product.
Definition: Vector3D.cpp:162
ComputationalCell xderivative
Slope in the x direction.
vector< double > serialize(void) const
Convert an object to an array of numbers.
ComputationalCell & operator=(ComputationalCell const &other)
Self decrement operator.
Vector3D operator/(Vector3D const &v, double d)
Scalar division.
Definition: Vector3D.cpp:176
ComputationalCell & operator+=(ComputationalCell const &other)
Self increment operator.
std::vector< std::string > tracer_names
The names of the tracers.
svector stickers
Stickers (stick to the same cell)
Base class for a serializable object.
Class for keeping the names of the tracers and stickers.
ComputationalCell(void)
Default constructor.
Vector3D operator+(Vector3D const &v1, Vector3D const &v2)
Term by term addition.
Definition: Vector3D.cpp:143
void unserialize(const vector< double > &data)
Convert an array of numbers to an object.
ComputationalCell & operator-=(ComputationalCell const &other)
Self reduction operator.
Vector2D velocity
Velocity.
2D Mathematical vector
Definition: geometry.hpp:15
Vector3D operator-(Vector3D const &v1, Vector3D const &v2)
Term by term subtraction.
Definition: Vector3D.cpp:152
Computational cell.
ComputationalCell yderivative
Slope in the y direction.