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

Introduce SingletonVectorType

parent d91418b8
No related branches found
No related tags found
No related merge requests found
......@@ -132,14 +132,13 @@ template <class GridType, class GridView, class LocalVectorType, class FEBasis>
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, Dune::FieldVector<double, 1>>
constantOneFunction(1);
NeumannBoundaryAssembler<GridType, Dune::FieldVector<double, 1>>
frictionalBoundaryAssembler(constantOneFunction);
ConstantFunction<LocalVectorType, Singleton> constantOneFunction(1);
NeumannBoundaryAssembler<GridType, Singleton> frictionalBoundaryAssembler(
constantOneFunction);
auto nodalIntegrals =
Dune::make_shared<Dune::BlockVector<Dune::FieldVector<double, 1>>>();
auto nodalIntegrals = Dune::make_shared<Dune::BlockVector<Singleton>>();
BoundaryFunctionalAssembler<FEBasis>(feBasis, frictionalBoundary)
.assemble(frictionalBoundaryAssembler, *nodalIntegrals,
true); // resize and zero output vector
......@@ -155,7 +154,6 @@ assemble_nonlinearity(
Dune::shared_ptr<Dune::BlockVector<Dune::FieldVector<double, 1>>> state,
double h) {
typedef Dune::BlockVector<Dune::FieldVector<double, 1>> SingletonVectorType;
// {{{ Assemble terms for the nonlinearity
auto mu = Dune::make_shared<SingletonVectorType>(size);
*mu = parset.get<double>("boundary.friction.mu");
......@@ -232,7 +230,7 @@ int main(int argc, char *argv[]) {
typedef Dune::FieldMatrix<double, dim, dim> SmallMatrix;
typedef Dune::BCRSMatrix<SmallMatrix> OperatorType;
typedef Dune::BlockVector<SmallVector> VectorType;
typedef Dune::BlockVector<Dune::FieldVector<double, 1>> CellVectorType;
typedef Dune::BlockVector<Dune::FieldVector<double, 1>> SingletonVectorType;
auto const E = parset.get<double>("body.E");
auto const nu = parset.get<double>("body.nu");
......@@ -314,7 +312,7 @@ int main(int argc, char *argv[]) {
grid->size(grid->maxLevel(), dim));
*s4_new = s4_old;
CellVectorType vonMisesStress;
SingletonVectorType vonMisesStress;
VectorType b1;
VectorType b2;
......@@ -478,7 +476,7 @@ int main(int argc, char *argv[]) {
Dune::make_shared<VTKBasisGridFunction<P1Basis, VectorType> const>(
p1Basis, u4, "displacement");
auto const vonmises_ptr = Dune::make_shared<
VTKBasisGridFunction<P0Basis, CellVectorType> const>(
VTKBasisGridFunction<P0Basis, SingletonVectorType> const>(
p0Basis, vonMisesStress, "stress");
Dune::VTKWriter<GridView> writer(leafView);
writer.addVertexData(displacement_ptr);
......
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