PETSC vector for linear algebra. More...
PETSC vector for linear algebra.
This vector wrap the PETSC vector for solving linear systems
Definition at line 106 of file Vector_petsc.hpp.
#include <Vector_petsc.hpp>
Public Member Functions | |
Vector (const Vector< T, PETSC_BASE > &v) | |
Copy the vector. | |
Vector (Vector< T, PETSC_BASE > &&v) | |
Copy the vector. | |
~Vector () | |
Destroy the vector. | |
Vector (size_t n, size_t n_row_local) | |
Create a vector with n elements. | |
Vector () | |
Create a vector with 0 elements. | |
void | resize (size_t row, size_t l_row) |
Resize the Vector. | |
void | insert (size_t i, T val) |
Return a reference to the vector element. | |
PetscScalar & | insert (size_t i) |
Return a reference to the vector element. | |
const PetscScalar & | insert (size_t i) const |
Return a reference to the vector element. | |
const PetscScalar & | operator() (size_t i) const |
Return a reference to the vector element. | |
PetscScalar & | operator() (size_t i) |
Return a reference to the vector element. | |
const Vec & | getVec () const |
Get the PETSC Vector object. | |
Vec & | getVec () |
Get the PETSC Vector object. | |
void | update () |
Update the Vector with the PETSC object. | |
Vector< T, PETSC_BASE > & | operator= (const Vector< T, PETSC_BASE > &v) |
Copy the vector. | |
Vector< T, PETSC_BASE > & | operator= (Vector< T, PETSC_BASE > &&v) |
Copy the vector. | |
void | setZero () |
Set to zero all the entries. | |
bool | write (std::string out, size_t opt=VTK_WRITER) |
Private Member Functions | |
void | setPetsc () const |
Set the Eigen internal vector. | |
Private Attributes | |
size_t | n_row |
Number of row the petsc vector has. | |
size_t | n_row_local |
Number of local rows. | |
bool | v_created = false |
Indicate if v has been allocated. | |
Vec | v |
Mutable vector. | |
openfpm::vector< rval< PetscScalar, PETSC_RVAL >, HeapMemory, memory_traits_inte > | row_val |
Mutable row value vector. | |
std::unordered_map< size_t, size_t > | map |
Global to local map. | |
T | invalid |
invalid | |
Destroy the vector.
Definition at line 177 of file Vector_petsc.hpp.
Create a vector with n elements.
n | global number of elements in the vector |
n_row_local | number |
Definition at line 189 of file Vector_petsc.hpp.
Create a vector with 0 elements.
Definition at line 201 of file Vector_petsc.hpp.
|
inline |
Get the PETSC Vector object.
Definition at line 334 of file Vector_petsc.hpp.
|
inline |
Get the PETSC Vector object.
Definition at line 322 of file Vector_petsc.hpp.
|
inline |
Return a reference to the vector element.
i | element |
Definition at line 246 of file Vector_petsc.hpp.
|
inline |
Return a reference to the vector element.
i | element |
Definition at line 264 of file Vector_petsc.hpp.
|
inline |
Return a reference to the vector element.
i | element |
val | value |
Definition at line 228 of file Vector_petsc.hpp.
|
inline |
Return a reference to the vector element.
i | element |
Definition at line 305 of file Vector_petsc.hpp.
|
inline |
Return a reference to the vector element.
i | element |
Definition at line 284 of file Vector_petsc.hpp.
|
inline |
Resize the Vector.
row | numbers of row |
l_row | number of local row |
Definition at line 214 of file Vector_petsc.hpp.
|
inlineprivate |
Set the Eigen internal vector.
Definition at line 133 of file Vector_petsc.hpp.
|
inline |
Set to zero all the entries.
Definition at line 408 of file Vector_petsc.hpp.
|
inline |
Update the Vector with the PETSC object.
Definition at line 344 of file Vector_petsc.hpp.
|
inline |
Definition at line 421 of file Vector_petsc.hpp.
|
private |
invalid
Definition at line 127 of file Vector_petsc.hpp.
|
mutableprivate |
Global to local map.
Definition at line 124 of file Vector_petsc.hpp.
|
private |
Number of row the petsc vector has.
Definition at line 109 of file Vector_petsc.hpp.
|
private |
Number of local rows.
Definition at line 112 of file Vector_petsc.hpp.
|
mutableprivate |
Mutable row value vector.
Definition at line 121 of file Vector_petsc.hpp.
|
mutableprivate |
Mutable vector.
Definition at line 118 of file Vector_petsc.hpp.
|
mutableprivate |
Indicate if v has been allocated.
Definition at line 115 of file Vector_petsc.hpp.