NOX
Development
|
Implementation of NOX::Abstract::Vector for Petsc vectors. More...
#include <NOX_Petsc_Vector.H>
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, std::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 NOX::size_type | length () const |
Return the length of vector. More... | |
std::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::Vector & | init (double value) |
Initialize every element of this vector with gamma . More... | |
virtual Abstract::Vector & | operator= (const Vec &source) |
Copies source vector into "this". | |
virtual Abstract::Vector & | operator= (const Vector &source) |
virtual Abstract::Vector & | operator= (const Abstract::Vector &source) |
See above. | |
virtual Abstract::Vector & | abs (const Vector &source) |
virtual Abstract::Vector & | abs (const Abstract::Vector &source) |
See above. | |
virtual Abstract::Vector & | random (bool useSeed=false, int seed=1) |
Initialize each element of this vector with a random value. More... | |
virtual Abstract::Vector & | reciprocal (const Vector &source) |
virtual Abstract::Vector & | reciprocal (const Abstract::Vector &source) |
See above. | |
virtual Abstract::Vector & | scale (double gammaval) |
Scale each element of this vector by gamma . More... | |
virtual Abstract::Vector & | scale (const Vector &a) |
virtual Abstract::Vector & | scale (const Abstract::Vector &a) |
See above. | |
virtual Abstract::Vector & | update (double alpha, const Vector &a, double gammaval=0.0) |
virtual Abstract::Vector & | update (double alpha, const Abstract::Vector &a, double gammaval=0.0) |
See above. | |
virtual Abstract::Vector & | update (double alpha, const Vector &a, double beta, const Vector &b, double gammaval=0.0) |
virtual Abstract::Vector & | update (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. More... | |
virtual double | norm (Abstract::Vector::NormType type=TwoNorm) const |
Norm. More... | |
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. | |
Public Member Functions inherited from NOX::Abstract::Vector | |
Vector () | |
Abstract Vector constructor (does nothing) | |
virtual void | print (std::ostream &stream) const |
Print the vector. To be used for debugging only. | |
virtual Teuchos::RCP < NOX::Abstract::MultiVector > | createMultiVector (const NOX::Abstract::Vector *const *vecs, int numVecs, NOX::CopyType type=NOX::DeepCopy) const |
Create a MultiVector with numVecs+1 columns out of an array of Vectors. The vector stored under this will be the first column with the remaining numVecs columns given by vecs . More... | |
virtual Teuchos::RCP < NOX::Abstract::MultiVector > | createMultiVector (int numVecs, NOX::CopyType type=NOX::DeepCopy) const |
Create a MultiVector with numVecs columns. More... | |
Vec | petscVec |
Pointer to Petsc vector owned by this object. | |
bool | isAlloc |
Flag to indicate if the vector has been allocated. | |
std::string | name |
virtual int | allocate (const Vec &source, CopyType type=DeepCopy) |
Additional Inherited Members | |
Public Types inherited from NOX::Abstract::Vector | |
enum | NormType { TwoNorm, OneNorm, MaxNorm } |
Norm types used in norm() calculations. More... | |
Implementation of NOX::Abstract::Vector for Petsc vectors.
|
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.
Implements NOX::Abstract::Vector.
References petscVec, and Teuchos::rcp().
|
virtual |
Initialize every element of this vector with gamma
.
Here x represents this vector, and we update it as
Implements NOX::Abstract::Vector.
References petscVec.
|
virtual |
Return the length of vector.
Implements NOX::Abstract::Vector.
References petscVec.
|
virtual |
Norm.
Here x represents this vector, and we compute its norm as follows: for each NOX::Abstract::Vector::NormType:
Implements NOX::Abstract::Vector.
References NOX::Abstract::Vector::MaxNorm, NOX::Abstract::Vector::OneNorm, petscVec, and NOX::Abstract::Vector::TwoNorm.
Referenced by NOX::Petsc::Group::computeF(), and norm().
|
virtual |
Initialize each element of this vector with a random value.
If useSeed
is true, uses the value of seed
to seed the random number generator before filling the entries of this vector. So, if two calls are made where useSeed
is true and seed
is the same, then the vectors returned should be the same.
Default implementation throw an error. Only referenced by LOCA methods.
Implements NOX::Abstract::Vector.
References petscVec.
|
virtual |
Scale each element of this vector by gamma
.
Here x represents this vector, and we update it as
Implements NOX::Abstract::Vector.
References petscVec.
Referenced by NOX::Petsc::Group::computeNewton(), and scale().