IFEM 90A354
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
SystemVector Class Referenceabstract

Base class for representing a system vector on different formats. More...

#include <SystemMatrix.h>

Inheritance diagram for SystemVector:
Inheritance graph
[legend]

Public Member Functions

virtual ~SystemVector ()
 Empty destructor.
 
virtual LinAlg::MatrixType getType () const =0
 Returns the vector type.
 
virtual SystemVectorcopy () const =0
 Creates a copy of the system vector and returns a pointer to it.
 
virtual size_t dim () const =0
 Returns the dimension/size of the system vector.
 
virtual void redim (size_t n)=0
 Sets the dimension of the system vector.
 
virtual void resize (size_t n, bool=false)
 Resizes the vector to length n.
 
bool empty () const
 Checks if the vector is empty.
 
virtual RealgetPtr ()=0
 Access through pointer.
 
virtual const RealgetRef () const =0
 Reference through pointer.
 
virtual const Vectorvec () const =0
 Reference to underlying utl::vector, if any.
 
virtual void init (Real value=Real(0))=0
 Initializes the vector assuming it is properly dimensioned.
 
SystemVectorcopy (const SystemVector &x)
 Copies entries from input vector x into *this.
 
virtual void assemble (const Vectors &vecs, const IntVec &meqn, int neq)=0
 Adds element vectors into the system vector.
 
virtual bool endAssembly ()
 Finalizes the system vector assembly.
 
virtual void mult (Real alpha)=0
 Multiplication with a scalar.
 
virtual void add (const SystemVector &vec, Real scale=Real(1))=0
 Addition of another system vector to this one.
 
virtual Real L1norm () const =0
 L1-norm of the vector.
 
virtual Real L2norm () const =0
 L2-norm of the vector.
 
virtual Real Linfnorm () const =0
 Linfinity-norm of the vector.
 
virtual void dump (std::ostream &, LinAlg::StorageFormat, const char *=nullptr) const
 Dumps the system vector on a specified format.
 

Static Public Member Functions

static SystemVectorcreate (const ProcessAdm *adm, LinAlg::MatrixType vtype)
 Static method creating a vector of the given type.
 

Protected Member Functions

 SystemVector ()
 The default constructor is protected to allow sub-classes only.
 
virtual std::ostream & write (std::ostream &os) const
 Writes the system vector to the given output stream.
 

Friends

std::ostream & operator<< (std::ostream &os, const SystemVector &X)
 Global stream operator printing the vector contents.
 

Detailed Description

Base class for representing a system vector on different formats.

Member Function Documentation

◆ add()

virtual void SystemVector::add ( const SystemVector vec,
Real  scale = Real(1) 
)
pure virtual

Addition of another system vector to this one.

Implemented in PETScVectors, and StdVector.

Referenced by SIMbase::addToRHSvector().

◆ assemble()

virtual void SystemVector::assemble ( const Vectors vecs,
const IntVec meqn,
int  neq 
)
pure virtual

Adds element vectors into the system vector.

Parameters
[in]vecsThe element vectors
[in]meqnMatrix of element equation numbers (0 based)
[in]neqNumber of equations for (each) load vector

This assembles for multiple RHS

Implemented in StdVector, and PETScVectors.

Referenced by ASMs1D::assembleL2matrices(), ASMs2DLag::assembleL2matrices(), ASMs3DLag::assembleL2matrices(), ASMu2D::assembleL2matrices(), and ASMu3D::assembleL2matrices().

◆ copy()

virtual SystemVector * SystemVector::copy ( ) const
pure virtual

Creates a copy of the system vector and returns a pointer to it.

Implemented in StdVector, PETScVector, and PETScVectors.

Referenced by SIMbase::getRHSvector(), and SystemMatrix::solve().

◆ dim()

virtual size_t SystemVector::dim ( ) const
pure virtual

◆ dump()

virtual void SystemVector::dump ( std::ostream &  ,
LinAlg::StorageFormat  ,
const char *  = nullptr 
) const
inlinevirtual

Dumps the system vector on a specified format.

Reimplemented in StdVector.

Referenced by SIMbase::dumpEqSys().

◆ endAssembly()

virtual bool SystemVector::endAssembly ( )
inlinevirtual

Finalizes the system vector assembly.

Reimplemented in ISTLVector, and PETScVector.

Referenced by ReactionsOnly::finalize(), and ASMbase::globalL2projection().

◆ getPtr()

virtual Real * SystemVector::getPtr ( )
pure virtual

◆ getRef()

virtual const Real * SystemVector::getRef ( ) const
pure virtual

Reference through pointer.

Implemented in StdVector, and PETScVectors.

Referenced by copy(), SAM::expandSolution(), DiagMatrix::multiply(), SPRMatrix::multiply(), and SystemMatrix::solve().

◆ getType()

virtual LinAlg::MatrixType SystemVector::getType ( ) const
pure virtual

Returns the vector type.

Implemented in StdVector, ISTLVector, PETScVector, and PETScVectors.

Referenced by SPRMatrix::assemble(), SPRMatrix::multiply(), and SPRMatrix::solve().

◆ init()

virtual void SystemVector::init ( Real  value = Real(0))
pure virtual

Initializes the vector assuming it is properly dimensioned.

Implemented in PETScVector, StdVector, ISTLVector, and PETScVectors.

◆ L1norm()

virtual Real SystemVector::L1norm ( ) const
pure virtual

L1-norm of the vector.

Implemented in StdVector, ISTLVector, PETScVector, and PETScVectors.

Referenced by HHTSIM::finalizeRHSvector(), and NewmarkSIM::initAcc().

◆ L2norm()

virtual Real SystemVector::L2norm ( ) const
pure virtual

L2-norm of the vector.

Implemented in StdVector, ISTLVector, PETScVector, and PETScVectors.

◆ Linfnorm()

virtual Real SystemVector::Linfnorm ( ) const
pure virtual

Linfinity-norm of the vector.

Implemented in StdVector, ISTLVector, PETScVector, and PETScVectors.

◆ mult()

virtual void SystemVector::mult ( Real  alpha)
pure virtual

Multiplication with a scalar.

Implemented in StdVector, and PETScVectors.

Referenced by TimeIntegration::SIMExplicitLMM< Solver >::solveStep().

◆ redim()

virtual void SystemVector::redim ( size_t  n)
pure virtual

Sets the dimension of the system vector.

Implemented in StdVector, ISTLVector, PETScVector, and PETScVectors.

Referenced by copy(), SPRMatrix::multiply(), and resize().

◆ resize()

virtual void SystemVector::resize ( size_t  n,
bool  = false 
)
inlinevirtual

Resizes the vector to length n.

Reimplemented in StdVector.

References redim().

Referenced by SparseMatrix::multiply().

◆ vec()

virtual const Vector & SystemVector::vec ( ) const
pure virtual

◆ write()

virtual std::ostream & SystemVector::write ( std::ostream &  os) const
inlineprotectedvirtual

Writes the system vector to the given output stream.

Reimplemented in StdVector.


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