29 #ifndef OOMPH_POROELASITICTY_FACE_ELEMENTS_HEADER
30 #define OOMPH_POROELASITICTY_FACE_ELEMENTS_HEADER
34 #include <oomph-lib-config.h>
47 namespace PoroelasticityFaceElementHelper
57 unsigned n_dim =
load.size();
58 for (
unsigned i = 0;
i < n_dim;
i++)
85 template<
class ELEMENT>
118 const unsigned& intpt,
132 const unsigned& intpt,
159 ELEMENT* elem_pt =
new ELEMENT;
161 if (elem_pt->dim() == 3)
168 "nodes are hanging\n",
177 Element_pt =
dynamic_cast<ELEMENT*
>(element_pt);
232 const unsigned&
i)
const
244 void output(std::ostream& outfile,
const unsigned& n_plot)
256 void output(FILE* file_pt,
const unsigned& n_plot)
286 template<
class ELEMENT>
291 unsigned n_dim = this->nodal_dimension();
295 interpolated_x(
s,
x);
299 outer_unit_normal(
s, unit_normal);
305 get_traction(time, ipt,
x, unit_normal, traction);
312 template<
class ELEMENT>
317 unsigned n_dim = this->nodal_dimension();
321 interpolated_x(
s,
x);
325 outer_unit_normal(
s, unit_normal);
338 template<
class ELEMENT>
343 unsigned n_node = nnode();
346 double time = node_pt(0)->time_stepper_pt()->time_pt()->time();
350 unsigned n_position_type = this->nnodal_position_type();
351 if (n_position_type != 1)
353 throw OomphLibError(
"Poroelasticity equations are not yet implemented "
354 "for more than one position type",
361 unsigned n_dim = this->nodal_dimension();
363 unsigned n_q_basis = Element_pt->nq_basis();
364 unsigned n_q_basis_edge = Element_pt->nq_basis_edge();
373 DShape dpsids(n_node, n_dim - 1);
375 Shape q_basis(n_q_basis, n_dim);
378 unsigned n_intpt = integral_pt()->nweight();
387 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
390 double w = integral_pt()->weight(ipt);
393 dshape_local_at_knot(ipt, psi, dpsids);
396 for (
unsigned i = 0;
i < n_dim - 1;
i++)
398 s_face[
i] = integral_pt()->knot(ipt,
i);
401 s_bulk = local_coordinate_in_bulk(s_face);
405 Element_pt->get_q_basis(s_bulk, q_basis);
414 for (
unsigned l = 0; l < n_node; l++)
417 for (
unsigned i = 0;
i < n_dim;
i++)
420 const double x_local = nodal_position(l,
i);
421 interpolated_x[
i] += x_local * psi(l);
424 for (
unsigned j = 0;
j < n_dim - 1;
j++)
426 interpolated_A(
j,
i) += x_local * dpsids(l,
j);
433 for (
unsigned i = 0;
i < n_dim - 1;
i++)
435 for (
unsigned j = 0;
j < n_dim - 1;
j++)
441 for (
unsigned k = 0;
k < n_dim;
k++)
443 A(
i,
j) += interpolated_A(
i,
k) * interpolated_A(
j,
k);
450 outer_unit_normal(ipt, interpolated_normal);
460 Adet =
A(0, 0) *
A(1, 1) -
A(0, 1) *
A(1, 0);
463 throw OomphLibError(
"Wrong dimension in PoroelasticityFaceElement",
470 double W =
w *
sqrt(Adet);
474 get_traction(time, ipt, interpolated_x, interpolated_normal, traction);
478 get_pressure(time, ipt, interpolated_x, interpolated_normal, pressure);
481 for (
unsigned l = 0; l < n_node; l++)
484 for (
unsigned i = 0;
i < n_dim;
i++)
486 local_eqn = this->nodal_local_eqn(l, Element_pt->u_index(
i));
491 residuals[local_eqn] -= traction[
i] * psi(l) *
W;
498 for (
unsigned l = 0; l < n_q_basis_edge; l++)
500 local_eqn = this->nodal_local_eqn(1, Element_pt->q_edge_index(l));
506 for (
unsigned i = 0;
i < n_dim;
i++)
509 residuals[local_eqn] +=
510 pressure * q_basis(l,
i) * interpolated_normal[
i] *
W;
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
RowVector3d w
Definition: Matrix_resize_int.cpp:3
void load(Archive &ar, ParticleHandler &handl)
Definition: Particles.h:21
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:47
Definition: elements.h:4338
int & face_index()
Definition: elements.h:4626
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:4497
Definition: elements.h:4998
Definition: elements.h:1313
virtual void output(std::ostream &outfile)
Definition: elements.h:3050
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Definition: elements.cc:5132
Definition: oomph_definitions.h:222
Definition: oomph_definitions.h:267
Definition: poroelasticity_face_elements.h:88
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
Definition: poroelasticity_face_elements.h:218
void(*&)(const double &time, const Vector< double > &x, const Vector< double > &n, double &pressure) pressure_fct_pt()
Reference to the pressure function pointer.
Definition: poroelasticity_face_elements.h:201
void traction(const double &time, const Vector< double > &s, Vector< double > &traction)
Definition: poroelasticity_face_elements.h:287
PoroelasticityFaceElement(FiniteElement *const &element_pt, const int &face_index)
Definition: poroelasticity_face_elements.h:152
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
Definition: poroelasticity_face_elements.h:256
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Return the residuals.
Definition: poroelasticity_face_elements.h:211
void(* Traction_fct_pt)(const double &time, const Vector< double > &x, const Vector< double > &n, Vector< double > &result)
Definition: poroelasticity_face_elements.h:97
void(*&)(const double &time, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction) traction_fct_pt()
Reference to the traction function pointer.
Definition: poroelasticity_face_elements.h:192
void output(std::ostream &outfile)
Output function.
Definition: poroelasticity_face_elements.h:238
ELEMENT * Element_pt
pointer to the bulk element this face element is attached to
Definition: poroelasticity_face_elements.h:91
void fill_in_contribution_to_residuals_darcy_face(Vector< double > &residuals)
Helper function that actually calculates the residuals.
Definition: poroelasticity_face_elements.h:340
void output(FILE *file_pt)
C_style output function.
Definition: poroelasticity_face_elements.h:250
virtual void get_traction(const double &time, const unsigned &intpt, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction)
Definition: poroelasticity_face_elements.h:117
virtual void get_pressure(const double &time, const unsigned &intpt, const Vector< double > &x, const Vector< double > &n, double &pressure)
Definition: poroelasticity_face_elements.h:131
void pressure(const double &time, const Vector< double > &s, double &pressure)
Definition: poroelasticity_face_elements.h:313
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
Definition: poroelasticity_face_elements.h:244
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: poroelasticity_face_elements.h:230
void(* Pressure_fct_pt)(const double &time, const Vector< double > &x, const Vector< double > &n, double &result)
Definition: poroelasticity_face_elements.h:106
Definition: refineable_elements.h:97
@ N
Definition: constructor.cpp:22
RealScalar s
Definition: level1_cplx_impl.h:130
char char char int int * k
Definition: level2_impl.h:374
void get_pressure(const Vector< double > &x, double &pressure)
Pressure depending on the position (x,y)
Definition: all_foeppl_von_karman/circular_disk.cc:60
void Zero_traction_fct(const double &time, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Default load function (zero traction)
Definition: poroelasticity_face_elements.h:52
void Zero_pressure_fct(const double &time, const Vector< double > &x, const Vector< double > &N, double &load)
Default load function (zero pressure)
Definition: poroelasticity_face_elements.h:67
@ W
Definition: quadtree.h:63
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
list x
Definition: plotDoE.py:28
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2