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

Constness

parent f6f797e0
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ class MyConvexProblem { ...@@ -22,7 +22,7 @@ class MyConvexProblem {
\param u The solution vector \param u The solution vector
*/ */
MyConvexProblem(MatrixType const &A, MyConvexProblem(MatrixType const &A,
Dune::GlobalNonlinearity<block_size> &phi, Dune::GlobalNonlinearity<block_size> const &phi,
VectorType const &f, VectorType &u) VectorType const &f, VectorType &u)
: A(A), phi(phi), f(f), u(u) {}; : A(A), phi(phi), f(f), u(u) {};
......
...@@ -137,7 +137,7 @@ void assemble_frictional( ...@@ -137,7 +137,7 @@ void assemble_frictional(
void assemble_nonlinearity( void assemble_nonlinearity(
int size, Dune::ParameterTree const &parset, int size, Dune::ParameterTree const &parset,
Dune::shared_ptr<Dune::GlobalNonlinearity<dim>> &myGlobalNonlinearity, Dune::shared_ptr<Dune::GlobalNonlinearity<dim> const> &myGlobalNonlinearity,
std::vector<Dune::FieldVector<double, 1>> &nodalIntegrals) { std::vector<Dune::FieldVector<double, 1>> &nodalIntegrals) {
// {{{ Assemble terms for the nonlinearity // {{{ Assemble terms for the nonlinearity
std::vector<double> mu; std::vector<double> mu;
...@@ -164,12 +164,14 @@ void assemble_nonlinearity( ...@@ -164,12 +164,14 @@ void assemble_nonlinearity(
auto const tmp = new Dune::GlobalRuinaNonlinearity<dim>( auto const tmp = new Dune::GlobalRuinaNonlinearity<dim>(
nodalIntegrals, a, mu, eta, normalStress); nodalIntegrals, a, mu, eta, normalStress);
myGlobalNonlinearity = Dune::shared_ptr<Dune::GlobalNonlinearity<dim>>(tmp); myGlobalNonlinearity =
Dune::shared_ptr<Dune::GlobalNonlinearity<dim> const>(tmp);
} else if (friction_model == std::string("Laursen")) { } else if (friction_model == std::string("Laursen")) {
auto const tmp = auto const tmp =
new Dune::GlobalLaursenNonlinearity<dim, Dune::LinearFunction>( new Dune::GlobalLaursenNonlinearity<dim, Dune::LinearFunction>(
mu, normalStress, nodalIntegrals); mu, normalStress, nodalIntegrals);
myGlobalNonlinearity = Dune::shared_ptr<Dune::GlobalNonlinearity<dim>>(tmp); myGlobalNonlinearity =
Dune::shared_ptr<Dune::GlobalNonlinearity<dim> const>(tmp);
} else { } else {
assert(false); assert(false);
} }
...@@ -277,7 +279,8 @@ int main(int argc, char *argv[]) { ...@@ -277,7 +279,8 @@ int main(int argc, char *argv[]) {
stiffnessMatrix.mmv(u2, b2); stiffnessMatrix.mmv(u2, b2);
stiffnessMatrix.mmv(u3, b3); stiffnessMatrix.mmv(u3, b3);
Dune::shared_ptr<Dune::GlobalNonlinearity<dim>> myGlobalNonlinearity; Dune::shared_ptr<Dune::GlobalNonlinearity<dim> const>
myGlobalNonlinearity;
assemble_nonlinearity(grid.size(grid.maxLevel(), dim), parset, assemble_nonlinearity(grid.size(grid.maxLevel(), dim), parset,
myGlobalNonlinearity, nodalIntegrals); myGlobalNonlinearity, nodalIntegrals);
// }}} // }}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment