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

Store normal stress in a vector

parent b43335ca
Branches
No related tags found
No related merge requests found
...@@ -58,7 +58,7 @@ assemble_nonlinearity( ...@@ -58,7 +58,7 @@ assemble_nonlinearity(
Dune::ParameterTree const &parset, Dune::ParameterTree const &parset,
Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals, Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals,
Dune::BlockVector<Dune::FieldVector<double, 1>> const &state, Dune::BlockVector<Dune::FieldVector<double, 1>> const &state,
double scalarNormalStress) { Dune::BlockVector<Dune::FieldVector<double, 1>> const &normalStress) {
auto const size = nodalIntegrals.size(); auto const size = nodalIntegrals.size();
typedef Dune::BlockVector<Dune::FieldVector<double, 1>> SingletonVectorType; typedef Dune::BlockVector<Dune::FieldVector<double, 1>> SingletonVectorType;
...@@ -66,9 +66,6 @@ assemble_nonlinearity( ...@@ -66,9 +66,6 @@ assemble_nonlinearity(
SingletonVectorType mu(size); SingletonVectorType mu(size);
mu = parset.get<double>("mu"); mu = parset.get<double>("mu");
SingletonVectorType normalStress(size);
normalStress = scalarNormalStress;
switch (parset.get<Config::model>("model")) { switch (parset.get<Config::model>("model")) {
case Config::Exponential: { case Config::Exponential: {
SingletonVectorType a(size); SingletonVectorType a(size);
......
...@@ -28,6 +28,5 @@ assemble_nonlinearity( ...@@ -28,6 +28,5 @@ assemble_nonlinearity(
Dune::ParameterTree const &parset, Dune::ParameterTree const &parset,
Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals, Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals,
Dune::BlockVector<Dune::FieldVector<double, 1>> const &state, Dune::BlockVector<Dune::FieldVector<double, 1>> const &state,
double scalarNormalStress); Dune::BlockVector<Dune::FieldVector<double, 1>> const &normalStress);
#endif #endif
...@@ -35,4 +35,4 @@ assemble_nonlinearity<MatrixType, VectorType>( ...@@ -35,4 +35,4 @@ assemble_nonlinearity<MatrixType, VectorType>(
Dune::ParameterTree const &parset, Dune::ParameterTree const &parset,
Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals, Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals,
Dune::BlockVector<Dune::FieldVector<double, 1>> const &state, Dune::BlockVector<Dune::FieldVector<double, 1>> const &state,
double scalarNormalStress); Dune::BlockVector<Dune::FieldVector<double, 1>> const &normalStress);
...@@ -256,6 +256,12 @@ int main(int argc, char *argv[]) { ...@@ -256,6 +256,12 @@ int main(int argc, char *argv[]) {
SingletonVectorType alpha(alpha_old); SingletonVectorType alpha(alpha_old);
SingletonVectorType vonMisesStress; SingletonVectorType vonMisesStress;
SingletonVectorType surfaceNormalStress(finestSize);
surfaceNormalStress = 0.0;
for (size_t i = 0; i < frictionalNodes.size(); ++i)
if (frictionalNodes[i][0])
surfaceNormalStress[i] = normalStress;
// }}} // }}}
typedef MyConvexProblem<MatrixType, VectorType> MyConvexProblemType; typedef MyConvexProblem<MatrixType, VectorType> MyConvexProblemType;
...@@ -345,7 +351,7 @@ int main(int argc, char *argv[]) { ...@@ -345,7 +351,7 @@ int main(int argc, char *argv[]) {
auto myGlobalNonlinearity = auto myGlobalNonlinearity =
assemble_nonlinearity<MatrixType, VectorType>( assemble_nonlinearity<MatrixType, VectorType>(
parset.sub("boundary.friction"), *nodalIntegrals, alpha, parset.sub("boundary.friction"), *nodalIntegrals, alpha,
normalStress); surfaceNormalStress);
MyConvexProblemType const myConvexProblem( MyConvexProblemType const myConvexProblem(
problem_A, *myGlobalNonlinearity, problem_rhs); problem_A, *myGlobalNonlinearity, problem_rhs);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment