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

Pass frictionalNodes on to nonlinearity

parent eed64f79
No related branches found
No related tags found
No related merge requests found
......@@ -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>(
......
......@@ -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"
......@@ -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);
......
......@@ -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);
......@@ -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(
......
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