16 #ifndef dealii_matrix_out_h 17 # define dealii_matrix_out_h 26 # ifdef DEAL_II_WITH_TRILINOS 112 Options(
const bool show_absolute_values =
false,
113 const unsigned int block_size = 1,
114 const bool discontinuous =
false);
139 template <
class Matrix>
142 const std::string &
name,
168 virtual const std::vector<Patch> &
175 virtual std::vector<std::string>
185 template <
class Matrix>
199 namespace MatrixOutImplementation
204 template <
typename number>
210 return matrix.el(i, j);
218 template <
typename number>
224 return matrix.el(i, j);
228 # ifdef DEAL_II_WITH_TRILINOS 237 return matrix.
el(i, j);
251 return matrix.
el(i, j);
256 # ifdef DEAL_II_WITH_PETSC 268 template <
class Matrix>
281 template <
class Matrix>
318 average /= n_elements;
324 template <
class Matrix>
327 const std::string &
name,
331 (matrix.n() % options.
block_size != 0 ? 1 : 0)),
332 gridpoints_y = (matrix.m() / options.
block_size +
333 (matrix.m() % options.
block_size != 0 ? 1 : 0));
346 patches.resize((gridpoints_x) * (gridpoints_y));
350 for (
size_type i = 0; i < gridpoints_y; ++i)
351 for (
size_type j = 0; j < gridpoints_x; ++j, ++index)
360 patches[index].vertices[0](0) = j;
361 patches[index].vertices[0](1) = -static_cast<signed int>(i);
362 patches[index].vertices[1](0) = j;
363 patches[index].vertices[1](1) = -static_cast<signed int>(i + 1);
364 patches[index].vertices[2](0) = j + 1;
365 patches[index].vertices[2](1) = -static_cast<signed int>(i);
366 patches[index].vertices[3](0) = j + 1;
367 patches[index].vertices[3](1) = -static_cast<signed int>(i + 1);
375 patches[index].n_subdivisions = 1;
377 patches[index].data.reinit(1, 4);
TrilinosScalar el(const size_type i, const size_type j) const
types::global_dof_index size_type
double get_element(const ::SparseMatrix< number > &matrix, const types::global_dof_index i, const types::global_dof_index j)
static double get_gridpoint_value(const Matrix &matrix, const size_type i, const size_type j, const Options &options)
Contents is actually a matrix.
virtual std::vector< std::string > get_dataset_names() const override
std::vector< Patch > patches
virtual ~MatrixOut() override=default
#define DEAL_II_NAMESPACE_CLOSE
value_type el(const size_type i, const size_type j) const
Expression fabs(const Expression &x)
void build_patches(const Matrix &matrix, const std::string &name, const Options options=Options(false, 1, false))
bool show_absolute_values
unsigned int global_dof_index
#define DEAL_II_NAMESPACE_OPEN
T min(const T &t, const MPI_Comm &mpi_communicator)
double get_element(const Matrix &matrix, const types::global_dof_index i, const types::global_dof_index j)
Options(const bool show_absolute_values=false, const unsigned int block_size=1, const bool discontinuous=false)
virtual const std::vector< Patch > & get_patches() const override