26 #ifndef OOMPH_TPOROELASTICITY_ELEMENTS_HEADER
27 #define OOMPH_TPOROELASTICITY_ELEMENTS_HEADER
31 #include <oomph-lib-config.h>
35 #include "../generic/Telements.h"
40 template<
unsigned ORDER>
84 std::ostringstream error_message;
85 error_message <<
"Range Error: n " << n <<
" is not in the range (0,1)";
87 OOMPH_CURRENT_FUNCTION,
88 OOMPH_EXCEPTION_LOCATION);
101 std::ostringstream error_message;
102 error_message <<
"Range Error: n " << n <<
" is not in the range (0,"
105 OOMPH_CURRENT_FUNCTION,
106 OOMPH_EXCEPTION_LOCATION);
116 #ifdef RANGE_CHECKING
119 std::ostringstream error_message;
120 error_message <<
"Range Error: n " << n <<
" is not in the range (0,"
123 OOMPH_CURRENT_FUNCTION,
124 OOMPH_EXCEPTION_LOCATION);
140 #ifdef RANGE_CHECKING
143 std::ostringstream error_message;
144 error_message <<
"Range Error: n " << n <<
" is not in the range (0,"
147 OOMPH_CURRENT_FUNCTION,
148 OOMPH_EXCEPTION_LOCATION);
151 return n % (ORDER + 1) + 2;
157 #ifdef RANGE_CHECKING
160 std::ostringstream error_message;
161 error_message <<
"Range Error: n " << n <<
" is not in the range (0,"
164 OOMPH_CURRENT_FUNCTION,
165 OOMPH_EXCEPTION_LOCATION);
174 #ifdef RANGE_CHECKING
177 std::ostringstream error_message;
178 error_message <<
"Range Error: n " << n <<
" is not in the range (0,"
181 OOMPH_CURRENT_FUNCTION,
182 OOMPH_EXCEPTION_LOCATION);
190 double q_edge(
const unsigned&
t,
const unsigned& n)
const
192 #ifdef RANGE_CHECKING
195 std::ostringstream error_message;
196 error_message <<
"Range Error: n " << n <<
" is not in the range (0,"
199 OOMPH_CURRENT_FUNCTION,
200 OOMPH_EXCEPTION_LOCATION);
209 #ifdef RANGE_CHECKING
212 std::ostringstream error_message;
213 error_message <<
"Range Error: n " << n <<
" is not in the range (0,"
216 OOMPH_CURRENT_FUNCTION,
217 OOMPH_EXCEPTION_LOCATION);
227 #ifdef RANGE_CHECKING
231 std::ostringstream error_message;
232 error_message <<
"Range Error: n " << n <<
" is not in the range (0,"
235 OOMPH_CURRENT_FUNCTION,
236 OOMPH_EXCEPTION_LOCATION);
254 Shape& div_q_basis_ds)
const;
264 #ifdef RANGE_CHECKING
267 std::ostringstream error_message;
268 error_message <<
"Range Error: edge " << edge
269 <<
" is not in the range (0,2)";
271 OOMPH_CURRENT_FUNCTION,
272 OOMPH_EXCEPTION_LOCATION);
276 std::ostringstream error_message;
277 error_message <<
"Range Error: n " << n <<
" is not in the range (0,"
280 OOMPH_CURRENT_FUNCTION,
281 OOMPH_EXCEPTION_LOCATION);
292 #ifdef RANGE_CHECKING
295 std::ostringstream error_message;
296 error_message <<
"Range Error: edge " << edge
297 <<
" is not in the range (0,2)";
299 OOMPH_CURRENT_FUNCTION,
300 OOMPH_EXCEPTION_LOCATION);
304 std::ostringstream error_message;
305 error_message <<
"Range Error: n " << n <<
" is not in the range (0,"
308 OOMPH_CURRENT_FUNCTION,
309 OOMPH_EXCEPTION_LOCATION);
329 s_gauss[0] = 1 - gauss_point;
330 s_gauss[1] = gauss_point;
334 s_gauss[1] = 1 - gauss_point;
337 s_gauss[0] = gauss_point;
349 #ifdef RANGE_CHECKING
352 std::ostringstream error_message;
353 error_message <<
"Range Error: n " << n <<
" is not in the range (0,"
356 OOMPH_CURRENT_FUNCTION,
357 OOMPH_EXCEPTION_LOCATION);
366 #ifdef RANGE_CHECKING
369 std::ostringstream error_message;
370 error_message <<
"Range Error: n " << n <<
" is not in the range (0,"
373 OOMPH_CURRENT_FUNCTION,
374 OOMPH_EXCEPTION_LOCATION);
383 #ifdef RANGE_CHECKING
386 std::ostringstream error_message;
387 error_message <<
"Range Error: n " << n <<
" is not in the range (0,"
390 OOMPH_CURRENT_FUNCTION,
391 OOMPH_EXCEPTION_LOCATION);
406 #ifdef RANGE_CHECKING
409 std::ostringstream error_message;
410 error_message <<
"Range Error: n " << n <<
" is not in the range (0,"
413 OOMPH_CURRENT_FUNCTION,
414 OOMPH_EXCEPTION_LOCATION);
428 double x0, y0, x1, y1;
432 for (
unsigned i = 0;
i < 3;
i++)
439 length[
i] = std::sqrt(std::pow(y1 - y0, 2) + std::pow(x1 - x0, 2));
444 const double ref_length[3] = {std::sqrt(2.0), 1, 1};
451 const unsigned n_index2 = basis.
nindex2();
452 for (
unsigned i = 0;
i < n_index2;
i++)
454 for (
unsigned l = 0; l < n_q_basis_edge; l++)
457 (length[l / (ORDER + 1)] / ref_length[l / (ORDER + 1)]);
482 void output(std::ostream& outfile,
const unsigned& Nplot)
501 Shape& div_q_basis_ds,
502 Shape& div_q_test_ds)
const
504 const unsigned n_q_basis = this->
nq_basis();
506 Shape q_basis_local(n_q_basis, 2);
511 double J = this->
transform_basis(s, q_basis_local, psi, dpsi, q_basis);
522 div_q_test_ds = div_q_basis_ds;
540 Shape& div_q_basis_ds,
541 Shape& div_q_test_ds)
const
544 for (
unsigned i = 0;
i < 2;
i++)
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
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.
double & x(const unsigned &i)
Return the i-th nodal coordinate.
An OomphLibError object which should be thrown when an run-time error is encountered....
Class implementing the generic maths of the poroelasticity equations: linear elasticity coupled with ...
double transform_basis(const Vector< double > &s, const Shape &q_basis_local, Shape &psi, DShape &dpsi, Shape &q_basis) const
Performs a div-conserving transformation of the vector basis functions from the reference element to ...
void output(std::ostream &outfile)
Output with default number of plot points.
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.
double q_edge(const unsigned &n) const
Return the values of the edge (flux) degrees of freedom.
short & sign_edge(const unsigned &n)
Accessor for the unit normal sign of edge n.
unsigned required_nvalue(const unsigned &n) const
Number of values required at node n.
void pin_p_value(const unsigned &n, const double &p)
Pin the nth pressure value.
TPoroelasticityElement()
Constructor.
double edge_gauss_point(const unsigned &edge, const unsigned &n) const
Returns the nth gauss point along an edge: if sign_edge(edge)==1, returns regular gauss point; if sig...
unsigned Q_internal_data_index
The internal data index where the internal q degrees of freedom are stored.
void get_div_q_basis_local(const Vector< double > &s, Shape &div_q_basis_ds) const
Returns the local form of the q basis and dbasis/ds at local coordinate s.
static const unsigned Q_edge_conv[]
Conversion scheme from an edge degree of freedom to the node it's stored at.
unsigned u_index(const unsigned &n) const
Return the nodal index of the n-th solid displacement unknown.
double shape_basis_test_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsi, Shape &u_basis, Shape &u_test, DShape &du_basis_dx, DShape &du_test_dx, Shape &q_basis, Shape &q_test, Shape &p_basis, Shape &p_test, Shape &div_q_basis_ds, Shape &div_q_test_ds) const
Returns the geometric basis, and the u, p and divergence basis functions and test functions at integr...
double shape_basis_test_local(const Vector< double > &s, Shape &psi, DShape &dpsi, Shape &u_basis, Shape &u_test, DShape &du_basis_dx, DShape &du_test_dx, Shape &q_basis, Shape &q_test, Shape &p_basis, Shape &p_test, Shape &div_q_basis_ds, Shape &div_q_test_ds) const
Returns the geometric basis, and the u, p and divergence basis functions and test functions at local ...
unsigned q_edge_index(const unsigned &n) const
Return the nodal index at which the nth edge unknown is stored.
std::vector< short > Sign_edge
Unit normal signs associated with each edge to ensure inter-element continuity of the flux.
void output(std::ostream &outfile)
Output with default number of plot points.
unsigned nedge_gauss_point() const
Returns the number of gauss points along each edge of the element.
void scale_basis(Shape &basis) const
Scale the edge basis to allow arbitrary edge mappings.
void pin_q_internal_value(const unsigned &n)
Pin the nth internal q value.
unsigned q_internal_index() const
Return the index of the internal data where the q_internal degrees of freedom are stored.
int p_local_eqn(const unsigned &n) const
Return the equation number of the n-th pressure degree of freedom.
void get_p_basis(const Vector< double > &s, Shape &p_basis) const
Return the pressure basis.
static const double Gauss_point[]
The points along each edge where the fluxes are taken to be.
unsigned np_basis() const
Return the total number of pressure basis functions.
unsigned nq_basis_edge() const
Return the number of edge basis functions for u.
int q_edge_local_eqn(const unsigned &n) const
Return the equation number of the n-th edge (flux) degree of freedom.
double q_internal(const unsigned &t, const unsigned &n) const
Return the values of the internal (moment) degrees of freedom at time history level t.
int q_internal_local_eqn(const unsigned &n) const
Return the equation number of the n-th internal (moment) degree of freedom.
double p_value(unsigned &n) const
Return the nth pressure value.
unsigned P_internal_data_index
The internal data index where the p degrees of freedom are stored.
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.
void get_q_basis_local(const Vector< double > &s, Shape &q_basis) const
Returns the local form of the q basis at local coordinate s.
static const unsigned Initial_Nvalue[]
The number of values stored at each node.
~TPoroelasticityElement()
Destructor.
double q_edge(const unsigned &t, const unsigned &n) const
Return the values of the edge (flux) degrees of freedom at time history level t.
unsigned q_edge_node_number(const unsigned &n) const
Return the number of the node where the nth edge unknown is stored.
void edge_gauss_point_global(const unsigned &edge, const unsigned &n, Vector< double > &x) const
Returns the global coordinates of the nth gauss point along an edge.
const short & sign_edge(const unsigned &n) const
Accessor for the unit normal sign of edge n (const version)
double q_internal(const unsigned &n) const
Return the values of the internal (moment) degrees of freedom.
unsigned nq_basis() const
Return the total number of computational basis functions for u.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...