Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
|
#include <PetscVecTools.hpp>
Static Public Member Functions | |
static void | Finalise (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) |
A collection of static methods for working with PETSc vectors.
Definition at line 46 of file PetscVecTools.hpp.
|
inlinestatic |
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 |
N.B. Values which are not local (ie the row is not owned) will be skipped.
Definition at line 151 of file PetscVecTools.hpp.
References GetOwnershipRange().
Referenced by LinearSystem::AddRhsMultipleValues().
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 127 of file PetscVecTools.cpp.
Referenced by AbstractContinuumMechanicsSolver< DIM >::ApplyDirichletBoundaryConditions(), SimpleNewtonNonlinearSolver::Solve(), and OdeLinearSystemSolver::SolveOneTimeStep().
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 65 of file PetscVecTools.cpp.
References GetOwnershipRange().
Referenced by LinearSystem::AddToRhsVectorElement(), and AbstractNonlinearAssemblerSolverHybrid< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputeJacobianNumerically().
|
static |
Display the given vector.
vector | the vector to display |
Definition at line 76 of file PetscVecTools.cpp.
Referenced by LinearSystem::DisplayRhs().
|
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 254 of file PetscVecTools.cpp.
|
static |
Performs scatter operation from a bidomain-like vector of interleaved values into two separate PETSc Vec.
interleavedVec | Source vector with interleaved values. (The source vector is treated as read-only.) |
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 184 of file PetscVecTools.cpp.
|
static |
Do parallel communication required to get the vector in a good state for further operations. This is a wrapper to PETSc functions like VecAssemblyBegin.
vector | the vector to assemble |
Definition at line 48 of file PetscVecTools.cpp.
Referenced by AbstractContinuumMechanicsSolver< DIM >::ApplyDirichletBoundaryConditions(), StokesFlowSolver< DIM >::AssembleSystem(), CompressibleNonlinearElasticitySolver< DIM >::AssembleSystem(), IncompressibleNonlinearElasticitySolver< DIM >::AssembleSystem(), AbstractNonlinearAssemblerSolverHybrid< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputeResidual(), LinearSystem::FinaliseRhsVector(), AbstractNonlinearElasticitySolver< DIM >::FinishAssembleSystem(), and AbstractNonlinearElasticitySolver< DIM >::SolveSnes().
vector | the vector |
row | the row index |
Definition at line 112 of file PetscVecTools.cpp.
References GetOwnershipRange().
Referenced by LinearSystem::GetRhsVectorElement(), and MonodomainPurkinjeSolver< ELEMENT_DIM, SPACE_DIM >::SetIdentityBlockToLhsMatrix().
Returns this process's ownership range of the contents of the vector via arguments.
vector | the vector |
lo | lowest index owned by this process (returned) |
hi | highest index owned by this process (returned) |
Definition at line 107 of file PetscVecTools.cpp.
Referenced by AddMultipleValues(), AddToElement(), GetElement(), and SetElement().
vector | the vector |
Definition at line 100 of file PetscVecTools.cpp.
Referenced by AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::DoAssemble(), ContinuumMechanicsNeumannBcsAssembler< DIM >::DoAssemble(), and AbstractCardiacTissue< SPACE_DIM >::rGetPurkinjeIntracellularStimulusCacheReplicated().
Scale the given vector. Calls VecScale (using the appropriate arguments for the PETSc version).
vector | the vector |
scaleFactor | the scale factor |
Definition at line 136 of file PetscVecTools.cpp.
Referenced by AbstractNonlinearAssemblerSolverHybrid< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputeJacobianNumerically().
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 54 of file PetscVecTools.cpp.
References GetOwnershipRange().
Referenced by AbstractContinuumMechanicsSolver< DIM >::AddIdentityBlockForDummyPressureVariables(), AbstractContinuumMechanicsSolver< DIM >::ApplyDirichletBoundaryConditions(), AbstractBidomainSolver< ELEMENT_DIM, SPACE_DIM >::FinaliseForBath(), LinearSystem::SetRhsVectorElement(), NodeBasedCellPopulationWithBuskeUpdate< DIM >::UpdateNodeLocations(), and ParabolicGrowingDomainPdeModifier< DIM >::UpdateSolutionVector().
|
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 154 of file PetscVecTools.cpp.
References PetscTools::CreateVec(), PetscTools::Destroy(), and PETSC_DESTROY_PARAM.
Referenced by PCBlockDiagonal::PCBlockDiagonalCreate(), and PCLDUFactorisation::PCLDUFactorisationCreate().
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 145 of file PetscVecTools.cpp.
Referenced by AbstractNonlinearAssemblerSolverHybrid< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputeJacobianNumerically(), and SimpleNewtonNonlinearSolver::Solve().
|
static |
Zero all entries of a given vector.
vector | the vector to be zero |
Definition at line 90 of file PetscVecTools.cpp.
Referenced by AbstractContinuumMechanicsSolver< DIM >::ApplyDirichletBoundaryConditions(), CompressibleNonlinearElasticitySolver< DIM >::AssembleSystem(), IncompressibleNonlinearElasticitySolver< DIM >::AssembleSystem(), AbstractContinuumMechanicsAssembler< DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX >::DoAssemble(), ContinuumMechanicsNeumannBcsAssembler< DIM >::DoAssemble(), AbstractFeCableIntegralAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX, INTERPOLATION_LEVEL >::DoAssemble(), AbstractFeVolumeIntegralAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, CAN_ASSEMBLE_VECTOR, CAN_ASSEMBLE_MATRIX, INTERPOLATION_LEVEL >::DoAssemble(), StokesFlowSolver< DIM >::Solve(), LinearSystem::Solve(), and LinearSystem::ZeroRhsVector().