// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- // vi: set et ts=4 sw=2 sts=2: #ifndef UNITCUBE_ALUGRID_HH #define UNITCUBE_ALUGRID_HH #include #include #include "unitcube.hh" #if HAVE_DUNE_ALUGRID #include #include // ALU3dGrid and ALU2dGrid simplex specialization. // Note: element type determined by type template class UnitCube,1> { public: typedef Dune::ALUGrid GridType; private: std::shared_ptr grid_; public: UnitCube () { Dune::FieldVector lowerLeft(0); Dune::FieldVector upperRight(1); std::array elements; std::fill(elements.begin(), elements.end(), 1); grid_ = Dune::StructuredGridFactory::createSimplexGrid(lowerLeft, upperRight, elements); } GridType &grid () { return *grid_; } }; // ALU3dGrid hexahedra specialization. Note: element type determined by type template<> class UnitCube,1> { public: typedef Dune::ALUGrid<3,3,Dune::cube,Dune::nonconforming> GridType; private: std::shared_ptr grid_; public: UnitCube () { Dune::FieldVector lowerLeft(0); Dune::FieldVector upperRight(1); std::array elements = { {1,1,1} }; grid_ = Dune::StructuredGridFactory::createCubeGrid(lowerLeft, upperRight, elements); } GridType &grid () { return *grid_; } }; #endif // HAVE_DUNE_ALUGRID #endif // UNITCUBE_ALUGRID_HH