16#ifndef dealii_matrix_out_h
17# define dealii_matrix_out_h
26# ifdef DEAL_II_WITH_TRILINOS
138 template <
class Matrix>
141 const std::string &
name,
167 virtual const std::vector<Patch> &
174 virtual std::vector<std::string>
184 template <
class Matrix>
198 namespace MatrixOutImplementation
203 template <
typename number>
209 return matrix.el(i, j);
217 template <
typename number>
223 return matrix.el(i, j);
227# ifdef DEAL_II_WITH_TRILINOS
236 return matrix.el(i, j);
250 return matrix.el(i, j);
255# ifdef DEAL_II_WITH_PETSC
267 template <
class Matrix>
280template <
class Matrix>
312 average += std::fabs(
317 average /= n_elements;
323template <
class Matrix>
326 const std::string &name,
330 (matrix.n() % options.
block_size != 0 ? 1 : 0)),
331 gridpoints_y = (matrix.m() / options.
block_size +
332 (matrix.m() % options.
block_size != 0 ? 1 : 0));
345 patches.resize((gridpoints_x) * (gridpoints_y));
349 for (
size_type i = 0; i < gridpoints_y; ++i)
350 for (
size_type j = 0; j < gridpoints_x; ++j, ++index)
352 patches[index].n_subdivisions = 1;
362 patches[index].vertices[0](0) = j;
363 patches[index].vertices[0](1) = -
static_cast<signed int>(i);
364 patches[index].vertices[1](0) = j;
365 patches[index].vertices[1](1) = -
static_cast<signed int>(i + 1);
366 patches[index].vertices[2](0) = j + 1;
367 patches[index].vertices[2](1) = -
static_cast<signed int>(i);
368 patches[index].vertices[3](0) = j + 1;
369 patches[index].vertices[3](1) = -
static_cast<signed int>(i + 1);
374 for (
auto &vertex :
patches[index].vertices)
377 patches[index].n_subdivisions = 1;
379 patches[index].data.reinit(1, 4);
virtual const std::vector< Patch > & get_patches() const override
void build_patches(const Matrix &matrix, const std::string &name, const Options options=Options(false, 1, false))
static double get_gridpoint_value(const Matrix &matrix, const size_type i, const size_type j, const Options &options)
std::vector< Patch > patches
types::global_dof_index size_type
virtual ~MatrixOut() override=default
virtual std::vector< std::string > get_dataset_names() const override
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
constexpr const ReferenceCell Quadrilateral
double get_element(const ::SparseMatrix< number > &matrix, const types::global_dof_index i, const types::global_dof_index j)
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
unsigned int global_dof_index
bool show_absolute_values