29 #ifndef OOMPH_AXISYM_POROELASITICTY_FACE_ELEMENTS_HEADER
30 #define OOMPH_AXISYM_POROELASITICTY_FACE_ELEMENTS_HEADER
34 #include <oomph-lib-config.h>
48 namespace AxisymmetricPoroelasticityTractionElementHelper
58 unsigned n_dim =
load.size();
59 for (
unsigned i = 0;
i < n_dim;
i++)
91 template<
class ELEMENT>
122 const unsigned& intpt,
136 const unsigned& intpt,
163 ELEMENT* elem_pt =
dynamic_cast<ELEMENT*
>(element_pt);
165 if (elem_pt->dim() == 3)
174 throw OomphLibError(
"This flux element will not work correctly "
175 "if nodes are hanging\n",
243 const unsigned&
i)
const
257 void output(std::ostream& outfile,
const unsigned& n_plot)
264 unsigned n_node =
nnode();
271 DShape dpsids(n_node, n_dim - 1);
278 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
299 bulk_pt->interpolated_u(s_bulk, disp);
303 bulk_pt->interpolated_du_dt(s_bulk, du_dt);
307 bulk_pt->interpolated_q(s_bulk,
q);
310 const double permeability = bulk_pt->permeability();
323 for (
unsigned l = 0; l < n_node; l++)
326 for (
unsigned i = 0;
i < 2;
i++)
329 unsigned u_nodal_index = bulk_pt->u_index_axisym_poroelasticity(
i);
332 interpolated_T1[
i] +=
340 sqrt(1.0 + (interpolated_t1[0] * interpolated_t1[0]) /
341 (interpolated_t1[1] * interpolated_t1[1])) *
346 double J_def =
sqrt(1.0 + (interpolated_T1[0] * interpolated_T1[0]) /
347 (interpolated_T1[1] * interpolated_T1[1])) *
362 double lagr_euler_translation_factor =
366 for (
unsigned i = 0;
i < n_dim;
i++)
368 outfile <<
x[
i] <<
" ";
372 for (
unsigned i = 0;
i < n_dim;
i++)
374 outfile << disp[
i] <<
" ";
378 for (
unsigned i = 0;
i < n_dim;
i++)
387 outfile << permeability *
q[0] <<
" "
388 << permeability *
q[1] <<
" ";
391 outfile << du_dt[0] <<
" "
395 outfile << du_dt[0] + permeability *
q[0] <<
" "
396 << du_dt[1] + permeability *
q[1] <<
" ";
399 outfile << unit_normal[0] <<
" "
400 << unit_normal[1] <<
" ";
403 outfile << bulk_pt->interpolated_div_q(s_bulk) <<
" ";
406 outfile << bulk_pt->interpolated_p(s_bulk) <<
" ";
409 outfile << J_undef <<
" ";
412 outfile << J_def <<
" ";
415 outfile << lagr_euler_translation_factor <<
" ";
417 outfile << std::endl;
431 void output(FILE* file_pt,
const unsigned& n_plot)
453 unsigned n_node =
nnode();
459 DShape dpsids(n_node, n_dim - 1);
476 bulk_pt->interpolated_u(s_bulk, disp);
481 for (
unsigned l = 0; l < n_node; l++)
484 for (
unsigned i = 0;
i < 2;
i++)
487 unsigned u_nodal_index = bulk_pt->u_index_axisym_poroelasticity(
i);
490 interpolated_T1[
i] +=
497 double J_undef =
sqrt(interpolated_t1[0] * interpolated_t1[0] +
498 interpolated_t1[1] * interpolated_t1[1]) *
503 double J_def =
sqrt(interpolated_T1[0] * interpolated_T1[0] +
504 interpolated_T1[1] * interpolated_T1[1]) *
507 double return_val = 1.0;
508 if (J_def != 0.0) return_val = J_undef / J_def;
531 double& seepage_flux_contrib)
537 const double permeability = bulk_el_pt->permeability();
540 const unsigned n_node = this->
nnode();
554 skeleton_flux_contrib = 0.0;
555 seepage_flux_contrib = 0.0;
556 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
570 for (
unsigned l = 0; l < n_node; l++)
573 for (
unsigned i = 0;
i < 2;
i++)
581 double tlength = interpolated_t1[0] * interpolated_t1[0] +
582 interpolated_t1[1] * interpolated_t1[1];
596 bulk_el_pt->interpolated_q(s_bulk,
q);
600 bulk_el_pt->interpolated_du_dt(s_bulk, du_dt);
604 x_bulk[0] = bulk_el_pt->interpolated_x(s_bulk, 0);
605 x_bulk[1] = bulk_el_pt->interpolated_x(s_bulk, 1);
609 double tol = 1.0e-10;
612 std::stringstream junk;
613 junk <<
"Gap between bulk and face element coordinate\n"
614 <<
"is suspiciously large: " <<
error
615 <<
"\nBulk at: " << x_bulk[0] <<
" " << x_bulk[1] <<
"\n"
625 double dudt_flux = 0.0;
626 for (
unsigned i = 0;
i < 2;
i++)
628 q_flux += permeability *
q[
i] * interpolated_normal[
i];
629 dudt_flux += du_dt[
i] * interpolated_normal[
i];
633 seepage_flux_contrib +=
635 skeleton_flux_contrib +=
650 template<
class ELEMENT>
654 unsigned n_dim = this->nodal_dimension();
658 interpolated_x(
s,
x);
662 outer_unit_normal(
s, unit_normal);
668 get_traction(time, ipt,
x, unit_normal, traction);
676 template<
class ELEMENT>
680 unsigned n_dim = this->nodal_dimension();
684 interpolated_x(
s,
x);
688 outer_unit_normal(
s, unit_normal);
702 template<
class ELEMENT>
708 unsigned n_node = nnode();
711 double time = node_pt(0)->time_stepper_pt()->time_pt()->time();
715 unsigned n_position_type = this->nnodal_position_type();
716 if (n_position_type != 1)
718 throw OomphLibError(
"Poroelasticity equations are not yet implemented "
719 "for more than one position type",
726 unsigned n_dim = this->nodal_dimension();
730 ELEMENT* bulk_el_pt =
dynamic_cast<ELEMENT*
>(bulk_element_pt());
732 unsigned n_q_basis = bulk_el_pt->nq_basis();
733 unsigned n_q_basis_edge = bulk_el_pt->nq_basis_edge();
742 DShape dpsids(n_node, n_dim - 1);
743 Shape q_basis(n_q_basis, n_dim);
746 unsigned n_intpt = integral_pt()->nweight();
752 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
755 double w = integral_pt()->weight(ipt);
758 dshape_local_at_knot(ipt, psi, dpsids);
761 for (
unsigned i = 0;
i < n_dim - 1;
i++)
763 s_face[
i] = integral_pt()->knot(ipt,
i);
765 s_bulk = local_coordinate_in_bulk(s_face);
768 ELEMENT* bulk_el_pt =
dynamic_cast<ELEMENT*
>(bulk_element_pt());
773 bulk_el_pt->get_q_basis(s_bulk, q_basis);
782 for (
unsigned l = 0; l < n_node; l++)
785 for (
unsigned i = 0;
i < n_dim;
i++)
788 const double x_local = nodal_position(l,
i);
789 interpolated_x[
i] += x_local * psi(l);
792 for (
unsigned j = 0;
j < n_dim - 1;
j++)
794 interpolated_A(
j,
i) += x_local * dpsids(l,
j);
801 for (
unsigned i = 0;
i < n_dim - 1;
i++)
803 for (
unsigned j = 0;
j < n_dim - 1;
j++)
809 for (
unsigned k = 0;
k < n_dim;
k++)
811 A(
i,
j) += interpolated_A(
i,
k) * interpolated_A(
j,
k);
818 outer_unit_normal(ipt, interpolated_normal);
828 Adet =
A(0, 0) *
A(1, 1) -
A(0, 1) *
A(1, 0);
832 "Wrong dimension in AxisymmetricPoroelasticityTractionElement",
839 double W =
w *
sqrt(Adet);
843 get_traction(time, ipt, interpolated_x, interpolated_normal, traction);
847 get_pressure(time, ipt, interpolated_x, interpolated_normal, pressure);
850 for (
unsigned l = 0; l < n_node; l++)
853 for (
unsigned i = 0;
i < n_dim;
i++)
855 local_eqn = this->nodal_local_eqn(
856 l, bulk_el_pt->u_index_axisym_poroelasticity(
i));
861 residuals[local_eqn] -=
862 traction[
i] * psi(l) * interpolated_x[0] *
W;
869 for (
unsigned l = 0; l < n_q_basis_edge; l++)
871 local_eqn = this->nodal_local_eqn(1, bulk_el_pt->q_edge_index(l));
877 for (
unsigned i = 0;
i < n_dim;
i++)
880 residuals[local_eqn] += pressure * q_basis(l,
i) *
881 interpolated_normal[
i] * interpolated_x[0] *
900 template<
class POROELASTICITY_BULK_ELEMENT,
class NAVIER_STOKES_BULK_ELEMENT>
903 POROELASTICITY_BULK_ELEMENT>,
920 const double&
q()
const
935 const unsigned& intpt,
941 NAVIER_STOKES_BULK_ELEMENT* ext_el_pt =
942 dynamic_cast<NAVIER_STOKES_BULK_ELEMENT*
>(
955 ext_el_pt->traction(s_ext, interpolated_normal, traction_nst);
963 for (
unsigned i = 0;
i < (n_dim - 1);
i++)
972 x_bulk[0] = ext_el_pt->interpolated_x(s_ext, 0);
973 x_bulk[1] = ext_el_pt->interpolated_x(s_ext, 1);
975 sqrt((x_local[0] - x_bulk[0]) * (x_local[0] - x_bulk[0]) +
976 (x_local[1] - x_bulk[1]) * (x_local[1] - x_bulk[1]));
977 double tol = 1.0e-10;
980 std::stringstream junk;
981 junk <<
"Gap between external and face element coordinate\n"
982 <<
"is suspiciously large:" <<
error <<
" ( tol = " << tol
984 <<
"\nExternal/bulk at: " << x_bulk[0] <<
" " << x_bulk[1]
986 <<
"Face at: " << x_local[0] <<
" " << x_local[1] <<
"\n";
995 const double q_value =
q();
1000 traction[0] = q_value * traction_nst[0];
1001 traction[1] = q_value * traction_nst[1];
1007 const unsigned& intpt,
1013 NAVIER_STOKES_BULK_ELEMENT* ext_el_pt =
1014 dynamic_cast<NAVIER_STOKES_BULK_ELEMENT*
>(
1027 ext_el_pt->traction(s_ext, interpolated_normal, traction_nst);
1030 const double q_value =
q();
1035 pressure = -q_value * (interpolated_normal[0] * traction_nst[0] +
1036 interpolated_normal[1] * traction_nst[1]);
1059 void output(std::ostream& outfile,
const unsigned& n_plot)
1077 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
1081 for (
unsigned i = 0;
i < n_dim - 1;
i++)
1094 POROELASTICITY_BULK_ELEMENT* bulk_pt =
1099 const double local_permeability = bulk_pt->permeability();
1103 bulk_pt->interpolated_q(s_bulk,
q);
1106 bulk_pt->interpolated_u(s_bulk, disp);
1118 for (
unsigned i = 0;
i < n_dim;
i++)
1120 outfile <<
x[
i] <<
" ";
1124 for (
unsigned i = 0;
i < n_dim;
i++)
1126 outfile << disp[
i] <<
" ";
1130 for (
unsigned i = 0;
i < n_dim;
i++)
1139 outfile << local_permeability *
q[0] <<
" "
1140 << local_permeability *
q[1] <<
" ";
1144 bulk_pt->interpolated_du_dt(s_bulk, du_dt);
1145 outfile << du_dt[0] <<
" "
1149 outfile << du_dt[0] + local_permeability *
q[0] <<
" "
1150 << du_dt[1] + local_permeability *
q[1] <<
" ";
1153 outfile << unit_normal[0] <<
" "
1154 << unit_normal[1] <<
" ";
1157 outfile << bulk_pt->interpolated_div_q(s_bulk) <<
" ";
1160 outfile << bulk_pt->interpolated_p(s_bulk) <<
" ";
1161 outfile << std::endl;
1186 template<
class POROELASTICITY_BULK_ELEMENT,
class NAVIER_STOKES_BULK_ELEMENT>
1187 double FSILinearisedAxisymPoroelasticTractionElement<
1188 POROELASTICITY_BULK_ELEMENT,
1189 NAVIER_STOKES_BULK_ELEMENT>::Default_Q_Value = 1.0;
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
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
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: axisym_poroelasticity_face_elements.h:95
virtual void get_traction(const double &time, const unsigned &intpt, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction)
Definition: axisym_poroelasticity_face_elements.h:121
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Return the residuals.
Definition: axisym_poroelasticity_face_elements.h:222
void(*&)(const double &time, const Vector< double > &x, const Vector< double > &n, double &pressure) pressure_fct_pt()
Reference to the pressure function pointer.
Definition: axisym_poroelasticity_face_elements.h:212
virtual void get_pressure(const double &time, const unsigned &intpt, const Vector< double > &x, const Vector< double > &n, double &pressure)
Definition: axisym_poroelasticity_face_elements.h:135
void output(FILE *file_pt)
C_style output function.
Definition: axisym_poroelasticity_face_elements.h:425
void contribution_to_total_porous_flux(double &skeleton_flux_contrib, double &seepage_flux_contrib)
Definition: axisym_poroelasticity_face_elements.h:530
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: axisym_poroelasticity_face_elements.h:202
AxisymmetricPoroelasticityTractionElement()
Default constructor.
Definition: axisym_poroelasticity_face_elements.h:199
void(* Traction_fct_pt)(const double &time, const Vector< double > &x, const Vector< double > &n, Vector< double > &result)
Definition: axisym_poroelasticity_face_elements.h:101
double lagrangian_eulerian_translation_factor(const Vector< double > &s)
Definition: axisym_poroelasticity_face_elements.h:447
void output(std::ostream &outfile)
Output function.
Definition: axisym_poroelasticity_face_elements.h:249
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: axisym_poroelasticity_face_elements.h:241
void(* Pressure_fct_pt)(const double &time, const Vector< double > &x, const Vector< double > &n, double &result)
Definition: axisym_poroelasticity_face_elements.h:110
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
Definition: axisym_poroelasticity_face_elements.h:229
void fill_in_contribution_to_residuals_axisym_poroelasticity_face(Vector< double > &residuals)
Helper function that actually calculates the residuals.
Definition: axisym_poroelasticity_face_elements.h:704
void pressure(const double &time, const Vector< double > &s, double &pressure)
Definition: axisym_poroelasticity_face_elements.h:677
AxisymmetricPoroelasticityTractionElement(FiniteElement *const &element_pt, const int &face_index)
Definition: axisym_poroelasticity_face_elements.h:156
void traction(const double &time, const Vector< double > &s, Vector< double > &traction)
Definition: axisym_poroelasticity_face_elements.h:651
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
Definition: axisym_poroelasticity_face_elements.h:431
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
Definition: axisym_poroelasticity_face_elements.h:257
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238
Definition: element_with_external_element.h:56
Vector< double > & external_element_local_coord(const unsigned &interaction_index, const unsigned &ipt)
Definition: element_with_external_element.h:136
void set_ninteraction(const unsigned &n_interaction)
Definition: element_with_external_element.h:178
FiniteElement *& external_element_pt(const unsigned &interaction_index, const unsigned &ipt)
Definition: element_with_external_element.h:107
void fill_in_jacobian_from_external_interaction_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: element_with_external_element.h:345
Definition: axisym_poroelasticity_face_elements.h:905
double *& q_pt()
Definition: axisym_poroelasticity_face_elements.h:927
void get_pressure(const double &time, const unsigned &intpt, const Vector< double > &x, const Vector< double > &n, double &pressure)
Definition: axisym_poroelasticity_face_elements.h:1006
FSILinearisedAxisymPoroelasticTractionElement(FiniteElement *const &element_pt, const int &face_index)
Definition: axisym_poroelasticity_face_elements.h:1042
double * Q_pt
Definition: axisym_poroelasticity_face_elements.h:910
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
Definition: axisym_poroelasticity_face_elements.h:1170
static double Default_Q_Value
Definition: axisym_poroelasticity_face_elements.h:914
void get_traction(const double &time, const unsigned &intpt, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction)
Definition: axisym_poroelasticity_face_elements.h:934
FSILinearisedAxisymPoroelasticTractionElement()
Default constructor.
Definition: axisym_poroelasticity_face_elements.h:1054
const double & q() const
Definition: axisym_poroelasticity_face_elements.h:920
void output(std::ostream &outfile, const unsigned &n_plot)
Definition: axisym_poroelasticity_face_elements.h:1059
Definition: elements.h:4338
int & face_index()
Definition: elements.h:4626
void outer_unit_normal(const Vector< double > &s, Vector< double > &unit_normal) const
Compute outer unit normal at the specified local coordinate.
Definition: elements.cc:6006
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:4497
Vector< double > local_coordinate_in_bulk(const Vector< double > &s) const
Definition: elements.cc:6353
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
Definition: elements.h:4735
double interpolated_x(const Vector< double > &s, const unsigned &i) const
Definition: elements.h:4528
Definition: elements.h:4998
Definition: elements.h:1313
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
double nodal_value(const unsigned &n, const unsigned &i) const
Definition: elements.h:2593
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Definition: elements.h:3161
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Definition: elements.cc:5132
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
Definition: elements.cc:3962
virtual void dshape_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsids) const
Definition: elements.cc:3239
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Definition: elements.h:1963
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Definition: elements.h:3148
virtual unsigned nplot_points(const unsigned &nplot) const
Definition: elements.h:3186
double nodal_position(const unsigned &n, const unsigned &i) const
Definition: elements.h:2317
virtual void dshape_local(const Vector< double > &s, Shape &psi, DShape &dpsids) const
Definition: elements.h:1981
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
Definition: elements.h:2484
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Definition: elements.h:3174
bool has_hanging_nodes() const
Definition: elements.h:2470
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
Definition: oomph_definitions.h:222
Definition: oomph_definitions.h:267
Definition: refineable_elements.h:97
Time *const & time_pt() const
Access function for the pointer to time (const version)
Definition: timesteppers.h:572
double & time()
Return the current value of the continuous time.
Definition: timesteppers.h:123
@ N
Definition: constructor.cpp:22
RealScalar s
Definition: level1_cplx_impl.h:130
char char char int int * k
Definition: level2_impl.h:374
EIGEN_DEVICE_FUNC const Scalar & q
Definition: SpecialFunctionsImpl.h:2019
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
int error
Definition: calibrate.py:297
bool Allow_gap_in_FSI
Definition: axisym_poroelasticity_face_elements.h:79
void Zero_pressure_fct(const double &time, const Vector< double > &x, const Vector< double > &N, double &load)
Default load function (zero pressure)
Definition: axisym_poroelasticity_face_elements.h:68
void Zero_traction_fct(const double &time, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Default load function (zero traction)
Definition: axisym_poroelasticity_face_elements.h:53
const double Pi
50 digits from maple
Definition: oomph_utilities.h:157
@ 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
void output(std::ostream &outfile, const unsigned &nplot)
Overload output function.
Definition: overloaded_element_body.h:490
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2