Commit e72b3c24 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'issue/problemstat_traits' into 'master'

parametrize BasisCreator with Grid instead of GridView

See merge request !14
parents 94bb365d 41cb8a31
......@@ -9,7 +9,7 @@
using namespace AMDiS;
using Grid = Dune::AlbertaGrid<GRIDDIM, WORLDDIM>;
using Param = LagrangeBasis<typename Grid::LeafGridView, 1, 1>;
using Param = LagrangeBasis<Grid, 1, 1>;
int main(int argc, char** argv)
{
......
......@@ -8,7 +8,7 @@
using namespace AMDiS;
using Grid = Dune::YaspGrid<2>;
using Basis = TaylorHoodBasis<Grid::LeafGridView>;
using Basis = TaylorHoodBasis<Grid>;
int main(int argc, char** argv)
{
......
......@@ -25,7 +25,7 @@ void run(Grid& grid)
{
grid.globalRefine(Grid::dimension == 2 ? 4 : 2);
using Traits = LagrangeBasis<typename Grid::LeafGridView, 2>;
using Traits = LagrangeBasis<Grid, 2>;
ProblemStat<Traits> prob("ellipt", grid);
prob.initialize(INIT_ALL);
prob.boundaryManager().setBoxBoundary({1,2,2,1});
......
......@@ -54,7 +54,7 @@ void print(Grid const& grid)
template <class Grid>
void run(Grid& grid)
{
using Traits = LagrangeBasis<typename Grid::LeafGridView, 1>;
using Traits = LagrangeBasis<Grid, 1>;
ProblemStat<Traits> prob("ellipt", grid);
prob.initialize(INIT_ALL);
......
......@@ -5,7 +5,7 @@
using namespace AMDiS;
using Grid = Dune::YaspGrid<2>;
using StokesParam = TaylorHoodBasis<Grid::LeafGridView>;
using StokesParam = TaylorHoodBasis<Grid>;
using StokesProblem = ProblemStat<StokesParam>;
int main(int argc, char** argv)
......
......@@ -5,7 +5,7 @@
using namespace AMDiS;
using Grid = Dune::YaspGrid<2>;
using StokesParam = TaylorHoodBasis<Grid::LeafGridView>;
using StokesParam = TaylorHoodBasis<Grid>;
using StokesProblem = ProblemStat<StokesParam>;
int main(int argc, char** argv)
......
......@@ -6,7 +6,7 @@
using namespace AMDiS;
using Grid = Dune::YaspGrid<2>;
using StokesParam = TaylorHoodBasis<Grid::LeafGridView>;
using StokesParam = TaylorHoodBasis<Grid>;
using StokesProblem = ProblemStat<StokesParam>;
int main(int argc, char** argv)
......
......@@ -10,8 +10,6 @@
using namespace AMDiS;
// 1 component with polynomial degree 1
//using Grid = Dune::AlbertaGrid<GRIDDIM, WORLDDIM>;
using ElliptParam = YaspGridBasis<GRIDDIM, 2,2>;
using ElliptProblem = ProblemStat<ElliptParam>;
......
......@@ -64,9 +64,10 @@ namespace AMDiS
};
template <class GridView, class PreBasisCreator>
template <class Grid, class PreBasisCreator>
struct DefaultBasisCreator
{
using GridView = typename Grid::LeafGridView;
static auto create(GridView const& gridView)
{
using namespace Dune::Functions::BasisFactory;
......@@ -78,23 +79,23 @@ namespace AMDiS
/// \brief ProblemStatTraits for a (composite) basis composed of
/// lagrange bases of different degree.
template <class GridView, int... degrees>
template <class Grid, int... degrees>
struct LagrangeBasis
: public DefaultBasisCreator<GridView, Impl::LagrangePreBasisCreator<degrees...>>
: public DefaultBasisCreator<Grid, Impl::LagrangePreBasisCreator<degrees...>>
{};
/// \brief Specialization of \ref LagrangeBasis for Grid type
/// \ref Dune::YaspGrid for a given dimension.
template <int dim, int... degrees>
struct YaspGridBasis
: public LagrangeBasis<typename Dune::YaspGrid<dim>::LeafGridView, degrees...>
: public LagrangeBasis<Dune::YaspGrid<dim>, degrees...>
{};
/// \brief ProblemStatTraits of Taylor-Hood basis of lagrange-type
/// with pressure degree k
template <class GridView, int k = 1>
template <class Grid, int k = 1>
struct TaylorHoodBasis
: public DefaultBasisCreator<GridView, Impl::TaylorHoodPreBasisCreator<GridView::dimensionworld,k>>
: public DefaultBasisCreator<Grid, Impl::TaylorHoodPreBasisCreator<Grid::dimensionworld,k>>
{};
} // end namespace AMDiS
......@@ -159,8 +159,8 @@ bool refine_test(Fcts<BasisCreator> const& funcs, bool simplex = true)
}
template <class Grid>
using Lagrange3 = LagrangeBasis<typename Grid::LeafGridView, 3>;
using Lagrange3 = LagrangeBasis<Grid, 3>;
template <class Grid>
using TaylorHood = TaylorHoodBasis<typename Grid::LeafGridView>;
using TaylorHood = TaylorHoodBasis<Grid>;
constexpr double pi = 3.141592653589793238463;
......@@ -8,7 +8,7 @@ using namespace AMDiS;
static const int d = 2; // problem dimension
using Grid = Dune::UGGrid<d>;
using Basis = LagrangeBasis<Grid::LeafGridView, 1>;
using Basis = LagrangeBasis<Grid, 1>;
using Problem = ProblemStat<Basis>;
using DomainType = typename Dune::FieldVector<double,d>;
......
......@@ -10,7 +10,7 @@
using namespace AMDiS;
using Grid = Dune::YaspGrid<2>;
using Param = TaylorHoodBasis<typename Grid::LeafGridView>;
using Param = TaylorHoodBasis<Grid>;
using Problem = ProblemStat<Param>;
int main(int argc, char** argv)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment