1 #include <boost/foreach.hpp> 11 vector<Vector2D> extract_velocity
12 (
const vector<ComputationalCell>& cells,
size_t N)
14 vector<Vector2D> res(N);
15 for(
size_t i=0;i<res.size();++i)
16 res.at(i) = cells.at(i).velocity;
22 const vector<Vector2D>& previous,
26 double circumference = 0;
27 const vector<int> edge_indices =
29 BOOST_FOREACH(
int index, edge_indices){
35 const double edge_length =
38 circumference += edge_length;
41 previous.at(static_cast<size_t>(other));
43 return (1.0/circumference)*res;
46 vector<Vector2D> smooth
48 const vector<Vector2D>& previous,
51 vector<Vector2D> res(previous.size());
52 for(
size_t i=0;i<res.size();++i)
53 res.at(i) = previous.at(i)*(1-alpha)+
54 alpha*neighbor_average(tess,previous,i);
59 vector<Vector2D> Duffell::operator()
61 const vector<ComputationalCell>& cells,
64 vector<Vector2D> res = extract_velocity(cells,static_cast<size_t>(tess.
GetPointNo()));
65 for(
int i=0;i<iter_;++i)
66 res = smooth(tess,res,alpha_);
Abstract class for tessellation.
virtual int GetPointNo(void) const =0
Get Total number of mesh generating points.
Interface between two cells.
Duffell(const double alpha, const int iter)
Class constructor.
virtual Edge const & GetEdge(int index) const =0
Returns edge (interface between cells)
std::pair< Vector2D, Vector2D > vertices
Points at the ends of the edge.
Class for keeping the names of the tracers and stickers.
std::pair< int, int > neighbors
Neighboring cells.
double abs(Vector3D const &v)
Norm of a vector.
virtual vector< int > const & GetCellEdges(int index) const =0
Returns the indexes of a cell's edges.