PFASST++
pfasst::encap::Encapsulation< time > Class Template Reference

Data/solution encapsulation. More...

#include <encapsulation.hpp>

+ Inheritance diagram for pfasst::encap::Encapsulation< time >:
+ Collaboration diagram for pfasst::encap::Encapsulation< time >:

Public Member Functions

virtual ~Encapsulation ()
 
virtual void zero ()
 Zeroes out all values of this data structure. More...
 
virtual void copy (shared_ptr< const Encapsulation< time >> other)
 Copies values from other into this data structure. More...
 
virtual time norm0 () const
 Computes the \( 0 \)-norm of the data structure's values. More...
 
virtual void saxpy (time a, shared_ptr< const Encapsulation< time >> x)
 Provides basic mathematical operation \( y+=ax \). More...
 
virtual void mat_apply (vector< shared_ptr< Encapsulation< time >>> dst, time a, Matrix< time > mat, vector< shared_ptr< Encapsulation< time >>> src, bool zero=true)
 Defines matrix-vector multiplication for this data type. More...
 
virtual void post (ICommunicator *comm, int tag)
 
virtual void send (ICommunicator *comm, int tag, bool blocking)
 Send values stored in this data structure. More...
 
virtual void recv (ICommunicator *comm, int tag, bool blocking)
 Receive values to store in this data structure. More...
 
virtual void broadcast (ICommunicator *comm)
 Broadcasting this data structure to all processes in comm. More...
 

Detailed Description

template<typename time = time_precision>
class pfasst::encap::Encapsulation< time >

Data/solution encapsulation.

An Encapsulation provides basic functionality of the user data used by PFASST such as mathematical operation axpy \( y=ax+y \) and packing/unpacking for message passing.

Template Parameters
timetime precision; defaults to pfasst::time_precision

Definition at line 41 of file encapsulation.hpp.

Constructor & Destructor Documentation

template<typename time >
pfasst::encap::Encapsulation< time >::~Encapsulation ( )
virtual

Definition at line 11 of file encapsulation_impl.hpp.

Member Function Documentation

template<typename time >
void pfasst::encap::Encapsulation< time >::broadcast ( ICommunicator comm)
virtual

Broadcasting this data structure to all processes in comm.

Parameters
[in]commcommunicator managing the processes to send this data structure to
Exceptions
NotImplementedYetThis function is required by PFASST

Definition at line 112 of file encapsulation_impl.hpp.

References UNUSED.

template<typename time>
void pfasst::encap::Encapsulation< time >::copy ( shared_ptr< const Encapsulation< time >>  other)
virtual

Copies values from other into this data structure.

Parameters
[in]otherother data structure to copy data from
Exceptions
NotImplementedYetThis function is required by Encapsulation

Reimplemented in pfasst::encap::VectorEncapsulation< scalar, time >.

Definition at line 27 of file encapsulation_impl.hpp.

template<typename time>
void pfasst::encap::Encapsulation< time >::mat_apply ( vector< shared_ptr< Encapsulation< time >>>  dst,
time  a,
Matrix< time >  mat,
vector< shared_ptr< Encapsulation< time >>>  src,
bool  zero = true 
)
virtual

Defines matrix-vector multiplication for this data type.

This implements the matrix-vector multiplication of the form \( \vec{y}=a M \vec{x} \). Here, \( a \) is a time point to scale the matrix-vector multiplication with, \( M \) is a matrix and \( x \) another data structure usually of the same type as this one.

If zero is true, then dst is zeroed out before applying the matrix-vector multiplication. Elsewise the result of the matrix-vector multiplication is added onto dst.

Parameters
[in,out]dstdata structure to store the result in
[in]a
[in]mat
[in]src
[in]zero
Todo:
Consider asserting size of matrix matches sizes of vectors.

Reimplemented in pfasst::encap::VectorEncapsulation< scalar, time >.

Definition at line 60 of file encapsulation_impl.hpp.

template<typename time >
time pfasst::encap::Encapsulation< time >::norm0 ( ) const
virtual

Computes the \( 0 \)-norm of the data structure's values.

Returns
\( 0 \)-norm of this data structure
Exceptions
NotImplementedYetThis function is required by Encapsulation

Reimplemented in pfasst::examples::boris::ParticleCloud< precision >, and pfasst::encap::VectorEncapsulation< scalar, time >.

Definition at line 36 of file encapsulation_impl.hpp.

template<typename time >
void pfasst::encap::Encapsulation< time >::post ( ICommunicator comm,
int  tag 
)
virtual
Todo:
Write documentation for this member function. How is it different to post/recv?
Parameters
[in]commcommunicator managing the processes to post ??? to/from ???
[in]tagtag to distinguish overlapping communication

Definition at line 83 of file encapsulation_impl.hpp.

References UNUSED.

template<typename time >
void pfasst::encap::Encapsulation< time >::recv ( ICommunicator comm,
int  tag,
bool  blocking 
)
virtual

Receive values to store in this data structure.

Parameters
[in]commcommunicator managing the processes to receive from
[in]tagtag to distinguish overlapping communication
[in]blockingwhether to use blocking or non-blocking receive
Exceptions
NotImplementedYetThis function is required by PFASST

Definition at line 102 of file encapsulation_impl.hpp.

References UNUSED.

template<typename time>
void pfasst::encap::Encapsulation< time >::saxpy ( time  a,
shared_ptr< const Encapsulation< time >>  x 
)
virtual

Provides basic mathematical operation \( y+=ax \).

This is the main mathematical operation applied by PFASST on the data structures. Here, \( a \) is a time point and \( x \) another data structure (usually of the same type) and \( y \) is this data structure.

Parameters
[in]atime point to multiply
[in]xanother data structure to scale-add onto this one
Exceptions
NotImplementedYetThis function is required by Encapsulation

Reimplemented in pfasst::encap::VectorEncapsulation< scalar, time >.

Definition at line 45 of file encapsulation_impl.hpp.

References UNUSED.

template<typename time >
void pfasst::encap::Encapsulation< time >::send ( ICommunicator comm,
int  tag,
bool  blocking 
)
virtual

Send values stored in this data structure.

Parameters
[in]commcommunicator managing the processes to send to
[in]tagtag to distinguish overlapping communication
[in]blockingwhether to use blocking or non-blocking send
Exceptions
NotImplementedYetThis function is required by PFASST

Definition at line 92 of file encapsulation_impl.hpp.

References UNUSED.

template<typename time >
void pfasst::encap::Encapsulation< time >::zero ( )
virtual

Zeroes out all values of this data structure.

Exceptions
NotImplementedYetThis function is required by Encapsulation

Reimplemented in pfasst::examples::boris::ParticleCloud< precision >, and pfasst::encap::VectorEncapsulation< scalar, time >.

Definition at line 18 of file encapsulation_impl.hpp.


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