DOpE
Public Member Functions
DOpE::ControlVector< VECTOR > Class Template Reference

#include <controlvector.h>

Public Member Functions

 ControlVector (const ControlVector &ref)
 
 ControlVector (const SpaceTimeHandlerBase< VECTOR > *STH, DOpEtypes::VectorStorageType behavior)
 
 ~ControlVector ()
 
void SetTimeDoFNumber (unsigned int time_point) const
 
VECTOR & GetSpacialVector ()
 ******************************************************/ More...
 
const VECTOR & GetSpacialVector () const
 
const dealii::Vector< double > & GetSpacialVectorCopy () const
 
void operator= (double value)
 
void operator= (const ControlVector &dq)
 
void operator+= (const ControlVector &dq)
 
void operator*= (double a)
 
double operator* (const ControlVector &dq) const
 
void add (double s, const ControlVector &dq)
 
void equ (double s, const ControlVector &dq)
 
void max (const ControlVector &dq)
 
void min (const ControlVector &dq)
 
void comp_mult (const ControlVector &dq)
 
void comp_invert ()
 
void init_by_sign (double smaller, double larger, double unclear, double TOL=1.e-10)
 
void PrintInfos (std::stringstream &out)
 
void UnLockCopy () const
 
DOpEtypes::VectorStorageType GetBehavior () const
 
const SpaceTimeHandlerBase
< VECTOR > * 
GetSpaceTimeHandler () const
 
void ReInit ()
 
double Norm (std::string name, std::string restriction="all") const
 

Detailed Description

template<typename VECTOR>
class DOpE::ControlVector< VECTOR >

This class represents the controlvector.

Template Parameters
<VECTOR>Class in which we want to store the spatial vector (i.e. dealii::Vector<double> or dealii::BlockVector<double>)

Constructor & Destructor Documentation

template<typename VECTOR >
ControlVector::ControlVector ( const ControlVector< VECTOR > &  ref)
template<typename VECTOR >
ControlVector::ControlVector ( const SpaceTimeHandlerBase< VECTOR > *  STH,
DOpEtypes::VectorStorageType  behavior 
)
template<typename VECTOR >
ControlVector::~ControlVector ( )

Member Function Documentation

template<typename VECTOR >
void ControlVector::add ( double  s,
const ControlVector< VECTOR > &  dq 
)

Sets this vector adds a multiple of an other vector to this vector. this = this + s * dq It expects both vectors to be of the same structure.

Parameters
sA double, by which the other vector is scaled.
dqThe other vector.
template<typename VECTOR >
void ControlVector::comp_invert ( )

Inverts the elements of the vetor component wise

template<typename VECTOR >
void ControlVector::comp_mult ( const ControlVector< VECTOR > &  dq)

Computes the component wise product of this vector with the argument.

template<typename VECTOR >
void ControlVector::equ ( double  s,
const ControlVector< VECTOR > &  dq 
)

Sets this vector to the values of an other given vector. The vector is not resized!

Parameters
dqThe other vector.
template<typename VECTOR>
DOpEtypes::VectorStorageType DOpE::ControlVector< VECTOR >::GetBehavior ( ) const
inline

This returns the behavior of the ControlVector

fullmem Means there is a spacial vector for each time point.
The whole vector is stored in main memory.
Returns
A string indicating the behavior.
template<typename VECTOR>
const SpaceTimeHandlerBase<VECTOR>* DOpE::ControlVector< VECTOR >::GetSpaceTimeHandler ( ) const
inline
Returns
A const pointer to the SpaceTimeHandler associated with this vector.
template<typename VECTOR >
VECTOR & ControlVector::GetSpacialVector ( )

******************************************************/

Returns a reference to the spacial vector associated to the last time given by SetTime* If the vecor behavior is initial this generates an error if we are not in the initial time point.

template<typename VECTOR >
const VECTOR & ControlVector::GetSpacialVector ( ) const

Returns a const reference to the spacial vector associated to the last time given by SetTime*

template<typename VECTOR >
const Vector< double > & ControlVector::GetSpacialVectorCopy ( ) const

Returns a const reference to the spacial vector associated to the last time given by SetTime* This makes a copy of the real vector in order to change the vector type. To assert data integrity this Only one Copy may be obtained at any time. Hence prior to calling this Function again UnLockCopy must be called.

template<typename VECTOR >
void ControlVector::init_by_sign ( double  smaller,
double  larger,
double  unclear,
double  TOL = 1.e-10 
)

Initializes this vector according to the signs in it.

Parameters
smallervalue to be taken if sign is negative
largervalue to be taken if sign is positive
unclearvalue to be taken if sign is unclear
TOLif abs(value) < TOL we consider the sign to be unclear
template<typename VECTOR >
void ControlVector::max ( const ControlVector< VECTOR > &  dq)

Sets this vector to the componentwise maximum of its own entries and that of the other vector The vector is not resized!

Parameters
dqThe other vector.
template<typename VECTOR >
void ControlVector::min ( const ControlVector< VECTOR > &  dq)

Sets this vector to the componentwise minimum of its own entries and that of the other vector The vector is not resized!

Parameters
dqThe other vector.
template<typename VECTOR >
double ControlVector::Norm ( std::string  name,
std::string  restriction = "all" 
) const

Computes the norm given by name of the vector. Feasible values are "infty", and "l1" The string restriction defines if only certain values are to be considered. Currently "all" and "positive" are feasible Meaning that either all or only the positive entries are considered.

template<typename VECTOR >
double ControlVector::operator* ( const ControlVector< VECTOR > &  dq) const

Computes the Euclidean scalar product of this vector with the argument. Both Vectors must have the same struckture.

Parameters
dqThe argument for the computation of the scalarproduct.
Returns
A double containing the scalar product.
template<typename VECTOR >
void ControlVector::operator*= ( double  a)

Multiplies the Vector with a constant.

Parameters
aA double to be multiplied with the vector.
template<typename VECTOR >
void ControlVector::operator+= ( const ControlVector< VECTOR > &  dq)

Upon completion each entry of this Vector contains the following Result this = this + dq; It is required that both this and dq have the same structure!

Parameters
dqThe increment.
template<typename VECTOR >
void ControlVector::operator= ( double  value)

Sets all the vector to a constant value.

Parameters
valueThe constant value to be assigned to the vector.
template<typename VECTOR >
void ControlVector::operator= ( const ControlVector< VECTOR > &  dq)

Sets this vector to the values of an other given vector. If required this vector is resized. This invalidates all prior SetTime* calls.

Parameters
dqThe other vector.
template<typename VECTOR >
void ControlVector::PrintInfos ( std::stringstream &  out)

Prints Information on this vector into the given stream.

Parameters
outThe output stream.
template<typename VECTOR >
void ControlVector::ReInit ( )

Call if the SpaceTimeHandler has changed to reinitialize vector sizes.

template<typename VECTOR >
void ControlVector::SetTimeDoFNumber ( unsigned int  time_point) const

Sets the time in the vector. This Function or SetTimeDoFNumber must be called before calling GetSpacialVector in order to load the required data.

Parameters
tA double containing the time we are interested in. If t doesn't match the time given by time_point, then an interpolation between the corresponding time_points is computed.
intervalAn TimeIterator. The interval containing t. Sets the time in the vector. This Function or SetTime must be called before calling GetSpacialVector in order to load the required data.
time_pointAn unsigned integer. This gives the number of the point in the time mesh.
template<typename VECTOR>
void DOpE::ControlVector< VECTOR >::UnLockCopy ( ) const
inline

This unlocks the function GetSpacialVectorCopy


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