version 0.4.1
Ikarus::ResultFunction< AS, RT, UserFunction > Class Template Reference

Wrapper to evaluate results for a vtkwriter. More...

#include <ikarus/io/resultfunction.hh>

Inheritance diagram for Ikarus::ResultFunction< AS, RT, UserFunction >:
[legend]

Public Types

using Assembler = AS
 
using GridView = typename Assembler::GridView
 
using FERequirementType = typename Assembler::FERequirement
 
using FEContainer = typename Assembler::FEContainer
 
using FiniteElement = typename std::remove_cvref_t< FEContainer >::value_type
 
using ctype = typename GridView::ctype
 
using Entity = typename GridView::template Codim< 0 >::Entity
 

Public Member Functions

double evaluate (int comp, const Entity &e, const Dune::FieldVector< ctype, griddim > &local) const override
 Evaluate the component at a given entity and local coordinates. More...
 
int ncomps () const override
 Get the number of components. More...
 
constexpr std::string name () const override
 Get the name of the result type. More...
 
Dune::VTK::Precision precision () const override
 Get the precision used for this result. More...
 
 ResultFunction (std::shared_ptr< Assembler > assembler, Dune::VTK::Precision prec=Dune::VTK::Precision::float64)
 Constructor for ResultFunction. More...
 

Static Public Attributes

static constexpr int griddim = GridView::dimension
 

Detailed Description

template<typename AS, template< typename, int, int > class RT, typename UserFunction = Impl::DefaultUserFunction>
requires (Concepts::FlatAssembler<AS> and Concepts::ResultType<RT>)
class Ikarus::ResultFunction< AS, RT, UserFunction >

Usage:

// Usage with Dune::Vtk::VtkWriter
auto resultFunction = Ikarus::makeResultVtkFunction<resType>(assembler);
vtkwriter.addPointData(resultFunction);
// Usage with the native Dune::VTKWriter
auto resultFunction = Ikarus::makeResultFunction<resType>(assembler);
vtkWriter.addVertexData(resultFunction);
def vtkWriter(assembler, DataCollector dataCollector=DataCollector.default, int order=1, dataFormat=FormatTypes.binary, datatype=DataTypes.Float32, headertype=DataTypes.UInt32)
Definition: io/__init__.py:37
Template Parameters
ASunderlying assembler (provides the finite elements and the requested results)
RTrequested result type
UserFunctionType of the user-defined function for custom result evaluation (default is DefaultUserFunction)

Member Typedef Documentation

◆ Assembler

template<typename AS , template< typename, int, int > class RT, typename UserFunction = Impl::DefaultUserFunction>
using Ikarus::ResultFunction< AS, RT, UserFunction >::Assembler = AS

◆ ctype

template<typename AS , template< typename, int, int > class RT, typename UserFunction = Impl::DefaultUserFunction>
using Ikarus::ResultFunction< AS, RT, UserFunction >::ctype = typename GridView::ctype

◆ Entity

template<typename AS , template< typename, int, int > class RT, typename UserFunction = Impl::DefaultUserFunction>
using Ikarus::ResultFunction< AS, RT, UserFunction >::Entity = typename GridView::template Codim<0>::Entity

◆ FEContainer

template<typename AS , template< typename, int, int > class RT, typename UserFunction = Impl::DefaultUserFunction>
using Ikarus::ResultFunction< AS, RT, UserFunction >::FEContainer = typename Assembler::FEContainer

◆ FERequirementType

template<typename AS , template< typename, int, int > class RT, typename UserFunction = Impl::DefaultUserFunction>
using Ikarus::ResultFunction< AS, RT, UserFunction >::FERequirementType = typename Assembler::FERequirement

◆ FiniteElement

template<typename AS , template< typename, int, int > class RT, typename UserFunction = Impl::DefaultUserFunction>
using Ikarus::ResultFunction< AS, RT, UserFunction >::FiniteElement = typename std::remove_cvref_t<FEContainer>::value_type

◆ GridView

template<typename AS , template< typename, int, int > class RT, typename UserFunction = Impl::DefaultUserFunction>
using Ikarus::ResultFunction< AS, RT, UserFunction >::GridView = typename Assembler::GridView

Constructor & Destructor Documentation

◆ ResultFunction()

template<typename AS , template< typename, int, int > class RT, typename UserFunction = Impl::DefaultUserFunction>
Ikarus::ResultFunction< AS, RT, UserFunction >::ResultFunction ( std::shared_ptr< Assembler assembler,
Dune::VTK::Precision  prec = Dune::VTK::Precision::float64 
)
inline

Constructs a ResultFunction object with given finite elements, ferequirements

Parameters
assemblershared pointer to the underlying assembler (provides the finite elements and the requested results)
prec(optional) specify the used precision (only has an effect when using resultfunciton with Dune::VTK::VTKWriter)

Member Function Documentation

◆ evaluate()

template<typename AS , template< typename, int, int > class RT, typename UserFunction = Impl::DefaultUserFunction>
double Ikarus::ResultFunction< AS, RT, UserFunction >::evaluate ( int  comp,
const Entity e,
const Dune::FieldVector< ctype, griddim > &  local 
) const
inlineoverride

This function is required by the Dune::VTKFunction interface.

Parameters
compStress component index
eEntity on which to evaluate the stress
localLocal coordinates within the entity
Returns
Stress component value

◆ name()

template<typename AS , template< typename, int, int > class RT, typename UserFunction = Impl::DefaultUserFunction>
constexpr std::string Ikarus::ResultFunction< AS, RT, UserFunction >::name ( ) const
inlineconstexproverride

This function is required by the Dune::VTKFunction interface.

Returns
String representing the name of the result type

◆ ncomps()

template<typename AS , template< typename, int, int > class RT, typename UserFunction = Impl::DefaultUserFunction>
int Ikarus::ResultFunction< AS, RT, UserFunction >::ncomps ( ) const
inlineoverride

This function is required by the Dune::VTKFunction interface.

Returns
Number of stress components

◆ precision()

template<typename AS , template< typename, int, int > class RT, typename UserFunction = Impl::DefaultUserFunction>
Dune::VTK::Precision Ikarus::ResultFunction< AS, RT, UserFunction >::precision ( ) const
inlineoverride

This function is part of the Dune::VTKFunction interface. This has no affect when the ResultFunction is used as part of a the dune-vtk module

Returns
Precision (i.e. float64 or float32)

Member Data Documentation

◆ griddim

template<typename AS , template< typename, int, int > class RT, typename UserFunction = Impl::DefaultUserFunction>
constexpr int Ikarus::ResultFunction< AS, RT, UserFunction >::griddim = GridView::dimension
staticconstexpr

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