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. More...
 
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

◆ 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 PETScVectors, and StdVector.

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


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