Skip to content
Snippets Groups Projects
Commit 42b68c59 authored by Elias Pipping's avatar Elias Pipping Committed by pipping
Browse files

Allow strainToStress to depend on the global position

[[Imported from SVN: r12871]]
parent 27845ccb
No related branches found
No related tags found
No related merge requests found
......@@ -108,7 +108,7 @@ class StrainProductAssembler
for (int rcomp=0; rcomp<dim; rcomp++) {
// Compute stress
SymmetricTensor<dim> stress = strainToStress(strain[row][rcomp]);
SymmetricTensor<dim> stress = strainToStress(strain[row][rcomp], element, quadPos);
for (int col=0; col<=row; col++) {
for (int ccomp=0; ccomp<dim; ccomp++) {
......@@ -137,8 +137,10 @@ class StrainProductAssembler
}
SymmetricTensor<dim> strainToStress(const SymmetricTensor<dim>& strain) const {
return static_cast<const A*>(this)->strainToStress(strain);
SymmetricTensor<dim> strainToStress(const SymmetricTensor<dim>& strain,
const Element& element,
const Dune::FieldVector<ctype, dim>& position) const {
return static_cast<const A*>(this)->strainToStress(strain, element, position);
}
};
......
......@@ -35,8 +35,9 @@ class StVenantKirchhoffAssembler
twoMu_(E / (1+nu) )
{}
SymmetricTensor<dim> strainToStress(const SymmetricTensor<dim>& strain) const {
SymmetricTensor<dim> strainToStress(const SymmetricTensor<dim>& strain,
const Element&,
const Dune::FieldVector<ctype, dim>&) const {
SymmetricTensor<dim> stress = strain;
stress *= twoMu_;
stress.addToDiag(lambda_ * strain.trace());
......
......@@ -30,8 +30,9 @@ class ViscosityAssembler
muShear_(muShear), muBulk_(muBulk)
{}
SymmetricTensor<dim> strainToStress(const SymmetricTensor<dim>& strain) const {
SymmetricTensor<dim> strainToStress(const SymmetricTensor<dim>& strain,
const Element&,
const Dune::FieldVector<ctype, dim>&) const {
SymmetricTensor<dim> stress = strain;
stress *= 2*muShear_;
stress.addToDiag((muBulk_-(2.0/3.0)*muShear_) * strain.trace());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment