Skip to content
Snippets Groups Projects
Commit 2260d903 authored by akbib's avatar akbib Committed by akbib@FU-BERLIN.DE
Browse files

add functions that compute the nonlinear and linearised strain tensors

[[Imported from SVN: r11276]]
parent b5f03cad
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,61 @@ namespace Dune {
namespace Elasticity {
/** \brief Compute nonlinear strain tensor from a displacement gradient.
*
* \param grad The gradient of the direction in which the linearisation is computed.
* \param strain The tensor to store the strain in.
*/
template <int dim>
void computeNonlinearStrain(const Dune::FieldMatrix<double, dim, dim>& grad, SymmetricTensor<dim>& strain) {
strain = 0;
for (int i=0; i<dim ; ++i) {
strain(i,i) +=grad[i][i];
for (int k=0;k<dim;++k)
strain(i,i) += 0.5*grad[k][i]*grad[k][i];
for (int j=i+1; j<dim; ++j) {
strain(i,j) += 0.5*(grad[i][j] + grad[j][i]);
for (int k=0;k<dim;++k)
strain(i,j) += 0.5*grad[k][i]*grad[k][j];
}
}
}
/** \brief Compute linearised strain at the identity from a given displacement gradient.
*
* \param grad The gradient of the direction in which the linearisation is computed.
* \param strain The tensor to store the strain in.
*/
template <int dim>
void computeLinearisedStrain(const Dune::FieldMatrix<double, dim, dim>& grad, SymmetricTensor<dim>& strain) {
for (int i=0; i<dim ; ++i)
{
strain(i,i) = grad[i][i];
for (int j=i+1; j<dim; ++j)
strain(i,j) = 0.5*(grad[i][j] + grad[j][i]);
}
}
/** \brief Compute linearised strain at a prescribed configuration in the direction of a given displacement gradient.
*
* \param grad The gradient of the direction in which the linearisation is computed.
* \param conf The deformation gradient(!) of the configuration at which the linearisation is evaluated.
* \param strain The tensor to store the strain in.
*/
template <int dim>
void computeLinearisedStrain(const Dune::FieldMatrix<double, dim, dim>& grad, const Dune::FieldMatrix<double, dim, dim>& conf,
SymmetricTensor<dim>& strain) {
strain = 0;
for (int i=0;i<dim; i++)
for (int j=i;j<dim;j++)
for (int k=0;k<dim;k++)
strain(i,j)+= grad[k][i]*conf[k][j]+conf[k][i]*grad[k][j];
strain *= 0.5;
}
/** \brief The penalty term \f$ \Gamma \f$ */
double Gamma(double x) {
return x*x - std::log(x);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment