Loading [MathJax]/extensions/tex2jax.js
DOLFINx
0.1.0
DOLFINx C++ interface
|
16 #include <xtl/xspan.hpp>
35 xtl::span<PetscScalar> x);
38 void petsc_error(
int error_code, std::string filename,
39 std::string petsc_function);
54 std::pair<std::reference_wrapper<const common::IndexMap>,
int>>& maps);
76 const std::vector<std::int64_t>& ghosts,
int bs);
82 std::pair<std::reference_wrapper<const common::IndexMap>,
int>>& maps);
86 Vec x,
const std::vector<xtl::span<const PetscScalar>>& x_b,
88 std::pair<std::reference_wrapper<const common::IndexMap>,
int>>& maps);
140 std::int64_t
size()
const;
void scatter_local_vectors(Vec x, const std::vector< xtl::span< const PetscScalar >> &x_b, const std::vector< std::pair< std::reference_wrapper< const common::IndexMap >, int >> &maps)
Scatter local vectors to Vec.
Definition: PETScVector.cpp:144
Norm
Norm types.
Definition: utils.h:15
std::string get_options_prefix() const
Returns the prefix used by PETSc when searching the options database.
Definition: PETScVector.cpp:295
PetscReal norm(la::Norm type) const
Compute norm of vector.
Definition: PETScVector.cpp:262
void petsc_error(int error_code, std::string filename, std::string petsc_function)
Print error message for PETSc calls that return an error.
Definition: PETScVector.cpp:26
This class represents the distribution index arrays across processes. An index array is a contiguous ...
Definition: IndexMap.h:48
void set_options_prefix(std::string options_prefix)
Sets the prefix used by PETSc when searching the options database.
Definition: PETScVector.cpp:288
std::int64_t size() const
Return global size of vector.
Definition: PETScVector.cpp:225
void set_from_options()
Call PETSc function VecSetFromOptions on the underlying Vec object.
Definition: PETScVector.cpp:304
PETScVector copy() const
Create a copy of the vector.
Definition: PETScVector.cpp:215
A simple wrapper for a PETSc vector pointer (Vec). Its main purpose is to assist with memory/lifetime...
Definition: PETScVector.h:95
PETScVector(const common::IndexMap &map, int bs)
Create vector.
Definition: PETScVector.cpp:188
std::int32_t local_size() const
Return local size of vector (belonging to this process)
Definition: PETScVector.cpp:234
Vec create_petsc_vector(const common::IndexMap &map, int bs)
Create a ghosted PETSc Vec.
Definition: PETScVector.cpp:76
Vec create_ghosted_vector(const common::IndexMap &map, int bs, xtl::span< PetscScalar > x)
Create a PETSc Vec that wraps the data in an array.
Definition: PETScVector.cpp:64
MPI_Comm mpi_comm() const
Return MPI communicator.
Definition: PETScVector.cpp:253
std::array< std::int64_t, 2 > local_range() const
Return ownership range for calling rank.
Definition: PETScVector.cpp:243
virtual ~PETScVector()
Destructor.
Definition: PETScVector.cpp:203
std::vector< std::vector< PetscScalar > > get_local_vectors(const Vec x, const std::vector< std::pair< std::reference_wrapper< const common::IndexMap >, int >> &maps)
Copy blocks from Vec into local vectors.
Definition: PETScVector.cpp:101
std::vector< IS > create_petsc_index_sets(const std::vector< std::pair< std::reference_wrapper< const common::IndexMap >, int >> &maps)
Definition: PETScVector.cpp:44
Vec vec() const
Return pointer to PETSc Vec object.
Definition: PETScVector.cpp:311