VMTK
Loading...
Searching...
No Matches
vtkvmtkDoubleVector.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: VMTK
4
5 Copyright (c) Luca Antiga, David Steinman. All rights reserved.
6 See LICENSE file for details.
7
8 Portions of this code are covered under the VTK copyright.
9 See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
10 for details.
11
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
15
16=========================================================================*/
33
34#ifndef __vtkvmtkDoubleVector_h
35#define __vtkvmtkDoubleVector_h
36
37#include "vtkObject.h"
38#include "vtkDataArray.h"
39//#include "vtkvmtkDifferentialGeometryWin32Header.h"
40#include "vtkvmtkWin32Header.h"
41
42#define VTK_VMTK_L2_NORM 0
43#define VTK_VMTK_LINF_NORM 1
44
45class VTK_VMTK_DIFFERENTIAL_GEOMETRY_EXPORT vtkvmtkDoubleVector : public vtkObject
46{
47public:
48
50 vtkTypeMacro(vtkvmtkDoubleVector,vtkObject);
51
53
57 vtkSetMacro(NormType,int);
58 vtkGetMacro(NormType,int);
63
64
69 vtkGetMacro(NumberOfElements,vtkIdType);
70
74 vtkGetMacro(NumberOfElementsPerVariable,vtkIdType);
75
80 vtkGetMacro(NumberOfVariables,vtkIdType);
81
87 void Allocate(vtkIdType numberOfElementsPerVariable, vtkIdType numberOfVariables=1);
88
92 void Fill(double value);
93
98 void Assign(vtkvmtkDoubleVector *src);
99
104 void Assign(vtkIdType numberOfElements, const double *array);
105
109 double GetElement(vtkIdType i) {return this->Array[i];};
110
114 void SetElement(vtkIdType i, double value) {this->Array[i] = value;};
115
119 void AddElement(vtkIdType i, double value) {this->Array[i] += value;};
120
121 //bool GetLocked(vtkIdType i) {return this->Locked[i];}
122 //void SetLocked(vtkIdType i, bool locked) {this->Locked[i] = locked;}
123 //void UnlockAll();
124
128 const double* GetArray() {return this->Array;};
129
134 void CopyIntoArrayComponent(vtkDataArray *array, int component);
135
141 void CopyVariableIntoArrayComponent(vtkDataArray *array, int variable, int component);
142
146 double ComputeNorm();
147
152 void Add(vtkvmtkDoubleVector* vectorToAdd);
153
158 void Subtract(vtkvmtkDoubleVector* vectorToSubtract);
159
163 void MultiplyBy(double scalar);
164
169 double Dot(vtkvmtkDoubleVector* vectorToDotWith);
170
174 void DeepCopy(vtkvmtkDoubleVector *src);
175
176protected:
179
183
185
186 double* Array;
187 //bool* Locked;
188
189private:
190 vtkvmtkDoubleVector(const vtkvmtkDoubleVector&); // Not implemented.
191 void operator=(const vtkvmtkDoubleVector&); // Not implemented.
192};
193
194#endif
195
Serves as the base class for vectors utilized in finite-element and other PDE evaluations.
virtual void SetNormType(int)
static vtkvmtkDoubleVector * New()
void AddElement(vtkIdType i, double value)
void Fill(double value)
double GetElement(vtkIdType i)
const double * GetArray()
void Assign(vtkvmtkDoubleVector *src)
void Allocate(vtkIdType numberOfElementsPerVariable, vtkIdType numberOfVariables=1)
void SetElement(vtkIdType i, double value)
#define VTK_VMTK_LINF_NORM
#define VTK_VMTK_L2_NORM