5#ifndef TWOD_TVDLF_ELT_H
6#define TWOD_TVDLF_ELT_H
21 typedef std::vector<TwoD_TVDLF_Elt> vector_of_elts;
22 typedef vector_of_elts::const_iterator celt_iter;
23 typedef vector_of_elts::iterator elt_iter;
29 std::set< int > face_indices;
43 double south,
double north,
45 bool flag =
false, std::set<int> faces = std::set<int>());
80 std::set< int > indices);
294 std::list< contribution > CONT_LIST;
307 std::vector< TwoD_TVDLF_Elt* > p_ELTS;
309 std::set<int> EXTERNAL_FACES;
312 std::vector<bool> FLUX_FACE_DONE;
320 return Q + (SLOPE_X * s[ 0 ] * DX
321 + SLOPE_Y * s[ 1 ] * DY) / 2;
349 const double sub_dx(DX * (s_ne[ 0 ] - s_sw[ 0 ]) / 2);
350 const double sub_dy(DY * (s_ne[ 1 ] - s_sw[ 1 ]) / 2);
351 return get_Q((s_ne + s_sw) / 2) * sub_dx * sub_dy;
358 return std::min(DX / c[ 0 ], DY / c[ 1 ]);
A matrix class that constructs a DENSE matrix as a row major std::vector of DenseVectors.
An DenseVector class – a dense vector object.
A class to represent a two-dimensional hyperbolic system of equations.
void set_external_flag(bool flag)
Set the external flag.
void clear_contributions()
Reset the contributions to this element.
void set_slope_x(const DenseVector< double > &value)
Set the x-slope vector for this element.
void set_ptrs(const int &index, TwoD_TVDLF_Elt *ptr)
Each element stores pointers to any adjacent elements in the four compass directions 0,...
double get_max_dt() const
Get the maximum allowable time step for this element by using information about the size of the eleme...
DenseVector< double > get_source_fn(const DenseVector< double > &s) const
Get the source function evaluated for the concentration value stored in this elt.
void dump() const
Dump the details of this element.
DenseVector< double > get_flux_fn_y(const DenseVector< double > &s) const
Get the flux function in the y direction evaluated for the concentration value stored in this elt.
DenseVector< double > get_slope_x() const
The concentration is approximated by a linear function in each element.
DenseVector< double > get_x(DenseVector< double > s) const
Get the global position of a local coordinate in this element.
double get_dA() const
Get the area of the element.
DenseVector< double > get_Q_mid() const
Get the nodal concentration.
DenseVector< double > get_flux_fn_x(const DenseVector< double > &s) const
Get the flux function in the x direction evaluated for the concentration value stored in this elt.
void add_external_face(const int &i)
Add an external face to the stored stl::set.
DenseVector< double > get_Q(const DenseVector< double > &s) const
Get the value of the 'concentration' stored in this element.
DenseMatrix< double > get_Jac_flux_fn_x(const DenseVector< double > &s) const
Get the Jacobian of the x flux function evaluated for the concentration value stored in this elt.
bool get_external_flag() const
Get the external flag.
bool face_is_external(const int &index) const
Test to see if a face index of an element is external to the mesh.
DenseVector< double > get_slope_y() const
The concentration is approximated by a linear function in each element.
TwoD_Hyperbolic_System * p_system
bool face_is_internal(const int &index) const
Test to see if a face index of an element is internal to the mesh.
void contributed_flux_out_north(const double &dt, DenseVector< double > &flux_out_north)
Compute the flux out of this element across the northern face.
void add_contribution(TwoD_TVDLF_Elt *ptr, const DenseVector< double > &sw, const DenseVector< double > &ne, std::set< int > indices)
Add a contribution to this element from another element.
void set_Q_mid(const DenseVector< double > &value)
Set the value of the vector 'concentration' stored in this element.
void set_slope_y(const DenseVector< double > &value)
Set the y-slope vector for this element.
DenseVector< double > get_dx() const
Get the size of the element as a vector (delta_x, delta_y).
void contributed_flux_in_west(const double &dt, DenseVector< double > &flux_in_west)
Compute the flux into this element across the western face.
DenseVector< double > get_x_mid() const
Get the global position of a central node in this element.
void add_flux_contributions(const double &dt)
Adds the contribution of each face's flux to the correction for this element unless it has already be...
DenseVector< double > get_source_contribution(const double &dt) const
Evaluate the contribution to this element by the hyperbolic system's source function over a given tim...
void contributed_flux_out_east(const double &dt, DenseVector< double > &flux_out_east)
Compute the flux out of this element across the eastern face.
std::set< int > get_external_faces() const
Get a set of indices of faces that are external.
void remove_external_face(const int &i)
Remove an external face to the stored stl::set.
DenseVector< double > get_s(const DenseVector< double > &x) const
Get the local coordinate that corresponds to a given global coordinate.
~TwoD_TVDLF_Elt()
An empty destructor.
DenseMatrix< double > get_Jac_flux_fn_y(const DenseVector< double > &s) const
Get the Jacobian of the y flux function evaluated for the concentration value stored in this elt.
void contributed_flux_in_south(const double &dt, DenseVector< double > &flux_in_south)
Compute the flux into this element across the southern face.
DenseVector< double > get_int_Q(const DenseVector< double > &sw, const DenseVector< double > &ne) const
Get the integral of Q over a sub-element.
DenseVector< double > contributed_Q() const
Find the integral contributions to this black/red element from the corresponding contributing red/bla...
DenseVector< double > get_Q_Taylor_series(const DenseVector< double > &s, const double &dt) const
Get the Taylor series expansion of the concentration for a given time step and local coordinate for t...
TwoD_TVDLF_Elt * get_ptrs(const int &index) const
Return a pointer to an element in the given compass direction.
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...