#ifndef DIM
#error DIM unset
#endif

#include <dune/common/fmatrix.hh>
#include <dune/common/fvector.hh>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wignored-qualifiers"
#include <dune/grid/alugrid.hh>
#pragma clang diagnostic pop
#include <dune/istl/bvector.hh>
#include <dune/istl/bcrsmatrix.hh>

#include <dune/fufem/functionspacebases/p1nodalbasis.hh>

using SmallVector = Dune::FieldVector<double, DIM>;
using SmallMatrix = Dune::FieldMatrix<double, DIM, DIM>;
using MatrixType = Dune::BCRSMatrix<SmallMatrix>;
using VectorType = Dune::BlockVector<SmallVector>;

using GridType = Dune::ALUGrid<DIM, DIM, Dune::simplex, Dune::nonconforming>;
using GridView = GridType::LeafGridView;
using P1Basis = P1NodalBasis<GridView, double>;
using AssemblerType = Assembler<P1Basis, P1Basis>;

template void assembleNeumann<GridView, SmallVector, AssemblerType>(
    GridView const &gridView, AssemblerType const &assembler,
    Dune::BitSetVector<1> const &neumannNodes,
    Dune::BlockVector<SmallVector> &f,
    Dune::VirtualFunction<double, double> const &neumann, double relativeTime);

template Dune::shared_ptr<Dune::BlockVector<Dune::FieldVector<double, 1>>>
assembleFrictionWeightsal<GridView, SmallVector, AssemblerType>(
    GridView const &gridView, AssemblerType const &assembler,
    Dune::BitSetVector<1> const &frictionalNodes);

template Dune::shared_ptr<Dune::GlobalNonlinearity<MatrixType, VectorType>>
assembleNonlinearity<MatrixType, VectorType>(
    Dune::BitSetVector<1> const &frictionalNodes,
    Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals,
    FrictionData const &fd);