|
VMTK
|
Serves as the base class for vectors utilized in finite-element and other PDE evaluations. More...
#include <vtkvmtkDoubleVector.h>
Public Types | |
| typedef vtkObject | Superclass |
Public Member Functions | |
| virtual int | IsA (const char *type) |
| vtkvmtkDoubleVector * | NewInstance () const |
| virtual vtkIdType | GetNumberOfElements () |
| virtual vtkIdType | GetNumberOfElementsPerVariable () |
| virtual vtkIdType | GetNumberOfVariables () |
| void | Allocate (vtkIdType numberOfElementsPerVariable, vtkIdType numberOfVariables=1) |
| void | Fill (double value) |
| void | Assign (vtkvmtkDoubleVector *src) |
| void | Assign (vtkIdType numberOfElements, const double *array) |
| double | GetElement (vtkIdType i) |
| void | SetElement (vtkIdType i, double value) |
| void | AddElement (vtkIdType i, double value) |
| const double * | GetArray () |
| void | CopyIntoArrayComponent (vtkDataArray *array, int component) |
| void | CopyVariableIntoArrayComponent (vtkDataArray *array, int variable, int component) |
| double | ComputeNorm () |
| void | Add (vtkvmtkDoubleVector *vectorToAdd) |
| void | Subtract (vtkvmtkDoubleVector *vectorToSubtract) |
| void | MultiplyBy (double scalar) |
| double | Dot (vtkvmtkDoubleVector *vectorToDotWith) |
| void | DeepCopy (vtkvmtkDoubleVector *src) |
| virtual void | SetNormType (int) |
| virtual int | GetNormType () |
| void | SetNormTypeToL2 () |
| void | SetNormTypeToLInf () |
Static Public Member Functions | |
| static vtkvmtkDoubleVector * | New () |
| static int | IsTypeOf (const char *type) |
| static vtkvmtkDoubleVector * | SafeDownCast (vtkObjectBase *o) |
Protected Member Functions | |
| virtual vtkObjectBase * | NewInstanceInternal () const |
| vtkvmtkDoubleVector () | |
| ~vtkvmtkDoubleVector () | |
Protected Attributes | |
| vtkIdType | NumberOfElements |
| vtkIdType | NumberOfElementsPerVariable |
| vtkIdType | NumberOfVariables |
| int | NormType |
| double * | Array |
Serves as the base class for vectors utilized in finite-element and other PDE evaluations.
vtkvmtkDoubleVector wraps a plain double array with the bookkeeping needed by vmtk's finite-element machinery: it can be Allocate()d for a given number of elements per variable and number of variables (so that, e.g., a solution with several unknowns per node can be stored as one contiguous array, see CopyVariableIntoArrayComponent), and it provides basic linear-algebra operations (Add, Subtract, MultiplyBy, Dot, ComputeNorm) used by iterative linear system solvers. It is used throughout the DifferentialGeometry classes as the concrete type for right-hand-side and solution vectors (see vtkvmtkLinearSystem, vtkvmtkFEAssembler).
Definition at line 45 of file vtkvmtkDoubleVector.h.
| typedef vtkObject vtkvmtkDoubleVector::Superclass |
Definition at line 50 of file vtkvmtkDoubleVector.h.
|
protected |
Definition at line 32 of file vtkvmtkDoubleVector.cxx.
|
protected |
Definition at line 42 of file vtkvmtkDoubleVector.cxx.
|
static |
|
static |
|
virtual |
|
static |
|
protectedvirtual |
| vtkvmtkDoubleVector * vtkvmtkDoubleVector::NewInstance | ( | ) | const |
|
virtual |
Set/get the norm type computed by ComputeNorm(): VTK_VMTK_L2_NORM (Euclidean norm, default) or VTK_VMTK_LINF_NORM (maximum element value).
|
virtual |
Set/get the norm type computed by ComputeNorm(): VTK_VMTK_L2_NORM (Euclidean norm, default) or VTK_VMTK_LINF_NORM (maximum element value).
|
inline |
Set/get the norm type computed by ComputeNorm(): VTK_VMTK_L2_NORM (Euclidean norm, default) or VTK_VMTK_LINF_NORM (maximum element value).
Definition at line 59 of file vtkvmtkDoubleVector.h.
|
inline |
Set/get the norm type computed by ComputeNorm(): VTK_VMTK_L2_NORM (Euclidean norm, default) or VTK_VMTK_LINF_NORM (maximum element value).
Definition at line 61 of file vtkvmtkDoubleVector.h.
|
virtual |
Get the total number of elements in the vector, i.e. NumberOfElementsPerVariable * NumberOfVariables.
|
virtual |
Get the number of elements per variable, as set by the last call to Allocate().
|
virtual |
Get the number of variables (i.e. the number of consecutive blocks of NumberOfElementsPerVariable elements), as set by the last call to Allocate().
| void vtkvmtkDoubleVector::Allocate | ( | vtkIdType | numberOfElementsPerVariable, |
| vtkIdType | numberOfVariables = 1 ) |
Allocate the internal array to hold numberOfElementsPerVariable * numberOfVariables elements, discarding any previous content. The array is laid out as numberOfVariables consecutive blocks of numberOfElementsPerVariable elements each (see CopyVariableIntoArrayComponent).
Definition at line 56 of file vtkvmtkDoubleVector.cxx.
| void vtkvmtkDoubleVector::Fill | ( | double | value | ) |
Set every element of the vector to value.
Definition at line 71 of file vtkvmtkDoubleVector.cxx.
| void vtkvmtkDoubleVector::Assign | ( | vtkvmtkDoubleVector * | src | ) |
Copy the contents of src into this vector. The two vectors must already have the same number of elements.
Definition at line 87 of file vtkvmtkDoubleVector.cxx.
| void vtkvmtkDoubleVector::Assign | ( | vtkIdType | numberOfElements, |
| const double * | array ) |
Copy numberOfElements values from the raw C array into this vector's internal array (which must already be allocated with at least that many elements).
Definition at line 98 of file vtkvmtkDoubleVector.cxx.
|
inline |
|
inline |
Set the value of the i-th element.
Definition at line 114 of file vtkvmtkDoubleVector.h.
|
inline |
Add value to the current value of the i-th element.
Definition at line 119 of file vtkvmtkDoubleVector.h.
|
inline |
Get direct read-only access to the underlying raw double array.
Definition at line 128 of file vtkvmtkDoubleVector.h.
| void vtkvmtkDoubleVector::CopyIntoArrayComponent | ( | vtkDataArray * | array, |
| int | component ) |
Copy this vector's elements into the given component of array, growing array's number of components and/or tuples as needed to fit.
Definition at line 191 of file vtkvmtkDoubleVector.cxx.
| void vtkvmtkDoubleVector::CopyVariableIntoArrayComponent | ( | vtkDataArray * | array, |
| int | variable, | ||
| int | component ) |
Copy the block of NumberOfElementsPerVariable elements belonging to the given variable index into the given component of array, growing array's number of components and/or tuples as needed to fit.
Definition at line 217 of file vtkvmtkDoubleVector.cxx.
| double vtkvmtkDoubleVector::ComputeNorm | ( | ) |
Compute and return the norm of the vector, according to NormType.
Definition at line 104 of file vtkvmtkDoubleVector.cxx.
| void vtkvmtkDoubleVector::Add | ( | vtkvmtkDoubleVector * | vectorToAdd | ) |
Add vectorToAdd element-wise to this vector (in place). The two vectors must have the same number of elements.
Definition at line 136 of file vtkvmtkDoubleVector.cxx.
| void vtkvmtkDoubleVector::Subtract | ( | vtkvmtkDoubleVector * | vectorToSubtract | ) |
Subtract vectorToSubtract element-wise from this vector (in place). The two vectors must have the same number of elements.
Definition at line 150 of file vtkvmtkDoubleVector.cxx.
| void vtkvmtkDoubleVector::MultiplyBy | ( | double | scalar | ) |
Multiply every element of this vector by scalar (in place).
Definition at line 164 of file vtkvmtkDoubleVector.cxx.
| double vtkvmtkDoubleVector::Dot | ( | vtkvmtkDoubleVector * | vectorToDotWith | ) |
Compute and return the dot product of this vector with vectorToDotWith. The two vectors must have the same number of elements.
Definition at line 172 of file vtkvmtkDoubleVector.cxx.
| void vtkvmtkDoubleVector::DeepCopy | ( | vtkvmtkDoubleVector * | src | ) |
Reallocate this vector's internal array and copy into it the size and contents of src.
Definition at line 243 of file vtkvmtkDoubleVector.cxx.
|
protected |
Definition at line 180 of file vtkvmtkDoubleVector.h.
|
protected |
Definition at line 181 of file vtkvmtkDoubleVector.h.
|
protected |
Definition at line 182 of file vtkvmtkDoubleVector.h.
|
protected |
Definition at line 184 of file vtkvmtkDoubleVector.h.
|
protected |
Definition at line 186 of file vtkvmtkDoubleVector.h.