33 #ifndef OOMPH_ELASTICITY_ELEMENTS_HEADER 34 #define OOMPH_ELASTICITY_ELEMENTS_HEADER 38 #include <oomph-lib-config.h> 43 #include "../generic/Qelements.h" 44 #include "../generic/Telements.h" 45 #include "../generic/mesh.h" 46 #include "../generic/hermite_elements.h" 47 #include "../constitutive/constitutive_laws.h" 48 #include "../generic/error_estimator.h" 49 #include "../generic/projection.h" 62 template <
unsigned DIM>
176 unsigned n_element = element_pt.size();
177 for(
unsigned e=0;
e<n_element;
e++)
189 unsigned n_element = element_pt.size();
190 for(
unsigned e=0;
e<n_element;
e++)
208 void get_energy(
double &pot_en,
double &kin_en);
215 def_covariant_basis);
242 (*Isotropic_growth_fct_pt)(xi,gamma);
257 for (
unsigned i=0;i<n;i++)
271 (*Body_force_fct_pt)(time,xi,b);
296 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
const 299 std::pair<unsigned,unsigned> dof_lookup;
302 const unsigned n_node = this->
nnode();
312 for(
unsigned n=0;n<n_node;n++)
316 for(
unsigned k=0;k<n_position_type;k++)
319 for(
unsigned i=0;i<nodal_dim;i++)
325 if (local_unknown >= 0)
329 dof_lookup.first = this->
eqn_number(local_unknown);
330 dof_lookup.second =
i;
333 dof_lookup_list.push_front(dof_lookup);
399 template <
unsigned DIM>
416 fill_in_generic_contribution_to_residuals_pvd(
455 this->fill_in_generic_contribution_to_residuals_pvd(
464 fill_in_generic_contribution_to_residuals_pvd(residuals,jacobian,1);
477 void output(std::ostream &outfile,
const unsigned &n_plot);
488 void output(FILE* file_pt,
const unsigned &n_plot);
493 void extended_output(std::ostream &outfile,
const unsigned &n_plot);
500 virtual void fill_in_generic_contribution_to_residuals_pvd(
502 const unsigned& flag);
517 "Elements derived from PVDEquations must have a constitutive law:\n";
519 "set one using the constitutive_law_pt() member function";
522 OOMPH_CURRENT_FUNCTION,
523 OOMPH_EXCEPTION_LOCATION);
545 "Elements derived from PVDEquations must have a constitutive law:\n";
547 "set one using the constitutive_law_pt() member function";
550 OOMPH_CURRENT_FUNCTION,
551 OOMPH_EXCEPTION_LOCATION);
575 template<
unsigned DIM,
unsigned NNODE_1D>
588 void output(std::ostream &outfile,
const unsigned &n_plot)
596 void output(FILE* file_pt,
const unsigned &n_plot)
605 template<
unsigned NNODE_1D>
618 template<
unsigned NNODE_1D>
632 template<
unsigned NNODE_1D>
644 template<
unsigned NNODE_1D>
657 template<
unsigned DIM>
673 void output(std::ostream &outfile,
const unsigned &n_plot)
680 void output(FILE* file_pt,
const unsigned &n_plot)
691 template<
class PVD_ELEMENT>
781 template<
class ELEMENT>
794 template<
class ELEMENT>
821 template <
unsigned DIM>
829 Incompressible(false) {}
845 virtual double solid_p(
const unsigned &l)=0;
848 virtual void set_solid_p(
const unsigned &l,
const double &p_value)=0;
855 fill_in_generic_residual_contribution_pvd_with_pressure(
873 std::string error_message =
"Can't assign consistent Newmark history\n";
874 error_message +=
" values for solid element with pressure dofs\n";
878 OOMPH_CURRENT_FUNCTION,
879 OOMPH_EXCEPTION_LOCATION);
887 fill_in_generic_residual_contribution_pvd_with_pressure(
900 fill_in_generic_residual_contribution_pvd_with_pressure(
923 std::string error_message =
"Can't assign consistent Newmark history\n";
924 error_message +=
" values for solid element with pressure dofs\n";
928 OOMPH_CURRENT_FUNCTION,
929 OOMPH_EXCEPTION_LOCATION);
938 fill_in_generic_residual_contribution_pvd_with_pressure(
939 residuals,jacobian,mass_matrix,4);
950 fill_in_generic_residual_contribution_pvd_with_pressure(
951 residuals,jacobian,mass_matrix,3);
955 const unsigned n_dof = this->
ndof();
956 for(
unsigned i=0;
i<n_dof;
i++)
958 residuals[
i] *= -1.0;
959 for(
unsigned j=0;j<n_dof;j++)
961 jacobian(
i,j) *= -1.0;
974 Shape psisp(n_solid_pres);
976 solid_pshape(s,psisp);
979 double interpolated_solid_p = 0.0;
981 for(
unsigned l=0;l<n_solid_pres;l++)
982 {interpolated_solid_p += solid_p(l)*psisp[l];}
984 return(interpolated_solid_p);
996 void output(std::ostream &outfile,
const unsigned &n_plot);
1007 void output(FILE* file_pt,
const unsigned &n_plot);
1011 void extended_output(std::ostream &outfile,
const unsigned &n_plot);
1034 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
const 1037 std::pair<unsigned,unsigned> dof_lookup;
1040 const unsigned n_node = this->
nnode();
1047 int local_unknown=0;
1050 for(
unsigned n=0;n<n_node;n++)
1054 for(
unsigned k=0;k<n_position_type;k++)
1057 for(
unsigned i=0;
i<nodal_dim;
i++)
1063 if (local_unknown >= 0)
1067 dof_lookup.first = this->
eqn_number(local_unknown);
1068 dof_lookup.second =
i;
1071 dof_lookup_list.push_front(dof_lookup);
1079 for (
unsigned j=0;j<np;j++)
1083 if (local_unknown >= 0)
1087 dof_lookup.first = this->
eqn_number(local_unknown);
1088 dof_lookup.second = DIM;
1091 dof_lookup_list.push_front(dof_lookup);
1108 double &gen_dil,
double &inv_kappa)
1116 "Elements derived from PVDEquationsWithPressure \n";
1117 error_message +=
"must have a constitutive law:\n";
1119 "set one using the constitutive_law_pt() member function";
1122 OOMPH_CURRENT_FUNCTION,
1123 OOMPH_EXCEPTION_LOCATION);
1127 calculate_second_piola_kirchhoff_stress(g,G,sigma_dev,Gcontra,
1140 const double &gen_dil,
1141 const double &inv_kappa,
1142 const double &interpolated_solid_p,
1153 "Elements derived from PVDEquationsWithPressure \n";
1154 error_message +=
"must have a constitutive law:\n";
1156 "set one using the constitutive_law_pt() member function";
1159 OOMPH_CURRENT_FUNCTION,
1160 OOMPH_EXCEPTION_LOCATION);
1165 calculate_d_second_piola_kirchhoff_stress_dG(
1166 g,G,sigma,gen_dil,inv_kappa,interpolated_solid_p,
1167 d_sigma_dG,d_gen_dil_dG,
false);
1178 unsigned Dim = this->
dim();
1184 solid_pshape(s,psi);
1199 virtual void fill_in_generic_residual_contribution_pvd_with_pressure(
1202 const unsigned& flag);
1222 "Elements derived from PVDEquationsWithPressure \n";
1223 error_message +=
"must have a constitutive law:\n";
1225 "set one using the constitutive_law_pt() member function";
1228 OOMPH_CURRENT_FUNCTION,
1229 OOMPH_EXCEPTION_LOCATION);
1233 calculate_second_piola_kirchhoff_stress(g,G,sigma_dev,Gcontra,detG);
1245 const double &interpolated_solid_p,
1255 "Elements derived from PVDEquationsWithPressure \n";
1256 error_message +=
"must have a constitutive law:\n";
1258 "set one using the constitutive_law_pt() member function";
1261 OOMPH_CURRENT_FUNCTION,
1262 OOMPH_EXCEPTION_LOCATION);
1267 calculate_d_second_piola_kirchhoff_stress_dG(
1268 g,G,sigma,detG,interpolated_solid_p,d_sigma_dG,d_detG_dG,
false);
1289 template<
unsigned DIM>
1299 for(
unsigned l=0;l<n_pres;l++)
1355 void output(std::ostream &outfile,
const unsigned &n_plot)
1363 void output(FILE* file_pt,
const unsigned &n_plot)
1462 template<
unsigned DIM>
1469 static const unsigned Initial_Nvalue[];
1476 unsigned n_node = this->
nnode();
1478 for(
unsigned n=0;n<n_node;n++)
1486 static const unsigned Pconv[];
1510 {
return Initial_Nvalue[n];}
1523 {
return static_cast<unsigned>(pow(2.0,static_cast<int>(DIM)));}
1536 void output(std::ostream &outfile,
const unsigned &n_plot)
1544 void output(FILE* file_pt,
const unsigned &n_plot)
1559 double psi1[2], psi2[2];
1566 for(
unsigned i=0;
i<2;
i++)
1568 for(
unsigned j=0;j<2;j++)
1571 psi[2*
i + j] = psi2[
i]*psi1[j];
1585 double psi1[2], psi2[2], psi3[2];
1593 for(
unsigned i=0;
i<2;
i++)
1595 for(
unsigned j=0;j<2;j++)
1597 for(
unsigned k=0;k<2;k++)
1600 psi[4*
i + 2*j + k] = psi3[
i]*psi2[j]*psi1[k];
1678 template<
unsigned DIM,
unsigned NNODE_1D>
1692 void output(std::ostream &outfile,
const unsigned &n_plot)
1700 void output(FILE* file_pt,
const unsigned &n_plot)
1729 return DIM + DIM*(DIM-1)/2;
1737 unsigned num_entries=DIM+((DIM*DIM)-DIM)/2;
1738 if (flux.size()!=num_entries)
1740 std::ostringstream error_message;
1741 error_message <<
"The flux vector has the wrong number of entries, " 1742 << flux.size() <<
", whereas it should be " 1743 << num_entries << std::endl;
1745 OOMPH_CURRENT_FUNCTION,
1746 OOMPH_EXCEPTION_LOCATION);
1758 for(
unsigned i=0;
i<DIM;
i++)
1760 flux[icount]=strain(
i,
i);
1764 for(
unsigned i=0;
i<DIM;
i++)
1766 for(
unsigned j=
i+1;j<DIM;j++)
1768 flux[icount]=strain(
i,j);
1781 template<
unsigned NNODE_1D>
1794 template<
unsigned NNODE_1D>
1808 template<
unsigned NNODE_1D>
1820 template<
unsigned NNODE_1D>
1842 template<
unsigned DIM,
unsigned NNODE_1D>
1858 void output(std::ostream &outfile,
const unsigned &n_plot)
1866 void output(FILE* file_pt,
const unsigned &n_plot)
1886 return DIM + DIM*(DIM-1)/2;
1894 unsigned num_entries=DIM+((DIM*DIM)-DIM)/2;
1895 if (flux.size()!=num_entries)
1897 std::ostringstream error_message;
1898 error_message <<
"The flux vector has the wrong number of entries, " 1899 << flux.size() <<
", whereas it should be " 1900 << num_entries << std::endl;
1902 OOMPH_CURRENT_FUNCTION,
1903 OOMPH_EXCEPTION_LOCATION);
1915 for(
unsigned i=0;
i<DIM;
i++)
1917 flux[icount]=strain(
i,
i);
1921 for(
unsigned i=0;
i<DIM;
i++)
1923 for(
unsigned j=
i+1;j<DIM;j++)
1925 flux[icount]=strain(
i,j);
1938 template<
unsigned NNODE_1D>
1951 template<
unsigned NNODE_1D>
1965 template<
unsigned NNODE_1D>
1977 template<
unsigned NNODE_1D>
1996 template <
unsigned DIM>
2004 static const unsigned Initial_Nvalue[];
2011 unsigned n_node = this->
nnode();
2013 for(
unsigned n=0;n<n_node;n++)
2021 static const unsigned Pconv[];
2063 {
return Initial_Nvalue[n];}
2088 void output(std::ostream &outfile,
const unsigned &n_plot)
2096 void output(FILE* file_pt,
const unsigned &n_plot)
2115 return DIM + DIM*(DIM-1)/2;
2123 unsigned num_entries=DIM+((DIM*DIM)-DIM)/2;
2124 if (flux.size()!=num_entries)
2126 std::ostringstream error_message;
2127 error_message <<
"The flux vector has the wrong number of entries, " 2128 << flux.size() <<
", whereas it should be " 2129 << num_entries << std::endl;
2131 OOMPH_CURRENT_FUNCTION,
2132 OOMPH_EXCEPTION_LOCATION);
2144 for(
unsigned i=0;
i<DIM;
i++)
2146 flux[icount]=strain(
i,
i);
2150 for(
unsigned i=0;
i<DIM;
i++)
2152 for(
unsigned j=
i+1;j<DIM;j++)
2154 flux[icount]=strain(
i,j);
2194 psi[2] = 1.0-s[0]-s[1];
2208 psi[3] = 1.0-s[0]-s[1]-s[2];
2249 namespace SolidHelpers
2256 template<
class ELEMENT>
2260 std::ofstream pos_file;
2261 std::ofstream neg_file;
2262 std::ostringstream filename;
2263 filename << doc_info.
directory() <<
"/pos_principal_stress" 2264 << doc_info.
number() <<
".dat";
2265 pos_file.open(filename.str().c_str());
2267 filename << doc_info.
directory() <<
"/neg_principal_stress" 2268 << doc_info.
number() <<
".dat";
2269 neg_file.open(filename.str().c_str());
2272 pos_file << 0.0 <<
" " << 0.0 <<
" " << 0.0 <<
" " << 0.0 <<
" " << std::endl;
2273 neg_file << 0.0 <<
" " << 0.0 <<
" " << 0.0 <<
" " << 0.0 <<
" " << std::endl;
2280 unsigned n_solid_element=mesh_pt->
nelement();
2281 for (
unsigned e=0;
e<n_solid_element;
e++)
2283 ELEMENT* el_pt=
dynamic_cast<ELEMENT*
>(mesh_pt->
element_pt(
e));
2288 el_pt->get_principal_stress(s,principal_stress_vector,principal_stress);
2291 el_pt->interpolated_x(s,x);
2296 bool hydrostat=
false;
2300 double dev_max=1.0e-2;
2301 if (principal_stress[0]!=0.0)
2303 if (std::fabs((principal_stress[0]-principal_stress[1])/
2304 principal_stress[0])<dev_max)
2307 double Cos=cos(0.25*3.14159);
2308 double Sin=sin(0.25*3.14159);
2310 Cos*principal_stress_vector(0,0) - Sin*principal_stress_vector(0,1);
2312 Sin*principal_stress_vector(0,0) + Cos*principal_stress_vector(0,1);
2314 Cos*principal_stress_vector(1,0) - Sin*principal_stress_vector(1,1);
2316 Sin*principal_stress_vector(1,0) + Cos*principal_stress_vector(1,1);
2321 for (
unsigned i=0;
i<2;
i++)
2323 if (principal_stress[
i]>0.0)
2325 pos_file << x[0] <<
" " << x[1] <<
" " 2326 << principal_stress_vector(
i,0) <<
" " 2327 << principal_stress_vector(
i,1) << std::endl;
2328 pos_file << x[0] <<
" " << x[1] <<
" " 2329 << -principal_stress_vector(
i,0) <<
" " 2330 << -principal_stress_vector(
i,1) << std::endl;
2333 pos_file << x[0] <<
" " << x[1] <<
" " 2335 << rot(
i,1) << std::endl;
2336 pos_file << x[0] <<
" " << x[1] <<
" " 2338 << -rot(
i,1) << std::endl;
2343 neg_file << x[0] <<
" " << x[1] <<
" " 2344 << principal_stress_vector(
i,0) <<
" " 2345 << principal_stress_vector(
i,1) << std::endl;
2346 neg_file << x[0] <<
" " << x[1] <<
" " 2347 << -principal_stress_vector(
i,0) <<
" " 2348 << -principal_stress_vector(
i,1) << std::endl;
2351 neg_file << x[0] <<
" " << x[1] <<
" " 2353 << rot(
i,1) << std::endl;
2354 neg_file << x[0] <<
" " << x[1] <<
" " 2356 << -rot(
i,1) << std::endl;
2374 template<
class PVD_ELEMENT>
2398 for(
unsigned j=0;j<n_solid_pres;j++)
2401 unsigned vertex_index=this->Pconv[j];
2402 data_values.push_back(std::make_pair(this->
node_pt(vertex_index),0));
2435 this->solid_pshape(s,psi);
2443 const unsigned &fld,
2446 return this->interpolated_solid_p(s);
2472 template<
class ELEMENT>
2485 template<
class ELEMENT>
double * Lambda_sq_pt
Timescale ratio (non-dim. density)
void unpin(const unsigned &i)
Unpin the i-th stored variable.
double value(const unsigned &i) const
Return i-th stored value. This function is not virtual so that it can be inlined. This means that if ...
unsigned npres_solid() const
Return number of pressure values.
unsigned nvertex_node() const
Number of vertex nodes in the element.
HermitePVDElement()
Constructor, there are no internal data points.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
void output(std::ostream &outfile)
Generic FiniteElement output function.
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of value j in field fld.
void output(std::ostream &outfile)
Output function.
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...
void solid_pshape(const Vector< double > &s, Shape &psi) const
Pressure shape functions at local coordinate s.
bool is_jacobian_evaluated_by_fd() const
Return the flag indicating whether the jacobian is evaluated by fd.
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Fill in contribution to Mass matrix and Jacobian (either by FD or analytically, for the positional va...
void get_energy(double &pot_en, double &kin_en)
Get potential (strain) and kinetic energy.
virtual void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the elemental contribution to the residuals vector. Note that this function will NOT initialise t...
const double & lambda_sq() const
Access function for timescale ratio (nondim density)
Base class for finite elements that can compute the quantities that are required for the Z2 error est...
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 ...
void disable_evaluate_jacobian_by_fd()
Set Jacobian to be evaluated analytically Else: by FD.
void unpin_elemental_solid_pressure_dofs()
Unpin all solid pressure dofs in the element.
int solid_p_nodal_index() const
Set the value at which the solid pressure is stored in the nodes.
void get_strain(const Vector< double > &s, DenseMatrix< double > &strain) const
Return the strain tensor.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
virtual void pin_elemental_redundant_nodal_solid_pressures()
Pin the element's redundant solid pressures (needed for refinement)
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
void output(std::ostream &outfile)
Generic FiniteElement output function.
QPVDElementWithContinuousPressure()
Constructor.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing...
unsigned nvertex_node() const
Number of vertex nodes in the element.
int solid_p_nodal_index() const
Broken assignment operator.
static double Default_lambda_sq_value
Static default value for timescale ratio (1.0 – for natural scaling)
void output(FILE *file_pt, const unsigned &n_plot)
C-style PVDEquationsWithPressure output function.
void set_solid_p(const unsigned &l, const double &p_value)
Set the l-th solid pressure value to p_value.
PVDElementWithContinuousPressure upgraded to become projectable.
static int Solid_pressure_not_stored_at_node
Static "magic" number that indicates that the solid pressure is not stored at a node.
Information for documentation of results: Directory and file number to enable output in the form RESL...
PrestressFctPt & prestress_fct_pt()
Access function: Pointer to pre-stress function.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
std::string directory() const
Output directory.
void output(FILE *file_pt)
C-style output function.
void output(FILE *file_pt)
C-style output function.
unsigned ndof_types() const
returns the number of DOF types associated with this element.
unsigned npres_solid() const
Return number of pressure values.
void output(FILE *file_pt)
C-style generic FiniteElement output function.
virtual int solid_p_local_eqn(const unsigned &i) const
Return the local degree of freedom associated with the i-th solid pressure. Default is that there are...
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
ConstitutiveLaw * Constitutive_law_pt
Pointer to the constitutive law.
double solid_p(const unsigned &l)
Return the lth pressure value.
void get_stress(const DenseMatrix< double > &g, const DenseMatrix< double > &G, DenseMatrix< double > &sigma_dev, DenseMatrix< double > &Gcontra, double &detG)
Return the deviatoric part of the 2nd Piola Kirchhoff stress tensor, as calculated from the constitut...
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 enable_inertia()
Switch on solid inertia.
void disable_inertia()
Switch off solid inertia.
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain tensor.
unsigned nfields_for_projection()
Number of fields to be projected: 1, corresponding to the pressure only.
void get_d_stress_dG_upper(const DenseMatrix< double > &g, const DenseMatrix< double > &G, const DenseMatrix< double > &sigma, RankFourTensor< double > &d_sigma_dG)
Return the derivatives of the 2nd Piola Kirchhoff stress tensor, as calculated from the constitutive ...
void output(std::ostream &outfile, const unsigned &n_plot)
PVDEquationsWithPressure output function.
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 ...
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
unsigned nhistory_values_for_coordinate_projection()
Number of positional history values (Includes the current value!)
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
void set_solid_p(const unsigned &l, const double &p_value)
Set the l-th solid pressure value to p_value.
FaceGeometry()
Constructor must call constructor of the underlying Solid element.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
QPVDElement()
Constructor, there are no internal data points.
void output(std::ostream &outfile)
Generic FiniteElement output function.
virtual int solid_p_nodal_index() const
Return the index at which the solid pressure is stored if it is stored at the nodes. If not stored at the nodes this will return a negative number.
void solid_pshape(const Vector< double > &s, Shape &psi) const
Return the pressure shape functions.
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...
PVDElementWithContinuousPressure upgraded to become projectable.
FaceGeometry()
Constructor must call constructor of the underlying element.
double *& lambda_sq_pt()
Access function for pointer to timescale ratio (nondim density)
PrestressFctPt Prestress_fct_pt
Pointer to prestress function.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution to Jacobian (either by FD or analytically, control this via evaluate_jacobian_by...
void pin(const unsigned &i)
Pin the i-th stored variable.
void output(FILE *file_pt)
C-style output: x,y,[z],xi0,xi1,[xi2],p,gamma.
unsigned nhistory_values_for_projection(const unsigned &fld)
Number of history values to be stored for fld-th field. (Includes the current value!) ...
ProjectablePVDElement()
Constructor [this was only required explicitly from gcc 4.5.2 onwards...].
ProjectablePVDElementWithContinuousPressure()
Constructor [this was only required explicitly from gcc 4.5.2 onwards...].
double(* PrestressFctPt)(const unsigned &i, const unsigned &j, const Vector< double > &xi)
Function pointer to function that specifies the pre-stress sigma_0(i,j) as a function of the Lagrangi...
unsigned & number()
Number used (e.g.) for labeling output files.
FaceGeometry()
Constructor must call constructor of underlying solid element.
unsigned Dim
Dimension of zeta tuples (set by get_dim_helper) – needed because we store the scalar coordinates in...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
unsigned long nelement() const
Return number of elements in the mesh.
void fill_in_jacobian_for_solid_ic(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in the residuals and Jacobian for the setup of an initial condition. The global equations are: ...
void output(std::ostream &outfile, const unsigned &n_plot)
SolidQHermiteElement output function.
PVDEquationsWithPressure()
Constructor, by default the element is NOT incompressible.
unsigned nnodal_position_type() const
Return the number of coordinate types that the element requires to interpolate the geometry between t...
bool Unsteady
Flag that switches inertia on/off.
PVDEquations()
Constructor.
virtual void get_stress(const Vector< double > &s, DenseMatrix< double > &sigma)=0
Return the 2nd Piola Kirchoff stress tensor, as calculated from the constitutive law at specified loc...
bool is_incompressible() const
Return whether the material is incompressible.
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...
unsigned ndof() const
Return the number of equations/dofs in the element.
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
void output(FILE *file_pt, const unsigned &n_plot)
C-style PVDEquationsWithPressure output function.
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 ...
void doc_2D_principal_stress(DocInfo &doc_info, SolidMesh *mesh_pt)
Document the principal stresses in a 2D SolidMesh pointed to by mesh_pt, in the directory specified b...
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...
void fix_solid_pressure(const unsigned &l, const double &pvalue)
Fix the pressure dof l to be the value pvalue.
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.
unsigned nhistory_values_for_coordinate_projection()
Number of positional history values (Includes the current value!)
void get_stress(const DenseMatrix< double > &g, const DenseMatrix< double > &G, DenseMatrix< double > &sigma)
Return the 2nd Piola Kirchhoff stress tensor, as calculated from the constitutive law: Pass metric te...
void set_solid_p(const unsigned &l, const double &p_value)
Set the l-th pressure value to p_value.
TPVDElement()
Constructor, there are no internal data points.
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
TPVDElementWithContinuousPressure()
Constructor.
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...
void solid_pshape(const Vector< double > &s, Shape &psi) const
Return the pressure shape functions.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
FaceGeometry()
Constructor must call constructor of the underlying Solid element.
void output(std::ostream &outfile)
Overload the output function.
virtual void fill_in_jacobian_from_solid_position_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Use finite differences to calculate the Jacobian entries corresponding to the solid positions...
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of value j in field fld.
FaceGeometry()
Constructor: Call constructor of base.
bool is_inertia_enabled() const
Access function to flag that switches inertia on/off (const version)
static void pin_redundant_nodal_solid_pressures(const Vector< GeneralisedElement *> &element_pt)
Loop over all elements in Vector (which typically contains all the elements in a refineable solid mes...
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
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...
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...
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
IsotropicGrowthFctPt & isotropic_growth_fct_pt()
Access function: Pointer to isotropic growth function.
void fix_solid_pressure(const unsigned &l, const double &pvalue)
Fix the pressure dof l to be the value pvalue.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number...
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
void unpin_elemental_solid_pressure_dofs()
Unpin all solid pressure dofs in the element.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
void get_stress(const DenseMatrix< double > &g, const DenseMatrix< double > &G, DenseMatrix< double > &sigma_dev, DenseMatrix< double > &Gcontra, double &gen_dil, double &inv_kappa)
Return the deviatoric part of the 2nd Piola Kirchhoff stress tensor, as calculated from the constitut...
FaceGeometry()
Constructor must call constructor of underlying solid element.
void fix_solid_pressure(const unsigned &l, const double &pvalue)
Fix the pressure dof l to be the value pvalue.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals for the solid equations (the discretised principle of virtual displacements) ...
A class that represents a collection of data; each Data object may contain many different individual ...
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...
FaceGeometry()
Constructor must call constructor of underlying solid element.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
void set_compressible()
Set the material to be compressible.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
void output(std::ostream &outfile, const unsigned &n_plot)
PVDEquationsWithPressure output function.
static void unpin_all_solid_pressure_dofs(const Vector< GeneralisedElement *> &element_pt)
Unpin all pressure dofs in elements listed in vector.
bool Incompressible
Boolean to determine whether the solid is incompressible or not.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
double & time()
Return the current value of the continuous time.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
unsigned nfields_for_projection()
Number of fields to be projected: 0.
double prestress(const unsigned &i, const unsigned &j, const Vector< double > xi)
Return (i,j)-th component of second Piola Kirchhoff membrane prestress at Lagrangian coordinate xi...
void(* IsotropicGrowthFctPt)(const Vector< double > &xi, double &gamma)
Function pointer to function that specifies the isotropic growth as a function of the Lagrangian coor...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
unsigned nhistory_values_for_projection(const unsigned &fld)
Number of history values to be stored for fld-th field (Includes the current value!). No nodal data.
int position_local_eqn(const unsigned &n, const unsigned &k, const unsigned &j) const
Access function that returns the local equation number that corresponds to the j-th coordinate of the...
QPVDElementWithPressure()
Constructor, there are DIM+1 internal data points.
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, as calculated from the constitutive law in the nearly incompresible formulation. Also return the derivative of the generalised dilatation.
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.
void enable_evaluate_jacobian_by_fd()
Set Jacobian to be evaluated by FD? Else: Analytically.
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...
void get_deformed_covariant_basis_vectors(const Vector< double > &s, DenseMatrix< double > &def_covariant_basis)
Return the deformed covariant basis vectors at specified local coordinate: def_covariant_basis(i,j) is the j-th component of the i-th basis vector.
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
bool Evaluate_jacobian_by_fd
Use FD to evaluate Jacobian.
void unpin_elemental_solid_pressure_dofs()
Unpin all solid pressure dofs in the element.
void fill_in_jacobian_for_newmark_accel(DenseMatrix< double > &jacobian)
Fill in the contributions of the Jacobian matrix for the consistent assignment of the initial "accele...
virtual void get_isotropic_growth(const unsigned &ipt, const Vector< double > &s, const Vector< double > &xi, double &gamma) const
Evaluate isotropic growth function at Lagrangian coordinate xi and/or local coordinate s...
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...
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld.
TPVDElementWithContinuousPressure(const TPVDElementWithContinuousPressure< DIM > &dummy)
Broken copy constructor.
IsotropicGrowthFctPt Isotropic_growth_fct_pt
Pointer to isotropic growth function.
PVDEquationsBase()
Constructor: Set null pointers for constitutive law and for isotropic growth function. Set physical parameter values to default values, enable inertia and set body force to zero. Default evaluation of Jacobian: analytically rather than by FD.
unsigned npres_solid() const
Return number of pressure values.
double solid_p(const unsigned &l)
bool Solve_for_consistent_newmark_accel_flag
Flag to indicate which system of equations to solve when assigning initial conditions for time-depend...
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
FaceGeometry()
Constructor must call constructor of underlying solid element.
unsigned nvertex_node() const
Number of vertex nodes in the element.
void output(std::ostream &outfile)
SolidQHermiteElement output function.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
IsotropicGrowthFctPt isotropic_growth_fct_pt() const
Access function: Pointer to isotropic growth function (const version)
Time *const & time_pt() const
Access function for the pointer to time (const version)
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
void output(FILE *file_pt)
C-style output function.
void output(std::ostream &outfile)
Output: x,y,[z],xi0,xi1,[xi2],gamma.
bool has_internal_solid_data()
There is internal solid data so we can't use the automatic assignment of consistent initial condition...
void output(std::ostream &outfile)
Output function.
void output(FILE *file_pt)
C-style output: x,y,[z],xi0,xi1,[xi2],gamma.
SolidInitialCondition * Solid_ic_pt
Pointer to object that specifies the initial condition.
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) internal data object to the element and return the index required to obtain it ...
TPVDBubbleEnrichedElement()
Constructor, there are no internal data points.
ConstitutiveLaw *& constitutive_law_pt()
Return the constitutive law pointer.
BodyForceFctPt Body_force_fct_pt
Pointer to body force function.
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain tensor.
unsigned ndof_types() const
returns the number of DOF types associated with this element: displacement components and pressure ...
void unpin_elemental_solid_pressure_dofs()
Unpin all solid pressure dofs – empty as there are no pressures.
FaceGeometry()
Constructor must call constructor of the underlying Point element.
FaceGeometry()
Constructor: Call constructor of base.
unsigned P_solid_internal_index
Internal index that indicates at which internal data value the solid presure is stored.
void set_incompressible()
Set the material to be incompressible.
virtual unsigned npres_solid() const
Return the number of solid pressure degrees of freedom Default is that there are no solid pressures...
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
void output(std::ostream &outfile)
Output: x,y,[z],xi0,xi1,[xi2],p,gamma.
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
void output(FILE *file_pt, const unsigned &n_plot)
C-style SolidQHermiteElement output function.
double interpolated_solid_p(const Vector< double > &s)
Return the interpolated_solid_pressure.
BodyForceFctPt & body_force_fct_pt()
Access function: Pointer to body force function.
unsigned nnode() const
Return the number of nodes.
void output(std::ostream &outfile, const unsigned &n_plot)
PVDEquationsWithPressure output function.
void output(FILE *file_pt)
C-style SolidQHermiteElement output function.
SolidFiniteElement class.
virtual void unpin_elemental_solid_pressure_dofs()=0
Unpin all solid pressure dofs in the element.
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s...
void solid_pshape_at_knot(const unsigned &ipt, Shape &psi) const
Return the stored solid shape functions at the knots.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
double solid_p(const unsigned &l)
void get_principal_stress(const Vector< double > &s, DenseMatrix< double > &principal_stress_vector, Vector< double > &principal_stress)
Compute principal stress vectors and (scalar) principal stresses at specified local coordinate...
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
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 ...
void output(FILE *file_pt)
C-style generic FiniteElement output function.
void output(FILE *file_pt, const unsigned &n_plot)
C-style PVDEquationsWithPressure output function.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution to Jacobian (either by FD or analytically, for the positional variables; control...
FaceGeometry()
Constructor must call the constructor of the underlying solid 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...
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...
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...
BodyForceFctPt body_force_fct_pt() const
Access function: Pointer to body force function (const version)
int internal_local_eqn(const unsigned &i, const unsigned &j) const
Return the local equation number corresponding to the j-th value stored at the i-th internal data...
void shape< 2 >(const double &s, double *Psi)
1D shape functions specialised to linear order (2 Nodes)
void output(FILE *file_pt)
C-style Generic FiniteElement output function.
void output(std::ostream &outfile)
Output function.