diff --git a/src/Makefile.am b/src/Makefile.am index 3b07f3e5f1531a944e26015f8ed2e8c010e6a6e1..ac90649d2259744dce386774ee8dbd0726891303 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -57,6 +57,7 @@ AM_CXXFLAGS = \ AM_CPPFLAGS = \ $(DUNE_CPPFLAGS) \ $(PYTHON_CPPFLAGS) \ + $(ALUGRID_CPPFLAGS) \ -I$(top_srcdir) # The libraries have to be given in reverse order (most basic libraries @@ -65,9 +66,11 @@ AM_CPPFLAGS = \ # here as well. LDADD = \ $(DUNE_LDFLAGS) $(DUNE_LIBS) \ + $(ALUGRID_LIBS) \ $(PYTHON_LIBS) AM_LDFLAGS = \ $(DUNE_LDFLAGS) \ + $(ALUGRID_LDFLAGS) \ $(PYTHON_LDFLAGS) # don't follow the full GNU-standard diff --git a/src/assemblers_tmpl.cc b/src/assemblers_tmpl.cc index 163d8f7339b3270ae163358259fa549a188c96a5..cb02a52c41cd8359457d23a27867234f6351cbee 100644 --- a/src/assemblers_tmpl.cc +++ b/src/assemblers_tmpl.cc @@ -1,6 +1,7 @@ #include <dune/common/fmatrix.hh> #include <dune/common/fvector.hh> -#include <dune/grid/yaspgrid.hh> +// #include <dune/grid/yaspgrid.hh> +#include <dune/grid/alugrid.hh> #include <dune/fufem/functionspacebases/p1nodalbasis.hh> @@ -10,7 +11,8 @@ typedef Dune::FieldMatrix<double, 2, 2> SmallMatrix2; typedef Dune::BCRSMatrix<SmallMatrix2> OperatorType2; typedef Dune::BlockVector<SmallVector2> VectorType2; -typedef Dune::YaspGrid<2> GridType2; +typedef Dune::ALUSimplexGrid<2, 2> GridType2; +// typedef Dune::YaspGrid<2> GridType2; typedef GridType2::LeafGridView GridView2; typedef P1NodalBasis<GridView2, double> P1Basis2; @@ -41,7 +43,8 @@ typedef Dune::FieldMatrix<double, 3, 3> SmallMatrix3; typedef Dune::BCRSMatrix<SmallMatrix3> OperatorType3; typedef Dune::BlockVector<SmallVector3> VectorType3; -typedef Dune::YaspGrid<3> GridType3; +typedef Dune::ALUSimplexGrid<3, 3> GridType3; +// typedef Dune::YaspGrid<3> GridType3; typedef GridType3::LeafGridView GridView3; typedef P1NodalBasis<GridView3, double> P1Basis3; diff --git a/src/mysolver_tmpl.cc b/src/mysolver_tmpl.cc index 188501d4c2def22fc668bdc0c772bbacd7d36422..a5b7b601165036be7ebbd8b306cbca216d2d4c1b 100644 --- a/src/mysolver_tmpl.cc +++ b/src/mysolver_tmpl.cc @@ -1,6 +1,7 @@ #include <dune/common/fmatrix.hh> #include <dune/common/fvector.hh> -#include <dune/grid/yaspgrid.hh> +//#include <dune/grid/yaspgrid.hh> +#include <dune/grid/alugrid.hh> #include <dune/istl/bcrsmatrix.hh> #include <dune/istl/bvector.hh> @@ -16,7 +17,8 @@ typedef Dune::BCRSMatrix<SmallMatrix2> OperatorType2; typedef MyConvexProblem<OperatorType2, VectorType2> MyConvexProblemType2; typedef MyBlockProblem<MyConvexProblemType2> MyBlockProblemType2; -typedef Dune::YaspGrid<2> GridType2; +typedef Dune::ALUSimplexGrid<2, 2> GridType2; +// typedef Dune::YaspGrid<2> GridType2; template class MySolver<2, VectorType2, OperatorType2, GridType2, MyBlockProblemType2>; @@ -31,7 +33,8 @@ typedef Dune::BCRSMatrix<SmallMatrix3> OperatorType3; typedef MyConvexProblem<OperatorType3, VectorType3> MyConvexProblemType3; typedef MyBlockProblem<MyConvexProblemType3> MyBlockProblemType3; -typedef Dune::YaspGrid<3> GridType3; +typedef Dune::ALUSimplexGrid<3, 3> GridType3; +// typedef Dune::YaspGrid<3> GridType3; template class MySolver<3, VectorType3, OperatorType3, GridType3, MyBlockProblemType3>; diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index fbe1792b644661d075dc4e2b469fcbcdf6f8bdb8..15a0abf5340f8b088c19d6bc18e64817f02c3ecb 100644 --- a/src/one-body-sample.cc +++ b/src/one-body-sample.cc @@ -14,6 +14,10 @@ #error Python is required #endif +#if !HAVE_ALUGRID +#error ALUGRID is required +#endif + #include <exception> #include <iostream> @@ -32,7 +36,11 @@ #include <dune/common/parametertreeparser.hh> #include <dune/common/shared_ptr.hh> #include <dune/common/timer.hh> +#include <dune/grid/alugrid.hh> +#include <dune/grid/alugrid/2d/alu2dgridfactory.hh> +#include <dune/grid/alugrid/3d/alu3dgridfactory.hh> #include <dune/grid/common/mcmgmapper.hh> +#include <dune/grid/utility/structuredgridfactory.hh> #include <dune/grid/yaspgrid.hh> #include <dune/istl/bcrsmatrix.hh> #include <dune/istl/bvector.hh> @@ -135,14 +143,14 @@ int main(int argc, char *argv[]) { verbose ? Solver::FULL : Solver::QUIET; // {{{ Set up grid - typedef Dune::YaspGrid<dim> GridType; - Dune::FieldVector<double, dim> const end_points( - 1); // nth dimension (zero-indexed) goes from 0 to end_points[n] - auto grid = Dune::make_shared<GridType>( - end_points, - Dune::FieldVector<int, dim>(1), // number of elements in each direction - Dune::FieldVector<bool, dim>(false), // non-periodic in each direction - 0); // zero overlap (whatever that is) + typedef Dune::ALUSimplexGrid<dim, dim> GridType; + Dune::FieldVector<typename GridType::ctype, dim> lowerLeft(0); + Dune::FieldVector<typename GridType::ctype, dim> upperRight(1); + Dune::array<unsigned int, dim> elements; + std::fill(elements.begin(), elements.end(), 1); + auto grid = Dune::StructuredGridFactory<GridType>::createSimplexGrid( + lowerLeft, upperRight, elements); + grid->globalRefine(refinements); size_t const finestSize = grid->size(grid->maxLevel(), dim); diff --git a/src/vtk_tmpl.cc b/src/vtk_tmpl.cc index 78679b9429507a30d24f21af5d359a866973af3c..182f51b6d64c9daafd1d5cfebca3c975a7edee4c 100644 --- a/src/vtk_tmpl.cc +++ b/src/vtk_tmpl.cc @@ -2,7 +2,8 @@ #include <dune/common/fmatrix.hh> #include <dune/common/fvector.hh> -#include <dune/grid/yaspgrid.hh> +//#include <dune/grid/yaspgrid.hh> +#include <dune/grid/alugrid.hh> #include <dune/istl/bvector.hh> #include <dune/fufem/functionspacebases/p0basis.hh> @@ -15,7 +16,8 @@ typedef Dune::FieldVector<double, 2> SmallVector2; typedef Dune::FieldMatrix<double, 2, 2> SmallMatrix2; typedef Dune::BlockVector<SmallVector2> VectorType2; -typedef Dune::YaspGrid<2> GridType2; +typedef Dune::ALUSimplexGrid<2, 2> GridType2; +// typedef Dune::YaspGrid<2> GridType2; typedef GridType2::LeafGridView GridView2; typedef P1NodalBasis<GridView2, double> P1Basis2; typedef P0Basis<GridView2, double> P0Basis2; @@ -33,7 +35,8 @@ typedef Dune::FieldVector<double, 3> SmallVector3; typedef Dune::FieldMatrix<double, 3, 3> SmallMatrix3; typedef Dune::BlockVector<SmallVector3> VectorType3; -typedef Dune::YaspGrid<3> GridType3; +typedef Dune::ALUSimplexGrid<3, 3> GridType3; +// typedef Dune::YaspGrid<3> GridType3; typedef GridType3::LeafGridView GridView3; typedef P1NodalBasis<GridView3, double> P1Basis3; typedef P0Basis<GridView3, double> P0Basis3;