33 #ifndef OOMPH_POROELASITICTY_FACE_ELEMENTS_HEADER 34 #define OOMPH_POROELASITICTY_FACE_ELEMENTS_HEADER 38 #include <oomph-lib-config.h> 54 namespace PoroelasticityFaceElementHelper
65 unsigned n_dim=load.size();
66 for (
unsigned i=0;
i<n_dim;
i++) {load[
i]=0.0;}
90 template <
class ELEMENT>
103 void (*Traction_fct_pt)(
const double& time,
112 void (*Pressure_fct_pt)(
const double& time,
124 const unsigned& intpt,
129 Traction_fct_pt(time,x,n,traction);
138 const unsigned& intpt,
143 Pressure_fct_pt(time,x,n,pressure);
151 void fill_in_contribution_to_residuals_darcy_face(
160 const int &face_index) :
166 ELEMENT* elem_pt =
new ELEMENT;
168 if(elem_pt->dim()==3)
171 if(dynamic_cast<RefineableElement*>(elem_pt))
175 "This flux element will not work correctly if nodes are hanging\n",
176 OOMPH_CURRENT_FUNCTION,
177 OOMPH_EXCEPTION_LOCATION);
184 Element_pt=
dynamic_cast<ELEMENT*
>(element_pt);
203 {
return Traction_fct_pt;}
210 {
return Pressure_fct_pt;}
216 fill_in_contribution_to_residuals_darcy_face(residuals);
226 fill_in_contribution_to_residuals_darcy_face(residuals);
235 const unsigned &
i)
const 243 void output(std::ostream &outfile,
const unsigned &n_plot)
251 void output(FILE* file_pt,
const unsigned &n_plot)
258 void traction(
const double& time,
265 void pressure(
const double& time,
280 template<
class ELEMENT>
284 unsigned n_dim = this->nodal_dimension();
292 outer_unit_normal(s,unit_normal);
298 get_traction(time,ipt,x,unit_normal,traction);
306 template<
class ELEMENT>
310 unsigned n_dim = this->nodal_dimension();
318 outer_unit_normal(s,unit_normal);
324 get_pressure(time,ipt,x,unit_normal,pressure);
332 template<
class ELEMENT>
339 unsigned n_node = nnode();
342 double time=node_pt(0)->time_stepper_pt()->time_pt()->time();
346 unsigned n_position_type = this->nnodal_position_type();
347 if(n_position_type != 1)
350 "Poroelasticity equations are not yet implemented for more than one position type",
351 OOMPH_CURRENT_FUNCTION,
352 OOMPH_EXCEPTION_LOCATION);
357 unsigned n_dim = this->nodal_dimension();
359 unsigned n_q_basis = Element_pt->nq_basis();
360 unsigned n_q_basis_edge = Element_pt->nq_basis_edge();
369 DShape dpsids(n_node,n_dim-1);
371 Shape q_basis(n_q_basis,n_dim);
374 unsigned n_intpt = integral_pt()->nweight();
383 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
386 double w = integral_pt()->weight(ipt);
389 dshape_local_at_knot(ipt,psi,dpsids);
392 for(
unsigned i=0;
i<n_dim-1;
i++)
394 s_face[
i] = integral_pt()->knot(ipt,
i);
397 s_bulk=local_coordinate_in_bulk(s_face);
401 Element_pt->get_q_basis(s_bulk,q_basis);
410 for(
unsigned l=0;l<n_node;l++)
413 for(
unsigned i=0;
i<n_dim;
i++)
416 const double x_local = nodal_position(l,
i);
417 interpolated_x[
i] += x_local*psi(l);
420 for(
unsigned j=0;j<n_dim-1;j++)
422 interpolated_A(j,
i) += x_local*dpsids(l,j);
429 for(
unsigned i=0;
i<n_dim-1;
i++)
431 for(
unsigned j=0;j<n_dim-1;j++)
437 for(
unsigned k=0;k<n_dim;k++)
439 A(
i,j) += interpolated_A(
i,k)*interpolated_A(j,k);
446 outer_unit_normal(ipt,interpolated_normal);
456 Adet = A(0,0)*A(1,1) - A(0,1)*A(1,0);
461 "Wrong dimension in PoroelasticityFaceElement",
462 OOMPH_CURRENT_FUNCTION,
463 OOMPH_EXCEPTION_LOCATION);
468 double W = w*sqrt(Adet);
487 for(
unsigned l=0;l<n_node;l++)
490 for(
unsigned i=0;
i<n_dim;
i++)
492 local_eqn = this->nodal_local_eqn(l,Element_pt->u_index(
i));
497 residuals[local_eqn] -= traction[
i]*psi(l)*
W;
504 for(
unsigned l=0;l<n_q_basis_edge;l++)
506 local_eqn = this->nodal_local_eqn(1,Element_pt->q_edge_index(l));
512 for(
unsigned i=0;
i<n_dim;
i++)
515 residuals[local_eqn] +=
516 pressure*q_basis(l,
i)*interpolated_normal[
i]*
W;
void Zero_traction_fct(const double &time, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Default load function (zero traction)
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing...
void output(FILE *file_pt)
C_style output function.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
ELEMENT * Element_pt
pointer to the bulk element this face element is attached to
void pressure(const double &time, const Vector< double > &s, double &pressure)
Compute pressure value at specified local coordinate Should only be used for post-processing; ignores...
A general Finite Element class.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
In a FaceElement, the "global" intrinsic coordinate of the element along the boundary, when viewed as part of a compound geometric object is specified using the boundary coordinate defined by the mesh. Note: Boundary coordinates will have been set up when creating the underlying mesh, and their values will have been stored at the nodes.
virtual void get_pressure(const double &time, const unsigned &intpt, const Vector< double > &x, const Vector< double > &n, double &pressure)
Get the pressure value: Pass number of integration point (dummy), Eulerlian coordinate and normal vec...
virtual void get_traction(const double &time, const unsigned &intpt, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction)
Get the traction vector: Pass number of integration point (dummy), Eulerlian coordinate and normal ve...
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
void output(std::ostream &outfile)
Output function.
void Zero_pressure_fct(const double &time, const Vector< double > &x, const Vector< double > &N, double &load)
Default load function (zero pressure)
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Return the residuals.
void(*&)(const double &time, const Vector< double > &x, const Vector< double > &n, double &pressure) pressure_fct_pt()
Reference to the pressure function pointer.
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Function for building a lower dimensional FaceElement on the specified face of the FiniteElement...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
void fill_in_contribution_to_residuals_darcy_face(Vector< double > &residuals)
Helper function that actually calculates the residuals.
PoroelasticityFaceElement(FiniteElement *const &element_pt, const int &face_index)
Constructor, which takes a "bulk" element and the value of the index and its limit.
void(*&)(const double &time, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction) traction_fct_pt()
Reference to the traction function pointer.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
The "global" intrinsic coordinate of the element when viewed as part of a geometric object should be ...
void traction(const double &time, const Vector< double > &s, Vector< double > &traction)
Compute traction vector at specified local coordinate Should only be used for post-processing; ignore...