Class implementing time dependent vectors. More...

#include <vectors.hh>

Inheritance diagram for timestepping::TimeVector:
concepts::Vector< Real >

Public Member Functions

virtual Function< Real > & add (const Function< Real > &fnc, Real sc)
 
Vector< Real > & add (const Vector< H > &fnc)
 Adds a vector of possible different length and type. More...
 
Vector< Real > & add (const Vector< H > &fnc, Real sc, uint offset=0)
 Adds a vector of possible different length and type with an offset. More...
 
Vector< Real > & apply (Real fnc(const Real &))
 Application operator to each component, e.g. More...
 
Vector< Real > & assemble (const Space< G > &spc, const LinearForm< Real, G > &lf)
 Assembles the vector w.r.t. linear form lf and space spc. More...
 
Real * data () const
 
Real l1 () const
 l1 norm More...
 
Real l2 () const
 l2 norm More...
 
Real l2_2 () const
 l2 norm squared More...
 
Real max () const
 Maximum of the absolute values in the vector, ie. $l^\infty$ norm. More...
 
uint n () const
 Elements in the vector. More...
 
 operator Real * () const
 Conversion operator. More...
 
virtual Real & operator() (uint i)
 
virtual Real operator() (uint i) const
 
Real operator* (const Vector< Real > &fnc) const
 Inner product (v = this, w = \fnc) More...
 
Vector< Real > operator* (Real c) const
 
virtual Function< Real > & operator*= (Real sc)
 Scaling operator. More...
 
Vector< Real > operator+ (const Function< Real > &fnc) const
 
Vector< Real > operator+ (Real c) const
 
virtual Function< Real > & operator+= (const Function< Real > &fnc)
 Addition operator. More...
 
virtual Function< Real > & operator+= (Real c)
 
Vector< Real > operator- (const Function< Real > &fnc) const
 
Vector< Real > operator- (Real c) const
 
virtual Function< Real > & operator-= (const Function< Real > &fnc)
 Subtraction operator. More...
 
virtual Function< Real > & operator-= (Real c)
 
Vector< Real > operator/ (Real c) const
 
virtual Function< Real > & operator/= (Real sc)
 
virtual void resize (uint n)
 Sets a new size, previous data might be lost
More...
 
void reverse ()
 
uint size () const
 
void storeMatlab (const char *filename, const char *name=0, bool append=false) const
 Stores the vector in a Matlab sparse matrix. More...
 
Real time () const
 Returns the current time_. More...
 
void time (Real time)
 Sets the current time_. More...
 
 TimeVector (const concepts::Space< Real > &spc)
 Constructor. More...
 
 TimeVector (const concepts::Space< Real > &spc, TimeLinearForm &tlf)
 Constructor. More...
 
 TimeVector (const concepts::Vector< Real > &vec)
 Copy Constructor. More...
 
 TimeVector (const concepts::Vector< Real > &vec, const concepts::Formula< Real > &frm, const Real time=0)
 Constructor for a constant vector times a formula in time. More...
 
const Vector< Real > & write (const std::string &fname) const
 Writes the vector to a file. More...
 
 ~TimeVector ()
 

Protected Member Functions

void fillEntries_ (const Space< G > &spc, const LinearForm< Real, G > &lf)
 
virtual std::ostream & info (std::ostream &os) const
 

Protected Attributes

Array< Real > data_
 Vector data. More...
 

Private Member Functions

void set_ (const concepts::Vector< Real > &vec)
 Sets the vector to vec. More...
 
void updateEntries_ ()
 Evaluates tlf_ at time_. More...
 

Private Attributes

const concepts::Formula< Real > * frm_
 Formula in time to multiply with template vector. More...
 
const concepts::Space< Real > * spc_
 Space. More...
 
const concepts::Vector< Real > * template_
 Template vector. More...
 
Real time_
 Time, is not necessarily correlated to the values of the vector. More...
 
TimeLinearFormtlf_
 Linear form. More...
 
Real * v_
 Pointer to the vector data. More...
 

Static Private Attributes

static uint storeMatlabCounter_
 Counts number of Matlab outputs (used to uniquely name the vectors) More...
 

Detailed Description

Class implementing time dependent vectors.

In order to get the vector at time t, call the time function with argument t.

Author
Manuel Walser, 2002

Definition at line 53 of file vectors.hh.

Constructor & Destructor Documentation

◆ TimeVector() [1/4]

timestepping::TimeVector::TimeVector ( const concepts::Space< Real > &  spc,
TimeLinearForm tlf 
)
inline

Constructor.

A TimeVector created with this constructor reassembles when the time is changed.

Parameters
spcSpace
tlfLinear form to be evaluated when the time is changed

Definition at line 60 of file vectors.hh.

◆ TimeVector() [2/4]

timestepping::TimeVector::TimeVector ( const concepts::Space< Real > &  spc)
inline

Constructor.

A TimeVector created with this constructor does not reassemble when the time is changed.

Parameters
spcSpace

Definition at line 67 of file vectors.hh.

◆ TimeVector() [3/4]

timestepping::TimeVector::TimeVector ( const concepts::Vector< Real > &  vec)
inline

Copy Constructor.

A TimeVector created with this constructor does not reassemble when the time is changed.

Parameters
vecThe Vector to be copied

Definition at line 74 of file vectors.hh.

◆ TimeVector() [4/4]

timestepping::TimeVector::TimeVector ( const concepts::Vector< Real > &  vec,
const concepts::Formula< Real > &  frm,
const Real  time = 0 
)

Constructor for a constant vector times a formula in time.

Parameters
vecThe vector
frmThe formula
timeCurrent time

◆ ~TimeVector()

timestepping::TimeVector::~TimeVector ( )
inline

Definition at line 85 of file vectors.hh.

Member Function Documentation

◆ add() [1/3]

virtual Function<Real >& concepts::Vector< Real >::add ( const Function< Real > &  fnc,
Real  sc 
)
virtualinherited

◆ add() [2/3]

Vector<Real >& concepts::Vector< Real >::add ( const Vector< H > &  fnc)
inlineinherited

Adds a vector of possible different length and type.

Definition at line 209 of file vector.hh.

◆ add() [3/3]

Vector< Real > & concepts::Vector< Real >::add ( const Vector< H > &  fnc,
Real  sc,
uint  offset = 0 
)
inherited

Adds a vector of possible different length and type with an offset.

Definition at line 205 of file vector.hh.

◆ apply()

Vector<Real >& concepts::Vector< Real >::apply ( Real  fncconst F &)
inherited

Application operator to each component, e.g.

std::sin or std::conj

◆ assemble()

Vector<Real >& concepts::Vector< Real >::assemble ( const Space< G > &  spc,
const LinearForm< Real , G > &  lf 
)
inherited

Assembles the vector w.r.t. linear form lf and space spc.

◆ data()

Real * concepts::Vector< Real >::data
inlineinherited
Examples
parallelizationTutorial.cc.

Definition at line 192 of file vector.hh.

◆ fillEntries_()

void concepts::Vector< Real >::fillEntries_ ( const Space< G > &  spc,
const LinearForm< Real , G > &  lf 
)
protectedinherited

◆ info()

virtual std::ostream& concepts::Vector< Real >::info ( std::ostream &  os) const
protectedvirtualinherited

◆ l1()

Real concepts::Vector< Real >::l1
inherited

l1 norm

◆ l2()

Real concepts::Vector< Real >::l2
inlineinherited

l2 norm

Definition at line 215 of file vector.hh.

◆ l2_2()

Real concepts::Vector< Real >::l2_2
inherited

l2 norm squared

◆ max()

Real concepts::Vector< Real >::max
inherited

Maximum of the absolute values in the vector, ie. $l^\infty$ norm.

◆ n()

uint concepts::Vector< Real >::n
inlineinherited

Elements in the vector.

Definition at line 224 of file vector.hh.

◆ operator Real *()

concepts::Vector< Real >::operator Real *
inlineinherited

Conversion operator.

Returns the array of values.

Definition at line 190 of file vector.hh.

◆ operator()() [1/2]

virtual Real & concepts::Vector< Real >::operator() ( uint  i)
inlinevirtualinherited

Definition at line 140 of file vector.hh.

◆ operator()() [2/2]

virtual Real concepts::Vector< Real >::operator() ( uint  i) const
inlinevirtualinherited

Definition at line 143 of file vector.hh.

◆ operator*() [1/2]

Real concepts::Vector< Real >::operator* ( const Vector< Real > &  fnc) const
inherited

Inner product (v = this, w = \fnc)

\[v \cdot w\]

or

\[v \cdot \overline{w}\]

for complex vectors respectivly.

◆ operator*() [2/2]

Vector<Real > concepts::Vector< Real >::operator* ( Real  c) const
inherited

◆ operator*=()

virtual Function<Real >& concepts::Vector< Real >::operator*= ( Real  sc)
virtualinherited

Scaling operator.

◆ operator+() [1/2]

Vector<Real > concepts::Vector< Real >::operator+ ( const Function< Real > &  fnc) const
inherited

◆ operator+() [2/2]

Vector<Real > concepts::Vector< Real >::operator+ ( Real  c) const
inherited

◆ operator+=() [1/2]

virtual Function<Real >& concepts::Vector< Real >::operator+= ( const Function< Real > &  fnc)
virtualinherited

Addition operator.

◆ operator+=() [2/2]

virtual Function<Real >& concepts::Vector< Real >::operator+= ( Real  c)
virtualinherited

◆ operator-() [1/2]

Vector<Real > concepts::Vector< Real >::operator- ( const Function< Real > &  fnc) const
inherited

◆ operator-() [2/2]

Vector<Real > concepts::Vector< Real >::operator- ( Real  c) const
inherited

◆ operator-=() [1/2]

virtual Function<Real >& concepts::Vector< Real >::operator-= ( const Function< Real > &  fnc)
virtualinherited

Subtraction operator.

◆ operator-=() [2/2]

virtual Function<Real >& concepts::Vector< Real >::operator-= ( Real  c)
virtualinherited

◆ operator/()

Vector<Real > concepts::Vector< Real >::operator/ ( Real  c) const
inherited

◆ operator/=()

virtual Function<Real >& concepts::Vector< Real >::operator/= ( Real  sc)
virtualinherited

◆ resize()

virtual void concepts::Vector< Real >::resize ( uint  n)
inlinevirtualinherited

Sets a new size, previous data might be lost

Definition at line 195 of file vector.hh.

◆ reverse()

void concepts::Vector< Real >::reverse
inherited

Definition at line 227 of file vector.hh.

◆ set_()

void timestepping::TimeVector::set_ ( const concepts::Vector< Real > &  vec)
private

Sets the vector to vec.

In difference to the constructor the rest remains.

◆ size()

uint concepts::Vector< Real >::size
inlineinherited
Examples
parallelizationTutorial.cc.

Definition at line 147 of file vector.hh.

◆ storeMatlab()

void concepts::Vector< Real >::storeMatlab ( const char *  filename,
const char *  name = 0,
bool  append = false 
) const
inherited

Stores the vector in a Matlab sparse matrix.

◆ time() [1/2]

Real timestepping::TimeVector::time ( ) const
inline

Returns the current time_.

Definition at line 88 of file vectors.hh.

◆ time() [2/2]

void timestepping::TimeVector::time ( Real  time)

Sets the current time_.

If tlf_ is set, the entries are updated.

◆ updateEntries_()

void timestepping::TimeVector::updateEntries_ ( )
inlineprivate

Evaluates tlf_ at time_.

Definition at line 106 of file vectors.hh.

◆ write()

const Vector<Real >& concepts::Vector< Real >::write ( const std::string &  fname) const
inherited

Writes the vector to a file.

This should be endian proof.

Parameters
fnameFilename

Member Data Documentation

◆ data_

Array<Real > concepts::Vector< Real >::data_
protectedinherited

Vector data.

Definition at line 243 of file vector.hh.

◆ frm_

const concepts::Formula<Real>* timestepping::TimeVector::frm_
private

Formula in time to multiply with template vector.

Definition at line 101 of file vectors.hh.

◆ spc_

const concepts::Space<Real>* timestepping::TimeVector::spc_
private

Space.

Definition at line 95 of file vectors.hh.

◆ storeMatlabCounter_

uint concepts::Vector< Real >::storeMatlabCounter_
staticprivateinherited

Counts number of Matlab outputs (used to uniquely name the vectors)

Definition at line 248 of file vector.hh.

◆ template_

const concepts::Vector<Real>* timestepping::TimeVector::template_
private

Template vector.

Definition at line 103 of file vectors.hh.

◆ time_

Real timestepping::TimeVector::time_
private

Time, is not necessarily correlated to the values of the vector.

Definition at line 99 of file vectors.hh.

◆ tlf_

TimeLinearForm* timestepping::TimeVector::tlf_
private

Linear form.

Definition at line 97 of file vectors.hh.

◆ v_

Real * concepts::Vector< Real >::v_
privateinherited

Pointer to the vector data.

Definition at line 246 of file vector.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich