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

Use ALUGrid

parent 9221669c
Branches
Tags
No related merge requests found
...@@ -57,6 +57,7 @@ AM_CXXFLAGS = \ ...@@ -57,6 +57,7 @@ AM_CXXFLAGS = \
AM_CPPFLAGS = \ AM_CPPFLAGS = \
$(DUNE_CPPFLAGS) \ $(DUNE_CPPFLAGS) \
$(PYTHON_CPPFLAGS) \ $(PYTHON_CPPFLAGS) \
$(ALUGRID_CPPFLAGS) \
-I$(top_srcdir) -I$(top_srcdir)
# The libraries have to be given in reverse order (most basic libraries # The libraries have to be given in reverse order (most basic libraries
...@@ -65,9 +66,11 @@ AM_CPPFLAGS = \ ...@@ -65,9 +66,11 @@ AM_CPPFLAGS = \
# here as well. # here as well.
LDADD = \ LDADD = \
$(DUNE_LDFLAGS) $(DUNE_LIBS) \ $(DUNE_LDFLAGS) $(DUNE_LIBS) \
$(ALUGRID_LIBS) \
$(PYTHON_LIBS) $(PYTHON_LIBS)
AM_LDFLAGS = \ AM_LDFLAGS = \
$(DUNE_LDFLAGS) \ $(DUNE_LDFLAGS) \
$(ALUGRID_LDFLAGS) \
$(PYTHON_LDFLAGS) $(PYTHON_LDFLAGS)
# don't follow the full GNU-standard # don't follow the full GNU-standard
......
#include <dune/common/fmatrix.hh> #include <dune/common/fmatrix.hh>
#include <dune/common/fvector.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> #include <dune/fufem/functionspacebases/p1nodalbasis.hh>
...@@ -10,7 +11,8 @@ typedef Dune::FieldMatrix<double, 2, 2> SmallMatrix2; ...@@ -10,7 +11,8 @@ typedef Dune::FieldMatrix<double, 2, 2> SmallMatrix2;
typedef Dune::BCRSMatrix<SmallMatrix2> OperatorType2; typedef Dune::BCRSMatrix<SmallMatrix2> OperatorType2;
typedef Dune::BlockVector<SmallVector2> VectorType2; 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 GridType2::LeafGridView GridView2;
typedef P1NodalBasis<GridView2, double> P1Basis2; typedef P1NodalBasis<GridView2, double> P1Basis2;
...@@ -41,7 +43,8 @@ typedef Dune::FieldMatrix<double, 3, 3> SmallMatrix3; ...@@ -41,7 +43,8 @@ typedef Dune::FieldMatrix<double, 3, 3> SmallMatrix3;
typedef Dune::BCRSMatrix<SmallMatrix3> OperatorType3; typedef Dune::BCRSMatrix<SmallMatrix3> OperatorType3;
typedef Dune::BlockVector<SmallVector3> VectorType3; 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 GridType3::LeafGridView GridView3;
typedef P1NodalBasis<GridView3, double> P1Basis3; typedef P1NodalBasis<GridView3, double> P1Basis3;
......
#include <dune/common/fmatrix.hh> #include <dune/common/fmatrix.hh>
#include <dune/common/fvector.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/bcrsmatrix.hh>
#include <dune/istl/bvector.hh> #include <dune/istl/bvector.hh>
...@@ -16,7 +17,8 @@ typedef Dune::BCRSMatrix<SmallMatrix2> OperatorType2; ...@@ -16,7 +17,8 @@ typedef Dune::BCRSMatrix<SmallMatrix2> OperatorType2;
typedef MyConvexProblem<OperatorType2, VectorType2> MyConvexProblemType2; typedef MyConvexProblem<OperatorType2, VectorType2> MyConvexProblemType2;
typedef MyBlockProblem<MyConvexProblemType2> MyBlockProblemType2; 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, template class MySolver<2, VectorType2, OperatorType2, GridType2,
MyBlockProblemType2>; MyBlockProblemType2>;
...@@ -31,7 +33,8 @@ typedef Dune::BCRSMatrix<SmallMatrix3> OperatorType3; ...@@ -31,7 +33,8 @@ typedef Dune::BCRSMatrix<SmallMatrix3> OperatorType3;
typedef MyConvexProblem<OperatorType3, VectorType3> MyConvexProblemType3; typedef MyConvexProblem<OperatorType3, VectorType3> MyConvexProblemType3;
typedef MyBlockProblem<MyConvexProblemType3> MyBlockProblemType3; 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, template class MySolver<3, VectorType3, OperatorType3, GridType3,
MyBlockProblemType3>; MyBlockProblemType3>;
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
#error Python is required #error Python is required
#endif #endif
#if !HAVE_ALUGRID
#error ALUGRID is required
#endif
#include <exception> #include <exception>
#include <iostream> #include <iostream>
...@@ -32,7 +36,11 @@ ...@@ -32,7 +36,11 @@
#include <dune/common/parametertreeparser.hh> #include <dune/common/parametertreeparser.hh>
#include <dune/common/shared_ptr.hh> #include <dune/common/shared_ptr.hh>
#include <dune/common/timer.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/common/mcmgmapper.hh>
#include <dune/grid/utility/structuredgridfactory.hh>
#include <dune/grid/yaspgrid.hh> #include <dune/grid/yaspgrid.hh>
#include <dune/istl/bcrsmatrix.hh> #include <dune/istl/bcrsmatrix.hh>
#include <dune/istl/bvector.hh> #include <dune/istl/bvector.hh>
...@@ -135,14 +143,14 @@ int main(int argc, char *argv[]) { ...@@ -135,14 +143,14 @@ int main(int argc, char *argv[]) {
verbose ? Solver::FULL : Solver::QUIET; verbose ? Solver::FULL : Solver::QUIET;
// {{{ Set up grid // {{{ Set up grid
typedef Dune::YaspGrid<dim> GridType; typedef Dune::ALUSimplexGrid<dim, dim> GridType;
Dune::FieldVector<double, dim> const end_points( Dune::FieldVector<typename GridType::ctype, dim> lowerLeft(0);
1); // nth dimension (zero-indexed) goes from 0 to end_points[n] Dune::FieldVector<typename GridType::ctype, dim> upperRight(1);
auto grid = Dune::make_shared<GridType>( Dune::array<unsigned int, dim> elements;
end_points, std::fill(elements.begin(), elements.end(), 1);
Dune::FieldVector<int, dim>(1), // number of elements in each direction auto grid = Dune::StructuredGridFactory<GridType>::createSimplexGrid(
Dune::FieldVector<bool, dim>(false), // non-periodic in each direction lowerLeft, upperRight, elements);
0); // zero overlap (whatever that is)
grid->globalRefine(refinements); grid->globalRefine(refinements);
size_t const finestSize = grid->size(grid->maxLevel(), dim); size_t const finestSize = grid->size(grid->maxLevel(), dim);
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
#include <dune/common/fmatrix.hh> #include <dune/common/fmatrix.hh>
#include <dune/common/fvector.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/istl/bvector.hh>
#include <dune/fufem/functionspacebases/p0basis.hh> #include <dune/fufem/functionspacebases/p0basis.hh>
...@@ -15,7 +16,8 @@ typedef Dune::FieldVector<double, 2> SmallVector2; ...@@ -15,7 +16,8 @@ typedef Dune::FieldVector<double, 2> SmallVector2;
typedef Dune::FieldMatrix<double, 2, 2> SmallMatrix2; typedef Dune::FieldMatrix<double, 2, 2> SmallMatrix2;
typedef Dune::BlockVector<SmallVector2> VectorType2; 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 GridType2::LeafGridView GridView2;
typedef P1NodalBasis<GridView2, double> P1Basis2; typedef P1NodalBasis<GridView2, double> P1Basis2;
typedef P0Basis<GridView2, double> P0Basis2; typedef P0Basis<GridView2, double> P0Basis2;
...@@ -33,7 +35,8 @@ typedef Dune::FieldVector<double, 3> SmallVector3; ...@@ -33,7 +35,8 @@ typedef Dune::FieldVector<double, 3> SmallVector3;
typedef Dune::FieldMatrix<double, 3, 3> SmallMatrix3; typedef Dune::FieldMatrix<double, 3, 3> SmallMatrix3;
typedef Dune::BlockVector<SmallVector3> VectorType3; 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 GridType3::LeafGridView GridView3;
typedef P1NodalBasis<GridView3, double> P1Basis3; typedef P1NodalBasis<GridView3, double> P1Basis3;
typedef P0Basis<GridView3, double> P0Basis3; typedef P0Basis<GridView3, double> P0Basis3;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment