35 template<
unsigned DIM>
46 template<
unsigned DIM>
53 std::ostringstream error_message;
54 error_message <<
"Strain matrix is " <<
strain.ncol() <<
" x "
55 <<
strain.nrow() <<
", but dimension of the equations is "
79 for (
unsigned i = 0;
i <
DIM;
i++)
81 for (
unsigned j = 0;
j <
DIM;
j++)
97 for (
unsigned i = 0;
i <
DIM;
i++)
100 interpolated_xi[
i] +=
101 this->lagrangian_position_gen(
l,
k,
i) *
psi(
l,
k);
104 for (
unsigned j = 0;
j <
DIM;
j++)
117 get_isotropic_growth(
ipt,
s, interpolated_xi, gamma);
124 for (
unsigned i = 0;
i <
DIM;
i++)
126 for (
unsigned j = 0;
j <
DIM;
j++)
144 for (
unsigned i = 0;
i <
DIM;
i++)
147 for (
unsigned j =
i;
j <
DIM;
j++)
152 for (
unsigned k = 0;
k <
DIM;
k++)
158 for (
unsigned j = 0;
j <
i;
j++)
165 for (
unsigned i = 0;
i <
DIM;
i++)
167 for (
unsigned j = 0;
j <
DIM;
j++)
178 template<
unsigned DIM>
182 const unsigned&
flag)
190 "PVDEquations cannot be used with incompressible constitutive laws.",
197 if (this->Solid_ic_pt != 0)
199 this->fill_in_residuals_for_solid_ic(
residuals);
220 double lambda_sq = this->lambda_sq();
236 for (
unsigned i = 0;
i <
DIM; ++
i)
255 for (
unsigned i = 0;
i <
DIM;
i++)
259 for (
unsigned j = 0;
j <
DIM;
j++)
276 for (
unsigned i = 0;
i <
DIM;
i++)
279 interpolated_xi[
i] += this->lagrangian_position_gen(
l,
k,
i) *
psi_;
282 if ((lambda_sq > 0.0) && (this->Unsteady))
288 for (
unsigned j = 0;
j <
DIM;
j++)
299 this->get_isotropic_growth(
ipt,
s, interpolated_xi, gamma);
304 this->body_force(interpolated_xi, b);
311 for (
unsigned i = 0;
i <
DIM;
i++)
313 for (
unsigned j = 0;
j <
DIM;
j++)
328 double W = gamma * w *
J;
334 for (
unsigned i = 0;
i <
DIM;
i++)
337 for (
unsigned j =
i;
j <
DIM;
j++)
342 for (
unsigned k = 0;
k <
DIM;
k++)
348 for (
unsigned j = 0;
j <
i;
j++)
356 get_stress(g,
G, sigma);
359 for (
unsigned i = 0;
i <
DIM;
i++)
361 for (
unsigned j = 0;
j <
DIM;
j++)
363 sigma(
i,
j) += this->prestress(
i,
j, interpolated_xi);
421 for (
unsigned i = 0;
i <
DIM;
i++)
433 sum += (lambda_sq * accel[
i] - b[
i]) *
psi(
l,
k);
436 for (
unsigned a = 0; a <
DIM; a++)
439 for (
unsigned b = 0; b <
DIM; b++)
478 for (
unsigned a = 0; a <
DIM; a++)
483 for (
unsigned b = a; b <
DIM; b++)
486 if (a == b)
factor *= 0.5;
532 for (
unsigned a = 0; a <
DIM; a++)
540 for (
unsigned b = 0; b <
DIM; b++)
574 template<
unsigned DIM>
593 this->interpolated_xi(
s, xi);
599 this->get_isotropic_growth(
ipt,
s, xi, gamma);
602 for (
unsigned i = 0;
i <
DIM;
i++)
608 for (
unsigned i = 0;
i <
DIM;
i++)
628 template<
unsigned DIM>
654 this->interpolated_xi(
s, xi);
660 this->get_isotropic_growth(
ipt,
s, xi, gamma);
663 for (
unsigned i = 0;
i <
DIM;
i++)
669 for (
unsigned i = 0;
i <
DIM;
i++)
704 this->interpolated_xi(
s, xi);
710 this->get_isotropic_growth(
ipt,
s, xi, gamma);
713 for (
unsigned i = 0;
i <
DIM;
i++)
719 for (
unsigned i = 0;
i <
DIM;
i++)
737 std::ostringstream error_message;
738 error_message <<
"No output routine for PVDEquations<" <<
DIM
739 <<
"> elements -- write it yourself!" << std::endl;
750 template<
unsigned DIM>
771 this->interpolated_xi(
s, xi);
777 this->get_isotropic_growth(
ipt,
s, xi, gamma);
780 for (
unsigned i = 0;
i <
DIM;
i++)
786 for (
unsigned i = 0;
i <
DIM;
i++)
796 for (
unsigned i = 0;
i <
DIM;
i++)
798 for (
unsigned j = 0;
j <=
i;
j++)
806 for (
unsigned i = 0;
i <
DIM;
i++)
808 for (
unsigned j = 0;
j <=
i;
j++)
828 template<
unsigned DIM>
852 double lambda_sq = this->lambda_sq();
858 for (
unsigned i = 0;
i <
DIM;
i++)
880 for (
unsigned i = 0;
i <
DIM;
i++)
883 interpolated_xi[
i] +=
884 this->lagrangian_position_gen(
l,
k,
i) *
psi(
l,
k);
897 this->get_isotropic_growth(
ipt,
s, interpolated_xi, gamma);
901 double W = gamma * w *
J;
907 this->get_stress(
s, sigma);
910 for (
unsigned i = 0;
i <
DIM;
i++)
912 for (
unsigned j = 0;
j <
DIM;
j++)
914 sigma(
i,
j) += prestress(
i,
j, interpolated_xi);
926 for (
unsigned i = 0;
i <
DIM;
i++)
928 for (
unsigned j = 0;
j <
DIM;
j++)
950 template<
unsigned DIM>
969 this->interpolated_xi(
s, xi);
975 this->get_isotropic_growth(
ipt,
s, xi, gamma);
982 for (
unsigned i = 0;
i <
DIM;
i++)
984 for (
unsigned j = 0;
j <
DIM;
j++)
1003 for (
unsigned i = 0;
i <
DIM;
i++)
1005 for (
unsigned j = 0;
j <
DIM;
j++)
1018 for (
unsigned i = 0;
i <
DIM;
i++)
1021 for (
unsigned j = 0;
j <
DIM;
j++)
1033 for (
unsigned i = 0;
i <
DIM;
i++)
1038 for (
int j = (
DIM - 1);
j >=
static_cast<int>(
i);
j--)
1043 for (
unsigned k = 0;
k <
DIM;
k++)
1049 for (
int j = (
i - 1);
j >= 0;
j--)
1056 get_stress(g,
G, sigma);
1070 template<
unsigned DIM>
1078 get_stress(
s, sigma);
1082 this->interpolated_xi(
s, xi);
1085 for (
unsigned i = 0;
i <
DIM;
i++)
1087 for (
unsigned j = 0;
j <
DIM;
j++)
1089 sigma(
i,
j) += this->prestress(
i,
j, xi);
1099 for (
unsigned i = 0;
i <
DIM;
i++)
1101 for (
unsigned j = 0;
j <
DIM;
j++)
1104 for (
unsigned k = 0;
k <
DIM;
k++)
1118 for (
unsigned k = 0;
k <
DIM;
k++)
1120 for (
unsigned l = 0;
l <
DIM;
l++)
1127 for (
unsigned l = 0;
l <
DIM;
l++)
1146 for (
unsigned i = 0;
i <
DIM;
i++)
1149 for (
unsigned j = 0;
j <
DIM;
j++)
1155 for (
unsigned j = 0;
j <
DIM;
j++)
1157 for (
unsigned k = 0;
k <
DIM;
k++)
1167 for (
unsigned i = 0;
i <
DIM;
i++)
1170 for (
unsigned j = 0;
j <
DIM;
j++)
1180 for (
unsigned i = 0;
i <
DIM;
i++)
1182 for (
unsigned j = 0;
j <
DIM;
j++)
1196 template<
unsigned DIM>
1216 for (
unsigned i = 0;
i <
DIM;
i++)
1218 for (
unsigned j = 0;
j <
DIM;
j++)
1231 for (
unsigned i = 0;
i <
DIM;
i++)
1234 for (
unsigned j = 0;
j <
DIM;
j++)
1254 template<
unsigned DIM>
1269 template<
unsigned DIM>
1275 const unsigned&
flag)
1283 throw OomphLibError(
"The constitutive law requires the use of the "
1284 "incompressible formulation by setting the element's "
1285 "member function set_incompressible()",
1293 if (this->Solid_ic_pt != 0)
1295 this->get_residuals_for_solid_ic(
residuals);
1322 double lambda_sq = this->lambda_sq();
1338 for (
unsigned i = 0;
i <
DIM; ++
i)
1362 for (
unsigned i = 0;
i <
DIM;
i++)
1366 for (
unsigned j = 0;
j <
DIM;
j++)
1379 for (
unsigned i = 0;
i <
DIM;
i++)
1382 interpolated_xi[
i] +=
1383 this->lagrangian_position_gen(
l,
k,
i) *
psi(
l,
k);
1388 if ((lambda_sq > 0.0) && (this->Unsteady))
1394 for (
unsigned j = 0;
j <
DIM;
j++)
1405 this->get_isotropic_growth(
ipt,
s, interpolated_xi, gamma);
1409 this->body_force(interpolated_xi, b);
1416 for (
unsigned i = 0;
i <
DIM;
i++)
1418 for (
unsigned j = 0;
j <
DIM;
j++)
1433 double W = gamma * w *
J;
1436 double interpolated_solid_p = 0.0;
1439 interpolated_solid_p += solid_p(
l) *
psisp[
l];
1447 for (
unsigned i = 0;
i <
DIM;
i++)
1450 for (
unsigned j =
i;
j <
DIM;
j++)
1455 for (
unsigned k = 0;
k <
DIM;
k++)
1461 for (
unsigned j = 0;
j <
i;
j++)
1522 for (
unsigned a = 0; a <
DIM; a++)
1524 for (
unsigned b = 0; b <
DIM; b++)
1526 sigma(a, b) =
sigma_dev(a, b) - interpolated_solid_p *
Gup(a, b);
1535 this->get_d_stress_dG_upper(
1547 for (
unsigned a = 0; a <
DIM; a++)
1549 for (
unsigned b = 0; b <
DIM; b++)
1551 sigma(a, b) =
sigma_dev(a, b) - interpolated_solid_p *
Gup(a, b);
1560 this->get_d_stress_dG_upper(g,
1565 interpolated_solid_p,
1572 for (
unsigned i = 0;
i <
DIM;
i++)
1574 for (
unsigned j = 0;
j <
DIM;
j++)
1576 sigma(
i,
j) += this->prestress(
i,
j, interpolated_xi);
1593 for (
unsigned i = 0;
i <
DIM;
i++)
1605 sum += (lambda_sq * accel[
i] - b[
i]) *
psi(
l,
k);
1608 for (
unsigned a = 0; a <
DIM; a++)
1611 for (
unsigned b = 0; b <
DIM; b++)
1672 for (
unsigned a = 0; a <
DIM; a++)
1677 for (
unsigned b = a; b <
DIM; b++)
1680 if (a == b)
factor *= 0.5;
1726 for (
unsigned a = 0; a <
DIM; a++)
1734 for (
unsigned b = 0; b <
DIM; b++)
1768 for (
unsigned a = 0; a <
DIM; a++)
1770 for (
unsigned b = 0; b <
DIM; b++)
1828 unsigned count = offset;
1883 unsigned count = offset;
1933 template<
unsigned DIM>
1954 this->interpolated_xi(
s, xi);
1960 this->get_isotropic_growth(
ipt,
s, xi, gamma);
1963 for (
unsigned i = 0;
i <
DIM;
i++)
1969 for (
unsigned i = 0;
i <
DIM;
i++)
1977 outfile << interpolated_solid_p(
s) <<
" ";
1989 template<
unsigned DIM>
2015 this->interpolated_xi(
s, xi);
2021 this->get_isotropic_growth(
ipt,
s, xi, gamma);
2024 for (
unsigned i = 0;
i <
DIM;
i++)
2030 for (
unsigned i = 0;
i <
DIM;
i++)
2068 this->interpolated_xi(
s, xi);
2074 this->get_isotropic_growth(
ipt,
s, xi, gamma);
2077 for (
unsigned i = 0;
i <
DIM;
i++)
2083 for (
unsigned i = 0;
i <
DIM;
i++)
2102 std::ostringstream error_message;
2103 error_message <<
"No output routine for PVDEquationsWithPressure<"
2104 <<
DIM <<
"> elements. Write it yourself!" << std::endl;
2115 template<
unsigned DIM>
2136 this->interpolated_xi(
s, xi);
2142 this->get_isotropic_growth(
ipt,
s, xi, gamma);
2145 for (
unsigned i = 0;
i <
DIM;
i++)
2151 for (
unsigned i = 0;
i <
DIM;
i++)
2160 outfile << interpolated_solid_p(
s) <<
" ";
2164 for (
unsigned i = 0;
i <
DIM;
i++)
2166 for (
unsigned j = 0;
j <=
i;
j++)
2174 for (
unsigned i = 0;
i <
DIM;
i++)
2176 for (
unsigned j = 0;
j <=
i;
j++)
2197 template<
unsigned DIM>
2239 for (
unsigned i = 0;
i <
DIM;
i++)
2266 template<
unsigned DIM>
2294 this->interpolated_xi(
s, xi);
2300 this->get_isotropic_growth(
ipt,
s, xi, gamma);
2307 for (
unsigned i = 0;
i <
DIM;
i++)
2309 for (
unsigned j = 0;
j <
DIM;
j++)
2328 for (
unsigned i = 0;
i <
DIM;
i++)
2330 for (
unsigned j = 0;
j <
DIM;
j++)
2343 for (
unsigned i = 0;
i <
DIM;
i++)
2346 for (
unsigned j = 0;
j <
DIM;
j++)
2359 for (
unsigned i = 0;
i <
DIM;
i++)
2364 for (
int j = (
DIM - 1);
j >=
static_cast<int>(
i);
j--)
2369 for (
unsigned k = 0;
k <
DIM;
k++)
2375 for (
int j = (
i - 1);
j >= 0;
j--)
2383 double interpolated_solid_p = 0.0;
2386 interpolated_solid_p += solid_p(
l) *
psisp[
l];
2413 for (
unsigned i = 0;
i <
DIM;
i++)
2415 for (
unsigned j = 0;
j <
DIM;
j++)
2433 1, 0, 1, 0, 0, 0, 1, 0, 1};
2446 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,
2447 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1};
2454 0, 2, 6, 8, 18, 20, 24, 26};
2479 1, 1, 1, 1, 0, 0, 0, 0, 0, 0};
virtual bool requires_incompressibility_constraint()=0
Pure virtual function in which the user must declare if the constitutive equation requires an incompr...
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
Class of matrices containing doubles, and stored as a DenseMatrix<double>, but with solving functiona...
void eigenvalues_by_jacobi(Vector< double > &eigen_val, DenseMatrix< double > &eigen_vect) const
Determine eigenvalues and eigenvectors, using Jacobi rotations. Only for symmetric matrices....
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
unsigned nnodal_position_type() const
Return the number of coordinate types that the element requires to interpolate the geometry between t...
double dnodal_position_gen_dt(const unsigned &n, const unsigned &k, const unsigned &i) const
i-th component of time derivative (velocity) of the generalised position, dx(k,i)/dt at local node n....
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
double nodal_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Return the value of the k-th type of the i-th positional variable at the local node n.
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")
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"...
unsigned ndof() const
Return the number of equations/dofs in the element.
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.
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...
void get_energy(double &pot_en, double &kin_en)
Get potential (strain) and kinetic energy.
static double Default_lambda_sq_value
Static default value for timescale ratio (1.0 – for natural scaling)
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....
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,...
void get_strain(const Vector< double > &s, DenseMatrix< double > &strain) const
Return the strain tensor.
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.
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 extended_output(std::ostream &outfile, const unsigned &n_plot)
Output: x,y,[z],xi0,xi1,[xi2],gamma and the strain and stress components.
void get_mass_matrix_diagonal(Vector< double > &mass_diag)
Compute the diagonal of the displacement mass matrix for LSC preconditioner.
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 extended_output(std::ostream &outfile, const unsigned &n_plot)
Output: x,y,[z],xi0,xi1,[xi2],gamma and the strain and stress components.
void output(std::ostream &outfile)
Output: x,y,[z],xi0,xi1,[xi2],gamma.
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...
An Element that solves the equations of solid mechanics, based on the discretised principle of virtua...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
TAdvectionDiffusionReactionElement()
Constructor: Call constructors for TElement and AdvectionDiffusionReaction equations.
An Element that solves the solid mechanics equations in an (near) incompressible formulation with qua...
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).