dune-pdelab  2.5-dev
Public Types | Public Member Functions | List of all members
Dune::PDELab::gfs::GridFunctionSubSpace< GFS, TreePath > Class Template Reference

Non-nesting implementation of GridFunctionSubSpace. More...

#include <dune/pdelab/gridfunctionspace/subspace.hh>

Public Types

typedef GFS BaseGridFunctionSpace
 The base GridFunctionSpace that this GridFunctionSubSpace is based on. More...
 
using ChildGridFunctionSpace = TypeTree::ChildForTreePath< GFS, TreePath >
 The type of the original GridFunctionSpace that is the root of this GridFunctionSpace. More...
 
typedef ChildGridFunctionSpace::Traits Traits
 Re-exported Traits from the original GridFunctionSpace. More...
 
typedef GridFunctionSubSpaceTag< TypeTree::ImplementationTag< ChildGridFunctionSpace > > ImplementationTag
 Our ImplementationTag is derived from the tag of the original GridFunctionSpace. More...
 

Public Member Functions

 GridFunctionSubSpace (std::shared_ptr< const GFS > gfs_storage)
 Construct a GridFunctionSubSpace from the storage object of a root space. More...
 
 GridFunctionSubSpace (const GFS &gfs)
 Construct a GridFunctionSubSpace from a root space. More...
 
template<typename TP >
 GridFunctionSubSpace (std::shared_ptr< const GridFunctionSubSpace< GFS, TP > > gfs_storage, typename std::enable_if<!std::is_same< TP, TreePath >::value, void * >::type=nullptr)
 Construct a GridFunctionSubSpace from the storage of another GridFunctionSubSpace. More...
 
template<typename TP >
 GridFunctionSubSpace (const GridFunctionSubSpace< GFS, TP > &gfs, typename std::enable_if<!std::is_same< TP, TreePath >::value, void * >::type=nullptr)
 Construct a GridFunctionSubSpace from another GridFunctionSubSpace. More...
 
const BaseGridFunctionSpacebaseGridFunctionSpace () const
 Returns the root GridFunctionSpace that this subspace view is based on. More...
 
std::shared_ptr< const BaseGridFunctionSpacebaseGridFunctionSpaceStorage () const
 Returns the storage object of the root GridFunctionSpace that this subspace view is based on. More...
 
const ChildGridFunctionSpacechildGridFunctionSpace () const
 Returns the original GridFunctionSpace that we provide a view for. More...
 
std::shared_ptr< const ChildGridFunctionSpacechildGridFunctionSpaceStorage () const
 Returns the storage object of the original GridFunctionSpace that we provide a view for. More...
 
std::string name () const
 
void name (const std::string &name)
 

Detailed Description

template<typename GFS, typename TreePath>
class Dune::PDELab::gfs::GridFunctionSubSpace< GFS, TreePath >

Non-nesting implementation of GridFunctionSubSpace.

This is the actual implementation of GridFunctionSubSpace. It is based around the idea of performing the mapping from the subspace to the rootspace in a single step using a SubOrdering. As SubOrderings cannot be nested, this class needs some helper functionality that constructs a new GridFunctionSubSpace directly on top of the underlying root GridFunctionSpace if the user attempts to nest GridFunctionSubSpaces. On the other hand, this implementation should render such usage mostly unnecessary, as it is now possible to directly construct a subspace for a given leaf space. If the compiler has support for template aliases, the de-nesting infrastructure will be able to completely remove all traces of nesting, letting the type obtained by nesting two GridFunctionSubSpaces look exactly like the type obtained by constructing a single GridFunctionSubSpace. Alternatively, without template aliases, it is only possible to have the actual implementation be non-nested. In this case, the Dune::PDELab::GridFunctionSubSpace classes will still nest.

Note
This class should always be used as Dune::PDELab::GridFunctionSubSpace. Never attempt to directly use the class Dune::PDELab::gfs::GridFunctionSubSpace!
Template Parameters
GFSThe root GridFunctionSpace.
TreePathPath from the root GridFunctionSpace to the represented subspace.

Member Typedef Documentation

◆ BaseGridFunctionSpace

template<typename GFS , typename TreePath >
typedef GFS Dune::PDELab::gfs::GridFunctionSubSpace< GFS, TreePath >::BaseGridFunctionSpace

The base GridFunctionSpace that this GridFunctionSubSpace is based on.

◆ ChildGridFunctionSpace

template<typename GFS , typename TreePath >
using Dune::PDELab::gfs::GridFunctionSubSpace< GFS, TreePath >::ChildGridFunctionSpace = TypeTree::ChildForTreePath<GFS,TreePath>

The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.

◆ ImplementationTag

template<typename GFS , typename TreePath >
typedef GridFunctionSubSpaceTag< TypeTree::ImplementationTag<ChildGridFunctionSpace> > Dune::PDELab::gfs::GridFunctionSubSpace< GFS, TreePath >::ImplementationTag

Our ImplementationTag is derived from the tag of the original GridFunctionSpace.

◆ Traits

template<typename GFS , typename TreePath >
typedef ChildGridFunctionSpace::Traits Dune::PDELab::gfs::GridFunctionSubSpace< GFS, TreePath >::Traits

Re-exported Traits from the original GridFunctionSpace.

Constructor & Destructor Documentation

◆ GridFunctionSubSpace() [1/4]

template<typename GFS , typename TreePath >
Dune::PDELab::gfs::GridFunctionSubSpace< GFS, TreePath >::GridFunctionSubSpace ( std::shared_ptr< const GFS >  gfs_storage)
inlineexplicit

Construct a GridFunctionSubSpace from the storage object of a root space.

◆ GridFunctionSubSpace() [2/4]

template<typename GFS , typename TreePath >
Dune::PDELab::gfs::GridFunctionSubSpace< GFS, TreePath >::GridFunctionSubSpace ( const GFS &  gfs)
inlineexplicit

Construct a GridFunctionSubSpace from a root space.

◆ GridFunctionSubSpace() [3/4]

template<typename GFS , typename TreePath >
template<typename TP >
Dune::PDELab::gfs::GridFunctionSubSpace< GFS, TreePath >::GridFunctionSubSpace ( std::shared_ptr< const GridFunctionSubSpace< GFS, TP > >  gfs_storage,
typename std::enable_if<!std::is_same< TP, TreePath >::value, void * >::type  = nullptr 
)
inlineexplicit

Construct a GridFunctionSubSpace from the storage of another GridFunctionSubSpace.

This constructor is used to implement the non-nesting behavior by extracting the original root space from the GridFunctionSubSpace and using that space for initialization. In order to work correctly, this relies on a support wrapper that correctly sets up the TreePath for the new space.

Note
The second parameter is a little SFINAE helper that removes the constructor from the overload set if the two spaces are identical to avoid masking the standard copy constructor.

◆ GridFunctionSubSpace() [4/4]

template<typename GFS , typename TreePath >
template<typename TP >
Dune::PDELab::gfs::GridFunctionSubSpace< GFS, TreePath >::GridFunctionSubSpace ( const GridFunctionSubSpace< GFS, TP > &  gfs,
typename std::enable_if<!std::is_same< TP, TreePath >::value, void * >::type  = nullptr 
)
inlineexplicit

Construct a GridFunctionSubSpace from another GridFunctionSubSpace.

This constructor is used to implement the non-nesting behavior by extracting the original root space from the GridFunctionSubSpace and using that space for initialization. In order to work correctly, this relies on a support wrapper that correctly sets up the TreePath for the new space.

Note
The second parameter is a little SFINAE helper that removes the constructor from the overload set if the two spaces are identical to avoid masking the standard copy constructor.

Member Function Documentation

◆ baseGridFunctionSpace()

template<typename GFS , typename TreePath >
const BaseGridFunctionSpace& Dune::PDELab::gfs::GridFunctionSubSpace< GFS, TreePath >::baseGridFunctionSpace ( ) const
inline

Returns the root GridFunctionSpace that this subspace view is based on.

◆ baseGridFunctionSpaceStorage()

template<typename GFS , typename TreePath >
std::shared_ptr<const BaseGridFunctionSpace> Dune::PDELab::gfs::GridFunctionSubSpace< GFS, TreePath >::baseGridFunctionSpaceStorage ( ) const
inline

Returns the storage object of the root GridFunctionSpace that this subspace view is based on.

◆ childGridFunctionSpace()

template<typename GFS , typename TreePath >
const ChildGridFunctionSpace& Dune::PDELab::gfs::GridFunctionSubSpace< GFS, TreePath >::childGridFunctionSpace ( ) const
inline

Returns the original GridFunctionSpace that we provide a view for.

Warning
Users should think at least twice before using this object in their code, as it will usually not do what they want! Due to the way GridFunctionSpaces are constructed, it is not aware of the overall structure of the space!

◆ childGridFunctionSpaceStorage()

template<typename GFS , typename TreePath >
std::shared_ptr<const ChildGridFunctionSpace> Dune::PDELab::gfs::GridFunctionSubSpace< GFS, TreePath >::childGridFunctionSpaceStorage ( ) const
inline

Returns the storage object of the original GridFunctionSpace that we provide a view for.

Warning
Users should think at least twice before using this object in their code, as it will usually not do what they want! Due to the way GridFunctionSpaces are constructed, it is not aware of the overall structure of the space!

◆ name() [1/2]

template<typename GFS , typename TreePath >
std::string Dune::PDELab::gfs::GridFunctionSubSpace< GFS, TreePath >::name ( ) const
inline

◆ name() [2/2]

template<typename GFS , typename TreePath >
void Dune::PDELab::gfs::GridFunctionSubSpace< GFS, TreePath >::name ( const std::string &  name)
inline

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