5#ifndef TWOD_TVDLF_MESH_H
6#define TWOD_TVDLF_MESH_H
75 double update(
const double& CFL,
const double& max_dt = std::numeric_limits<long double>::max());
81 void update_to(
const double& CFL,
const double& t_end);
140 std::string target_colour,
156 if(target_colour ==
"red") {
162 j = (offset - i) / Bx;
163 switch(corner_index) {
194 }
else if(target_colour ==
"black") {
199 j = (offset - i) / Rx;
200 switch(corner_index) {
231 return target_elts -> begin() + k;
291 int sgn(
double a)
const;
322 while(e != elts -> end()) {
324 if(e -> get_external_flag()) {
325 std::set<int> faces(e -> get_external_faces());
326 std::set<int>::iterator i(faces.begin());
328 while(i != faces.end()) {
355 std::vector<bool> inflow = e -> p_system -> edge_values(face, e -> get_x(s), Qe);
359 if(inflow[ j ] ==
true) {
Specification of a two dimensional linear element for use in a TVD Lax-Friedrichs scheme.
An DenseVector class – a dense vector object.
A class to represent a two-dimensional hyperbolic system of equations.
vector_of_elts * get_elts_from_colour(std::string mesh_colour)
Given a choice of black or red mesh, return a pointer to the appropriate vector of elements.
vector_of_elts RED_ELTS
An STL vector of linear elements – the red mesh.
virtual void actions_before_time_step1(const double &time_step)
A virtual method that is run before the first time update.
DenseVector< double > get_point_values(const DenseVector< double > &x)
Get the vector of unknowns at a point in the 2D mesh.
std::size_t get_number_elts_in_x(std::string mesh_colour)
Given a choice of black or red mesh, return the number of elements in the x-direction.
void dump_gnu(std::string filename)
Dump the data to a given filename in a gnuplot format.
DenseVector< double > minmod(DenseVector< double > A, DenseVector< double > B) const
A vector version of the minmod operator.
void calc_slopes(vector_of_elts *elt_vector)
Use the appropriate limiter to approximate the slope in each element in the mesh.
vector_of_boundary_elts::iterator bdry_elt_iter
DenseVector< double > integrate(std::string mesh_colour="black")
Integrate the concentration values across the entire mesh.
void update_to(const double &CFL, const double &t_end)
Update the mesh object to a set time level.
unsigned LIMITER
Slope limiter method.
DenseVector< double > EW_diff(elt_iter e)
Compute a finite difference approximation of the derivative in the compass direction.
DenseVector< double > west_diff(elt_iter e) const
Compute a finite difference approximation of the derivative in the compass direction.
DenseVector< double > east_diff(elt_iter e) const
Compute a finite difference approximation of the derivative in the compass direction.
DenseVector< double > south_diff(elt_iter e) const
Compute a finite difference approximation of the derivative in the compass direction.
void(* fn_ptr)(const double &, const double &, DenseVector< double > &)
function pointer used in the initial conditions
void dump_data(std::string filename)
Dump the data over the nodal positions to a given filename.
void boundary_diff(elt_iter e, const int &face_index, DenseVector< double > &diff) const
Given an element iterator and the local coordinate this will return zero for any components specified...
vector_of_elts BLACK_ELTS
An STL vector of linear elements – the black mesh.
elt_iter get_elt_iter_from_elt_iter(elt_iter e, std::string target_colour, int corner_index)
Given an element in the INITIAL STRUCTURED MESH, this method will return an iterator to an element in...
std::vector< TwoD_TVDLF_Elt * > vector_of_boundary_elts
fn_ptr p_Q_INIT
function pointer to a funnction that defines the initial distribution
std::size_t ORDER_OF_SYSTEM
order of the conservative system
int sgn(double a) const
Sign of a double.
void set_boundary_Q(vector_of_elts *elts)
Loops over all boundary elements and sets the Q values in each one to be the value specified by the e...
const double & get_time() const
Get a const reference to the time value for the current mesh.
vector_of_elts::const_iterator celt_iter
void dump_nodes_y(std::string filename) const
Dump the y-nodal positions to a given filename.
double update(const double &CFL, const double &max_dt=std::numeric_limits< long double >::max())
Update the mesh object.
DenseVector< double > NS_diff(elt_iter e)
Compute a finite difference approximation of the derivative in the compass direction.
DenseVector< double > maxmod(DenseVector< double > A, DenseVector< double > B) const
A vector version of the maxmod operator.
void dump_nodes_x(std::string filename) const
Dump the x-nodal positions to a given filename.
std::size_t NX
number of faces in the x & y directions
DenseVector< double > north_diff(elt_iter e) const
Compute a finite difference approximation of the derivative in the compass direction.
virtual ~TwoD_TVDLF_Mesh()
Empty desctructor.
void set_limiter(const unsigned &id)
Set the limiter type to be applied in the slope values.
double MESH_TIME
the time level of the mesh
virtual void actions_before_time_step2(const double &time_step)
A virtual method that is run before the second time update.
vector_of_elts::iterator elt_iter
std::vector< TwoD_TVDLF_Elt > vector_of_elts
iterators for the vector of elements
elt_iter get_elt_iter_from_x(const DenseVector< double > &x, std::string mesh_colour="black")
Given a global coordinate, return a pointer to the elt that contains that point.
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...