diff --git a/dune/tectonic/globalruinanonlinearity.hh b/dune/tectonic/globalruinanonlinearity.hh index 6a2c68c69f0b1feaa414c1cd2b1aa3bc300e45d2..0181c61966603b4e455bfbc1e4c4ecee84ca03b5 100644 --- a/dune/tectonic/globalruinanonlinearity.hh +++ b/dune/tectonic/globalruinanonlinearity.hh @@ -23,13 +23,14 @@ class GlobalRuinaNonlinearity public: using GlobalNonlinearity<MatrixType, VectorType>::dim; - GlobalRuinaNonlinearity(dataref nodalIntegrals, FrictionData const &fd, + GlobalRuinaNonlinearity(Dune::BitSetVector<1> const &frictionalNodes, + dataref nodalIntegrals, FrictionData const &fd, dataref state) : restrictions(nodalIntegrals.size()) { auto trivialNonlinearity = make_shared<LocalFriction<dim> const>( make_shared<TrivialFunction const>()); for (size_t i = 0; i < restrictions.size(); ++i) { - restrictions[i] = (nodalIntegrals[i] == 0) + restrictions[i] = frictionalNodes[i][0] ? trivialNonlinearity : make_shared<LocalFriction<dim> const>( make_shared<FrictionPotential const>( diff --git a/src/assemblers.cc b/src/assemblers.cc index 3f605f38dc76712ec47e2771a6b6f4e9c83d9674..1e2e2b131af4b25ade55324a8b8e3ab015a564a0 100644 --- a/src/assemblers.cc +++ b/src/assemblers.cc @@ -50,12 +50,13 @@ assemble_frictional(GridView const &gridView, AssemblerType const &assembler, template <class MatrixType, class VectorType> Dune::shared_ptr<Dune::GlobalNonlinearity<MatrixType, VectorType> const> assemble_nonlinearity( + Dune::BitSetVector<1> const &frictionalNodes, Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals, FrictionData const &fd, Dune::BlockVector<Dune::FieldVector<double, 1>> const &state) { return Dune::make_shared< Dune::GlobalRuinaNonlinearity<MatrixType, VectorType> const>( - nodalIntegrals, fd, state); + frictionalNodes, nodalIntegrals, fd, state); } #include "assemblers_tmpl.cc" diff --git a/src/assemblers.hh b/src/assemblers.hh index f746326054d94d9164a1da06ea2445781828d52a..acbde2fe78744b118254902a20150d97a4f9dd55 100644 --- a/src/assemblers.hh +++ b/src/assemblers.hh @@ -26,6 +26,7 @@ assemble_frictional(GridView const &gridView, AssemblerType const &assembler, template <class MatrixType, class VectorType> Dune::shared_ptr<Dune::GlobalNonlinearity<MatrixType, VectorType> const> assemble_nonlinearity( + Dune::BitSetVector<1> const &frictionalNodes, Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals, FrictionData const &fd, Dune::BlockVector<Dune::FieldVector<double, 1>> const &state); diff --git a/src/assemblers_tmpl.cc b/src/assemblers_tmpl.cc index e9ac682467ca0ba95a73f67cf6e7ac09b3211fa1..aa565f595fe710b57db9fd37a2eaeb88ae580c8c 100644 --- a/src/assemblers_tmpl.cc +++ b/src/assemblers_tmpl.cc @@ -34,6 +34,7 @@ assemble_frictional<GridView, SmallVector, AssemblerType>( template Dune::shared_ptr< Dune::GlobalNonlinearity<MatrixType, VectorType> const> assemble_nonlinearity<MatrixType, VectorType>( + Dune::BitSetVector<1> const &frictionalNodes, Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals, FrictionData const &fd, Dune::BlockVector<Dune::FieldVector<double, 1>> const &state); diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index 9bb48e0e9f19661b7de14a6a5faec335d3a82fe6..504595228a3f7ad75d7884fffb080642b6b65788 100644 --- a/src/one-body-sample.cc +++ b/src/one-body-sample.cc @@ -408,8 +408,8 @@ int main(int argc, char *argv[]) { auto solveVelocityProblem = [&](VectorType &_problem_iterate, SingletonVectorType const &_alpha) { auto myGlobalNonlinearity = - assemble_nonlinearity<MatrixType, VectorType>(*nodalIntegrals, - frictionData, _alpha); + assemble_nonlinearity<MatrixType, VectorType>( + frictionalNodes, *nodalIntegrals, frictionData, _alpha); using MyConvexProblemType = MyConvexProblem<MatrixType, VectorType>; MyConvexProblemType const myConvexProblem(