29 #ifndef OOMPH_ELASTICITY_ELEMENTS_HEADER
30 #define OOMPH_ELASTICITY_ELEMENTS_HEADER
34 #include <oomph-lib-config.h>
39 #include "../generic/Qelements.h"
40 #include "../generic/Telements.h"
41 #include "../generic/mesh.h"
42 #include "../generic/hermite_elements.h"
43 #include "../constitutive/constitutive_laws.h"
44 #include "../generic/error_estimator.h"
45 #include "../generic/projection.h"
56 template<
unsigned DIM>
212 unsigned n_element = element_pt.size();
213 for (
unsigned e = 0;
e < n_element;
e++)
225 unsigned n_element = element_pt.size();
226 for (
unsigned e = 0;
e < n_element;
e++)
244 void get_energy(
double& pot_en,
double& kin_en);
280 (*Isotropic_growth_fct_pt)(xi, gamma);
294 for (
unsigned i = 0;
i < n;
i++)
308 (*Body_force_fct_pt)(time, xi, b);
330 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list)
const
333 std::pair<unsigned, unsigned> dof_lookup;
336 const unsigned n_node = this->
nnode();
343 int local_unknown = 0;
346 for (
unsigned n = 0; n < n_node; n++)
349 for (
unsigned k = 0; k < n_position_type; k++)
352 for (
unsigned i = 0;
i < nodal_dim;
i++)
358 if (local_unknown >= 0)
362 dof_lookup.first = this->
eqn_number(local_unknown);
363 dof_lookup.second =
i;
366 dof_lookup_list.push_front(dof_lookup);
438 template<
unsigned DIM>
513 void output(std::ostream& outfile,
const unsigned& n_plot);
524 void output(FILE* file_pt,
const unsigned& n_plot);
538 const unsigned& flag);
553 "Elements derived from PVDEquations must have a constitutive law:\n";
555 "set one using the constitutive_law_pt() member function";
558 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
580 "Elements derived from PVDEquations must have a constitutive law:\n";
582 "set one using the constitutive_law_pt() member function";
585 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
590 g, G, sigma, d_sigma_dG,
false);
605 template<
unsigned DIM,
unsigned NNODE_1D>
620 void output(std::ostream& outfile,
const unsigned& n_plot)
633 void output(FILE* file_pt,
const unsigned& n_plot)
643 template<
unsigned NNODE_1D>
656 template<
unsigned NNODE_1D>
670 template<
unsigned NNODE_1D>
682 template<
unsigned NNODE_1D>
695 template<
unsigned DIM>
710 void output(std::ostream& outfile,
const unsigned& n_plot)
722 void output(FILE* file_pt,
const unsigned& n_plot)
732 template<
class PVD_ELEMENT>
822 template<
class ELEMENT>
835 template<
class ELEMENT>
859 template<
unsigned DIM>
893 virtual double solid_p(
const unsigned& l) = 0;
896 virtual void set_solid_p(
const unsigned& l,
const double& p_value) = 0;
922 std::string error_message =
"Can't assign consistent Newmark history\n";
923 error_message +=
" values for solid element with pressure dofs\n";
926 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
968 std::string error_message =
"Can't assign consistent Newmark history\n";
969 error_message +=
" values for solid element with pressure dofs\n";
972 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
982 residuals, jacobian, mass_matrix, 4);
994 residuals, jacobian, mass_matrix, 3);
998 const unsigned n_dof = this->
ndof();
999 for (
unsigned i = 0;
i < n_dof;
i++)
1001 residuals[
i] *= -1.0;
1002 for (
unsigned j = 0; j < n_dof; j++)
1004 jacobian(
i, j) *= -1.0;
1016 Shape psisp(n_solid_pres);
1023 for (
unsigned l = 0; l < n_solid_pres; l++)
1035 unsigned n_plot = 5;
1040 void output(std::ostream& outfile,
const unsigned& n_plot);
1046 unsigned n_plot = 5;
1051 void output(FILE* file_pt,
const unsigned& n_plot);
1078 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list)
const
1081 std::pair<unsigned, unsigned> dof_lookup;
1084 const unsigned n_node = this->
nnode();
1091 int local_unknown = 0;
1094 for (
unsigned n = 0; n < n_node; n++)
1097 for (
unsigned k = 0; k < n_position_type; k++)
1100 for (
unsigned i = 0;
i < nodal_dim;
i++)
1106 if (local_unknown >= 0)
1110 dof_lookup.first = this->
eqn_number(local_unknown);
1111 dof_lookup.second =
i;
1114 dof_lookup_list.push_front(dof_lookup);
1122 for (
unsigned j = 0; j < np; j++)
1126 if (local_unknown >= 0)
1130 dof_lookup.first = this->
eqn_number(local_unknown);
1131 dof_lookup.second = DIM;
1134 dof_lookup_list.push_front(dof_lookup);
1158 "Elements derived from PVDEquationsWithPressure \n";
1159 error_message +=
"must have a constitutive law:\n";
1161 "set one using the constitutive_law_pt() member function";
1164 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1168 g, G, sigma_dev, Gcontra, gen_dil, inv_kappa);
1180 const double& gen_dil,
1181 const double& inv_kappa,
1193 "Elements derived from PVDEquationsWithPressure \n";
1194 error_message +=
"must have a constitutive law:\n";
1196 "set one using the constitutive_law_pt() member function";
1199 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1223 unsigned Dim = this->
dim();
1227 for (
unsigned i = 0;
i <
Dim;
i++)
1250 const unsigned& flag);
1270 "Elements derived from PVDEquationsWithPressure \n";
1271 error_message +=
"must have a constitutive law:\n";
1273 "set one using the constitutive_law_pt() member function";
1276 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1280 g, G, sigma_dev, Gcontra, detG);
1302 "Elements derived from PVDEquationsWithPressure \n";
1303 error_message +=
"must have a constitutive law:\n";
1305 "set one using the constitutive_law_pt() member function";
1308 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1329 template<
unsigned DIM>
1338 for (
unsigned l = 0; l < n_pres; l++)
1409 void output(std::ostream& outfile,
const unsigned& n_plot)
1422 void output(FILE* file_pt,
const unsigned& n_plot)
1519 template<
unsigned DIM>
1534 unsigned n_node = this->
nnode();
1536 for (
unsigned n = 0; n < n_node; n++)
1594 return static_cast<unsigned>(pow(2.0,
static_cast<int>(DIM)));
1611 void output(std::ostream& outfile,
const unsigned& n_plot)
1624 void output(FILE* file_pt,
const unsigned& n_plot)
1640 double psi1[2], psi2[2];
1647 for (
unsigned i = 0;
i < 2;
i++)
1649 for (
unsigned j = 0; j < 2; j++)
1652 psi[2 *
i + j] = psi2[
i] * psi1[j];
1666 double psi1[2], psi2[2], psi3[2];
1674 for (
unsigned i = 0;
i < 2;
i++)
1676 for (
unsigned j = 0; j < 2; j++)
1678 for (
unsigned k = 0; k < 2; k++)
1681 psi[4 *
i + 2 * j + k] = psi3[
i] * psi2[j] * psi1[k];
1752 template<
unsigned DIM,
unsigned NNODE_1D>
1768 void output(std::ostream& outfile,
const unsigned& n_plot)
1781 void output(FILE* file_pt,
const unsigned& n_plot)
1790 return (NNODE_1D - 1);
1819 return DIM + DIM * (DIM - 1) / 2;
1827 unsigned num_entries = DIM + ((DIM * DIM) - DIM) / 2;
1828 if (flux.size() != num_entries)
1830 std::ostringstream error_message;
1831 error_message <<
"The flux vector has the wrong number of entries, "
1832 << flux.size() <<
", whereas it should be " << num_entries
1835 OOMPH_CURRENT_FUNCTION,
1836 OOMPH_EXCEPTION_LOCATION);
1845 unsigned icount = 0;
1848 for (
unsigned i = 0;
i < DIM;
i++)
1850 flux[icount] = strain(
i,
i);
1854 for (
unsigned i = 0;
i < DIM;
i++)
1856 for (
unsigned j =
i + 1; j < DIM; j++)
1858 flux[icount] = strain(
i, j);
1869 template<
unsigned NNODE_1D>
1882 template<
unsigned NNODE_1D>
1896 template<
unsigned NNODE_1D>
1908 template<
unsigned NNODE_1D>
1930 template<
unsigned DIM,
unsigned NNODE_1D>
1950 void output(std::ostream& outfile,
const unsigned& n_plot)
1963 void output(FILE* file_pt,
const unsigned& n_plot)
1973 return (NNODE_1D - 1);
1992 return DIM + DIM * (DIM - 1) / 2;
2000 unsigned num_entries = DIM + ((DIM * DIM) - DIM) / 2;
2001 if (flux.size() != num_entries)
2003 std::ostringstream error_message;
2004 error_message <<
"The flux vector has the wrong number of entries, "
2005 << flux.size() <<
", whereas it should be " << num_entries
2008 OOMPH_CURRENT_FUNCTION,
2009 OOMPH_EXCEPTION_LOCATION);
2018 unsigned icount = 0;
2021 for (
unsigned i = 0;
i < DIM;
i++)
2023 flux[icount] = strain(
i,
i);
2027 for (
unsigned i = 0;
i < DIM;
i++)
2029 for (
unsigned j =
i + 1; j < DIM; j++)
2031 flux[icount] = strain(
i, j);
2042 template<
unsigned NNODE_1D>
2055 template<
unsigned NNODE_1D>
2069 template<
unsigned NNODE_1D>
2081 template<
unsigned NNODE_1D>
2098 template<
unsigned DIM>
2113 unsigned n_node = this->
nnode();
2115 for (
unsigned n = 0; n < n_node; n++)
2200 void output(std::ostream& outfile,
const unsigned& n_plot)
2213 void output(FILE* file_pt,
const unsigned& n_plot)
2241 return DIM + DIM * (DIM - 1) / 2;
2249 unsigned num_entries = DIM + ((DIM * DIM) - DIM) / 2;
2250 if (flux.size() != num_entries)
2252 std::ostringstream error_message;
2253 error_message <<
"The flux vector has the wrong number of entries, "
2254 << flux.size() <<
", whereas it should be " << num_entries
2257 OOMPH_CURRENT_FUNCTION,
2258 OOMPH_EXCEPTION_LOCATION);
2267 unsigned icount = 0;
2270 for (
unsigned i = 0;
i < DIM;
i++)
2272 flux[icount] = strain(
i,
i);
2276 for (
unsigned i = 0;
i < DIM;
i++)
2278 for (
unsigned j =
i + 1; j < DIM; j++)
2280 flux[icount] = strain(
i, j);
2321 psi[2] = 1.0 -
s[0] -
s[1];
2335 psi[3] = 1.0 -
s[0] -
s[1] -
s[2];
2372 namespace SolidHelpers
2378 template<
class ELEMENT>
2382 std::ofstream pos_file;
2383 std::ofstream neg_file;
2384 std::ostringstream filename;
2385 filename << doc_info.
directory() <<
"/pos_principal_stress"
2386 << doc_info.
number() <<
".dat";
2387 pos_file.open(filename.str().c_str());
2389 filename << doc_info.
directory() <<
"/neg_principal_stress"
2390 << doc_info.
number() <<
".dat";
2391 neg_file.open(filename.str().c_str());
2394 pos_file << 0.0 <<
" " << 0.0 <<
" " << 0.0 <<
" " << 0.0 <<
" "
2396 neg_file << 0.0 <<
" " << 0.0 <<
" " << 0.0 <<
" " << 0.0 <<
" "
2404 unsigned n_solid_element = mesh_pt->
nelement();
2405 for (
unsigned e = 0;
e < n_solid_element;
e++)
2407 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt->
element_pt(
e));
2412 el_pt->get_principal_stress(
2413 s, principal_stress_vector, principal_stress);
2416 el_pt->interpolated_x(
s, x);
2421 bool hydrostat =
false;
2425 double dev_max = 1.0e-2;
2426 if (principal_stress[0] != 0.0)
2428 if (std::fabs((principal_stress[0] - principal_stress[1]) /
2429 principal_stress[0]) < dev_max)
2432 double Cos = cos(0.25 * 3.14159);
2433 double Sin = sin(0.25 * 3.14159);
2434 rot(0, 0) = Cos * principal_stress_vector(0, 0) -
2435 Sin * principal_stress_vector(0, 1);
2436 rot(0, 1) = Sin * principal_stress_vector(0, 0) +
2437 Cos * principal_stress_vector(0, 1);
2438 rot(1, 0) = Cos * principal_stress_vector(1, 0) -
2439 Sin * principal_stress_vector(1, 1);
2440 rot(1, 1) = Sin * principal_stress_vector(1, 0) +
2441 Cos * principal_stress_vector(1, 1);
2446 for (
unsigned i = 0;
i < 2;
i++)
2448 if (principal_stress[
i] > 0.0)
2450 pos_file << x[0] <<
" " << x[1] <<
" "
2451 << principal_stress_vector(
i, 0) <<
" "
2452 << principal_stress_vector(
i, 1) << std::endl;
2453 pos_file << x[0] <<
" " << x[1] <<
" "
2454 << -principal_stress_vector(
i, 0) <<
" "
2455 << -principal_stress_vector(
i, 1) << std::endl;
2458 pos_file << x[0] <<
" " << x[1] <<
" " << rot(
i, 0) <<
" "
2459 << rot(
i, 1) << std::endl;
2460 pos_file << x[0] <<
" " << x[1] <<
" " << -rot(
i, 0) <<
" "
2461 << -rot(
i, 1) << std::endl;
2466 neg_file << x[0] <<
" " << x[1] <<
" "
2467 << principal_stress_vector(
i, 0) <<
" "
2468 << principal_stress_vector(
i, 1) << std::endl;
2469 neg_file << x[0] <<
" " << x[1] <<
" "
2470 << -principal_stress_vector(
i, 0) <<
" "
2471 << -principal_stress_vector(
i, 1) << std::endl;
2474 neg_file << x[0] <<
" " << x[1] <<
" " << rot(
i, 0) <<
" "
2475 << rot(
i, 1) << std::endl;
2476 neg_file << x[0] <<
" " << x[1] <<
" " << -rot(
i, 0) <<
" "
2477 << -rot(
i, 1) << std::endl;
2493 template<
class PVD_ELEMENT>
2514 const unsigned n_solid_pres = this->npres_solid();
2515 for (
unsigned j = 0; j < n_solid_pres; j++)
2518 unsigned vertex_index = this->Pconv[j];
2519 data_values.push_back(std::make_pair(this->
node_pt(vertex_index), 0));
2555 this->solid_pshape(
s, psi);
2563 const unsigned& fld,
2566 return this->interpolated_solid_p(
s);
2573 return this->npres_solid();
2580 return this->solid_p_local_eqn(j);
2589 template<
class ELEMENT>
2602 template<
class ELEMENT>
///////////////////////////////////////////////////////////////// ///////////////////////////////////...
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 that represents a collection of data; each Data object may contain many different individual ...
void pin(const unsigned &i)
Pin the i-th stored variable.
void unpin(const unsigned &i)
Unpin the i-th stored variable.
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
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...
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 ...
Information for documentation of results: Directory and file number to enable output in the form RESL...
std::string directory() const
Output directory.
unsigned & number()
Number used (e.g.) for labeling output files.
Base class for finite elements that can compute the quantities that are required for the Z2 error est...
FaceGeometry()
Constructor must call constructor of the underlying Point element.
FaceGeometry()
Constructor must call constructor of the underlying element.
FaceGeometry()
Constructor must call constructor of underlying solid element.
FaceGeometry()
Constructor must call constructor of underlying solid element.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
FaceGeometry()
Constructor must call constructor of the underlying Solid element.
FaceGeometry()
Constructor must call constructor of the underlying Solid element.
FaceGeometry()
Constructor must call constructor of underlying solid element.
FaceGeometry()
Constructor must call constructor of underlying solid element.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
FaceGeometry()
Constructor: Call constructor of base.
FaceGeometry()
Constructor: Call constructor of base.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
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.
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 void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing.
unsigned nnodal_position_type() const
Return the number of coordinate types that the element requires to interpolate the geometry between t...
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 dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
unsigned nnode() const
Return the number of nodes.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
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 ...
unsigned ndof() const
Return the number of equations/dofs in the element.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number.
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
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.
An Element that solves the principle of virtual diplacements using Hermite interpolation for the vari...
void output(FILE *file_pt, const unsigned &n_plot)
C-style SolidQHermiteElement output function.
void output(FILE *file_pt)
C-style SolidQHermiteElement output function.
void output(std::ostream &outfile, const unsigned &n_plot)
SolidQHermiteElement output function.
void output(std::ostream &outfile)
SolidQHermiteElement output function.
HermitePVDElement()
Constructor, there are no internal data points.
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
unsigned long nelement() const
Return number of elements in the mesh.
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....
A base class for elements that solve the equations of solid mechanics, based on the principle of virt...
bool Unsteady
Flag that switches inertia on/off.
static void unpin_all_solid_pressure_dofs(const Vector< GeneralisedElement * > &element_pt)
Unpin all pressure dofs in elements listed in vector.
void get_energy(double &pot_en, double &kin_en)
Get potential (strain) and kinetic energy.
virtual void pin_elemental_redundant_nodal_solid_pressures()
Pin the element's redundant solid pressures (needed for refinement)
PrestressFctPt & prestress_fct_pt()
Access function: Pointer to pre-stress function.
void disable_evaluate_jacobian_by_fd()
Set Jacobian to be evaluated analytically Else: by FD.
static double Default_lambda_sq_value
Static default value for timescale ratio (1.0 – for natural scaling)
BodyForceFctPt Body_force_fct_pt
Pointer to body force 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....
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 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....
bool is_jacobian_evaluated_by_fd() const
Return the flag indicating whether the jacobian is evaluated by fd.
BodyForceFctPt & body_force_fct_pt()
Access function: Pointer to body force function.
ConstitutiveLaw *& constitutive_law_pt()
Return the constitutive law pointer.
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...
ConstitutiveLaw * Constitutive_law_pt
Pointer to the constitutive law.
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 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(* IsotropicGrowthFctPt)(const Vector< double > &xi, double &gamma)
Function pointer to function that specifies the isotropic growth as a function of the Lagrangian coor...
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....
void disable_inertia()
Switch off solid inertia.
virtual unsigned npres_solid() const
Return the number of solid pressure degrees of freedom Default is that there are no solid pressures.
unsigned ndof_types() const
returns the number of DOF types associated with this element.
bool is_inertia_enabled() const
Access function to flag that switches inertia on/off (const version)
double *& lambda_sq_pt()
Access function for pointer to timescale ratio (nondim density)
BodyForceFctPt body_force_fct_pt() const
Access function: Pointer to body force function (const version)
static int Solid_pressure_not_stored_at_node
Static "magic" number that indicates that the solid pressure is not stored at a node.
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,...
IsotropicGrowthFctPt isotropic_growth_fct_pt() const
Access function: Pointer to isotropic growth function (const version)
void get_strain(const Vector< double > &s, DenseMatrix< double > &strain) const
Return the strain tensor.
IsotropicGrowthFctPt Isotropic_growth_fct_pt
Pointer to isotropic growth function.
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...
PVDEquationsBase()
Constructor: Set null pointers for constitutive law and for isotropic growth function....
PrestressFctPt Prestress_fct_pt
Pointer to prestress function.
bool Evaluate_jacobian_by_fd
Use FD to evaluate Jacobian.
IsotropicGrowthFctPt & isotropic_growth_fct_pt()
Access function: Pointer to isotropic growth function.
virtual void unpin_elemental_solid_pressure_dofs()=0
Unpin all solid pressure dofs in the element.
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...
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 enable_evaluate_jacobian_by_fd()
Set Jacobian to be evaluated by FD? Else: Analytically.
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...
double * Lambda_sq_pt
Timescale ratio (non-dim. density)
void enable_inertia()
Switch on solid inertia.
const double & lambda_sq() const
Access function for timescale ratio (nondim density)
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
void get_stress(const Vector< double > &s, DenseMatrix< double > &sigma)
Return the 2nd Piola Kirchoff stress tensor, as calculated from the constitutive law at specified loc...
void output(std::ostream &outfile)
Output: x,y,[z],xi0,xi1,[xi2],p,gamma.
void set_compressible()
Set the material to be compressible.
virtual double solid_p(const unsigned &l)=0
Return the lth solid pressure.
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...
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,...
virtual void set_solid_p(const unsigned &l, const double &p_value)=0
Set the lth solid pressure to p_value.
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...
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...
virtual void fill_in_generic_residual_contribution_pvd_with_pressure(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, const unsigned &flag)
Returns the residuals for the discretised principle of virtual displacements, formulated in the incom...
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 fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals.
void solid_pshape_at_knot(const unsigned &ipt, Shape &psi) const
Return the stored solid shape functions at the knots.
void extended_output(std::ostream &outfile, const unsigned &n_plot)
Output: x,y,[z],xi0,xi1,[xi2],gamma and the strain and stress components.
double interpolated_solid_p(const Vector< double > &s)
Return the interpolated_solid_pressure.
bool Incompressible
Boolean to determine whether the solid is incompressible or not.
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 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...
unsigned ndof_types() const
returns the number of DOF types associated with this element: displacement components and pressure
bool is_incompressible() const
Return whether the material is incompressible.
void get_mass_matrix_diagonal(Vector< double > &mass_diag)
Compute the diagonal of the displacement mass matrix for LSC preconditioner.
virtual void solid_pshape(const Vector< double > &s, Shape &psi) const =0
Return the solid pressure shape functions.
void set_incompressible()
Set the material to be incompressible.
void output(FILE *file_pt)
C-style output: x,y,[z],xi0,xi1,[xi2],p,gamma.
PVDEquationsWithPressure()
Constructor, by default the element is NOT incompressible.
A class for elements that solve the equations of solid mechanics, based on the principle of virtual d...
virtual void fill_in_generic_contribution_to_residuals_pvd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Compute element residual Vector only (if flag=and/or element Jacobian matrix.
void unpin_elemental_solid_pressure_dofs()
Unpin all solid pressure dofs – empty as there are no pressures.
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 extended_output(std::ostream &outfile, const unsigned &n_plot)
Output: x,y,[z],xi0,xi1,[xi2],gamma and the strain and stress components.
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...
PVDEquations()
Constructor.
void output(std::ostream &outfile)
Output: x,y,[z],xi0,xi1,[xi2],gamma.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals for the solid equations (the discretised principle of virtual displacements)
void get_stress(const Vector< double > &s, DenseMatrix< double > &sigma)
Return the 2nd Piola Kirchoff stress tensor, as calculated from the constitutive law at specified loc...
void output(FILE *file_pt)
C-style output: x,y,[z],xi0,xi1,[xi2],gamma.
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...
/////////////////////////////////////////////////////////////////////// /////////////////////////////...
Wrapper class for projectable elements. Adds "projectability" to the underlying ELEMENT.
PVDElementWithContinuousPressure upgraded to become projectable.
unsigned nfields_for_projection()
Number of fields to be projected: 1, corresponding to the pressure only.
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld.
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 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.
ProjectablePVDElementWithContinuousPressure()
Constructor [this was only required explicitly from gcc 4.5.2 onwards...].
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.
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 nhistory_values_for_projection(const unsigned &fld)
Number of history values to be stored for fld-th field. (Includes the current value!...
PVDElementWithContinuousPressure upgraded to become projectable.
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld.
unsigned nhistory_values_for_projection(const unsigned &fld)
Number of history values to be stored for fld-th field (Includes the current value!...
unsigned nfields_for_projection()
Number of fields to be projected: 0.
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 nhistory_values_for_coordinate_projection()
Number of positional history values (Includes the current value!)
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 ...
ProjectablePVDElement()
Constructor [this was only required explicitly from gcc 4.5.2 onwards...].
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of value j in field fld.
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.
//////////////////////////////////////////////////////////////////////// ////////////////////////////...
QPVDElementWithContinuousPressure()
Constructor.
double solid_p(const unsigned &l)
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)
PVDEquationsWithPressure output function.
void unpin_elemental_solid_pressure_dofs()
Unpin all solid pressure dofs in the element.
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of solid pressure values at each node.
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 set_solid_p(const unsigned &l, const double &p_value)
Set the l-th solid pressure value to p_value.
unsigned npres_solid() const
Return number of pressure values.
void solid_pshape(const Vector< double > &s, Shape &psi) const
Return the pressure shape functions.
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...
int solid_p_nodal_index() const
Set the value at which the solid pressure is stored in the nodes.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
void fix_solid_pressure(const unsigned &l, const double &pvalue)
Fix the pressure dof l to be the value pvalue.
void output(std::ostream &outfile)
Generic FiniteElement output function.
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 output(FILE *file_pt, const unsigned &n_plot)
C-style PVDEquationsWithPressure output function.
void solid_pshape(const Vector< double > &s, Shape &psi) const
Return the pressure shape functions.
unsigned npres_solid() const
Return number of pressure values.
void output(std::ostream &outfile)
Generic FiniteElement output function.
void set_solid_p(const unsigned &l, const double &p_value)
Set the l-th pressure value to p_value.
void fix_solid_pressure(const unsigned &l, const double &pvalue)
Fix the pressure dof l to be the value pvalue.
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 output(std::ostream &outfile, const unsigned &n_plot)
PVDEquationsWithPressure output function.
bool has_internal_solid_data()
There is internal solid data so we can't use the automatic assignment of consistent initial condition...
void output(FILE *file_pt)
C-style Generic FiniteElement output function.
void unpin_elemental_solid_pressure_dofs()
Unpin all solid pressure dofs in the element.
double solid_p(const unsigned &l)
Return the lth pressure value.
QPVDElementWithPressure()
Constructor, there are DIM+1 internal data points.
unsigned P_solid_internal_index
Internal index that indicates at which internal data value the solid presure is stored.
An Element that solves the solid mechanics equations, based on the principle of virtual displacements...
void output(std::ostream &outfile)
Output function.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
void output(FILE *file_pt)
C-style output function.
QPVDElement()
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...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
bool Solve_for_consistent_newmark_accel_flag
Flag to indicate which system of equations to solve when assigning initial conditions for time-depend...
SolidInitialCondition * Solid_ic_pt
Pointer to object that specifies the initial condition.
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...
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....
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 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 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...
SolidQElement elements are quadrilateral elements whose derivatives also include those based upon the...
////////////////////////////////////////////////////////////////////
void output(std::ostream &outfile)
Overload the output function.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
/////////////////////////////////////////////////////////////////////// /////////////////////////////...
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
void output(std::ostream &outfile)
Output function.
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
TPVDBubbleEnrichedElement()
Constructor, there are no internal data points.
void output(FILE *file_pt)
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.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
unsigned nvertex_node() const
Number of vertex nodes in the element.
An Element that solves the solid mechanics equations in an (near) incompressible formulation with qua...
TPVDElementWithContinuousPressure(const TPVDElementWithContinuousPressure< DIM > &dummy)=delete
Broken copy constructor.
void output(FILE *file_pt)
C-style generic FiniteElement output function.
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...
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
TPVDElementWithContinuousPressure()
Constructor.
void output(std::ostream &outfile)
Generic FiniteElement output function.
unsigned nvertex_node() const
Number of vertex nodes in the element.
void unpin_elemental_solid_pressure_dofs()
Unpin all solid pressure dofs in the element.
unsigned npres_solid() const
Return number of pressure values.
void set_solid_p(const unsigned &l, const double &p_value)
Set the l-th solid pressure value to p_value.
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.
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
void solid_pshape(const Vector< double > &s, Shape &psi) const
Pressure shape functions at local coordinate s.
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at node.
void fix_solid_pressure(const unsigned &l, const double &pvalue)
Fix the pressure dof l to be the value pvalue.
void output(FILE *file_pt, const unsigned &n_plot)
C-style PVDEquationsWithPressure output function.
double solid_p(const unsigned &l)
Return the l-th pressure value, make sure to use the hanging representation if there is one!
int solid_p_nodal_index() const
Broken assignment operator.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain tensor.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
void output(std::ostream &outfile, const unsigned &n_plot)
PVDEquationsWithPressure output function.
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
void output(std::ostream &outfile)
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.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
TPVDElement()
Constructor, there are no internal data points.
void output(FILE *file_pt)
C-style output function.
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
unsigned nvertex_node() const
Number of vertex nodes in the element.
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.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
unsigned Dim
Dimension of zeta tuples (set by get_dim_helper) – needed because we store the scalar coordinates in ...
void shape< 2 >(const double &s, double *Psi)
1D shape functions specialised to linear order (2 Nodes)
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...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...