Dune-Fufem 2.11-git
Loading...
Searching...
No Matches
Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct > Class Template Reference

A discrete coordinate function for Dune::GeometryGrid. More...

#include <dune/fufem/functions/deformationfunction.hh>

Inheritance diagram for Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >:
Inheritance graph

Public Types

using HostGrid = HG
 
using Domain = typename HostGrid::template Codim< dim >::Geometry::GlobalCoordinate
 
using ctype = ct
 
using Range = Dune::FieldVector< ct, deformedDim >
 
using Basis = Dune::Functions::DefaultGlobalBasis< PreBasis >
 
using CoefficientVector = Dune::BlockVector< Range >
 
typedef Base::RangeVector RangeVector
 
typedef This Interface
 
typedef Impl Implementation
 

Public Member Functions

 DeformationFunction (const HostGrid &hostGrid, Dune::index_constant< deformedDim > deformedDimConstant={})
 Create a deformation function on given HostGrid.
 
template<class F >
 DeformationFunction (const HostGrid &hostGrid, const F &f, Dune::index_constant< deformedDim > deformedDimConstant={})
 Create a deformation function on given HostGrid from given function.
 
virtual ~DeformationFunction ()
 
virtual void evaluate (const typename HostGrid::template Codim< 0 >::Entity &entity, unsigned int corner, Range &y) const
 Evaluate function at a host vertex (corner param is redundant but prescribed by the interface...)
 
virtual void evaluate (const typename HostGrid::template Codim< dim >::Entity &entity, unsigned int corner, Range &y) const
 Evaluate function at a corner of a host element.
 
void adapt ()
 Adapt to changes in the host grid.
 
const Basisbasis () const
 Access basis for deformation function.
 
CoefficientVectorcoefficients ()
 Mutable access to coefficient vector.
 
const CoefficientVectorcoefficients () const
 Const access to coefficient vector.
 
template<class F >
void interpolate (const F &f)
 Reset the deformation to the interpolate of the given function.
 
void evaluate (const HostEntity &hostEntity, unsigned int corner, RangeVector &y) const
 

Static Public Attributes

static const unsigned int dimRange
 

Protected Member Functions

void setupLeafIndices ()
 
const ImplementationasImp () const
 
ImplementationasImp ()
 

Protected Attributes

std::vector< std::vector< std::size_t > > leafIndices_
 
const HostGridhostGrid_
 
Basis basis_
 
CoefficientVector coefficients_
 

Detailed Description

template<class HG, std::size_t deformedDim, class ct = double>
class Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >

A discrete coordinate function for Dune::GeometryGrid.

This class implements the interface of a Dune::DiscreteCoordFunction which can be used as coordinate function for a Dune::GeometryGrid.

Template Parameters
HGType of the grid that should be deformed
deformedDimWorld dimension of the defomed grid
ctGlobal coordinate type of the defomed grid

Member Typedef Documentation

◆ Basis

template<class HG , std::size_t deformedDim, class ct = double>
using Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::Basis = Dune::Functions::DefaultGlobalBasis<PreBasis>

◆ CoefficientVector

template<class HG , std::size_t deformedDim, class ct = double>
using Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::CoefficientVector = Dune::BlockVector<Range>

◆ ctype

template<class HG , std::size_t deformedDim, class ct = double>
using Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::ctype = ct

◆ Domain

template<class HG , std::size_t deformedDim, class ct = double>
using Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::Domain = typename HostGrid::template Codim<dim>::Geometry::GlobalCoordinate

◆ HostGrid

template<class HG , std::size_t deformedDim, class ct = double>
using Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::HostGrid = HG

◆ Range

template<class HG , std::size_t deformedDim, class ct = double>
using Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::Range = Dune::FieldVector<ct, deformedDim>

Constructor & Destructor Documentation

◆ DeformationFunction() [1/2]

template<class HG , std::size_t deformedDim, class ct = double>
Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::DeformationFunction ( const HostGrid hostGrid,
Dune::index_constant< deformedDim >  deformedDimConstant = {} 
)
inline

Create a deformation function on given HostGrid.

Parameters
hostGridThe underlying HostGrid that should be deformed

◆ DeformationFunction() [2/2]

template<class HG , std::size_t deformedDim, class ct = double>
template<class F >
Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::DeformationFunction ( const HostGrid hostGrid,
const F &  f,
Dune::index_constant< deformedDim >  deformedDimConstant = {} 
)
inline

Create a deformation function on given HostGrid from given function.

Parameters
hostGridThe underlying HostGrid that should be deformed
fThe function to interpolate

◆ ~DeformationFunction()

template<class HG , std::size_t deformedDim, class ct = double>
virtual Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::~DeformationFunction ( )
inlinevirtual

Member Function Documentation

◆ adapt()

template<class HG , std::size_t deformedDim, class ct = double>
void Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::adapt ( )
inline

Adapt to changes in the host grid.

◆ basis()

template<class HG , std::size_t deformedDim, class ct = double>
const Basis & Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::basis ( ) const
inline

Access basis for deformation function.

The deformation is a function from the space spanned by this basis.

◆ coefficients() [1/2]

template<class HG , std::size_t deformedDim, class ct = double>
CoefficientVector & Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::coefficients ( )
inline

Mutable access to coefficient vector.

This provides access to the coefficient vector storing the coefficient of the deformation function with respect to the basis.

◆ coefficients() [2/2]

template<class HG , std::size_t deformedDim, class ct = double>
const CoefficientVector & Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::coefficients ( ) const
inline

Const access to coefficient vector.

This provides access to the coefficient vector storing the coefficient of the deformation function with respect to the basis.

◆ evaluate() [1/2]

template<class HG , std::size_t deformedDim, class ct = double>
virtual void Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::evaluate ( const typename HostGrid::template Codim< 0 >::Entity entity,
unsigned int  corner,
Range y 
) const
inlinevirtual

Evaluate function at a host vertex (corner param is redundant but prescribed by the interface...)

◆ evaluate() [2/2]

template<class HG , std::size_t deformedDim, class ct = double>
virtual void Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::evaluate ( const typename HostGrid::template Codim< dim >::Entity entity,
unsigned int  corner,
Range y 
) const
inlinevirtual

Evaluate function at a corner of a host element.

◆ interpolate()

template<class HG , std::size_t deformedDim, class ct = double>
template<class F >
void Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::interpolate ( const F &  f)
inline

Reset the deformation to the interpolate of the given function.

Parameters
fThe function to interpolate

This method will interpolate the given function with respect to the basis and store the respective coefficient vector. Hence the given function should be defined on the LeafGridView of the HostGrid and have the range type Range.

◆ setupLeafIndices()

template<class HG , std::size_t deformedDim, class ct = double>
void Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::setupLeafIndices ( )
inlineprotected

Member Data Documentation

◆ basis_

template<class HG , std::size_t deformedDim, class ct = double>
Basis Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::basis_
protected

◆ coefficients_

template<class HG , std::size_t deformedDim, class ct = double>
CoefficientVector Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::coefficients_
protected

◆ hostGrid_

template<class HG , std::size_t deformedDim, class ct = double>
const HostGrid* Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::hostGrid_
protected

◆ leafIndices_

template<class HG , std::size_t deformedDim, class ct = double>
std::vector<std::vector<std::size_t> > Dune::Fufem::Experimental::DeformationFunction< HG, deformedDim, ct >::leafIndices_
protected

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