DUNE PDELab (2.8)

recipe-blocking.cc

See explanation at Setting up blocked data structures

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <iostream>
#include <dune/pdelab.hh>
int main(int argc, char** argv)
{
// Initialize Mpi
Dune::MPIHelper::instance(argc, argv);
// need a grid in order to test grid functions
constexpr unsigned int dim = 2;
std::array<int,dim> N(Dune::filledArray<dim,int>(64));
typedef Dune::YaspGrid<dim> Grid;
Grid grid(L,N);
using DF = double;
using GV = decltype(grid.leafGridView());
// instantiate finite element maps
FEM fem(grid.leafGridView());
//Set up constraints
// [Scalar grid function space]
// Set up scalar grid function space
SCALAR_GFS U1(grid.leafGridView(),fem); U1.name("U1");
SCALAR_GFS U2(grid.leafGridView(),fem); U2.name("U2");
{
// [Lexiographic blocked type]
// Use lexiographical blocked ordering
typedef Dune::PDELab::LexicographicOrderingTag LexiographicOrderingTag;
// Set up power grid function space
using VBE = Dune::PDELab::ISTL::VectorBackend<Dune::PDELab::ISTL::Blocking::fixed>; // blocking vector backend
dim, // block size
VBE, // blocked vector backend
LexiographicOrderingTag> GFS;
GFS gfs(U1,U2);
}
{
// [Entity blocked type]
// Use entity blocked ordering
typedef Dune::PDELab::EntityBlockedOrderingTag EntityOrderingTag;
// Setting up a composite grid function space with the same scalar grid function space in both components
using VBE = Dune::PDELab::ISTL::VectorBackend<Dune::PDELab::ISTL::Blocking::fixed>; // blocking vector backend
typedef Dune::PDELab::CompositeGridFunctionSpace<VBE, // blocked vector backend
EntityOrderingTag,
SCALAR_GFS, SCALAR_GFS> GFS;
GFS gfs(U1,U2);
}
}
vector space out of a tensor product of fields.
Definition: fvector.hh:95
base class for tuples of grid function spaces base class that holds implementation of the methods thi...
Definition: compositegridfunctionspace.hh:53
Dirichlet Constraints construction.
Definition: conforming.hh:38
A grid function space.
Definition: gridfunctionspace.hh:191
base class for tuples of grid function spaces product of identical grid function spaces base class th...
Definition: powergridfunctionspace.hh:49
[ provides Dune::Grid ]
Definition: yaspgrid.hh:160
Utility to generate an array with a certain value.
Helpers for dealing with MPI.
Indicate blocking of the unknowns by grid entity.
Definition: tags.hh:53
Indicate lexicographic ordering of the unknowns of non-leaf grid function spaces.
Definition: tags.hh:63
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)