Newer
Older
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <dune/fufem/boundarypatch.hh>
#include <dune/fufem/functions/constantfunction.hh>
#include <dune/fufem/assemblers/localassemblers/neumannboundaryassembler.hh>
#include <dune/tectonic/globalruinanonlinearity.hh>
// Assembles Neumann boundary term in f
template <class GridView, class LocalVectorType, class AssemblerType>
void assembleNeumann(GridView const &gridView, AssemblerType const &assembler,
Dune::BitSetVector<1> const &neumannNodes,
Dune::BlockVector<LocalVectorType> &f,
Dune::VirtualFunction<double, double> const &neumann,
double relativeTime) { // constant sample function on
// neumann boundary
BoundaryPatch<GridView> const neumannBoundary(gridView, neumannNodes);
LocalVectorType SampleVector(0);
neumann.evaluate(relativeTime, SampleVector[0]);
ConstantFunction<LocalVectorType, LocalVectorType> const fNeumann(
SampleVector);
NeumannBoundaryAssembler<typename GridView::Grid, LocalVectorType>
neumannBoundaryAssembler(fNeumann);
assembler.assembleBoundaryFunctional(neumannBoundaryAssembler, f,
neumannBoundary);
}
// Assembles constant 1-function on frictional boundary in nodalIntegrals
template <class GridView, class LocalVectorType, class AssemblerType>
Dune::shared_ptr<Dune::BlockVector<Dune::FieldVector<double, 1>>>
assembleFrictionWeightsal(GridView const &gridView,
AssemblerType const &assembler,
Dune::BitSetVector<1> const &frictionalNodes) {
BoundaryPatch<GridView> const frictionalBoundary(gridView, frictionalNodes);
ConstantFunction<LocalVectorType, Singleton> const constantOneFunction(1);
NeumannBoundaryAssembler<typename GridView::Grid, Singleton>
frictionalBoundaryAssembler(constantOneFunction);
auto const nodalIntegrals = Dune::make_shared<Dune::BlockVector<Singleton>>();
assembler.assembleBoundaryFunctional(frictionalBoundaryAssembler,
*nodalIntegrals, frictionalBoundary);
return nodalIntegrals;
}
template <class MatrixType, class VectorType>
Dune::shared_ptr<Dune::GlobalNonlinearity<MatrixType, VectorType>>
assembleNonlinearity(
Dune::BitSetVector<1> const &frictionalNodes,
Dune::BlockVector<Dune::FieldVector<double, 1>> const &nodalIntegrals,
Dune::GlobalRuinaNonlinearity<MatrixType, VectorType>>(