29 #ifndef OOMPH_DG_ELEMENT_HEADER
30 #define OOMPH_DG_ELEMENT_HEADER
34 #include <oomph-lib-config.h>
126 std::ostringstream error_stream;
128 <<
"Empty numerical flux function called\n"
129 <<
"This function should be overloaded with a specific flux\n"
130 <<
"that is appropriate to the equations being solved.\n";
218 if (this->Average_value != 0)
266 this->M_pt = element_pt->
M_pt;
292 std::vector<bool>& boundary_flag,
296 const unsigned n_node = this->
nnode();
298 if (boundary_flag.size() != n_node)
300 std::ostringstream error_stream;
302 <<
"Size of boundary_flag vector is " << boundary_flag.size() <<
"\n"
303 <<
"It must be the same as the number of nodes in the element "
312 for (
unsigned n = 0;
n < n_node;
n++)
315 if (boundary_flag[
n])
330 DG_mesh_pt = mesh_pt;
339 const unsigned n_node = this->
nnode();
340 for (
unsigned n = 0;
n < n_node;
n++)
350 DG_mesh_pt = mesh_pt;
375 unsigned n_face =
nface();
376 for (
unsigned f = 0;
f < n_face;
f++)
384 const int& face_index,
395 unsigned n_face = this->
nface();
396 for (
unsigned f = 0;
f < n_face;
f++)
411 unsigned n_face = this->
nface();
412 for (
unsigned f = 0;
f < n_face;
f++)
471 const int& face_index,
476 std::string error_message =
"Empty neighbour_finder() has been called.\n";
478 "This function is implemented in the base class of a DGMesh.\n";
479 error_message +=
"It must be overloaded in a specific DGMesh\n";
490 const bool& add_face_data_as_external =
false)
493 const unsigned n_element = this->
nelement();
494 for (
unsigned e = 0;
e < n_element;
e++)
505 const unsigned n_element = this->
nelement();
506 for (
unsigned e = 0;
e < n_element;
e++)
512 for (
unsigned e = 0;
e < n_element;
e++)
515 ->slope_limit(slope_limiter_pt);
572 void limit(
const unsigned&
i,
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
A Base class for DGElements.
Definition: dg_elements.h:161
bool Can_delete_mass_matrix
Definition: dg_elements.h:190
void disable_mass_matrix_reuse()
Function that disables the reuse of the mass matrix.
Definition: dg_elements.h:240
void calculate_averages()
Calculate the elemental averages.
Definition: dg_elements.h:430
DGMesh * DG_mesh_pt
Pointer to Mesh, which will be responsible for the neighbour finding.
Definition: dg_elements.h:171
void setup_face_neighbour_info(const bool &add_face_data_as_external)
Definition: dg_elements.h:393
virtual void calculate_element_averages(double *&average_values)
Calculate the averages in the element.
Definition: dg_elements.h:422
virtual void build_all_faces()=0
void pre_compute_mass_matrix()
Function that computes and stores the (inverse) mass matrix.
Definition: dg_elements.cc:578
bool mass_matrix_has_been_computed()
Definition: dg_elements.h:227
void add_flux_contributions_to_residuals(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Definition: dg_elements.h:406
void enable_mass_matrix_reuse()
Function that allows the reuse of the mass matrix.
Definition: dg_elements.h:233
double * Average_value
Definition: dg_elements.h:179
void slope_limit(SlopeLimiter *const &slope_limiter_pt)
Limit the slope within the element.
Definition: dg_elements.cc:686
DGElement()
Constructor, initialise the pointers to zero.
Definition: dg_elements.h:200
void construct_nodes_and_faces(DGMesh *const &mesh_pt, TimeStepper *const &time_stepper_pt)
Construct the nodes and faces of the element.
Definition: dg_elements.h:335
Vector< FaceElement * > Face_element_pt
Vector of pointers to faces of the element.
Definition: dg_elements.h:168
unsigned nface() const
Return the number of faces.
Definition: dg_elements.h:360
virtual void set_mass_matrix_from_element(DGElement *const &element_pt)
Set the mass matrix to point to one in another element.
Definition: dg_elements.h:256
virtual unsigned required_nflux()
Set the number of flux components.
Definition: dg_elements.h:193
void set_mesh_pt(DGMesh *&mesh_pt)
Definition: dg_elements.h:354
bool Mass_matrix_has_been_computed
Definition: dg_elements.h:186
double & average_value(const unsigned &i)
Return the average values.
Definition: dg_elements.h:436
void construct_boundary_nodes_and_faces(DGMesh *const &mesh_pt, std::vector< bool > &boundary_flag, TimeStepper *const &time_stepper_pt)
Definition: dg_elements.h:291
bool Mass_matrix_reuse_is_enabled
Boolean flag to indicate whether to reuse the mass matrix.
Definition: dg_elements.h:182
void output_faces(std::ostream &outfile)
Output the faces of the element.
Definition: dg_elements.h:372
DGFaceElement * face_element_pt(const unsigned &i)
Access function for the faces.
Definition: dg_elements.h:366
void get_neighbouring_face_and_local_coordinate(const int &face_index, const Vector< double > &s, FaceElement *&face_element_pt, Vector< double > &s_face)
Return the neighbour info.
Definition: dg_elements.cc:675
virtual ~DGElement()
Definition: dg_elements.h:212
virtual void get_inverse_mass_matrix_times_residuals(Vector< double > &minv_res)
Definition: dg_elements.cc:614
const double & average_value(const unsigned &i) const
Return the average values.
Definition: dg_elements.h:449
DenseDoubleMatrix * M_pt
Definition: dg_elements.h:175
Definition: dg_elements.h:50
virtual void numerical_flux(const Vector< double > &n_out, const Vector< double > &u_int, const Vector< double > &u_ext, Vector< double > &flux)
Definition: dg_elements.h:121
virtual ~DGFaceElement()
Empty Destructor.
Definition: dg_elements.h:84
virtual void get_interpolation_data(Vector< Data * > &interpolation_data)
Definition: dg_elements.cc:241
void setup_neighbour_info(const bool &add_neighbour_data_to_bulk)
Definition: dg_elements.cc:42
void report_info()
Output information about the present element and its neighbour.
Definition: dg_elements.cc:123
Vector< FaceElement * > Neighbour_face_pt
Vector of neighbouring face elements at the integration points.
Definition: dg_elements.h:52
void add_flux_contributions(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Add the contribution from integrating the numerical flux.
Definition: dg_elements.cc:416
DGFaceElement()
Empty Constructor.
Definition: dg_elements.h:81
Vector< Vector< unsigned > > Neighbour_external_data
Definition: dg_elements.h:63
virtual void dnumerical_flux_du(const Vector< double > &n_out, const Vector< double > &u_int, const Vector< double > &u_ext, DenseMatrix< double > &dflux_du_int, DenseMatrix< double > &dflux_du_ext)
Definition: dg_elements.cc:338
virtual void interpolated_u(const Vector< double > &s, Vector< double > &f)
Return the interpolated values of the unknown fluxes.
Definition: dg_elements.cc:196
virtual void numerical_flux_at_knot(const unsigned &ipt, const Shape &psi, Vector< double > &flux, DenseMatrix< double > &dflux_du_int, DenseMatrix< double > &dflux_du_ext, unsigned flag)
Definition: dg_elements.cc:266
Vector< Vector< double > > Neighbour_local_coordinate
Vector of neighbouring local coordinates at the integration points.
Definition: dg_elements.h:55
virtual unsigned flux_index(const unsigned &i) const
Return the index at which the i-th unknown flux is stored.
Definition: dg_elements.h:68
FaceElement * neighbour_face_pt(const unsigned &i)
Access function for neighbouring face information.
Definition: dg_elements.h:87
virtual unsigned required_nflux()
Set the number of flux components.
Definition: dg_elements.h:74
Definition: dg_elements.h:462
void limit_slopes(SlopeLimiter *const &slope_limiter_pt)
Definition: dg_elements.h:502
virtual ~DGMesh()
Definition: dg_elements.h:468
DGMesh()
Definition: dg_elements.h:466
virtual void neighbour_finder(FiniteElement *const &bulk_element_pt, const int &face_index, const Vector< double > &s_bulk, FaceElement *&face_element_pt, Vector< double > &s_face)
Definition: dg_elements.h:470
void setup_face_neighbour_info(const bool &add_face_data_as_external=false)
Definition: dg_elements.h:489
static double FaceTolerance
Definition: dg_elements.h:464
Definition: matrices.h:1271
Definition: elements.h:4338
Definition: elements.h:1313
virtual Node * construct_node(const unsigned &n)
Definition: elements.h:2509
virtual void output(std::ostream &outfile)
Definition: elements.h:3050
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
virtual Node * construct_boundary_node(const unsigned &n)
Definition: elements.h:2538
TimeStepper *& time_stepper_pt()
Definition: geom_objects.h:192
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
Definition: mesh.h:460
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:590
Definition: dg_elements.h:544
double minmod(Vector< double > &args)
The basic minmod function.
Definition: dg_elements.cc:740
bool MUSCL
Boolean flag to indicate a MUSCL or straight min-mod limiter.
Definition: dg_elements.h:550
double minmodB(Vector< double > &args, const double &h)
The modified minmod function.
Definition: dg_elements.cc:800
MinModLimiter(const double &m=0.0, const bool &muscl=false)
Definition: dg_elements.h:556
virtual ~MinModLimiter()
Empty destructor.
Definition: dg_elements.h:562
void limit(const unsigned &i, const Vector< DGElement * > &required_element_pt)
The limit function.
Definition: dg_elements.cc:822
double M
Definition: dg_elements.h:547
Definition: oomph_definitions.h:222
Base class for slope limiters.
Definition: dg_elements.h:525
virtual ~SlopeLimiter()
virtual destructor
Definition: dg_elements.h:531
SlopeLimiter()
Empty constructor.
Definition: dg_elements.h:528
virtual void limit(const unsigned &i, const Vector< DGElement * > &required_element_pt)
Basic function.
Definition: dg_elements.h:534
Definition: timesteppers.h:231
Definition: oomph-lib/src/generic/Vector.h:58
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237
RealScalar s
Definition: level1_cplx_impl.h:130
int * m
Definition: level2_cplx_impl.h:294
void flux(const double &time, const Vector< double > &x, double &flux)
Get flux applied along boundary x=0.
Definition: pretend_melt.cc:59
args
Definition: compute_granudrum_aor.py:143
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86