dune-grid 2.9.0
Static Public Member Functions | Protected Types | Static Protected Member Functions | List of all members
Dune::StructuredGridFactory< AlbertaGrid< dim, dimworld > > Class Template Reference

specialization of the generic StructuredGridFactory for AlbertaGrid More...

#include <dune/grid/albertagrid/structuredgridfactory.hh>

Static Public Member Functions

static void createSimplexGrid (GridFactory< GridType > &factory, const FieldVector< ctype, dimworld > &lowerLeft, const FieldVector< ctype, dimworld > &upperRight, const std::array< unsigned int, dim > &elements)
 Create a structured simplex grid for AlbertaGrid. More...
 
static std::unique_ptr< GridTypecreateSimplexGrid (const FieldVector< ctype, dimworld > &lowerLeft, const FieldVector< ctype, dimworld > &upperRight, const std::array< unsigned int, dim > &elements)
 Create a structured simplex grid for AlbertaGrid. More...
 
static void createCubeGrid (GridFactory< GridType > &factory, const FieldVector< ctype, dimworld > &lowerLeft, const FieldVector< ctype, dimworld > &upperRight, const std::array< unsigned int, dim > &elements)
 
static std::unique_ptr< GridTypecreateCubeGrid (const FieldVector< ctype, dimworld > &lowerLeft, const FieldVector< ctype, dimworld > &upperRight, const std::array< unsigned int, dim > &elements)
 

Protected Types

using ctype = typename GridType::ctype
 

Static Protected Member Functions

static void insertElement (GridFactory< GridType > &factory, const GeometryType &type, const std::vector< unsigned int > &vertices)
 
static void insertVertices (GridFactory< GridType > &factory, const FieldVector< ctype, dimworld > &lowerLeft, const FieldVector< ctype, dimworld > &upperRight, const std::array< unsigned int, dim > &vertices)
 
static std::array< unsigned int, dim > computeUnitOffsets (const std::array< unsigned int, dim > &vertices)
 

Detailed Description

template<int dim, int dimworld>
class Dune::StructuredGridFactory< AlbertaGrid< dim, dimworld > >

specialization of the generic StructuredGridFactory for AlbertaGrid

The simplex grid generated by the default StructuredGridFactory is not compatible with the Alberta vertex numbering. This might lead to infinite recursions when refining such grid. This specialization of the StructuredGridFactory solves this issue by

  1. generating a structured cube grid
  2. subdividing each cube into 2 (2d) or 6 (3d) simplices following a compatible numbering scheme for AlbertaGrid.

Member Typedef Documentation

◆ ctype

template<int dim, int dimworld>
using Dune::StructuredGridFactory< AlbertaGrid< dim, dimworld > >::ctype = typename GridType::ctype
protected

Member Function Documentation

◆ computeUnitOffsets()

template<int dim, int dimworld>
static std::array< unsigned int, dim > Dune::StructuredGridFactory< AlbertaGrid< dim, dimworld > >::computeUnitOffsets ( const std::array< unsigned int, dim > &  vertices)
inlinestaticprotected

◆ createCubeGrid() [1/2]

template<int dim, int dimworld>
static std::unique_ptr< GridType > Dune::StructuredGridFactory< AlbertaGrid< dim, dimworld > >::createCubeGrid ( const FieldVector< ctype, dimworld > &  lowerLeft,
const FieldVector< ctype, dimworld > &  upperRight,
const std::array< unsigned int, dim > &  elements 
)
inlinestatic

◆ createCubeGrid() [2/2]

template<int dim, int dimworld>
static void Dune::StructuredGridFactory< AlbertaGrid< dim, dimworld > >::createCubeGrid ( GridFactory< GridType > &  factory,
const FieldVector< ctype, dimworld > &  lowerLeft,
const FieldVector< ctype, dimworld > &  upperRight,
const std::array< unsigned int, dim > &  elements 
)
inlinestatic

◆ createSimplexGrid() [1/2]

template<int dim, int dimworld>
static std::unique_ptr< GridType > Dune::StructuredGridFactory< AlbertaGrid< dim, dimworld > >::createSimplexGrid ( const FieldVector< ctype, dimworld > &  lowerLeft,
const FieldVector< ctype, dimworld > &  upperRight,
const std::array< unsigned int, dim > &  elements 
)
inlinestatic

Create a structured simplex grid for AlbertaGrid.

This works in dimensions 1-3. Each cube is split into into dim! simplices by constructing macro triangulation, see insertElement for the local simplex numbering.

Parameters
lowerLeftLower left corner of the grid
upperRightUpper right corner of the grid
elementsNumber of elements in each coordinate direction

◆ createSimplexGrid() [2/2]

template<int dim, int dimworld>
static void Dune::StructuredGridFactory< AlbertaGrid< dim, dimworld > >::createSimplexGrid ( GridFactory< GridType > &  factory,
const FieldVector< ctype, dimworld > &  lowerLeft,
const FieldVector< ctype, dimworld > &  upperRight,
const std::array< unsigned int, dim > &  elements 
)
inlinestatic

Create a structured simplex grid for AlbertaGrid.

This works in dimensions 1-3. Each cube is split into into dim! simplices by constructing macro triangulation, see insertElement for the local simplex numbering.

Parameters
factoryGrid factory used for creating the grid
lowerLeftLower left corner of the grid
upperRightUpper right corner of the grid
elementsNumber of elements in each coordinate direction

◆ insertElement()

template<int dim, int dimworld>
static void Dune::StructuredGridFactory< AlbertaGrid< dim, dimworld > >::insertElement ( GridFactory< GridType > &  factory,
const GeometryType &  type,
const std::vector< unsigned int > &  vertices 
)
inlinestaticprotected

◆ insertVertices()

template<int dim, int dimworld>
static void Dune::StructuredGridFactory< AlbertaGrid< dim, dimworld > >::insertVertices ( GridFactory< GridType > &  factory,
const FieldVector< ctype, dimworld > &  lowerLeft,
const FieldVector< ctype, dimworld > &  upperRight,
const std::array< unsigned int, dim > &  vertices 
)
inlinestaticprotected

The documentation for this class was generated from the following file: