33 #ifndef OOMPH_DARCY_FACE_ELEMENTS_HEADER 34 #define OOMPH_DARCY_FACE_ELEMENTS_HEADER 38 #include <oomph-lib-config.h> 43 #include "../../../src/generic/Qelements.h" 54 namespace DarcyFaceElementHelper
78 template <
class ELEMENT>
88 void (*Pressure_fct_pt)(
const double &time,
100 const unsigned &intpt,
105 Pressure_fct_pt(time,x,n,pressure);
113 void fill_in_contribution_to_residuals_darcy_face(
122 const int &face_index) :
129 ELEMENT* elem_pt =
dynamic_cast<ELEMENT*
>(element_pt);
131 if(elem_pt->dim()==3)
137 if (this->has_hanging_nodes())
140 "This flux element will not work correctly if nodes are hanging\n",
141 OOMPH_CURRENT_FUNCTION,
142 OOMPH_EXCEPTION_LOCATION);
163 {
return Pressure_fct_pt;}
169 fill_in_contribution_to_residuals_darcy_face(residuals);
179 fill_in_contribution_to_residuals_darcy_face(residuals);
188 const unsigned &
i)
const 196 void output(std::ostream &outfile,
const unsigned &n_plot)
206 void output(FILE* file_pt,
const unsigned &n_plot)
213 void pressure(
const double& time,
228 template<
class ELEMENT>
232 unsigned n_dim = this->nodal_dimension();
240 outer_unit_normal(s,unit_normal);
246 get_pressure(time,ipt,x,unit_normal,pressure);
254 template<
class ELEMENT>
261 unsigned n_node = nnode();
264 double time=node_pt(0)->time_stepper_pt()->time_pt()->time();
268 unsigned n_position_type = this->nnodal_position_type();
269 if(n_position_type != 1)
272 "Darcy equations are not yet implemented for more than one position type",
273 OOMPH_CURRENT_FUNCTION,
274 OOMPH_EXCEPTION_LOCATION);
279 unsigned n_dim = this->nodal_dimension();
282 ELEMENT* bulk_el_pt=
dynamic_cast<ELEMENT*
>(bulk_element_pt());
284 unsigned n_q_basis = bulk_el_pt->nq_basis();
285 unsigned n_q_basis_edge = bulk_el_pt->nq_basis_edge();
294 DShape dpsids(n_node,n_dim-1);
296 Shape q_basis(n_q_basis,n_dim);
299 unsigned n_intpt = integral_pt()->nweight();
305 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
308 double w = integral_pt()->weight(ipt);
311 dshape_local_at_knot(ipt,psi,dpsids);
314 for(
unsigned i=0;
i<n_dim-1;
i++)
316 s_face[
i] = integral_pt()->knot(ipt,
i);
319 s_bulk=local_coordinate_in_bulk(s_face);
323 bulk_el_pt->get_q_basis(s_bulk,q_basis);
332 for(
unsigned l=0;l<n_node;l++)
335 for(
unsigned i=0;
i<n_dim;
i++)
338 const double x_local = nodal_position(l,
i);
339 interpolated_x[
i] += x_local*psi(l);
342 for(
unsigned j=0;j<n_dim-1;j++)
344 interpolated_A(j,
i) += x_local*dpsids(l,j);
351 for(
unsigned i=0;
i<n_dim-1;
i++)
353 for(
unsigned j=0;j<n_dim-1;j++)
359 for(
unsigned k=0;k<n_dim;k++)
361 A(
i,j) += interpolated_A(
i,k)*interpolated_A(j,k);
368 outer_unit_normal(ipt,interpolated_normal);
378 Adet = A(0,0)*A(1,1) - A(0,1)*A(1,0);
383 "Wrong dimension in DarcyFaceElement",
384 OOMPH_CURRENT_FUNCTION,
385 OOMPH_EXCEPTION_LOCATION);
390 double W = w*sqrt(Adet);
402 for(
unsigned l=0;l<n_q_basis_edge;l++)
404 local_eqn = this->nodal_local_eqn(1,bulk_el_pt->q_edge_index(l));
410 for(
unsigned i=0;
i<n_dim;
i++)
413 residuals[local_eqn] +=
414 pressure*q_basis(l,
i)*interpolated_normal[
i]*
W;
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 ...
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.
void Zero_pressure_fct(const double &time, const Vector< double > &x, const Vector< double > &N, double &load)
Default load function (zero pressure)
void(*&)(const double &time, const Vector< double > &x, const Vector< double > &n, double &pressure) pressure_fct_pt()
Reference to the pressure function pointer.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
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...
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...
void output(std::ostream &outfile)
Output with default number of plot points.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
void output(FILE *file_pt)
C_style output function.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Return the residuals.
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_residuals_darcy_face(Vector< double > &residuals)
Helper function that actually calculates the residuals.
DarcyFaceElement(FiniteElement *const &element_pt, const int &face_index)
Constructor, which takes a "bulk" element and the value of the index and its limit.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
void output(std::ostream &outfile)
Output function.