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

#include <constraintvector.h>

Public Member Functions

 ConstraintVector (const ConstraintVector &ref)
 
 ConstraintVector (const SpaceTimeHandlerBase< VECTOR > *STH, DOpEtypes::VectorStorageType behavior)
 
 ~ConstraintVector ()
 
void SetTime (double t, const TimeIterator &interval) const
 
void SetTimeDoFNumber (unsigned int time_point) const
 
bool HasType (std::string name) const
 
VECTOR & GetSpacialVector (std::string name)
 
const VECTOR & GetSpacialVector (std::string name) const
 
const dealii::Vector< double > & GetGlobalConstraints () const
 
dealii::Vector< double > & GetGlobalConstraints ()
 
void operator= (double value)
 
void operator= (const ConstraintVector &dq)
 
void operator+= (const ConstraintVector &dq)
 
void operator*= (double a)
 
double operator* (const ConstraintVector &dq) const
 
void add (double s, const ConstraintVector &dq)
 
void equ (double s, const ConstraintVector &dq)
 
void PrintInfos (std::stringstream &out)
 
DOpEtypes::VectorStorageType GetBehavior () const
 
const SpaceTimeHandlerBase
< VECTOR > * 
GetSpaceTimeHandler () const
 
void ReInit ()
 
double Norm (std::string name, std::string restriction="all") const
 
virtual bool IsFeasible () const
 
virtual bool IsEpsilonFeasible (double eps) const
 
virtual bool IsLargerThan (double eps) const
 
virtual double Complementarity (const ConstraintVector< VECTOR > &g) const
 

Detailed Description

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

This class represents the constraint vector used for additional constraints beyond the PDE.

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 >
ConstraintVector::ConstraintVector ( const ConstraintVector< VECTOR > &  ref)
template<typename VECTOR >
ConstraintVector::ConstraintVector ( const SpaceTimeHandlerBase< VECTOR > *  STH,
DOpEtypes::VectorStorageType  behavior 
)
template<typename VECTOR >
ConstraintVector::~ConstraintVector ( )

Member Function Documentation

template<typename VECTOR >
void ConstraintVector::add ( double  s,
const ConstraintVector< 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 >
double ConstraintVector::Complementarity ( const ConstraintVector< VECTOR > &  g) const
virtual

This function calculates the element-wise product of the constraintvector with the given argument. The absolute value of these products is then summed.

Parameters
gA given vector to check the complementarity.
Returns
the complementarity product.
template<typename VECTOR >
void ConstraintVector::equ ( double  s,
const ConstraintVector< 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::ConstraintVector< VECTOR >::GetBehavior ( ) const
inline

This returns the behavior of the ConstraintVector Currently implemented are the following posibilities

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 dealii::Vector< double > & ConstraintVector::GetGlobalConstraints ( ) const

Returns the vector containing information on global in space and time constraints

template<typename VECTOR >
dealii::Vector< double > & ConstraintVector::GetGlobalConstraints ( )

Returns the vector containing information on global in space and time constraints

template<typename VECTOR>
const SpaceTimeHandlerBase<VECTOR>* DOpE::ConstraintVector< VECTOR >::GetSpaceTimeHandler ( ) const
inline
Returns
A const pointer to the SpaceTimeHandler associated with this vector.
template<typename VECTOR >
VECTOR & ConstraintVector::GetSpacialVector ( std::string  name)

Returns a reference to the spacial vector associated to the last time given by SetTime* The Constrainttype must be indicated in the string name. Feasible values are 'local' for local in time and space 'local_global' for local in space but global in time constraints.

template<typename VECTOR >
const VECTOR & ConstraintVector::GetSpacialVector ( std::string  name) const

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

template<typename VECTOR >
bool ConstraintVector::HasType ( std::string  name) const

Returns true if there is a constraint associated to the name.

template<typename VECTOR >
bool ConstraintVector::IsEpsilonFeasible ( double  eps) const
virtual

This function is used to check whether the values stored in this vector corresponding to an epsilon feasible control, i.e., if all entries are not larger than the given eps.

Parameters
epsThe value of epsilon.
Returns
A boolean beeing true if the constraint is eps-feasible and false otherwise.
template<typename VECTOR >
bool ConstraintVector::IsFeasible ( ) const
virtual

This function is used to check whether the values stored in this vector corresponding to a feasible control, i.e., if all entries are non positive

Returns
A boolean beeing true if the constraint is feasible and false otherwise.
template<typename VECTOR >
bool ConstraintVector::IsLargerThan ( double  eps) const
virtual

This function is used to check whether the values stored in this vector are larger than the given epsilon.

Parameters
epsThe value of epsilon.
Returns
A boolean beeing true if the constraint is larger than eps and false otherwise.
template<typename VECTOR >
double ConstraintVector::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 ConstraintVector::operator* ( const ConstraintVector< 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 ConstraintVector::operator*= ( double  a)

Multiplies the Vector with a constant.

Parameters
aA double to be multiplied with the vector.
template<typename VECTOR >
void ConstraintVector::operator+= ( const ConstraintVector< 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 ConstraintVector::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 ConstraintVector::operator= ( const ConstraintVector< 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 ConstraintVector::PrintInfos ( std::stringstream &  out)

Prints Information on this vector into the given stream.

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

Call if the SpaceTimeHandler has changed to reinitialize vector sizes.

template<typename VECTOR >
void ConstraintVector::SetTime ( double  t,
const TimeIterator interval 
) 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.
template<typename VECTOR >
void ConstraintVector::SetTimeDoFNumber ( unsigned int  time_point) const

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

Parameters
time_pointAn unsigned integer. This gives the number of the point in the time mesh.

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