#include <PetscVecTools.hpp>
Static Public Member Functions | |
static void | Assemble (Vec vector) |
static void | Display (Vec vector) |
static void | Zero (Vec vector) |
static void | SetElement (Vec vector, PetscInt row, double value) |
static void | AddToElement (Vec vector, PetscInt row, double value) |
static unsigned | GetSize (Vec vector) |
static void | GetOwnershipRange (Vec vector, PetscInt &lo, PetscInt &hi) |
static double | GetElement (Vec vector, PetscInt row) |
static void | AddScaledVector (Vec y, Vec x, double scaleFactor) |
static void | Scale (Vec vector, double scaleFactor) |
static void | WAXPY (Vec w, double a, Vec x, Vec y) |
template<size_t VECTOR_SIZE> | |
static void | AddMultipleValues (Vec vector, unsigned *vectorIndices, c_vector< double, VECTOR_SIZE > &smallVector) |
static void | SetupInterleavedVectorScatterGather (Vec interleavedVec, VecScatter &rFirstVariableScatterContext, VecScatter &rSecondVariableScatterContext) |
static void | DoInterleavedVecScatter (Vec interleavedVec, VecScatter firstVariableScatterContext, Vec firstVariableVec, VecScatter secondVariableScatterContext, Vec secondVariableVec) |
static void | DoInterleavedVecGather (Vec interleavedVec, VecScatter firstVariableScatterContext, Vec firstVariableVec, VecScatter secondVariableScatterContext, Vec secondVariableVec) |
Definition at line 40 of file PetscVecTools.hpp.
void PetscVecTools::Assemble | ( | Vec | vector | ) | [static] |
Do parallel communication required to get the vector in a good state for further operations.
vector | the vector to assemble |
Definition at line 41 of file PetscVecTools.cpp.
Referenced by LinearSystem::AssembleRhsVector(), and AbstractNonlinearAssemblerSolverHybrid< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputeResidual().
void PetscVecTools::Display | ( | Vec | vector | ) | [static] |
Display the given vector.
vector | the vector to display |
Definition at line 69 of file PetscVecTools.cpp.
Referenced by LinearSystem::DisplayRhs().
void PetscVecTools::Zero | ( | Vec | vector | ) | [static] |
Zero all entries of a given vector.
vector | the vector to be zero |
Definition at line 74 of file PetscVecTools.cpp.
Referenced by BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ApplyDirichletToLinearProblem(), AbstractFeObjectAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX, INTERPOLATION_LEVEL >::DoAssemble(), and LinearSystem::ZeroRhsVector().
void PetscVecTools::SetElement | ( | Vec | vector, | |
PetscInt | row, | |||
double | value | |||
) | [static] |
Set an element of a vector to a given value.
vector | the vector to modify | |
row | the row index | |
value | the value to set this entry |
Definition at line 47 of file PetscVecTools.cpp.
References GetOwnershipRange().
Referenced by BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ApplyDirichletToLinearProblem(), AbstractBidomainSolver< ELEMENT_DIM, SPACE_DIM >::FinaliseForBath(), and LinearSystem::SetRhsVectorElement().
void PetscVecTools::AddToElement | ( | Vec | vector, | |
PetscInt | row, | |||
double | value | |||
) | [static] |
Add a value to an element of a vector.
vector | the vector to modify | |
row | the row index | |
value | the value to set this entry |
Definition at line 58 of file PetscVecTools.cpp.
References GetOwnershipRange().
Referenced by LinearSystem::AddToRhsVectorElement(), and AbstractNonlinearAssemblerSolverHybrid< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputeJacobianNumerically().
unsigned PetscVecTools::GetSize | ( | Vec | vector | ) | [static] |
Get the size of a vector.
vector | the vector |
Definition at line 84 of file PetscVecTools.cpp.
void PetscVecTools::GetOwnershipRange | ( | Vec | vector, | |
PetscInt & | lo, | |||
PetscInt & | hi | |||
) | [static] |
Get this process's ownership range of the contents of the vector.
vector | the vector | |
lo | lowest index owned by this process | |
hi | highest index owned by this process |
Definition at line 91 of file PetscVecTools.cpp.
Referenced by AddMultipleValues(), AddToElement(), GetElement(), and SetElement().
double PetscVecTools::GetElement | ( | Vec | vector, | |
PetscInt | row | |||
) | [static] |
Return an element of a vector. May only be called for elements you own.
vector | the vector | |
row | the row index |
Definition at line 96 of file PetscVecTools.cpp.
References GetOwnershipRange().
Referenced by LinearSystem::GetRhsVectorElement().
void PetscVecTools::AddScaledVector | ( | Vec | y, | |
Vec | x, | |||
double | scaleFactor | |||
) | [static] |
Computes y += ax, using the PETSc method VecAXPY (with appropriate arguments for the PETSc version).
y | the vector which is added to | |
x | the vector which is scaled and added to y | |
scaleFactor | the value 'a' above, the factor x is multiplied by. |
Definition at line 111 of file PetscVecTools.cpp.
Referenced by BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ApplyDirichletToLinearProblem(), and SimpleNewtonNonlinearSolver::Solve().
void PetscVecTools::Scale | ( | Vec | vector, | |
double | scaleFactor | |||
) | [static] |
Scale the given vector. Calls VecScale (using the appropriate arguments for the PETSc version).
vector | the vector | |
scaleFactor | the scale factor |
Definition at line 123 of file PetscVecTools.cpp.
Referenced by AbstractNonlinearAssemblerSolverHybrid< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputeJacobianNumerically().
void PetscVecTools::WAXPY | ( | Vec | w, | |
double | a, | |||
Vec | x, | |||
Vec | y | |||
) | [static] |
Calls the PETSc function VecWAXPY (using the appropriate arguments for the PETSc version), which does w = ax+y, where x,y,w are distinct vectors and a is scalar.
w | the result vector | |
a | the scale factor | |
x | the scale vector | |
y | the other vector |
Definition at line 132 of file PetscVecTools.cpp.
Referenced by AbstractNonlinearAssemblerSolverHybrid< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputeJacobianNumerically(), and SimpleNewtonNonlinearSolver::Solve().
static void PetscVecTools::AddMultipleValues | ( | Vec | vector, | |
unsigned * | vectorIndices, | |||
c_vector< double, VECTOR_SIZE > & | smallVector | |||
) | [inline, static] |
Add multiple values to a vector.
vector | the vector to modify | |
vectorIndices | mapping from index of the ublas vector (see param below) to index of the vector of this linear system | |
smallVector | Ublas vector containing the values to be added |
Definition at line 142 of file PetscVecTools.hpp.
References GetOwnershipRange().
Referenced by LinearSystem::AddRhsMultipleValues().
void PetscVecTools::SetupInterleavedVectorScatterGather | ( | Vec | interleavedVec, | |
VecScatter & | rFirstVariableScatterContext, | |||
VecScatter & | rSecondVariableScatterContext | |||
) | [static] |
Set up scatter/gather PETSc context for splitting a bidomain-like vector with interleaved values for two variables into two separate PETSc Vec containing each of them.
interleavedVec | Source vector with interleaved values. | |
rFirstVariableScatterContext | Context for scattering/gathering first variable | |
rSecondVariableScatterContext | Context for scattering/gathering second variable |
Definition at line 142 of file PetscVecTools.cpp.
References PetscTools::CreateVec().
Referenced by PCBlockDiagonal::PCBlockDiagonalCreate(), and PCLDUFactorisation::PCLDUFactorisationCreate().
void PetscVecTools::DoInterleavedVecScatter | ( | Vec | interleavedVec, | |
VecScatter | firstVariableScatterContext, | |||
Vec | firstVariableVec, | |||
VecScatter | secondVariableScatterContext, | |||
Vec | secondVariableVec | |||
) | [static] |
Performs scatter operation from a bidomain-like vector of interleaved values into two separate PETSc Vec.
interleavedVec | Source vector with interleaved values. | |
firstVariableScatterContext | Context for scattering/gathering first variable | |
firstVariableVec | Destination vector for first variable | |
secondVariableScatterContext | Context for scattering/gathering second variable | |
secondVariableVec | Destination vector for second variable |
Definition at line 172 of file PetscVecTools.cpp.
void PetscVecTools::DoInterleavedVecGather | ( | Vec | interleavedVec, | |
VecScatter | firstVariableScatterContext, | |||
Vec | firstVariableVec, | |||
VecScatter | secondVariableScatterContext, | |||
Vec | secondVariableVec | |||
) | [static] |
Performs scatter operation from a bidomain-like vector of interleaved values into two separate PETSc Vec.
interleavedVec | Destination vector for interleaved values. | |
firstVariableScatterContext | Context for scattering/gathering first variable | |
firstVariableVec | Source vector with first variable | |
secondVariableScatterContext | Context for scattering/gathering second variable | |
secondVariableVec | Source vector with second variable |
Definition at line 234 of file PetscVecTools.cpp.