29 #ifndef OOMPH_DARCY_FACE_ELEMENTS_HEADER
30 #define OOMPH_DARCY_FACE_ELEMENTS_HEADER
34 #include <oomph-lib-config.h>
39 #include "../../../src/generic/Qelements.h"
47 namespace DarcyFaceElementHelper
70 template<
class ELEMENT>
91 const unsigned& intpt,
117 ELEMENT* elem_pt =
dynamic_cast<ELEMENT*
>(element_pt);
119 if (elem_pt->dim() == 3)
128 throw OomphLibError(
"This flux element will not work correctly "
129 "if nodes are hanging\n",
130 OOMPH_CURRENT_FUNCTION,
131 OOMPH_EXCEPTION_LOCATION);
179 const unsigned&
i)
const
191 void output(std::ostream& outfile,
const unsigned& n_plot)
203 void output(FILE* file_pt,
const unsigned& n_plot)
226 template<
class ELEMENT>
231 unsigned n_dim = this->nodal_dimension();
235 interpolated_x(
s, x);
239 outer_unit_normal(
s, unit_normal);
245 get_pressure(time, ipt, x, unit_normal, pressure);
252 template<
class ELEMENT>
257 unsigned n_node = nnode();
260 double time = node_pt(0)->time_stepper_pt()->time_pt()->time();
264 unsigned n_position_type = this->nnodal_position_type();
265 if (n_position_type != 1)
267 throw OomphLibError(
"Darcy equations are not yet implemented for more "
268 "than one position type",
269 OOMPH_CURRENT_FUNCTION,
270 OOMPH_EXCEPTION_LOCATION);
275 unsigned n_dim = this->nodal_dimension();
278 ELEMENT* bulk_el_pt =
dynamic_cast<ELEMENT*
>(bulk_element_pt());
280 unsigned n_q_basis = bulk_el_pt->nq_basis();
281 unsigned n_q_basis_edge = bulk_el_pt->nq_basis_edge();
290 DShape dpsids(n_node, n_dim - 1);
292 Shape q_basis(n_q_basis, n_dim);
295 unsigned n_intpt = integral_pt()->nweight();
301 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
304 double w = integral_pt()->weight(ipt);
307 dshape_local_at_knot(ipt, psi, dpsids);
310 for (
unsigned i = 0;
i < n_dim - 1;
i++)
312 s_face[
i] = integral_pt()->knot(ipt,
i);
315 s_bulk = local_coordinate_in_bulk(s_face);
319 bulk_el_pt->get_q_basis(s_bulk, q_basis);
328 for (
unsigned l = 0; l < n_node; l++)
331 for (
unsigned i = 0;
i < n_dim;
i++)
334 const double x_local = nodal_position(l,
i);
335 interpolated_x[
i] += x_local * psi(l);
338 for (
unsigned j = 0; j < n_dim - 1; j++)
340 interpolated_A(j,
i) += x_local * dpsids(l, j);
347 for (
unsigned i = 0;
i < n_dim - 1;
i++)
349 for (
unsigned j = 0; j < n_dim - 1; j++)
355 for (
unsigned k = 0; k < n_dim; k++)
357 A(
i, j) += interpolated_A(
i, k) * interpolated_A(j, k);
364 outer_unit_normal(ipt, interpolated_normal);
374 Adet = A(0, 0) * A(1, 1) - A(0, 1) * A(1, 0);
378 OOMPH_CURRENT_FUNCTION,
379 OOMPH_EXCEPTION_LOCATION);
384 double W = w * sqrt(Adet);
388 get_pressure(time, ipt, interpolated_x, interpolated_normal, pressure);
392 for (
unsigned l = 0; l < n_q_basis_edge; l++)
394 local_eqn = this->nodal_local_eqn(1, bulk_el_pt->q_edge_index(l));
400 for (
unsigned i = 0;
i < n_dim;
i++)
403 residuals[local_eqn] +=
404 pressure * q_basis(l,
i) * interpolated_normal[
i] *
W;
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
A class for elements that allow the imposition of an applied pressure in the Darcy equations....
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.
void(* Pressure_fct_pt)(const double &time, const Vector< double > &x, const Vector< double > &n, double &result)
Pointer to an imposed pressure function. Arguments: Eulerian coordinate; outer unit normal; applied p...
void fill_in_contribution_to_residuals_darcy_face(Vector< double > &residuals)
Helper function that actually calculates the residuals.
void output(FILE *file_pt)
C_style output function.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
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(std::ostream &outfile, const unsigned &n_plot)
Output function.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
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...
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Specify the value of nodal zeta from the face geometry The "global" intrinsic coordinate of the eleme...
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 output(std::ostream &outfile)
Output function.
FaceElements are elements that coincide with the faces of higher-dimensional "bulk" elements....
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
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,...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A general Finite Element class.
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....
bool has_hanging_nodes() const
Return boolean to indicate if any of the element's nodes are geometrically hanging.
An OomphLibError object which should be thrown when an run-time error is encountered....
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
void output()
Doc the command line arguments.
void Zero_pressure_fct(const double &time, const Vector< double > &x, const Vector< double > &N, double &load)
Default load function (zero pressure)
//////////////////////////////////////////////////////////////////// ////////////////////////////////...