version 0.4
Ikarus::ResultFunction< ElementType_, UserFunction > Class Template Reference

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

#include <ikarus/io/resultfunction.hh>

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

Public Types

using ElementType = ElementType_
 
using ResultRequirements = typename ElementType::ResultRequirementsType
 
using GridView = typename ElementType::GridView
 
using ctype = typename GridView::ctype
 
typedef GridView::template Codim< 0 >::Entity 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...
 
 ResultFunction (std::vector< ElementType > *fes, const ResultRequirements &req, UserFunction userFunction={})
 Constructor for ResultFunction. More...
 

Static Public Attributes

static constexpr int griddim = GridView::dimension
 

Detailed Description

template<typename ElementType_, typename UserFunction = Impl::DefaultUserFunction>
class Ikarus::ResultFunction< ElementType_, UserFunction >

Usage:

auto resultFunction = std::make_shared<ResultFunction<ElementType>>(&fes, resReq);
vtkWriter.addPointData(Dune::Vtk::Function<GridView>( resultFunction));
// or with Dunes native Vtk
vtkWriter.addVertexData(resultFunction);
Class representing the requirements for obtaining specific results.
Definition: ferequirements.hh:405
ResultRequirements & addResultRequest(ResultTypes &&... keys)
Add one or more result types to the set of requested results.
Definition: ferequirements.hh:501
ResultRequirements & insertParameter(FEParameter &&key, ParameterTypeRaw &val)
Insert a parameter into the finite element requirements.
Definition: ferequirements.hh:472
ResultRequirements & insertGlobalSolution(FESolutions &&key, SolutionVectorTypeRaw &sol)
Insert a global solution into the finite element requirements.
Definition: ferequirements.hh:486
Template Parameters
ElementType_Type of the finite element
UserFunctionType of the user-defined function for custom result evaluation (default is DefaultUserFunction)

Member Typedef Documentation

◆ ctype

template<typename ElementType_ , typename UserFunction = Impl::DefaultUserFunction>
using Ikarus::ResultFunction< ElementType_, UserFunction >::ctype = typename GridView::ctype

◆ ElementType

template<typename ElementType_ , typename UserFunction = Impl::DefaultUserFunction>
using Ikarus::ResultFunction< ElementType_, UserFunction >::ElementType = ElementType_

◆ Entity

template<typename ElementType_ , typename UserFunction = Impl::DefaultUserFunction>
typedef GridView::template Codim<0>::Entity Ikarus::ResultFunction< ElementType_, UserFunction >::Entity

◆ GridView

template<typename ElementType_ , typename UserFunction = Impl::DefaultUserFunction>
using Ikarus::ResultFunction< ElementType_, UserFunction >::GridView = typename ElementType::GridView

◆ ResultRequirements

template<typename ElementType_ , typename UserFunction = Impl::DefaultUserFunction>
using Ikarus::ResultFunction< ElementType_, UserFunction >::ResultRequirements = typename ElementType::ResultRequirementsType

Constructor & Destructor Documentation

◆ ResultFunction()

template<typename ElementType_ , typename UserFunction = Impl::DefaultUserFunction>
Ikarus::ResultFunction< ElementType_, UserFunction >::ResultFunction ( std::vector< ElementType > *  fes,
const ResultRequirements req,
UserFunction  userFunction = {} 
)
inline

Constructs a ResultFunction object with given finite elements, result requirements, and an optional user function.

Parameters
fesPointer to a vector of finite elements
reqResult requirements for evaluation
userFunctionUser-defined function for custom result evaluation (default is DefaultUserFunction)

Member Function Documentation

◆ evaluate()

template<typename ElementType_ , typename UserFunction = Impl::DefaultUserFunction>
double Ikarus::ResultFunction< ElementType_, 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 ElementType_ , typename UserFunction = Impl::DefaultUserFunction>
constexpr std::string Ikarus::ResultFunction< ElementType_, 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 ElementType_ , typename UserFunction = Impl::DefaultUserFunction>
int Ikarus::ResultFunction< ElementType_, UserFunction >::ncomps ( ) const
inlineoverride

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

Returns
Number of stress components

Member Data Documentation

◆ griddim

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

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