30 #ifndef OOMPH_TPOROELASTICITY_ELEMENTS_HEADER 31 #define OOMPH_TPOROELASTICITY_ELEMENTS_HEADER 35 #include <oomph-lib-config.h> 39 #include "../generic/Telements.h" 45 template<
unsigned ORDER>
79 return Initial_Nvalue[n];
87 std::ostringstream error_message;
88 error_message <<
"Range Error: n " << n
89 <<
" is not in the range (0,1)";
91 OOMPH_CURRENT_FUNCTION,
92 OOMPH_EXCEPTION_LOCATION);
102 #ifdef RANGE_CHECKING 105 std::ostringstream error_message;
106 error_message <<
"Range Error: n " << n
107 <<
" is not in the range (0," 110 OOMPH_CURRENT_FUNCTION,
111 OOMPH_EXCEPTION_LOCATION);
120 #ifdef RANGE_CHECKING 123 std::ostringstream error_message;
124 error_message <<
"Range Error: n " << n
125 <<
" is not in the range (0," 128 OOMPH_CURRENT_FUNCTION,
129 OOMPH_EXCEPTION_LOCATION);
145 #ifdef RANGE_CHECKING 148 std::ostringstream error_message;
149 error_message <<
"Range Error: n " << n
150 <<
" is not in the range (0," 153 OOMPH_CURRENT_FUNCTION,
154 OOMPH_EXCEPTION_LOCATION);
157 return n%(ORDER+1)+2;
163 #ifdef RANGE_CHECKING 166 std::ostringstream error_message;
167 error_message <<
"Range Error: n " << n
168 <<
" is not in the range (0," 171 OOMPH_CURRENT_FUNCTION,
172 OOMPH_EXCEPTION_LOCATION);
175 return Q_edge_conv[n/(ORDER+1)];
181 #ifdef RANGE_CHECKING 184 std::ostringstream error_message;
185 error_message <<
"Range Error: n " << n
186 <<
" is not in the range (0," 189 OOMPH_CURRENT_FUNCTION,
190 OOMPH_EXCEPTION_LOCATION);
198 double q_edge(
const unsigned &
t,
const unsigned &n)
const 200 #ifdef RANGE_CHECKING 203 std::ostringstream error_message;
204 error_message <<
"Range Error: n " << n
205 <<
" is not in the range (0," 208 OOMPH_CURRENT_FUNCTION,
209 OOMPH_EXCEPTION_LOCATION);
218 #ifdef RANGE_CHECKING 221 std::ostringstream error_message;
222 error_message <<
"Range Error: n " << n
223 <<
" is not in the range (0," 226 OOMPH_CURRENT_FUNCTION,
227 OOMPH_EXCEPTION_LOCATION);
237 #ifdef RANGE_CHECKING 241 std::ostringstream error_message;
242 error_message <<
"Range Error: n " << n
243 <<
" is not in the range (0," 246 OOMPH_CURRENT_FUNCTION,
247 OOMPH_EXCEPTION_LOCATION);
261 Shape &q_basis)
const;
265 Shape &div_q_basis_ds)
const;
273 const unsigned &n)
const 275 #ifdef RANGE_CHECKING 278 std::ostringstream error_message;
279 error_message <<
"Range Error: edge " << edge
280 <<
" is not in the range (0,2)";
282 OOMPH_CURRENT_FUNCTION,
283 OOMPH_EXCEPTION_LOCATION);
287 std::ostringstream error_message;
288 error_message <<
"Range Error: n " << n
289 <<
" is not in the range (0," 292 OOMPH_CURRENT_FUNCTION,
293 OOMPH_EXCEPTION_LOCATION);
304 #ifdef RANGE_CHECKING 307 std::ostringstream error_message;
308 error_message <<
"Range Error: edge " << edge
309 <<
" is not in the range (0,2)";
311 OOMPH_CURRENT_FUNCTION,
312 OOMPH_EXCEPTION_LOCATION);
316 std::ostringstream error_message;
317 error_message <<
"Range Error: n " << n
318 <<
" is not in the range (0," 321 OOMPH_CURRENT_FUNCTION,
322 OOMPH_EXCEPTION_LOCATION);
332 unsigned node_number=Q_edge_conv[edge];
342 s_gauss[0]=1-gauss_point;
343 s_gauss[1]=gauss_point;
347 s_gauss[1]=1-gauss_point;
350 s_gauss[0]=gauss_point;
362 #ifdef RANGE_CHECKING 365 std::ostringstream error_message;
366 error_message <<
"Range Error: n " << n
367 <<
" is not in the range (0," 370 OOMPH_CURRENT_FUNCTION,
371 OOMPH_EXCEPTION_LOCATION);
380 #ifdef RANGE_CHECKING 383 std::ostringstream error_message;
384 error_message <<
"Range Error: n " << n
385 <<
" is not in the range (0," 388 OOMPH_CURRENT_FUNCTION,
389 OOMPH_EXCEPTION_LOCATION);
398 #ifdef RANGE_CHECKING 401 std::ostringstream error_message;
402 error_message <<
"Range Error: n " << n
403 <<
" is not in the range (0," 406 OOMPH_CURRENT_FUNCTION,
407 OOMPH_EXCEPTION_LOCATION);
418 Shape &p_basis)
const;
423 #ifdef RANGE_CHECKING 426 std::ostringstream error_message;
427 error_message <<
"Range Error: n " << n
428 <<
" is not in the range (0," 431 OOMPH_CURRENT_FUNCTION,
432 OOMPH_EXCEPTION_LOCATION);
450 for(
unsigned i=0;
i<3;
i++)
457 length[
i]=std::sqrt(std::pow(y1-y0,2)+std::pow(x1-x0,2));
462 const double ref_length[3]={std::sqrt(2.0),1,1};
469 const unsigned n_index2 = basis.
nindex2();
470 for(
unsigned i=0;
i<n_index2;
i++)
472 for(
unsigned l=0;l<n_q_basis_edge;l++)
474 basis(l,
i)*=(length[l/(ORDER+1)]/ref_length[l/(ORDER+1)]);
499 void output(std::ostream &outfile,
const unsigned &Nplot)
519 Shape &div_q_basis_ds,
520 Shape &div_q_test_ds)
const 522 const unsigned n_q_basis = this->
nq_basis();
524 Shape q_basis_local(n_q_basis,2);
540 div_q_test_ds=div_q_basis_ds;
558 Shape &div_q_basis_ds,
559 Shape &div_q_test_ds)
const 567 du_basis_dx,du_test_dx,
570 div_q_basis_ds,div_q_test_ds);
unsigned nindex2() const
Return the range of index 2 of the shape function object.
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 ...
unsigned u_index(const unsigned &n) const
Return the nodal index of the n-th solid displacement unknown.
double p_value(unsigned &n) const
Return the nth pressure value.
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.
unsigned q_edge_index(const unsigned &n) const
Return the nodal index at which the nth edge unknown is stored.
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 ...
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_edge(const unsigned &n) const
Return the values of the edge (flux) degrees of freedom.
void output(std::ostream &outfile)
Output with default number of plot points.
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...
void pin_q_internal_value(const unsigned &n)
Pin the nth internal q value.
int q_internal_local_eqn(const unsigned &n) const
Return the equation number of the n-th internal (moment) degree of freedom.
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.
double q_internal(const unsigned &n) const
Return the values of the internal (moment) degrees of freedom.
int p_local_eqn(const unsigned &n) const
Return the equation number of the n-th pressure degree of freedom.
~TPoroelasticityElement()
Destructor.
void pin(const unsigned &i)
Pin the i-th stored variable.
FaceGeometry()
Constructor: Call constructor of base.
TPoroelasticityElement()
Constructor.
void scale_basis(Shape &basis) const
Scale the edge basis to allow arbitrary edge mappings.
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.
void pin_p_value(const unsigned &n, const double &p)
Pin the nth pressure value.
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.
double & x(const unsigned &i)
Return the i-th nodal coordinate.
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
int q_edge_local_eqn(const unsigned &n) const
Return the equation number of the n-th edge (flux) degree of freedom.
unsigned required_nvalue(const unsigned &n) const
Number of values required at node n.
Element which solves the Darcy equations using TElements.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
unsigned nq_basis_edge() const
Return the number of edge basis functions for u.
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
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...
const unsigned Initial_Nvalue[6]
The number of values stored at each node.
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
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.
double edge_gauss_point(const unsigned &edge, const unsigned &n) const
unsigned np_basis() const
Return the total number of pressure basis functions.
const short & sign_edge(const unsigned &n) const
Accessor for the unit normal sign of edge n (const version)
FaceGeometry()
Constructor: Call constructor of base class.
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...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Class implementing the generic maths of the poroelasticity equations: linear elasticity coupled with ...
unsigned q_internal_index() const
Return the index of the internal data where the q_internal degrees of freedom are stored...
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...
unsigned nq_basis() const
Return the total number of computational basis functions for u.
const unsigned Q_edge_conv[3]
Conversion scheme from an edge degree of freedom to the node it's stored at.
unsigned q_edge_node_number(const unsigned &n) const
Return the number of the node where 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...
unsigned P_internal_data_index
The internal data index where the p degrees of freedom are stored.
const double Gauss_point[1]
The points along each edge where the fluxes are taken to be.
unsigned Q_internal_data_index
The internal data index where the internal q degrees of freedom are stored.
unsigned nedge_gauss_point() const
Returns the number of gauss points along each edge of the element.
void get_p_basis(const Vector< double > &s, Shape &p_basis) const
Return the pressure basis.
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 ...
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...
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...