28#ifndef OOMPH_AXISYM_CYLINDRICAL_ELASTICITY_WITH_PRESSURE_ELEMENTS_HEADER
29#define OOMPH_AXISYM_CYLINDRICAL_ELASTICITY_WITH_PRESSURE_ELEMENTS_HEADER
33#include <oomph-lib-config.h>
37#include "../generic/Telements.h"
38#include "../constitutive/constitutive_laws.h"
39#include "../generic/error_estimator.h"
40#include "../generic/projection.h"
146 for (
unsigned i = 0;
i < 2;
i++)
160 (*Body_force_fct_pt)(time, xi, b);
177 std::string error_message =
178 "Elements derived from AxisymmetricPVDEquationsWithPressure";
179 error_message +=
" must have a constitutive law :\n ";
181 "set one using the constitutive_law_pt() member function\n";
203 std::string error_message =
204 "Elements derived from AxisymmetricPVDEquationsWithPressure";
205 error_message +=
" must have a constitutive law :\n ";
207 "set one using the constitutive_law_pt() member function\n";
237 std::string error_message =
238 "Elements derived from PVDEquationsWithPressure \n";
239 error_message +=
"must have a constitutive law:\n";
241 "set one using the constitutive_law_pt() member function";
278 std::string error_message =
279 "Elements derived from PVDEquationsWithPressure \n";
280 error_message +=
"must have a constitutive law:\n";
282 "set one using the constitutive_law_pt() member function";
332 for (
unsigned i = 0;
i < 2;
i++)
339 for (
unsigned j = 0;
j < 2;
j++)
381 for (
unsigned i = 0;
i < 3;
i++)
383 for (
unsigned j = 0;
j < 3;
j++)
390 for (
unsigned i = 0;
i < 2;
i++)
392 for (
unsigned j = 0;
j < 2;
j++)
402 strain(2, 2) = 0.5 * (
G(2, 2) - g(2, 2));
439 for (
unsigned i = 0;
i < 2;
i++)
464 for (
unsigned i = 0;
i < 2;
i++)
472 for (
unsigned j = 0;
j < 2;
j++)
506 double W = w *
J *
sqrt(g(0, 0) * g(1, 1) * g(2, 2));
543 for (
unsigned i = 0;
i < 3;
i++)
545 for (
unsigned j = 0;
j < 3;
j++)
561 for (
unsigned i = 0;
i < 3;
i++)
563 for (
unsigned j = 0;
j < 3;
j++)
568 veloc_sq = veloc[0] * veloc[0] + veloc[1] * veloc[1];
579 virtual double solid_p(
const unsigned&
l)
const = 0;
591 const unsigned&
flag);
618 const unsigned n_plot = 5;
648 for (
unsigned i = 0;
i < 2;
i++)
654 for (
unsigned i = 0;
i < 2;
i++)
661 <<
" " <<
strain(2, 2) <<
" ";
677 const unsigned n_plot = 5;
702 const unsigned&
nplot)
const
758 error_stream <<
"These elements only store " << 5 <<
" fields, "
759 <<
"but i is currently " <<
i << std::endl;
775 return "Lagrangian coord. r";
779 return "Lagrangian coord. z";
796 return "Strain phi-phi";
801 return "Solid pressure";
807 error_stream <<
"These elements only output " << 7 <<
" fields,\n"
808 <<
"but i is currently " <<
i << std::endl;
846 template<
class PVD_ELEMENT>
903 this->solid_pshape(
s,
psi);
914 return this->interpolated_solid_p(
s);
921 return this->nsolid_pres();
928 return this->solid_p_local_eqn(
j);
937 template<
class ELEMENT>
951 template<
class ELEMENT>
1086 for (
unsigned i = 0;
i < 2;
i++)
1088 for (
unsigned j = 0;
j < 2;
j++)
1283 std::ostringstream error_message;
1284 error_message <<
"The flux vector has the wrong number of entries, "
1301 for (
unsigned i = 0;
i < 3;
i++)
1320 psi[2] = 1.0 -
s[0] -
s[1];
A class for elements that solve the equations of solid mechanics, based on the principle of virtual d...
void body_force(const Vector< double > &xi, Vector< double > &b) const
Evaluate body force at Lagrangian coordinate xi at present time (returns zero vector if no body force...
void get_stress(const DenseMatrix< double > &g, const DenseMatrix< double > &G, DenseMatrix< double > &sigma, DenseMatrix< double > &Gup, double &pressure_stress, double &kappa)
Return the stress tensor, as calculated from the constitutive law in the Near-incompresible formulati...
unsigned ndof_types() const
returns the number of DOF types associated with this element.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals by calling the generic function.
virtual void solid_pshape(const Vector< double > &s, Shape &psi) const =0
Return the solid pressure shape functions.
double eta_mass()
Return the mass damping parameter.
std::string scalar_name_paraview(const unsigned &i) const
Name of the i-th scalar field. Default implementation returns V1 for the first one,...
void get_d_stress_dG_upper(const DenseMatrix< double > &g, const DenseMatrix< double > &G, const DenseMatrix< double > &sigma, const double &detG, const double &interpolated_solid_p, RankFourTensor< double > &d_sigma_dG, DenseMatrix< double > &d_detG_dG)
Return the derivative of the 2nd Piola Kirchhoff stress tensor, as calculated from the constitutive l...
void set_incompressible()
Set the material to be incompressible.
void get_strain(const Vector< double > &s, DenseMatrix< double > &strain) const
Get the strain.
BodyForceFctPt body_force_fct_pt() const
Access function: Pointer to body force function (const version)
BodyForceFctPt & body_force_fct_pt()
Access function: Pointer to body force function.
BodyForceFctPt Body_force_fct_pt
Pointer to body force function.
AxisymmetricCylindricalPVDWithPressureEquations()
Constructor.
void output(std::ostream &outfile)
Overload the output function.
double interpolated_solid_p(const Vector< double > &s) const
Return the interpolated_solid_pressure.
void solid_pshape_at_knot(const unsigned &ipt, Shape &psi) const
Return the stored solid shape functions at the knots.
bool is_incompressible() const
Return whether the material is incompressible.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in the jacobian.
void get_stress(const DenseMatrix< double > &g, const DenseMatrix< double > &G, DenseMatrix< double > &sigma, DenseMatrix< double > &Gup, double &detG)
Return the stress tensor, as calculated from the constitutive law in the "true" incompresible formula...
virtual int solid_p_local_eqn(const unsigned &i) const =0
Access function that returns the local equation number for the n-th solid pressure value.
void get_d_stress_dG_upper(const DenseMatrix< double > &g, const DenseMatrix< double > &G, const DenseMatrix< double > &sigma, const double &gen_dil, const double &inv_kappa, const double &interpolated_solid_p, RankFourTensor< double > &d_sigma_dG, DenseMatrix< double > &d_gen_dil_dG)
Return the derivative of the deviatoric part of the 2nd Piola Kirchhoff stress tensor,...
ConstitutiveLaw * Constitutive_law_pt
Pointer to constitutive law.
void set_compressible()
Set the material to be compressible.
virtual double solid_p(const unsigned &l) const =0
Return the lth solid pressures.
double *& lambda_sq_pt()
Access function for pointer to timescale ratio (nondim density)
ConstitutiveLaw *& constitutive_law_pt()
Return the constitutive law pointer.
static double Default_eta_value
Static default value for damping parameters.
double * Lambda_sq_pt
Timescale ratio (non-dim. density)
void get_energy(double &pot_en, double &kin_en)
Get potential (strain) and kinetic energy.
bool Incompressible
Boolean to determine whether the solid is incompressible or not.
void output(FILE *file_pt)
Overload the output function.
double *& eta_mass_pt()
Access function for mass damping parameter.
unsigned nscalar_paraview() const
-----—Paraview stuff---------------------------------------—/// Number of scalars/fields output by th...
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
void scalar_value_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
Write values of the i-th scalar field at the plot points. Needs to be implemented for each new specif...
static double Default_lambda_sq_value
Static default value for timescale ratio (1.0 – for natural scaling)
void(* BodyForceFctPt)(const double &t, const Vector< double > &xi, Vector< double > &b)
Function pointer to function that specifies the body force as a function of the Lagrangian coordinate...
virtual void fill_in_contribution_to_residuals_axisym_pvd_with_pressure(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Return the residuals for the equations of solid mechanics.
virtual int solid_p_nodal_index() const
Return the index at which the solid pressure is stored.
double * Eta_mass_pt
Pointer to the mass damping parameter.
virtual unsigned nsolid_pres() const =0
Return the number of solid pressure degrees of freedom.
void output(FILE *file_pt, const unsigned &n_plot)
Output function.
const double & lambda_sq() const
Access function for timescale ratio (nondim density)
A class for constitutive laws for elements that solve the equations of solid mechanics based upon the...
virtual void calculate_d_second_piola_kirchhoff_stress_dG(const DenseMatrix< double > &g, const DenseMatrix< double > &G, const DenseMatrix< double > &sigma, RankFourTensor< double > &d_sigma_dG, const bool &symmetrize_tensor=true)
Calculate the derivatives of the contravariant 2nd Piola Kirchhoff stress tensor with respect to the ...
virtual void calculate_second_piola_kirchhoff_stress(const DenseMatrix< double > &g, const DenseMatrix< double > &G, DenseMatrix< double > &sigma)=0
Calculate the contravariant 2nd Piola Kirchhoff stress tensor. Arguments are the covariant undeformed...
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.
void pin(const unsigned &i)
Pin the i-th stored variable.
void unpin(const unsigned &i)
Unpin the i-th stored variable.
void set_value(const unsigned &i, const double &value_)
Set the i-th stored data value to specified value. The only reason that we require an explicit set fu...
Base class for finite elements that can compute the quantities that are required for the Z2 error est...
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
FaceGeometry class definition: This policy class is used to allow construction of face elements that ...
virtual unsigned nplot_points_paraview(const unsigned &nplot) const
Return the number of actual plot points for paraview plot with parameter nplot. Broken virtual; can b...
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
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.
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 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 ...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
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"...
double dnodal_position_dt(const unsigned &n, const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt at local node n.
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
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.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
An OomphLibError object which should be thrown when an run-time error is encountered....
Point element has just a single node and a single shape function which is identically equal to one.
AxisymCylindricalPVDWithPressureElement upgraded to become projectable.
double jacobian_and_shape_of_field(const unsigned &fld, const Vector< double > &s, Shape &psi)
Return Jacobian of mapping and shape functions of field fld at local coordinate s.
double get_field(const unsigned &t, const unsigned &fld, const Vector< double > &s)
Return interpolated field fld at local coordinate s, at time level t (t=0: present; t>0: history valu...
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld.
unsigned nhistory_values_for_coordinate_projection()
Number of positional history values (Includes the current value!)
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of value j in field fld.
Vector< std::pair< Data *, unsigned > > data_values_of_field(const unsigned &fld)
Specify the values associated with field fld. The information is returned in a vector of pairs which ...
unsigned nfields_for_projection()
Number of fields to be projected: 1 (pressure)
ProjectableAxisymCylindricalPVDWithPressureElement()
Constructor [this was only required explicitly from gcc 4.5.2 onwards...].
unsigned nhistory_values_for_projection(const unsigned &fld)
Number of history values to be stored for fld-th field (Includes the current value!...
Wrapper class for projectable elements. Adds "projectability" to the underlying ELEMENT.
void set_solid_p(const unsigned &l, const double &p_value)
Set the l-th solid pressure value to p_value.
int solid_p_local_eqn(const unsigned &i) const
Overload the access function that is used to return local equation corresponding to the i-th solid pr...
void fix_solid_pressure(const unsigned &l, const double &pvalue)
Fix the pressure dof l to be the value pvalue.
void solid_pshape(const Vector< double > &s, Shape &psi) const
Pressure shape functions at local coordinate s.
void unpin_elemental_solid_pressure_dofs()
Unpin all solid pressure dofs in the element.
void output(FILE *file_pt)
C-style output function.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
double solid_p(const unsigned &l) const
Return the l-th pressure value, make sure to use the hanging representation if there is one!
void output(std::ostream &outfile)
Output function.
unsigned nsolid_pres() const
Return number of pressure values.
int solid_p_nodal_index() const
Set the value at which the solid pressure is stored in the nodes.
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at node.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
virtual unsigned required_nvalue(const unsigned &n) const
Number of values (pinned or dofs) required at node n. Can be overwritten for hanging node version.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
QAxisymmetricCylindricalPVDWithPressureElement()
Constructor, there are no internal data points.
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
SolidFiniteElement class.
double lagrangian_position(const unsigned &n, const unsigned &i) const
Return i-th Lagrangian coordinate at local node n.
double dshape_lagrangian(const Vector< double > &s, Shape &psi, DShape &dpsidxi) const
Calculate shape functions and derivatives w.r.t. Lagrangian coordinates at local coordinate s....
virtual double interpolated_xi(const Vector< double > &s, const unsigned &i) const
Return i-th FE-interpolated Lagrangian coordinate xi[i] at local coordinate s.
virtual double dshape_lagrangian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidxi) const
Return the geometric shape functions and also first derivatives w.r.t. Lagrangian coordinates at ipt-...
void describe_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the element. The ostream specifies the output stream to which ...
SolidQElement elements are quadrilateral elements whose derivatives also include those based upon the...
SolidTElement elements are triangular/tet elements whose derivatives also include those based upon th...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
An Element that solves the axisymmetric solid mechanics equations, based on the principle of virtual ...
void unpin_elemental_solid_pressure_dofs()
Unpin all solid pressure dofs in the element.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
virtual unsigned required_nvalue(const unsigned &n) const
Number of values (pinned or dofs) required at node n. Can be overwritten for hanging node version.
void solid_pshape(const Vector< double > &s, Shape &psi) const
Pressure shape functions at local coordinate s.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain tensor.
int solid_p_local_eqn(const unsigned &i) const
Overload the access function that is used to return local equation corresponding to the i-th solid pr...
TAxisymCylindricalPVDWithPressureElement()
Constructor, there are no internal data points.
void output(std::ostream &outfile)
Output function.
void set_solid_p(const unsigned &l, const double &p_value)
Set the l-th solid pressure value to p_value.
unsigned nvertex_node() const
Number of vertex nodes in the element.
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at node.
int solid_p_nodal_index() const
Set the value at which the solid pressure is stored in the nodes.
unsigned nsolid_pres() const
Return number of pressure values.
void output(FILE *file_pt)
C-style output function.
void fix_solid_pressure(const unsigned &l, const double &pvalue)
Fix the pressure dof l to be the value pvalue.
double solid_p(const unsigned &l) const
Return the l-th pressure value, make sure to use the hanging representation if there is one!
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
Time *const & time_pt() const
Access function for the pointer to time (const version)
double & time()
Return the current value of the continuous time.
void shape< 2 >(const double &s, double *Psi)
1D shape functions specialised to linear order (2 Nodes)
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).