version 0.4.2
Ikarus::ControlSubsamplingVertexVTKWriter< B > Class Template Reference

ControlSubsamplingVertexVTKWriter class for writing VTK files with subsampling based on control messages. More...

#include <ikarus/utils/listener/controlvtkwriter.hh>

Inheritance diagram for Ikarus::ControlSubsamplingVertexVTKWriter< B >:
[legend]

Public Types

using Token = std::shared_ptr< void >
 

Public Member Functions

 ControlSubsamplingVertexVTKWriter (const Basis &basis, int refinementLevels=0)
 Constructor for ControlSubsamplingVertexVTKWriter. More...
 
template<typename BC >
ControlSubsamplingVertexVTKWritersubscribeTo (BC &bc)
 
auto setFieldInfo (std::string &&name, Dune::VTK::FieldInfo::Type type, std::size_t size, Dune::VTK::Precision prec=Dune::VTK::Precision::float32)
 Set field information for the VTK file. More...
 
auto setFileNamePrefix (std::string &&name)
 Set the file name prefix for VTK files. More...
 
void update (ControlMessages message, const Concepts::ControlRoutineState auto &state)
 Implementation of the update method. More...
 
template<typename Broadcaster >
auto subscribe (Broadcaster &broadcaster, std::function< void(typename Broadcaster::MessageType, const typename Broadcaster::State &)> callback)
 Function to subscribe to a broadcaster with a given function (either a lambda, std::function or function pointer). More...
 
void unSubscribeAll ()
 Unsubscribe from all listeners. At the moment unsubscribing can't be done more granularly. More...
 
void unSubscribeLast ()
 Unsubscribe from the last subscribed listener. More...
 
void unSubscribe (const Token &token)
 Unsubscribe from a specific token. More...
 

Detailed Description

template<typename B>
class Ikarus::ControlSubsamplingVertexVTKWriter< B >

It inherits from the Listener class and is specifically designed for handling SOLUTION_CHANGED messages.

Template Parameters
BThe type of the grid basis.

Member Typedef Documentation

◆ Token

using Ikarus::Listener::Token = std::shared_ptr<void>
inherited

Constructor & Destructor Documentation

◆ ControlSubsamplingVertexVTKWriter()

template<typename B >
Ikarus::ControlSubsamplingVertexVTKWriter< B >::ControlSubsamplingVertexVTKWriter ( const Basis &  basis,
int  refinementLevels = 0 
)
inline

Initializes the VTK writer with the provided basis, solution, and refinement levels.

Parameters
basisThe grid basis.
refinementLevelsThe refinement levels for subsampling.

Member Function Documentation

◆ setFieldInfo()

template<typename B >
auto Ikarus::ControlSubsamplingVertexVTKWriter< B >::setFieldInfo ( std::string &&  name,
Dune::VTK::FieldInfo::Type  type,
std::size_t  size,
Dune::VTK::Precision  prec = Dune::VTK::Precision::float32 
)
inline
Parameters
nameThe name of the field.
typeThe type of the field.
sizeThe size of the field.
precThe precision of the field.
Returns
The field information.

◆ setFileNamePrefix()

template<typename B >
auto Ikarus::ControlSubsamplingVertexVTKWriter< B >::setFileNamePrefix ( std::string &&  name)
inline
Parameters
p_nameThe file name prefix.

◆ subscribe()

template<typename Broadcaster >
auto Ikarus::Listener::subscribe ( Broadcaster broadcaster,
std::function< void(typename Broadcaster::MessageType, const typename Broadcaster::State &)>  callback 
)
inlineinherited
Template Parameters
Broadcasterthe type of the Broadcaster (for example a NonlinearSolver or ControlRoutine)
Parameters
broadcasterthe broadcaster
callbackthe function
Here is the caller graph for this function:

◆ subscribeTo()

template<typename B >
template<typename BC >
ControlSubsamplingVertexVTKWriter & Ikarus::ControlSubsamplingVertexVTKWriter< B >::subscribeTo ( BC &  bc)
inline

◆ unSubscribe()

void Ikarus::Listener::unSubscribe ( const Token token)
inlineinherited

◆ unSubscribeAll()

void Ikarus::Listener::unSubscribeAll ( )
inlineinherited

◆ unSubscribeLast()

void Ikarus::Listener::unSubscribeLast ( )
inlineinherited

◆ update()

template<typename B >
void Ikarus::ControlSubsamplingVertexVTKWriter< B >::update ( ControlMessages  message,
const Concepts::ControlRoutineState auto &  state 
)
inline

This method is called upon receiving a SOLUTION_CHANGED control message. It writes VTK files with subsampling based on the provided field information.

Parameters
messageThe received control message.
stateThe received control state.
Here is the caller graph for this function:

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