diff --git a/dune/tectonic/globalruinanonlinearity.hh b/dune/tectonic/globalruinanonlinearity.hh index f3bd55dec0e5a80663a93a12595a12c9db247175..b64d8bba57a970eb44749181e31d6a321d1674e2 100644 --- a/dune/tectonic/globalruinanonlinearity.hh +++ b/dune/tectonic/globalruinanonlinearity.hh @@ -23,9 +23,9 @@ class GlobalRuinaNonlinearity public: using GlobalNonlinearity<MatrixType, VectorType>::dim; - GlobalRuinaNonlinearity(dataref nodalIntegrals, dataref a, dataref mu0, - dataref V0, dataref normalStress, dataref b, - dataref state, dataref L) + GlobalRuinaNonlinearity(dataref nodalIntegrals, double a, double mu0, + double V0, double normalStress, double b, + dataref state, double L) : restrictions(nodalIntegrals.size()) { auto trivialNonlinearity = make_shared<LocalNonlinearity<dim> const>( make_shared<TrivialFunction const>()); @@ -34,8 +34,8 @@ class GlobalRuinaNonlinearity ? trivialNonlinearity : make_shared<LocalNonlinearity<dim> const>( make_shared<RuinaFunction const>( - nodalIntegrals[i], a[i], mu0[i], V0[i], - normalStress[i], b[i], state[i], L[i])); + nodalIntegrals[i], a, mu0, V0, + normalStress, b, state[i], L)); } } diff --git a/src/assemblers.cc b/src/assemblers.cc index 283da47e47591797053aba0814329bad8aebd246..aa19a12201815ad5613da8a6d870b6783e8a4dbd 100644 --- a/src/assemblers.cc +++ b/src/assemblers.cc @@ -52,27 +52,8 @@ Dune::shared_ptr<Dune::GlobalNonlinearity<MatrixType, VectorType> const> assemble_nonlinearity( Dune::ParameterTree const &parset, Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals, - Dune::BlockVector<Dune::FieldVector<double, 1>> const &state, - Dune::BlockVector<Dune::FieldVector<double, 1>> const &normalStress) { - auto const size = nodalIntegrals.size(); - - using SingletonVectorType = Dune::BlockVector<Dune::FieldVector<double, 1>>; - // {{{ Assemble terms for the nonlinearity - SingletonVectorType mu0(size); - mu0 = parset.get<double>("mu0"); - - SingletonVectorType a(size); - a = parset.get<double>("a"); - - SingletonVectorType V0(size); - V0 = parset.get<double>("V0"); - - SingletonVectorType b(size); - b = parset.get<double>("b"); - - SingletonVectorType L(size); - L = parset.get<double>("L"); - + double a, double mu0, double V0, double normalStress, double b, + Dune::BlockVector<Dune::FieldVector<double, 1>> const &state, double L) { return Dune::make_shared< Dune::GlobalRuinaNonlinearity<MatrixType, VectorType> const>( nodalIntegrals, a, mu0, V0, normalStress, b, state, L); diff --git a/src/assemblers.hh b/src/assemblers.hh index ceceddee6fa2a2a4e611f9b258e39050bae2692f..f29d6fad176a6e9bb52ead930bae684ded676204 100644 --- a/src/assemblers.hh +++ b/src/assemblers.hh @@ -29,6 +29,6 @@ Dune::shared_ptr<Dune::GlobalNonlinearity<MatrixType, VectorType> const> assemble_nonlinearity( Dune::ParameterTree const &parset, Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals, - Dune::BlockVector<Dune::FieldVector<double, 1>> const &state, - Dune::BlockVector<Dune::FieldVector<double, 1>> const &normalStress); + double a, double mu0, double V0, double normalStress, double b, + Dune::BlockVector<Dune::FieldVector<double, 1>> const &state, double L); #endif diff --git a/src/assemblers_tmpl.cc b/src/assemblers_tmpl.cc index 31686a4c270cf6390215298a2fcea6708c589a5a..9a7fcc68a1f1eaec2bfb29e3ad284ae8bfe2417b 100644 --- a/src/assemblers_tmpl.cc +++ b/src/assemblers_tmpl.cc @@ -36,5 +36,5 @@ template Dune::shared_ptr< assemble_nonlinearity<MatrixType, VectorType>( Dune::ParameterTree const &parset, Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals, - Dune::BlockVector<Dune::FieldVector<double, 1>> const &state, - Dune::BlockVector<Dune::FieldVector<double, 1>> const &normalStress); + double a, double mu0, double V0, double normalStress, double b, + Dune::BlockVector<Dune::FieldVector<double, 1>> const &state, double L); diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index a654eede7d230fb2dc1e5c6f5885eaaed4e5a539..66b550fe5dc84876d67fe9c39003cfb0c27237b6 100644 --- a/src/one-body-sample.cc +++ b/src/one-body-sample.cc @@ -294,8 +294,6 @@ int main(int argc, char *argv[]) { gravityFunctional); } } - SingletonVectorType surfaceNormalStress(finestSize); - surfaceNormalStress = normalStress; MatrixType stiffnessMatrix; EnergyNorm<MatrixType, VectorType> const stiffnessMatrixNorm( @@ -413,8 +411,8 @@ int main(int argc, char *argv[]) { SingletonVectorType const &_alpha) { auto myGlobalNonlinearity = assemble_nonlinearity<MatrixType, VectorType>( - parset.sub("boundary.friction"), *nodalIntegrals, _alpha, - surfaceNormalStress); + parset.sub("boundary.friction"), *nodalIntegrals, a, mu0, V0, + normalStress, b, _alpha, L); using MyConvexProblemType = MyConvexProblem<MatrixType, VectorType>; MyConvexProblemType const myConvexProblem(