Skip to content
Snippets Groups Projects
Commit 47ce740a authored by Andreas Fischle's avatar Andreas Fischle Committed by Oliver Sander
Browse files

Rewrite Hencky energy following Patrizio Neff's notation

parent 922c4bbb
Branches
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ public: // for testing ...@@ -32,6 +32,7 @@ public: // for testing
// Lame constants // Lame constants
mu_ = parameters.template get<double>("mu"); mu_ = parameters.template get<double>("mu");
lambda_ = parameters.template get<double>("lambda"); lambda_ = parameters.template get<double>("lambda");
kappa_ = (2.0 * mu_ + 3.0 * lambda_) / 3.0;
} }
/** \brief Assemble the energy for a single element */ /** \brief Assemble the energy for a single element */
...@@ -40,7 +41,7 @@ public: // for testing ...@@ -40,7 +41,7 @@ public: // for testing
const std::vector<Dune::FieldVector<field_type,gridDim> >& localConfiguration) const; const std::vector<Dune::FieldVector<field_type,gridDim> >& localConfiguration) const;
/** \brief Lame constants */ /** \brief Lame constants */
double mu_, lambda_; double mu_, lambda_, kappa_;
}; };
template <class GridView, class LocalFiniteElement, class field_type> template <class GridView, class LocalFiniteElement, class field_type>
...@@ -65,6 +66,7 @@ energy(const Entity& element, ...@@ -65,6 +66,7 @@ energy(const Entity& element,
const Dune::QuadratureRule<DT, gridDim>& quad const Dune::QuadratureRule<DT, gridDim>& quad
= Dune::QuadratureRules<DT, gridDim>::rule(element.type(), quadOrder); = Dune::QuadratureRules<DT, gridDim>::rule(element.type(), quadOrder);
field_type distortionEnergy = 0, dilatationEnergy = 0;
for (size_t pt=0; pt<quad.size(); pt++) { for (size_t pt=0; pt<quad.size(); pt++) {
// Local position of the quadrature point // Local position of the quadrature point
...@@ -89,40 +91,45 @@ energy(const Entity& element, ...@@ -89,40 +91,45 @@ energy(const Entity& element,
derivative[j].axpy(localConfiguration[i][j], gradients[i]); derivative[j].axpy(localConfiguration[i][j], gradients[i]);
///////////////////////////////////////////////////////// /////////////////////////////////////////////////////////
// compute F^T F // compute C = F^TF
///////////////////////////////////////////////////////// /////////////////////////////////////////////////////////
Dune::FieldMatrix<field_type,gridDim,gridDim> FTF(0); Dune::FieldMatrix<field_type,gridDim,gridDim> C(0);
for (int i=0; i<gridDim; i++) for (int i=0; i<gridDim; i++)
for (int j=0; j<gridDim; j++) for (int j=0; j<gridDim; j++)
for (int k=0; k<gridDim; k++) for (int k=0; k<gridDim; k++)
FTF[i][j] += derivative[k][i] * derivative[k][j]; C[i][j] += derivative[k][i] * derivative[k][j];
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
// Eigenvalues of FTF // Eigenvalues of C = F^TF
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
Dune::FieldVector<field_type,dim> lambda; Dune::FieldVector<field_type,dim> sigmaSquared;
FMatrixHelp::eigenValues(FTF, lambda); FMatrixHelp::eigenValues(C, sigmaSquared);
// logarithms of the eigenvalues // logarithms of the singular values of F, i.e., eigenvalues of U
std::array<field_type,dim> ln; std::array<field_type, dim> lnSigma;
for (int i=0; i<dim; i++) for (int i = 0; i < dim; i++)
ln[i] = std::log(lambda[i]); lnSigma[i] = 0.5 * log(sigmaSquared[i]);
// Add the local energy density field_type trLogU = 0;
for (int i=0; i<dim; i++) for (int i = 0; i < dim; i++)
energy += weight * mu_ * ln[i]*ln[i]; trLogU += lnSigma[i];
field_type trace = 0;
for (int i=0; i<dim; i++)
trace += ln[i];
energy += weight * 0.5 * lambda_ * trace * trace; field_type normDevLogUSquared = 0;
for (int i = 0; i < dim; i++)
{
// the deviator shifts the spectrum by the trace
field_type lnDevSigma_i = lnSigma[i] - (1.0 / double(dim)) * trLogU;
normDevLogUSquared += lnDevSigma_i * lnDevSigma_i;
}
// Add the local energy density
distortionEnergy += weight * mu_ * normDevLogUSquared;
dilatationEnergy += weight * 0.5 * kappa_ * (trLogU * trLogU);
} }
return energy; return distortionEnergy + dilatationEnergy;
} }
} // namespace Dune } // namespace Dune
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment