Skip to content
Snippets Groups Projects
Commit 49d5b5e9 authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Allow the normal stress to be adjusted dynamically

parent 479cc5e6
No related branches found
No related tags found
No related merge requests found
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
#include <dune/fufem/assemblers/localassemblers/stvenantkirchhoffassembler.hh> #include <dune/fufem/assemblers/localassemblers/stvenantkirchhoffassembler.hh>
#include <dune/fufem/assemblers/localassemblers/vonmisesstressassembler.hh> #include <dune/fufem/assemblers/localassemblers/vonmisesstressassembler.hh>
#include <dune/fufem/assemblers/operatorassembler.hh> #include <dune/fufem/assemblers/operatorassembler.hh>
#include <dune/fufem/boundarypatch.hh>
#include <dune/fufem/computestress.hh>
#include <dune/fufem/dunepython.hh> #include <dune/fufem/dunepython.hh>
#include <dune/fufem/functions/basisgridfunction.hh> #include <dune/fufem/functions/basisgridfunction.hh>
#include <dune/fufem/functions/constantfunction.hh> #include <dune/fufem/functions/constantfunction.hh>
...@@ -241,6 +243,7 @@ int main(int argc, char *argv[]) { ...@@ -241,6 +243,7 @@ int main(int argc, char *argv[]) {
auto const nodalIntegrals = auto const nodalIntegrals =
assemble_frictional<GridType, GridView, SmallVector, P1Basis>( assemble_frictional<GridType, GridView, SmallVector, P1Basis>(
leafView, p1Basis, frictionalNodes); leafView, p1Basis, frictionalNodes);
BoundaryPatch<GridView> const frictionalBoundary(leafView, frictionalNodes);
// {{{ Initialise vectors // {{{ Initialise vectors
VectorType u(finestSize); VectorType u(finestSize);
...@@ -367,6 +370,21 @@ int main(int argc, char *argv[]) { ...@@ -367,6 +370,21 @@ int main(int argc, char *argv[]) {
timeSteppingScheme->extractDisplacement(u); timeSteppingScheme->extractDisplacement(u);
timeSteppingScheme->extractVelocity(ud); timeSteppingScheme->extractVelocity(ud);
// Update the normal stress
if (parset.get<bool>("updateNormalStress")) {
VectorType tmp(finestSize);
Stress<GridView>::getElasticSurfaceNormalStress(frictionalBoundary,
u, tmp, E, nu);
for (size_t i = 0; i < frictionalNodes.size(); ++i)
if (frictionalNodes[i][0]) {
if (tmp[i][1] < 0) {
DUNE_THROW(Dune::Exception,
"Encountered negative normal stress");
} else
surfaceNormalStress[i] = tmp[i][1];
}
}
// Update the state // Update the state
for (size_t i = 0; i < frictionalNodes.size(); ++i) { for (size_t i = 0; i < frictionalNodes.size(); ++i) {
if (frictionalNodes[i][0]) { if (frictionalNodes[i][0]) {
......
...@@ -10,6 +10,8 @@ enableTimer = false ...@@ -10,6 +10,8 @@ enableTimer = false
timeSteppingScheme = implicitEuler timeSteppingScheme = implicitEuler
updateNormalStress = false
[grid] [grid]
refinements = 4 refinements = 4
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment