Dune-Fufem 2.11-git
Loading...
Searching...
No Matches
Dune::Fufem::ElementData< GV, T > Class Template Reference

Class for storing data associated to elements. More...

#include <dune/fufem/grid/elementdata.hh>

Public Types

using GridView = GV
 
using Grid = typename GridView::Grid
 
using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper< GridView >
 
using Element = typename GridView::template Codim< 0 >::Entity
 

Public Member Functions

 ElementData (const std::vector< T > &coarseData, const GridView &gridView)
 Create ElementData.
 
 ElementData (const Dune::GmshReader< Grid > &reader, const Dune::GridFactory< Grid > &factory, const GridView &gridView)
 Create ElementData.
 
 ElementData (const Dune::GmshReader< Grid > &reader, const Dune::GridFactory< Grid > &factory, const Grid &grid)
 Create ElementData.
 
 ElementData (std::vector< T > &&coarseData, const GridView &gridView)
 Create ElementData.
 
void update (const GridView &gridView)
 Update after changes to the grid or GridView.
 
const T & operator() (const Element &element) const
 Map element to associated data.
 
const T & operator[] (std::size_t elementIndex) const
 Access data by consecutive element index.
 
std::size_t size () const
 Size of the container (number of elements in grid view)
 
const std::vector< T > & data () const
 Access raw container with stored data.
 
const std::vector< T > & coarseData () const
 Access raw container with stored level-0 coarse data.
 

Detailed Description

template<class GV, class T = int>
class Dune::Fufem::ElementData< GV, T >

Class for storing data associated to elements.

Template Parameters
GVGridView for access via element
TType of data associated to elements

This behaves like a random access container that associates data to elements from the grid view. The container is indexed using consecutive element indices as provided by a MultipleCodimMultipleGeomTypeMapper(gridView, mcmgElementLayout()). The class also provides a function interface mapping elements directly to the associated data.

This class is intended to be used to extract element data from a Dune::GmshReader in a persistent form.

Member Typedef Documentation

◆ Element

template<class GV , class T = int>
using Dune::Fufem::ElementData< GV, T >::Element = typename GridView::template Codim<0>::Entity

◆ Grid

template<class GV , class T = int>
using Dune::Fufem::ElementData< GV, T >::Grid = typename GridView::Grid

◆ GridView

template<class GV , class T = int>
using Dune::Fufem::ElementData< GV, T >::GridView = GV

◆ Mapper

template<class GV , class T = int>
using Dune::Fufem::ElementData< GV, T >::Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>

Constructor & Destructor Documentation

◆ ElementData() [1/4]

template<class GV , class T = int>
Dune::Fufem::ElementData< GV, T >::ElementData ( const std::vector< T > &  coarseData,
const GridView gridView 
)
inline

Create ElementData.

Parameters
coarseDataA raw vector with the respective level-0 data
gridViewGridView for which element data should be accessed

This constructor requires that the passed level-0 coarse data is indexed using the consecutive element indices provided by a MultipleCodimMultipleGeomTypeMapper(grid.levelGridView(0), mcmgElementLayout()). This will copy the passed data.

◆ ElementData() [2/4]

template<class GV , class T = int>
Dune::Fufem::ElementData< GV, T >::ElementData ( const Dune::GmshReader< Grid > &  reader,
const Dune::GridFactory< Grid > &  factory,
const GridView gridView 
)
inline

Create ElementData.

Parameters
readerA GmshReader to extract the element data from
factoryThe GridFactory used with the reader to translate insertion indices
gridViewGridView for which element data should be accessed

This constructor will extract the element data from the given GmshReader. To permute from the insertion order used by the reader to the order induced by the grid view indices, this additionally needs the factory that was used to create the grid.

◆ ElementData() [3/4]

template<class GV , class T = int>
Dune::Fufem::ElementData< GV, T >::ElementData ( const Dune::GmshReader< Grid > &  reader,
const Dune::GridFactory< Grid > &  factory,
const Grid grid 
)
inline

Create ElementData.

Parameters
readerA GmshReader to extract the element data from
factoryThe GridFactory used with the reader to translate insertion indices
gridGrid for which element data should be accessed

This constructor will extract the element data from the given GmshReader. To permute from the insertion order used by the reader to the order induced by the grid view indices, this additionally needs the factory that was used to create the grid. This constructor will associate the data to a grid.leafGridView() and is thus only available if the GridView type is Grid::LeafGridView.

◆ ElementData() [4/4]

template<class GV , class T = int>
Dune::Fufem::ElementData< GV, T >::ElementData ( std::vector< T > &&  coarseData,
const GridView gridView 
)
inline

Create ElementData.

Parameters
coarseDataA raw vector with the respective level-0 data
gridViewGridView for access via intersections.

This constructor requires that the passed level-0 coarse data is indexed using the consecutive element indices provided by a MultipleCodimMultipleGeomTypeMapper(grid.levelGridView(0), mcmgElementLayout()). This will move the passed data.

Member Function Documentation

◆ coarseData()

template<class GV , class T = int>
const std::vector< T > & Dune::Fufem::ElementData< GV, T >::coarseData ( ) const
inline

Access raw container with stored level-0 coarse data.

◆ data()

template<class GV , class T = int>
const std::vector< T > & Dune::Fufem::ElementData< GV, T >::data ( ) const
inline

Access raw container with stored data.

◆ operator()()

template<class GV , class T = int>
const T & Dune::Fufem::ElementData< GV, T >::operator() ( const Element element) const
inline

Map element to associated data.

◆ operator[]()

template<class GV , class T = int>
const T & Dune::Fufem::ElementData< GV, T >::operator[] ( std::size_t  elementIndex) const
inline

Access data by consecutive element index.

◆ size()

template<class GV , class T = int>
std::size_t Dune::Fufem::ElementData< GV, T >::size ( ) const
inline

Size of the container (number of elements in grid view)

◆ update()

template<class GV , class T = int>
void Dune::Fufem::ElementData< GV, T >::update ( const GridView gridView)
inline

Update after changes to the grid or GridView.

This will recompute the data on the given grid view from the stored level-0 coarse data using a hierarchic traversal of the grid.


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