82 const Shape& q_basis_local,
101 const unsigned n_q_basis = this->
nq_basis();
104 for (
unsigned l = 0; l < n_q_basis; l++)
107 for (
unsigned i = 0;
i < 2;
i++)
115 for (
unsigned i = 0;
i < 2;
i++)
118 for (
unsigned j = 0; j < 2; j++)
122 double jac_trans = jacobian(j,
i) / det;
125 for (
unsigned l = 0; l < n_q_basis; l++)
128 q_basis(l,
i) += jac_trans * q_basis_local(l, j);
146 const unsigned& nplot)
160 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
166 for (
unsigned i = 0;
i < 2;
i++)
172 for (
unsigned i = 0;
i < 2;
i++)
178 for (
unsigned i = 0;
i < 2;
i++)
191 outfile <<
du_dt[0] <<
" ";
192 outfile <<
du_dt[1] <<
" ";
194 outfile << std::endl;
206 std::ostream& outfile,
207 const unsigned& nplot,
225 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
234 (*exact_soln_pt)(x, exact_soln);
237 for (
unsigned i = 0;
i < 2;
i++)
239 outfile << x[
i] <<
" ";
241 for (
unsigned i = 0;
i < 13;
i++)
243 outfile << exact_soln[
i] <<
" ";
245 outfile << std::endl;
257 std::ostream& outfile,
258 const unsigned& nplot,
277 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
286 (*exact_soln_pt)(time, x, exact_soln);
289 for (
unsigned i = 0;
i < 2;
i++)
291 outfile << x[
i] <<
" ";
293 for (
unsigned i = 0;
i < 13;
i++)
295 outfile << exact_soln[
i] <<
" ";
297 outfile << std::endl;
309 std::ostream& outfile,
314 for (
unsigned i = 0;
i < 3;
i++)
329 outfile <<
"ZONE" << std::endl;
335 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
338 for (
unsigned i = 0;
i < 2;
i++)
356 (*exact_soln_pt)(x, exact_soln);
359 for (
unsigned i = 0;
i < 2;
i++)
361 norm[0] += exact_soln[
i] * exact_soln[
i] *
W;
368 for (
unsigned i = 0;
i < 2;
i++)
370 norm[1] += exact_soln[2 +
i] * exact_soln[2 +
i] *
W;
377 norm[1] += exact_soln[2 * 2] * exact_soln[2 * 2] *
W;
382 norm[2] += exact_soln[2 * 2 + 1] * exact_soln[2 * 2 + 1] *
W;
387 for (
unsigned i = 0;
i < 2;
i++)
389 outfile << x[
i] <<
" ";
393 for (
unsigned i = 0;
i < 2;
i++)
399 for (
unsigned i = 0;
i < 2;
i++)
405 outfile << exact_soln[2 * 2 + 1] - this->
interpolated_p(s) <<
" ";
407 outfile << std::endl;
416 std::ostream& outfile,
422 for (
unsigned i = 0;
i < 3;
i++)
437 outfile <<
"ZONE" << std::endl;
443 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
446 for (
unsigned i = 0;
i < 2;
i++)
464 (*exact_soln_pt)(time, x, exact_soln);
467 for (
unsigned i = 0;
i < 2;
i++)
469 norm[0] += exact_soln[
i] * exact_soln[
i] *
W;
476 for (
unsigned i = 0;
i < 2;
i++)
478 norm[1] += exact_soln[2 +
i] * exact_soln[2 +
i] *
W;
485 norm[1] += exact_soln[2 * 2] * exact_soln[2 * 2] *
W;
490 norm[2] += exact_soln[2 * 2 + 1] * exact_soln[2 * 2 + 1] *
W;
495 for (
unsigned i = 0;
i < 2;
i++)
497 outfile << x[
i] <<
" ";
501 for (
unsigned i = 0;
i < 2;
i++)
507 for (
unsigned i = 0;
i < 2;
i++)
513 outfile << exact_soln[2 * 2 + 1] - this->
interpolated_p(s) <<
" ";
515 outfile << std::endl;
529 const unsigned n_node =
nnode();
530 const unsigned n_q_basis =
nq_basis();
532 const unsigned n_p_basis =
np_basis();
535 Shape psi(n_node), u_basis(n_node), u_test(n_node), q_basis(n_q_basis, 2),
536 q_test(n_q_basis, 2), p_basis(n_p_basis), p_test(n_p_basis),
537 div_q_basis_ds(n_q_basis), div_q_test_ds(n_q_basis);
539 DShape dpsidx(n_node, 2), du_basis_dx(n_node, 2), du_test_dx(n_node, 2);
554 double mass_source_local = 0.0;
557 double nu_local = this->
nu();
561 double lambda = youngs_modulus_local * nu_local / (1.0 + nu_local) /
562 (1.0 - 2.0 * nu_local);
564 double mu = youngs_modulus_local / 2.0 / (1.0 + nu_local);
586 double rho_f_over_rho =
593 int local_eqn = 0, local_unknown = 0;
596 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
599 for (
unsigned i = 0;
i < 2;
i++)
627 double interpolated_div_du_dt_dx = 0.0;
628 double interpolated_du_r_dt = 0.0;
631 double interpolated_div_q_ds = 0.0;
636 for (
unsigned l = 0; l < n_node; l++)
639 for (
unsigned i = 0;
i < 2;
i++)
642 interpolated_d2u_dt2[
i] += this->
d2u_dt2(l,
i) * u_basis(l);
645 const double u_value =
650 for (
unsigned j = 0; j < 2; j++)
652 interpolated_du_dx(
i, j) += u_value * du_basis_dx(l, j);
656 interpolated_div_du_dt_dx += this->
du_dt(l,
i) * du_basis_dx(l,
i);
660 interpolated_du_r_dt +=
du_dt(l, 0) * u_basis(l);
665 for (
unsigned i = 0;
i < 2;
i++)
668 for (
unsigned l = 0; l < n_q_basis_edge; l++)
674 for (
unsigned l = n_q_basis_edge; l < n_q_basis; l++)
677 interpolated_dq_dt[
i] +=
683 for (
unsigned l = 0; l < n_p_basis; l++)
690 for (
unsigned l = 0; l < n_q_basis_edge; l++)
692 interpolated_div_q_ds +=
q_edge(l) * div_q_basis_ds(l);
694 for (
unsigned l = n_q_basis_edge; l < n_q_basis; l++)
696 interpolated_div_q_ds +=
697 q_internal(l - n_q_basis_edge) * div_q_basis_ds(l);
715 double du_r_dr = interpolated_du_dx(0, 0);
716 double du_r_dz = interpolated_du_dx(0, 1);
717 double du_z_dr = interpolated_du_dx(1, 0);
718 double du_z_dz = interpolated_du_dx(1, 1);
721 double G_r = 0, G_z = 0;
723 for (
unsigned l = 0; l < n_node; l++)
725 for (
unsigned a = 0; a < 2; a++)
732 residuals[local_eqn] +=
734 (interpolated_d2u_dt2[a] +
735 rho_f_over_rho * local_permeability * interpolated_dq_dt[a]) -
737 u_test(l) * r * w * J;
742 residuals[local_eqn] +=
743 (mu * (2.0 * du_r_dr * du_test_dx(l, 0) +
744 du_test_dx(l, 1) * (du_r_dz + du_z_dr) +
745 2.0 * u_test(l) / pow(r, 2) * (u_r)) +
746 (lambda * (du_r_dr + u_r / r + du_z_dz) -
748 (du_test_dx(l, 0) + u_test(l) / r)) *
753 residuals[local_eqn] +=
754 (mu * (du_test_dx(l, 0) * (du_r_dz + du_z_dr) +
755 2.0 * du_z_dz * du_test_dx(l, 1)) +
756 (lambda * (du_r_dr + u_r / r + du_z_dz) -
765 OOMPH_CURRENT_FUNCTION,
766 OOMPH_EXCEPTION_LOCATION);
773 for (
unsigned l2 = 0; l2 < n_node; l2++)
778 (mu * (2.0 * du_basis_dx(l2, 0) * du_test_dx(l, 0) +
779 du_test_dx(l, 1) * du_basis_dx(l2, 1) +
780 2 * u_test(l) / pow(r, 2) * u_basis(l2)) +
781 (lambda * (du_basis_dx(l2, 0) + u_basis(l2) / r)) *
782 (du_test_dx(l, 0) + u_test(l) / r) +
784 u_basis(l2) * u_test(l)) *
787 G_z = (mu * du_test_dx(l, 1) * du_basis_dx(l2, 0) +
788 lambda * du_basis_dx(l2, 1) *
789 (du_test_dx(l, 0) + u_test(l) / r)) *
794 G_r = (mu * du_test_dx(l, 0) * du_basis_dx(l2, 1) +
795 lambda * (du_basis_dx(l2, 0) + u_basis(l2) / r) *
799 (mu * (du_test_dx(l, 0) * du_basis_dx(l2, 0) +
800 2.0 * du_basis_dx(l2, 1) * du_test_dx(l, 1)) +
801 lambda * du_basis_dx(l2, 1) * du_test_dx(l, 1) +
803 u_basis(l2) * u_test(l)) *
807 for (
unsigned c = 0; c < 2; c++)
811 if (local_unknown >= 0)
815 jacobian(local_eqn, local_unknown) += G_r;
819 jacobian(local_eqn, local_unknown) += G_z;
826 for (
unsigned l2 = 0; l2 < n_q_basis; l2++)
830 if (l2 < n_q_basis_edge)
843 if (local_unknown >= 0)
845 jacobian(local_eqn, local_unknown) +=
846 lambda_sq * rho_f_over_rho * local_permeability *
847 timestepper_pt->
weight(1, 0) * q_basis(l2, a) * u_test(l) *
853 for (
unsigned l2 = 0; l2 < n_p_basis; l2++)
856 if (local_unknown >= 0)
860 jacobian(local_eqn, local_unknown) -=
861 alpha * p_basis(l2) * (du_test_dx(l, 0) + u_test(l) / r) *
866 jacobian(local_eqn, local_unknown) -=
867 alpha * p_basis(l2) * du_test_dx(l, 1) * r * w * J;
881 for (
unsigned l = 0; l < n_q_basis; l++)
883 if (l < n_q_basis_edge)
895 for (
unsigned i = 0;
i < 2;
i++)
897 residuals[local_eqn] +=
899 (interpolated_d2u_dt2[
i] +
900 (local_permeability /
porosity) * interpolated_dq_dt[
i]) +
902 rho_f_over_rho * f_fluid[
i]) *
903 q_test(l,
i) * r * w * J;
907 residuals[local_eqn] -=
interpolated_p * div_q_test_ds(l) * r * w;
916 for (
unsigned l2 = 0; l2 < n_node; l2++)
918 for (
unsigned c = 0; c < 2; c++)
922 if (local_unknown >= 0)
924 jacobian(local_eqn, local_unknown) +=
927 u_basis(l2) * q_test(l, c) * r * w * J;
933 for (
unsigned l2 = 0; l2 < n_q_basis; l2++)
937 if (l2 < n_q_basis_edge)
950 if (local_unknown >= 0)
952 for (
unsigned c = 0; c < 2; c++)
954 jacobian(local_eqn, local_unknown) +=
955 q_basis(l2, c) * q_test(l, c) *
956 (1.0 / local_permeability_ratio +
957 rho_f_over_rho *
lambda_sq * local_permeability *
965 for (
unsigned l2 = 0; l2 < n_p_basis; l2++)
969 if (local_unknown >= 0)
971 jacobian(local_eqn, local_unknown) -=
972 p_basis(l2) * (div_q_test_ds(l) * r + q_test(l, 0) * J) * w;
980 for (
unsigned l = 0; l < n_p_basis; l++)
989 residuals[local_eqn] +=
990 alpha * interpolated_div_du_dt_dx * p_test(l) * r * w * J;
991 residuals[local_eqn] +=
992 alpha * interpolated_du_r_dt * p_test(l) * w * J;
994 residuals[local_eqn] +=
995 local_permeability * interpolated_div_q_ds * p_test(l) * r * w;
997 residuals[local_eqn] +=
999 residuals[local_eqn] -= mass_source_local * p_test(l) * r * w * J;
1005 for (
unsigned l2 = 0; l2 < n_node; l2++)
1007 for (
unsigned c = 0; c < 2; c++)
1012 if (local_unknown >= 0)
1014 jacobian(local_eqn, local_unknown) +=
1016 du_basis_dx(l2, c) * p_test(l) * r * w * J;
1021 jacobian(local_eqn, local_unknown) +=
1024 u_basis(l2) * p_test(l) * w * J;
1031 for (
unsigned l2 = 0; l2 < n_q_basis; l2++)
1033 if (l2 < n_q_basis_edge)
1042 if (local_unknown >= 0)
1044 jacobian(local_eqn, local_unknown) +=
1045 (div_q_basis_ds(l2) * r + q_basis(l2, 0) * J) *
1046 local_permeability * p_test(l) * w;
static double Default_lambda_sq_value
Static default value for timescale ratio.
void mass_source(const double &time, const Vector< double > &x, double &b) const
Indirect access to the mass source function - returns 0 if no mass source function has been set.
static double Default_youngs_modulus_value
Static default value for Young's modulus (1.0 – for natural scaling, i.e. all stresses have been non-...
virtual unsigned q_internal_index() const =0
Return the index of the internal data where the q internal degrees of freedom are stored.
double dq_internal_dt(const unsigned &n) const
dq_internal/dt for the n-th internal degree of freedom
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
Compute the error between the FE solution and the exact solution using the H(div) norm for q and L^2 ...
virtual void scale_basis(Shape &basis) const =0
Scale the edge basis to allow arbitrary edge mappings.
virtual unsigned u_index_axisym_poroelasticity(const unsigned &j) const =0
Return the nodal index of the j-th solid displacement unknown.
const double & porosity() const
Access function for the porosity.
virtual int q_edge_local_eqn(const unsigned &j) const =0
Return the equation number of the j-th edge (flux) degree of freedom.
void interpolated_u(const Vector< double > &s, Vector< double > &disp) const
Calculate the FE representation of u.
const double & youngs_modulus() const
Access function to non-dim Young's modulus (ratio of actual Young's modulus to reference stress used ...
virtual unsigned q_edge_node_number(const unsigned &j) const =0
Return the number of the node where the jth edge unknown is stored.
virtual int q_internal_local_eqn(const unsigned &j) const =0
Return the equation number of the j-th internal degree of freedom.
virtual double shape_basis_test_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsi, Shape &u_basis, Shape &u_test, DShape &du_basis_dx, DShape &du_test_dx, Shape &q_basis, Shape &q_test, Shape &p_basis, Shape &p_test, Shape &div_q_basis_ds, Shape &div_q_test_ds) const =0
Compute the geometric basis, and the q, p and divergence basis functions and test functions at integr...
void interpolated_q(const Vector< double > &s, Vector< double > &q) const
Calculate the FE representation of q.
const double & permeability_ratio() const
Access function for the ratio of the material's actual permeability to the permeability used in the n...
static double Default_porosity_value
Static default value for the porosity.
double du_dt(const unsigned &n, const unsigned &i) const
du/dt at local node n
static double Default_permeability_value
Static default value for the permeability (1.0 for natural scaling; i.e. timescale is given by L^2/(k...
static double Default_permeability_ratio_value
Static default value for the ratio of the material's actual permeability to the permeability used to ...
void interpolated_div_q(const Vector< double > &s, double &div_q) const
Calculate the FE representation of div u.
double transform_basis(const Vector< double > &s, const Shape &q_basis_local, Shape &psi, DShape &dpsi, Shape &q_basis) const
Performs a div-conserving transformation of the vector basis functions from the reference element to ...
virtual unsigned np_basis() const =0
Return the total number of pressure basis functions.
virtual unsigned nq_basis() const
Return the total number of computational basis functions for q.
const double & density_ratio() const
Access function for the density ratio (fluid to solid)
const double & lambda_sq() const
Access function for timescale ratio (nondim density)
virtual unsigned nq_basis_edge() const =0
Return the number of edge basis functions for q.
virtual double q_internal(const unsigned &j) const =0
Return the values of the j-th internal degree of freedom.
void interpolated_p(const Vector< double > &s, double &p) const
Calculate the FE representation of p.
void interpolated_du_dt(const Vector< double > &s, Vector< double > &du_dt) const
Calculate the FE representation of du_dt.
virtual double p_value(const unsigned &j) const =0
Return the jth pressure value.
const double & permeability() const
Access function for the nondim permeability.
virtual void fill_in_generic_residual_contribution(Vector< double > &residuals, DenseMatrix< double > &jacobian, bool flag)
Fill in residuals and, if flag==true, jacobian.
double d2u_dt2(const unsigned &n, const unsigned &i) const
d^2u/dt^2 at local node n
static double Default_density_ratio_value
Static default value for the density ratio.
const double & alpha() const
Access function for alpha, the Biot parameter.
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output FE representation of exact soln: x,y,u1,u2,div_q,p at Nplot^2 plot points.
void fluid_body_force(const double &time, const Vector< double > &x, Vector< double > &b) const
Indirect access to the fluid body force function - returns 0 if no forcing function has been set.
static double Default_alpha_value
Static default value for alpha, the biot parameter.
void solid_body_force(const double &time, const Vector< double > &x, Vector< double > &b) const
Indirect access to the solid body force function - returns 0 if no forcing function has been set.
virtual double q_edge(const unsigned &j) const =0
Return the values of the j-th edge (flux) degree of freedom.
const double & nu() const
Access function for Poisson's ratio.
double dq_edge_dt(const unsigned &n) const
dq_edge/dt for the n-th edge degree of freedom
void output(std::ostream &outfile)
Output with default number of plot points.
virtual int p_local_eqn(const unsigned &j) const =0
Return the equation number of the j-th pressure degree of freedom.
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual void transform_derivatives(const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
Convert derivative w.r.t.local coordinates to derivatives w.r.t the coordinates used to assemble the ...
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Return the local equation number corresponding to the i-th value at the n-th local node.
unsigned nnode() const
Return the number of nodes.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
virtual double local_to_eulerian_mapping(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Calculate the mapping from local to Eulerian coordinates, given the derivatives of the shape function...
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction")
double nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. If the node is hanging, the appropriate interpolation is ...
virtual void dshape_local(const Vector< double > &s, Shape &psi, DShape &dpsids) const
Function to compute the geometric shape functions and derivatives w.r.t. local coordinates at local c...
double raw_nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n but do NOT take hanging nodes into account.
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Add tecplot zone "footer" to output stream (when plotting nplot points in each "coordinate direction"...
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
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.
An OomphLibError object which should be thrown when an run-time error is encountered....
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
Time *const & time_pt() const
Access function for the pointer to time (const version)
double & time()
Return the current value of the continuous time.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...