26 #ifndef OOMPH_TRAVIART_THOMAS_DARCY_HEADER
27 #define OOMPH_TRAVIART_THOMAS_DARCY_HEADER
31 #include <oomph-lib-config.h>
35 #include "../generic/Telements.h"
46 template<
unsigned ORDER>
110 s[0] = flux_interpolation_point[0];
113 s[0] = 1.0 - flux_interpolation_point[0];
116 s[0] = flux_interpolation_point[0];
167 return n % (ORDER + 1);
218 Shape& div_q_basis_ds)
const;
227 const unsigned& n)
const
230 coord[0] = (1.0 -
sign_edge(edge)) / 2.0 +
270 s_flux_interpolation[0] = 1.0 - flux_interpolation_point[0];
271 s_flux_interpolation[1] = flux_interpolation_point[0];
274 s_flux_interpolation[0] = 0.0;
275 s_flux_interpolation[1] = 1.0 - flux_interpolation_point[0];
278 s_flux_interpolation[0] = flux_interpolation_point[0];
279 s_flux_interpolation[1] = 0.0;
331 double x0, y0, x1, y1;
335 for (
unsigned i = 0;
i < 3;
i++)
342 length[
i] = std::sqrt(std::pow(y1 - y0, 2) + std::pow(x1 - x0, 2));
347 const double ref_length[3] = {std::sqrt(2.0), 1, 1};
354 const unsigned n_index2 = basis.
nindex2();
355 for (
unsigned i = 0;
i < n_index2;
i++)
357 for (
unsigned l = 0; l < n_q_basis_edge; l++)
360 (length[l / (ORDER + 1)] / ref_length[l / (ORDER + 1)]);
385 void output(std::ostream& outfile,
const unsigned& Nplot)
415 Shape& div_q_basis_ds,
416 Shape& div_q_test_ds)
const
418 const unsigned n_q_basis = this->
nq_basis();
420 Shape q_basis_local(n_q_basis, 2);
429 div_q_test_ds = div_q_basis_ds;
442 Shape& div_q_basis_ds,
443 Shape& div_q_test_ds)
const
446 for (
unsigned i = 0;
i < 2;
i++)
Class implementing the generic maths of the Darcy equations using Raviart-Thomas elements with both e...
double transform_basis(const Vector< double > &s, const Shape &q_basis_local, Shape &psi, Shape &q_basis) const
Performs a div-conserving transformation of the vector basis functions from the reference element to ...
unsigned nq_basis() const
Return the total number of computational basis functions for q.
void output(std::ostream &outfile)
Output with default number of plot points.
A class that represents a collection of data; each Data object may contain many different individual ...
void pin(const unsigned &i)
Pin the i-th stored variable.
void set_value(const unsigned &i, const double &value_)
Set the i-th stored data value to specified value. The only reason that we require an explicit set fu...
double value(const unsigned &i) const
Return i-th stored value. This function is not virtual so that it can be inlined. This means that if ...
FaceGeometry()
Constructor: Call constructor of base.
FaceGeometry()
Constructor: Call constructor of base class.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Return the local equation number corresponding to the i-th value at the n-th local node.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
int internal_local_eqn(const unsigned &i, const unsigned &j) const
Return the local equation number corresponding to the j-th value stored at the i-th internal data.
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
double & x(const unsigned &i)
Return the i-th nodal coordinate.
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
unsigned nindex2() const
Return the range of index 2 of the shape function object.
Element which solves the Darcy equations using TElements. Geometrically the element is always a six n...
Node * edge_flux_node_pt(const unsigned &edge)
Get pointer to node that stores the edge flux dofs for specified edge.
void edge_flux_interpolation_point_global(const unsigned &j, Vector< double > &x) const
Compute the global coordinates of the flux interpolation point associated with the j-th edge-based q ...
void get_q_basis_local(const Vector< double > &s, Shape &q_basis) const
Return the local form of the q basis at local coordinate s.
unsigned face_index_of_edge(const unsigned &j) const
Return the face index associated with specified edge.
const short & sign_edge(const unsigned &n) const
Accessor for the unit normal sign of edge n (const version)
void face_local_coordinate_of_flux_interpolation_point(const unsigned &edge, const unsigned &n, Vector< double > &s) const
Compute the face element coordinates of the nth flux interpolation point along specified edge.
void pin_q_internal_value(const unsigned &n)
Pin the nth internal q value.
Data * p_data_pt() const
Return pointer to the Data object that stores the pressure values.
int p_local_eqn(const unsigned &n) const
Return the equation number of the n-th pressure degree of freedom.
unsigned required_nvalue(const unsigned &n) const
Number of values required at node n.
unsigned nvertex_node() const
Number of vertex nodes in the element.
void edge_flux_interpolation_point_global(const unsigned &edge, const unsigned &n, Vector< double > &x) const
Compute the global coordinates of the nth flux interpolation point along an edge.
Data * q_internal_data_pt() const
Return pointer to the Data object that stores the internal flux values.
double p_value(const unsigned &n) const
Return the nth pressure value.
unsigned q_edge_index(const unsigned &n) const
Return the nodal index at which the nth edge unknown is stored.
void output(std::ostream &outfile)
Output with default number of plot points.
short & sign_edge(const unsigned &n)
Accessor for the unit normal sign of edge n.
double q_internal(const unsigned &n) const
Return the values of the internal degree of freedom.
void set_q_internal(const unsigned &n, const double &value)
Set the values of the internal degree of freedom.
void get_div_q_basis_local(const Vector< double > &s, Shape &div_q_basis_ds) const
Return the local form of the q basis and dbasis/ds at local coordinate s.
~TRaviartThomasDarcyElement()
Destructor.
static const unsigned Initial_Nvalue[]
The number of values stored at each node.
unsigned np_basis() const
Return the total number of pressure basis functions.
static const unsigned Q_edge_conv[]
Conversion scheme from an edge degree of freedom to the node it's stored at.
unsigned face_index_of_q_edge_basis_fct(const unsigned &j) const
Return the face index associated with edge flux degree of freedom.
unsigned q_edge_node_number(const unsigned &n) const
Return the local node number of the node where the nth edge unknown is stored.
double q_edge(const unsigned &n) const
Return the values of the edge (flux) degree of freedom.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
static const unsigned Face_index_of_edge_flux[]
Face index associated with edge flux degree of freedom.
std::vector< short > Sign_edge
Unit normal signs associated with each edge to ensure inter-element continuity of the flux.
void set_p_value(const unsigned &n, const double &value)
Set the nth pressure value.
void output(std::ostream &outfile, const unsigned &Nplot)
Output FE representation of soln: x,y,u1,u2,div_q,p at Nplot^DIM plot points.
int q_internal_local_eqn(const unsigned &n) const
Return the equation number of the n-th internal degree of freedom.
static const double Flux_interpolation_point[]
The points along each edge where the fluxes are interpolated.
unsigned q_internal_index() const
Return the index of the internal data where the q_internal degrees of freedom are stored.
void scale_basis(Shape &basis) const
Scale the edge basis to allow arbitrary edge mappings.
void get_p_basis(const Vector< double > &s, Shape &p_basis) const
Compute the pressure basis.
unsigned P_internal_data_index
The internal data index where the p degrees of freedom are stored.
double shape_basis_test_local(const Vector< double > &s, Shape &psi, Shape &q_basis, Shape &q_test, Shape &p_basis, Shape &p_test, Shape &div_q_basis_ds, Shape &div_q_test_ds) const
Return the geometric basis, and the q, p and divergence basis functions and test functions at local c...
int q_edge_local_eqn(const unsigned &n) const
Return the equation nunmber of the n-th edge (flux) degree of freedom.
Vector< Data * > q_edge_data_pt() const
Return vector of pointers to the Data objects that store the edge flux values.
void set_q_edge(const unsigned &n, const double &value)
Set the values of the edge (flux) degree of freedom.
unsigned nrecovery_order()
Recovery order for Z2 error estimator.
TRaviartThomasDarcyElement()
Constructor.
Vector< double > edge_flux_interpolation_point(const unsigned &edge, const unsigned &n) const
Return the local coordinate of the nth flux interpolation point along an edge.
void pin_p_value(const unsigned &n)
Pin the nth pressure value.
unsigned Q_internal_data_index
The internal data index where the internal q degrees of freedom are stored.
unsigned nedge_flux_interpolation_point() const
Return the number of flux interpolation points along each edge of the element.
unsigned nq_basis_internal() const
Return the number of internal basis functions for q.
unsigned nq_basis_edge() const
Return the number of edge basis functions for q.
double shape_basis_test_local_at_knot(const unsigned &ipt, Shape &psi, Shape &q_basis, Shape &q_test, Shape &p_basis, Shape &p_test, Shape &div_q_basis_ds, Shape &div_q_test_ds) const
Return the geometric basis, and the q, p and divergence basis functions and test functions at integra...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...