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

Constness, minor cleanup

parent 46b107ca
No related branches found
No related tags found
No related merge requests found
......@@ -110,21 +110,19 @@ void assemble_neumann(GridView const &gridView, FEBasis const &feBasis,
Dune::BlockVector<LocalVectorType> &f,
double time) { // constant sample function on neumann
// boundary
BoundaryPatch<GridView> neumannBoundary(gridView, neumannNodes);
BoundaryPatch<GridView> const neumannBoundary(gridView, neumannNodes);
LocalVectorType SampleVector(0);
// FIXME: random values (time-dependent)
SampleVector[0] =
(time <= 0.5) ? sin(time * 2 * M_PI) * 1e3 : (time - 0.5) * 2 * 1e4;
SampleVector[1] = 0;
ConstantFunction<LocalVectorType, LocalVectorType> fNeumann(SampleVector);
ConstantFunction<LocalVectorType, LocalVectorType> const fNeumann(
SampleVector);
NeumannBoundaryAssembler<GridType, LocalVectorType> neumannBoundaryAssembler(
fNeumann);
BoundaryFunctionalAssembler<FEBasis> boundaryFunctionalAssembler(
feBasis, neumannBoundary);
boundaryFunctionalAssembler.assemble(
neumannBoundaryAssembler, f,
true); // whether to resize the output vector and zero all of its entries
BoundaryFunctionalAssembler<FEBasis>(feBasis, neumannBoundary).assemble(
neumannBoundaryAssembler, f, true); // resize and zero output vector
}
// Assembles constant 1-function on frictional boundary in nodalIntegrals
......@@ -133,12 +131,12 @@ Dune::shared_ptr<Dune::BlockVector<Dune::FieldVector<double, 1>>>
assemble_frictional(GridView const &gridView, FEBasis const &feBasis,
Dune::BitSetVector<1> const &frictionalNodes) {
typedef Dune::FieldVector<double, 1> Singleton;
BoundaryPatch<GridView> frictionalBoundary(gridView, frictionalNodes);
ConstantFunction<LocalVectorType, Singleton> constantOneFunction(1);
BoundaryPatch<GridView> const frictionalBoundary(gridView, frictionalNodes);
ConstantFunction<LocalVectorType, Singleton> const constantOneFunction(1);
NeumannBoundaryAssembler<GridType, Singleton> frictionalBoundaryAssembler(
constantOneFunction);
auto nodalIntegrals = Dune::make_shared<Dune::BlockVector<Singleton>>();
auto const nodalIntegrals = Dune::make_shared<Dune::BlockVector<Singleton>>();
BoundaryFunctionalAssembler<FEBasis>(feBasis, frictionalBoundary)
.assemble(frictionalBoundaryAssembler, *nodalIntegrals,
true); // resize and zero output vector
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment