SeveralGhostGenerators.cpp
2 
3 GhostCriteria::~GhostCriteria(void) {}
4 
5 typedef boost::container::flat_map<size_t, ComputationalCell> GhostCells;
6 
7 SeveralGhostGenerators::SeveralGhostGenerators(vector<GhostPointGenerator*> ghosts, GhostCriteria const& ghostchooser) :
8  ghosts_(ghosts), ghost_chooser_(ghostchooser)
9 {}
10 
11 boost::container::flat_map<size_t, ComputationalCell> SeveralGhostGenerators::operator() (const Tessellation& tess,
12  const vector<ComputationalCell>& cells, double time, TracerStickerNames const&
13  tracerstickernames) const
14 {
15  size_t nghosts = ghosts_.size();
16  vector<GhostCells> ghost_cells(nghosts);
17  for (size_t i = 0; i < nghosts; ++i)
18  ghost_cells[i] = ghosts_[i]->operator()(tess, cells, time, tracerstickernames);
19  GhostCells res;
20  for (GhostCells::const_iterator it = ghost_cells[0].begin(); it != ghost_cells[0].end(); ++it)
21  {
22  res.insert(std::pair<size_t, ComputationalCell>(it->first,
23  ghost_cells[ghost_chooser_.GhostChoose(tess, static_cast<int>(it->first))][it->first]));
24  }
25  return res;
26 }
27 
29  const vector<ComputationalCell>& cells, const vector<Slope>& gradients,
30  size_t ghost_index, double time, Edge const& edge,TracerStickerNames const&
31  tracerstickernames) const
32 {
33  return ghosts_[ghost_chooser_.GhostChoose(tess,
34  static_cast<int>(ghost_index))]->GetGhostGradient(tess, cells, gradients, ghost_index, time, edge,tracerstickernames);
35 }
36 
Class for chhosing which ghost generator to use.
boost::container::flat_map< size_t, ComputationalCell > operator()(const Tessellation &tess, const vector< ComputationalCell > &cells, double time, TracerStickerNames const &tracerstickernames) const
Calculates the ghost points.
virtual size_t GhostChoose(Tessellation const &tess, int index) const =0
Chooses the ghost generator.
Abstract class for tessellation.
SeveralGhostGenerators(vector< GhostPointGenerator *> ghosts, GhostCriteria const &ghostchooser)
Class constructor.
Interface between two cells.
Definition: Edge.hpp:13
Class for spatial interpolations.
Class for creating computationalcells of ghost points from several different methods.
Slope GetGhostGradient(const Tessellation &tess, const vector< ComputationalCell > &cells, const vector< Slope > &gradients, size_t ghost_index, double time, const Edge &edge, TracerStickerNames const &tracerstickernames) const
Calculates the gradients for the ghost cells.
Class for keeping the names of the tracers and stickers.