Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vector_block_utils.hpp File Reference
#include <petscsys.h>
#include <array>
#include <cassert>
#include <cinttypes>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <vector>
#include "vulpes/la/sparse_matrix.hpp"
#include "vulpes/la/vector.hpp"
Include dependency graph for vector_block_utils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  vulpes
namespace  vulpes::la

Functions

void vulpes::la::extractComponent (const Vector &blocked_vec, std::size_t f, Vector &comp)
 Extract one scalar component from a blocked vector into an existing scalar vector (owned entries; ghost entries untouched).
template<typename DofHandlerType>
Vector vulpes::la::extractComponent (const Vector &blocked_vec, const DofHandlerType &dof_handler, std::size_t f)
 Extract one scalar component from a blocked vector into a new vector.
template<std::size_t NFields, typename DofHandlerType>
std::vector< Vector > vulpes::la::extractAllComponents (const Vector &blocked_vec, const DofHandlerType &dof_handler)
 Extract all scalar components from a blocked vector.
template<std::size_t NFields, typename DofHandlerType>
Vector vulpes::la::mergeBlockedVector (const std::vector< Vector > &scalars, const DofHandlerType &dof_handler)
 Merge scalar vectors into a blocked vector.
void vulpes::la::addComponent (const Vector &scalar_vec, Vector &blocked_vec, std::size_t f)
 Add a scalar vector into one stride of a blocked vector.
void vulpes::la::extractDiagonalBlockComponent (const SparseMatrix &blocked_mat, std::size_t component, SparseMatrix &scalar_mat, double zero_tol=0.0)
 Extract one scalar diagonal component from a blocked matrix.
template<std::size_t NFields>
void vulpes::la::mergeDiagonalBlockedMatrix (const std::array< std::reference_wrapper< const SparseMatrix >, NFields > &scalar_components, SparseMatrix &blocked_mat, double zero_tol=0.0)
 Merge scalar diagonal component matrices into a blocked matrix.

Variables

static constexpr PetscInt vulpes::la::kMaxDenseExtractSize = 2000
 Largest scalar dimension for which the dense helpers below call toEigenDense(). Beyond it the O(N^2) dense allocation would exhaust memory, so these helpers abort.