1 #include "ConditionExtensiveUpdater.hpp" 2 #include "../../misc/utils.hpp" 6 bool bracketed(
int low,
int arg,
int high)
8 return arg >= low && high>arg;
12 ConditionExtensiveUpdater::Condition::~Condition() {}
14 ConditionExtensiveUpdater::Action::~Action() {}
16 ConditionExtensiveUpdater::~ConditionExtensiveUpdater() {}
19 sequence_(sequence) {}
26 const vector<ComputationalCell>& cells,
27 vector<Extensive>& extensives,
33 for (
size_t i = 0; i<edge_list.size(); ++i)
35 const Edge& edge = edge_list[i];
37 delta *= dt*cd.
areas[i];
39 extensives[
static_cast<size_t>(edge.
neighbors.first)] -= delta;
41 extensives[
static_cast<size_t>(edge.
neighbors.second)] += delta;
43 size_t n =
static_cast<size_t>(tess.
GetPointNo());
44 for (
size_t i = 0; i < n; ++i)
46 for (
size_t j = 0; j < sequence_.size(); ++j)
48 if (sequence_[j].first->operator()(i, tess, cells, time, tracerstickernames))
50 sequence_[j].second->operator()(fluxes, pg, tess, dt, cd, cells, extensives[i], i, time, tracerstickernames);
Abstract class for tessellation.
virtual int GetPointNo(void) const =0
Get Total number of mesh generating points.
Interface between two cells.
const CachedLazyList< double > areas
List of areas of interfaces.
virtual const vector< Edge > & getAllEdges(void) const =0
Returns reference to the list of all edges.
void ReplaceExtensive(Extensive &toreplace, Extensive const &other)
Replaces the data in the extensive. The tracers should already be allocated.
Container for cache data.
void operator()(const vector< Extensive > &fluxes, const PhysicalGeometry &pg, const Tessellation &tess, const double dt, const CacheData &cd, const vector< ComputationalCell > &cells, vector< Extensive > &extensives, double time, TracerStickerNames const &tracerstickernames) const
Updates the extensive variables.
Class for keeping the names of the tracers and stickers.
std::pair< int, int > neighbors
Neighboring cells.
Base class for physical geometry.
ConditionExtensiveUpdater(const vector< pair< const Condition *, const Action *> > &sequence)
Class constructor.