NOX::Petsc::Vector Class Reference

Implementation of NOX::Abstract::Vector for Petsc vectors. More...

#include <NOX_Petsc_Vector.H>

Inheritance diagram for NOX::Petsc::Vector:

Inheritance graph
[legend]
Collaboration diagram for NOX::Petsc::Vector:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Vector (const Vec &source, CopyType type=DeepCopy)
 Construct by copying map and/or elements of a Petsc Vec.
 Vector (const Vec &source, string name="Unnamed", CopyType type=DeepCopy)
 Construct by copying map and/or elements of a Petsc Vec.
 Vector (const Vector &source, CopyType type=DeepCopy)
 Construct by copying a NOX::Petsc::Vector.
 ~Vector ()
 Destruct Vector.
virtual int length () const
 Return the length of vector.
string Name ()
virtual Vec & getPetscVector ()
 Get reference to underlying Petsc vector.
virtual const Vec & getPetscVector () const
 Get const reference to underlying Petsc vector.
virtual Abstract::Vectorinit (double value)
 Initialize every element of this vector with gamma.
virtual Abstract::Vectoroperator= (const Vec &source)
 Copies source vector into "this".
virtual Abstract::Vectoroperator= (const Vector &source)
virtual Abstract::Vectoroperator= (const Abstract::Vector &source)
 See above.
virtual Abstract::Vectorabs (const Vector &source)
virtual Abstract::Vectorabs (const Abstract::Vector &source)
 See above.
virtual Abstract::Vectorreciprocal (const Vector &source)
virtual Abstract::Vectorreciprocal (const Abstract::Vector &source)
 See above.
virtual Abstract::Vectorscale (double gammaval)
 Scale each element of this vector by gamma.
virtual Abstract::Vectorscale (const Vector &a)
virtual Abstract::Vectorscale (const Abstract::Vector &a)
 See above.
virtual Abstract::Vectorupdate (double alpha, const Vector &a, double gammaval=0.0)
virtual Abstract::Vectorupdate (double alpha, const Abstract::Vector &a, double gammaval=0.0)
 See above.
virtual Abstract::Vectorupdate (double alpha, const Vector &a, double beta, const Vector &b, double gammaval=0.0)
virtual Abstract::Vectorupdate (double alpha, const Abstract::Vector &a, double beta, const Abstract::Vector &b, double gammaval=0.0)
 See above.
virtual Teuchos::RCP
< NOX::Abstract::Vector
clone (CopyType type=DeepCopy) const
 Create a new Vector of the same underlying type by cloning "this", and return a pointer to the new vector.
virtual double norm (Abstract::Vector::NormType type=TwoNorm) const
 Norm.
virtual double norm (const Vector &weights) const
virtual double norm (const Abstract::Vector &weights) const
 See above.
virtual double innerProduct (const Vector &y) const
virtual double innerProduct (const Abstract::Vector &y) const
 See above.
Vec petscVec
 Pointer to Petsc vector owned by this object.
bool isAlloc
 Flag to indicate if the vector has been allocated.
string name
virtual int allocate (const Vec &source, CopyType type=DeepCopy)


Detailed Description

Implementation of NOX::Abstract::Vector for Petsc vectors.

Definition at line 67 of file NOX_Petsc_Vector.H.


Constructor & Destructor Documentation

Vector::Vector ( const Vec &  source,
CopyType  type = DeepCopy 
)

Construct by copying map and/or elements of a Petsc Vec.

Definition at line 50 of file NOX_Petsc_Vector.C.

Vector::Vector ( const Vec &  source,
string  name = "Unnamed",
CopyType  type = DeepCopy 
)

Construct by copying map and/or elements of a Petsc Vec.

Definition at line 60 of file NOX_Petsc_Vector.C.

Vector::Vector ( const Vector source,
CopyType  type = DeepCopy 
)

Construct by copying a NOX::Petsc::Vector.

Definition at line 55 of file NOX_Petsc_Vector.C.

References getPetscVector().

Vector::~Vector (  )  [virtual]

Destruct Vector.

Reimplemented from NOX::Abstract::Vector.

Definition at line 66 of file NOX_Petsc_Vector.C.

References isAlloc.


Member Function Documentation

Vec & Vector::getPetscVector (  )  [virtual]

const Vec & Vector::getPetscVector (  )  const [virtual]

Get const reference to underlying Petsc vector.

Definition at line 134 of file NOX_Petsc_Vector.C.

References petscVec.

Abstract::Vector & Vector::init ( double  gamma  )  [virtual]

Initialize every element of this vector with gamma.

Here x represents this vector, and we update it as

\[ x_i = \gamma \quad \mbox{for } i=1,\dots,n \]

Returns:
Reference to this object

Implements NOX::Abstract::Vector.

Definition at line 140 of file NOX_Petsc_Vector.C.

References petscVec.

Abstract::Vector & Vector::operator= ( const Vec &  source  )  [virtual]

Copies source vector into "this".

Definition at line 78 of file NOX_Petsc_Vector.C.

References isAlloc, and petscVec.

Referenced by operator=().

Abstract::Vector & Vector::operator= ( const Abstract::Vector source  )  [virtual]

See above.

Implements NOX::Abstract::Vector.

Definition at line 87 of file NOX_Petsc_Vector.C.

References operator=().

Abstract::Vector & Vector::abs ( const Abstract::Vector source  )  [virtual]

See above.

Implements NOX::Abstract::Vector.

Definition at line 147 of file NOX_Petsc_Vector.C.

Abstract::Vector & Vector::reciprocal ( const Abstract::Vector source  )  [virtual]

See above.

Implements NOX::Abstract::Vector.

Definition at line 161 of file NOX_Petsc_Vector.C.

Abstract::Vector & Vector::scale ( double  gamma  )  [virtual]

Scale each element of this vector by gamma.

Here x represents this vector, and we update it as

\[ x_i = \gamma x_i \quad \mbox{for } i=1,\dots,n \]

Returns:
Reference to this object

Implements NOX::Abstract::Vector.

Definition at line 175 of file NOX_Petsc_Vector.C.

References petscVec.

Referenced by NOX::Petsc::Group::computeNewton(), and scale().

Abstract::Vector & Vector::scale ( const Abstract::Vector a  )  [virtual]

See above.

Implements NOX::Abstract::Vector.

Definition at line 182 of file NOX_Petsc_Vector.C.

References scale().

Abstract::Vector & Vector::update ( double  alpha,
const Abstract::Vector a,
double  gammaval = 0.0 
) [virtual]

See above.

Implements NOX::Abstract::Vector.

Definition at line 195 of file NOX_Petsc_Vector.C.

Abstract::Vector & Vector::update ( double  alpha,
const Abstract::Vector a,
double  beta,
const Abstract::Vector b,
double  gammaval = 0.0 
) [virtual]

See above.

Implements NOX::Abstract::Vector.

Definition at line 210 of file NOX_Petsc_Vector.C.

Teuchos::RCP< NOX::Abstract::Vector > Vector::clone ( CopyType  type = DeepCopy  )  const [virtual]

Create a new Vector of the same underlying type by cloning "this", and return a pointer to the new vector.

If type is NOX::DeepCopy, then we need to create an exact replica of "this". Otherwise, if type is NOX::ShapeCopy, we need only replicate the shape of "this" (the memory is allocated for the objects, but the current values are not copied into the vector). Note that there is no assumption that a vector created by ShapeCopy is initialized to zeros.

Returns:
Pointer to newly created vector or NULL if clone is not supported.

Implements NOX::Abstract::Vector.

Definition at line 230 of file NOX_Petsc_Vector.C.

References petscVec.

double Vector::norm ( Abstract::Vector::NormType  type = TwoNorm  )  const [virtual]

double Vector::norm ( const Abstract::Vector weights  )  const [virtual]

See above.

Implements NOX::Abstract::Vector.

Definition at line 257 of file NOX_Petsc_Vector.C.

References norm().

double Vector::innerProduct ( const Abstract::Vector y  )  const [virtual]

See above.

Implements NOX::Abstract::Vector.

Definition at line 272 of file NOX_Petsc_Vector.C.

int Vector::length (  )  const [virtual]

Return the length of vector.

Returns:
The length of this vector
Note:
Even if the vector is distributed across processors, this should return the global length of the vector.

Implements NOX::Abstract::Vector.

Definition at line 286 of file NOX_Petsc_Vector.C.

References petscVec.


Member Data Documentation

Pointer to Petsc vector owned by this object.

Definition at line 173 of file NOX_Petsc_Vector.H.

Referenced by clone(), getPetscVector(), init(), length(), norm(), operator=(), and scale().

bool NOX::Petsc::Vector::isAlloc [protected]

Flag to indicate if the vector has been allocated.

Definition at line 176 of file NOX_Petsc_Vector.H.

Referenced by operator=(), and ~Vector().


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

Generated on Wed Oct 21 14:28:48 2009 for Nonlinear Solver Project by  doxygen 1.5.9