TBTK
TBTK::SourceAmplitude Class Reference

Source amplitude for equations with a source term. More...

#include <SourceAmplitude.h>

Public Member Functions

 SourceAmplitude ()
 
 SourceAmplitude (std::complex< double > amplitude, Index index)
 
 SourceAmplitude (std::complex< double >(*amplitudeCallback)(const Index &index), Index index)
 
 SourceAmplitude (const std::string &serializeation, Serializable::Mode mode)
 
std::complex< double > getAmplitude () const
 
const IndexgetIndex () const
 
std::string toString () const
 
std::string serialize (Serializable::Mode mode) const
 
unsigned int getSizeInBytes () const
 

Detailed Description

Source amplitude for equations with a source term.

The Source Amplitude is used to encode information about the source term \(S\) in an equation such as \(i\hbar\frac{\partial\Psi}{\partial t} = H\Psi + S\).

Constructor & Destructor Documentation

TBTK::SourceAmplitude::SourceAmplitude ( )
inline

Constructs a SourceAmplitude.

TBTK::SourceAmplitude::SourceAmplitude ( std::complex< double >  amplitude,
Index  index 
)

Constructs a SourceAmplitude from a value and an Index.

Parameters
amplitudeThe amplitude value.
indexThe index for which the SourceAmplitude is defined.
TBTK::SourceAmplitude::SourceAmplitude ( std::complex< double >(*)(const Index &index)  amplitudeCallback,
Index  index 
)

Constructor. Takes a callback function rather than a paramater value. The callback function has to be defined such that it returns a value for the given index when called at run time.

Parameters
amplitudeCallbackA callback function that is able to return a value when passed index.
indexThe Index for which the SourceAmplitude is defined.
TBTK::SourceAmplitude::SourceAmplitude ( const std::string &  serializeation,
Serializable::Mode  mode 
)

Constructor. Constructs the SourceAmplitude from a serialization string.

Parameters
serializationSerialization string from which to construct the SourceAmplitude.
modeMode with which the string has been serialized.

Member Function Documentation

std::complex< double > TBTK::SourceAmplitude::getAmplitude ( ) const
inline

Get the amplitude value \(S_{i}\).

Returns
The value of the amplitude.
const Index & TBTK::SourceAmplitude::getIndex ( ) const
inline

Get index.

Returns
The Index.
unsigned int TBTK::SourceAmplitude::getSizeInBytes ( ) const
inline

Get size in bytes.

Returns
Memory size required to store the SourceAmplitude.
std::string TBTK::SourceAmplitude::serialize ( Serializable::Mode  mode) const

Serialize SourceAmplitude. Note that SourceAmplitude is pseudo-Serializable in that it implements the Serializable interface, but does so non-virtually.

Parameters
modeSerialization mode to use.
Returns
Serialized string representation of the SourceAmplitude.
std::string TBTK::SourceAmplitude::toString ( ) const
inline

Get string representation of the SourceAmplitude.

Returns
A string representation of the SourceAmplitude.

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