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 ...@@ -23,13 +23,14 @@ class GlobalRuinaNonlinearity
public: public:
using GlobalNonlinearity<MatrixType, VectorType>::dim; using GlobalNonlinearity<MatrixType, VectorType>::dim;
GlobalRuinaNonlinearity(dataref nodalIntegrals, FrictionData const &fd, GlobalRuinaNonlinearity(Dune::BitSetVector<1> const &frictionalNodes,
dataref nodalIntegrals, FrictionData const &fd,
dataref state) dataref state)
: restrictions(nodalIntegrals.size()) { : restrictions(nodalIntegrals.size()) {
auto trivialNonlinearity = make_shared<LocalFriction<dim> const>( auto trivialNonlinearity = make_shared<LocalFriction<dim> const>(
make_shared<TrivialFunction const>()); make_shared<TrivialFunction const>());
for (size_t i = 0; i < restrictions.size(); ++i) { for (size_t i = 0; i < restrictions.size(); ++i) {
restrictions[i] = (nodalIntegrals[i] == 0) restrictions[i] = frictionalNodes[i][0]
? trivialNonlinearity ? trivialNonlinearity
: make_shared<LocalFriction<dim> const>( : make_shared<LocalFriction<dim> const>(
make_shared<FrictionPotential const>( make_shared<FrictionPotential const>(
......
...@@ -50,12 +50,13 @@ assemble_frictional(GridView const &gridView, AssemblerType const &assembler, ...@@ -50,12 +50,13 @@ assemble_frictional(GridView const &gridView, AssemblerType const &assembler,
template <class MatrixType, class VectorType> template <class MatrixType, class VectorType>
Dune::shared_ptr<Dune::GlobalNonlinearity<MatrixType, VectorType> const> Dune::shared_ptr<Dune::GlobalNonlinearity<MatrixType, VectorType> const>
assemble_nonlinearity( assemble_nonlinearity(
Dune::BitSetVector<1> const &frictionalNodes,
Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals, Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals,
FrictionData const &fd, FrictionData const &fd,
Dune::BlockVector<Dune::FieldVector<double, 1>> const &state) { Dune::BlockVector<Dune::FieldVector<double, 1>> const &state) {
return Dune::make_shared< return Dune::make_shared<
Dune::GlobalRuinaNonlinearity<MatrixType, VectorType> const>( Dune::GlobalRuinaNonlinearity<MatrixType, VectorType> const>(
nodalIntegrals, fd, state); frictionalNodes, nodalIntegrals, fd, state);
} }
#include "assemblers_tmpl.cc" #include "assemblers_tmpl.cc"
...@@ -26,6 +26,7 @@ assemble_frictional(GridView const &gridView, AssemblerType const &assembler, ...@@ -26,6 +26,7 @@ assemble_frictional(GridView const &gridView, AssemblerType const &assembler,
template <class MatrixType, class VectorType> template <class MatrixType, class VectorType>
Dune::shared_ptr<Dune::GlobalNonlinearity<MatrixType, VectorType> const> Dune::shared_ptr<Dune::GlobalNonlinearity<MatrixType, VectorType> const>
assemble_nonlinearity( assemble_nonlinearity(
Dune::BitSetVector<1> const &frictionalNodes,
Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals, Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals,
FrictionData const &fd, FrictionData const &fd,
Dune::BlockVector<Dune::FieldVector<double, 1>> const &state); Dune::BlockVector<Dune::FieldVector<double, 1>> const &state);
......
...@@ -34,6 +34,7 @@ assemble_frictional<GridView, SmallVector, AssemblerType>( ...@@ -34,6 +34,7 @@ assemble_frictional<GridView, SmallVector, AssemblerType>(
template Dune::shared_ptr< template Dune::shared_ptr<
Dune::GlobalNonlinearity<MatrixType, VectorType> const> Dune::GlobalNonlinearity<MatrixType, VectorType> const>
assemble_nonlinearity<MatrixType, VectorType>( assemble_nonlinearity<MatrixType, VectorType>(
Dune::BitSetVector<1> const &frictionalNodes,
Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals, Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals,
FrictionData const &fd, FrictionData const &fd,
Dune::BlockVector<Dune::FieldVector<double, 1>> const &state); Dune::BlockVector<Dune::FieldVector<double, 1>> const &state);
...@@ -408,8 +408,8 @@ int main(int argc, char *argv[]) { ...@@ -408,8 +408,8 @@ int main(int argc, char *argv[]) {
auto solveVelocityProblem = [&](VectorType &_problem_iterate, auto solveVelocityProblem = [&](VectorType &_problem_iterate,
SingletonVectorType const &_alpha) { SingletonVectorType const &_alpha) {
auto myGlobalNonlinearity = auto myGlobalNonlinearity =
assemble_nonlinearity<MatrixType, VectorType>(*nodalIntegrals, assemble_nonlinearity<MatrixType, VectorType>(
frictionData, _alpha); frictionalNodes, *nodalIntegrals, frictionData, _alpha);
using MyConvexProblemType = MyConvexProblem<MatrixType, VectorType>; using MyConvexProblemType = MyConvexProblem<MatrixType, VectorType>;
MyConvexProblemType const myConvexProblem( MyConvexProblemType const myConvexProblem(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment