lagrangian1d.cpp
1 #include "lagrangian1d.hpp"
2 
3 Lagrangian1D::Lagrangian1D(bool rigid_walls):
4  rigid_walls_(rigid_walls) {}
5 
6 double Lagrangian1D::operator()
7 (size_t i, vector<double> const& /*vp*/,
8  vector<ComputationalCell> const& hv) const
9 {
10  if(i==0){
11  if(rigid_walls_)
12  return 0;
13  else
14  return hv[0].velocity.x;
15  }
16  else if(i==hv.size()){
17  if(rigid_walls_)
18  return 0;
19  else
20  return hv[hv.size()-1].velocity.x;
21  }
22  else
23  return 0.5*(hv[size_t(i)-1].velocity.x+
24  hv[size_t(i)].velocity.x);
25 }
Lagrangian1D(bool rigid_walls)
Class constructor.
Definition: lagrangian1d.cpp:3
A velocity scheme where the velocities of all vertices are determined by the velocities of adjacents ...