Reference documentation for deal.II version GIT relicensing-136-gb80d0be4af 2024-03-18 08:20:02+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
DataOutBase::DataOutFilter Class Reference

#include <deal.II/base/data_out_base.h>

Classes

struct  Point3Comp
 

Public Member Functions

 DataOutFilter ()
 
 DataOutFilter (const DataOutBase::DataOutFilterFlags &flags)
 
template<int dim>
void write_point (const unsigned int index, const Point< dim > &p)
 
template<int dim>
void write_cell (const unsigned int index, const unsigned int start, const std::array< unsigned int, dim > &offsets)
 
void write_cell_single (const unsigned int index, const unsigned int start, const unsigned int n_points, const ReferenceCell &reference_cell)
 
void write_data_set (const std::string &name, const unsigned int dimension, const unsigned int set_num, const Table< 2, double > &data_vectors)
 
void fill_node_data (std::vector< double > &node_data) const
 
void fill_cell_data (const unsigned int local_node_offset, std::vector< unsigned int > &cell_data) const
 
std::string get_data_set_name (const unsigned int set_num) const
 
unsigned int get_data_set_dim (const unsigned int set_num) const
 
const double * get_data_set (const unsigned int set_num) const
 
unsigned int n_nodes () const
 
unsigned int n_cells () const
 
unsigned int n_data_sets () const
 
void flush_points ()
 
void flush_cells ()
 

Private Types

using Map3DPoint = std::multimap< Point< 3 >, unsigned int, Point3Comp >
 

Private Member Functions

void internal_add_cell (const unsigned int cell_index, const unsigned int pt_index)
 

Private Attributes

DataOutBase::DataOutFilterFlags flags
 
unsigned int node_dim
 
unsigned int num_cells
 
Map3DPoint existing_points
 
std::map< unsigned int, unsigned intfiltered_points
 
std::map< unsigned int, unsigned intfiltered_cells
 
std::vector< std::string > data_set_names
 
std::vector< unsigned intdata_set_dims
 
std::vector< std::vector< double > > data_sets
 

Detailed Description

DataOutFilter provides a way to remove redundant vertices and values generated by the deal.II output. By default, DataOutBase and the classes that build on it output data at each vertex of each cell. This means that data is output multiple times for each vertex of the mesh, once for each cell adjacent to the vertex. The purpose of this scheme is to support output of discontinuous quantities, either because the finite element space is discontinuous or because the quantity that is output is computed from a solution field and is discontinuous across faces (for example for quantities computed via DataPostprocessor; typical cases where output quantities are discontinuous are when a postprocessor computes a quantity using the gradient of the solution, which is generally discontinuous even if the element itself is continuous). Other cases where the output is discontinuous are if the data to be output is not a finite element field but, for example, results from a class such as MatrixOut.

This class is an attempt to rein in the amount of data that is written. If the fields that are written to files are indeed discontinuous, the only way to faithfully represent them is indeed to write multiple values for each vertex (this is typically done by creating multiple logical nodes in the output file, all of which have the same physical location; data is then associated to nodes, allowing to have multiple values associated with the same location). However, for fine meshes, one may not necessarily be interested in an exact representation of output fields that will likely only have small discontinuities. Rather, it may be sufficient to just output one value per vertex, which may be chosen arbitrarily from among those that are defined at this vertex, i.e., chosen arbitrarily from any of the adjacent cells.

Definition at line 1398 of file data_out_base.h.

Member Typedef Documentation

◆ Map3DPoint

using DataOutBase::DataOutFilter::Map3DPoint = std::multimap<Point<3>, unsigned int, Point3Comp>
private

Definition at line 1549 of file data_out_base.h.

Constructor & Destructor Documentation

◆ DataOutFilter() [1/2]

DataOutBase::DataOutFilter::DataOutFilter ( )

Default constructor.

Definition at line 421 of file data_out_base.cc.

◆ DataOutFilter() [2/2]

DataOutBase::DataOutFilter::DataOutFilter ( const DataOutBase::DataOutFilterFlags flags)

Constructor with a given set of flags. See DataOutFilterFlags for possible flags.

Definition at line 429 of file data_out_base.cc.

Member Function Documentation

◆ write_point()

template<int dim>
void DataOutBase::DataOutFilter::write_point ( const unsigned int  index,
const Point< dim > &  p 
)

Write a point with the specified index into the filtered data set. If the point already exists and we are filtering redundant values, the provided index will internally refer to another recorded point.

Definition at line 439 of file data_out_base.cc.

◆ write_cell()

template<int dim>
void DataOutBase::DataOutFilter::write_cell ( const unsigned int  index,
const unsigned int  start,
const std::array< unsigned int, dim > &  offsets 
)

Record a deal.II cell in the internal reordered format.

Definition at line 572 of file data_out_base.cc.

◆ write_cell_single()

void DataOutBase::DataOutFilter::write_cell_single ( const unsigned int  index,
const unsigned int  start,
const unsigned int  n_points,
const ReferenceCell reference_cell 
)

Record a single deal.II cell without subdivisions (e.g. simplex) in the internal reordered format.

Definition at line 635 of file data_out_base.cc.

◆ write_data_set()

void DataOutBase::DataOutFilter::write_data_set ( const std::string &  name,
const unsigned int  dimension,
const unsigned int  set_num,
const Table< 2, double > &  data_vectors 
)

Filter and record a data set. If there are multiple values at a given vertex and redundant values are being removed, one is arbitrarily chosen as the recorded value. In the future this can be expanded to average/min/max multiple values at a given vertex.

Definition at line 656 of file data_out_base.cc.

◆ fill_node_data()

void DataOutBase::DataOutFilter::fill_node_data ( std::vector< double > &  node_data) const

Resize and fill a vector with all the filtered node vertex points, for output to a file.

Definition at line 481 of file data_out_base.cc.

◆ fill_cell_data()

void DataOutBase::DataOutFilter::fill_cell_data ( const unsigned int  local_node_offset,
std::vector< unsigned int > &  cell_data 
) const

Resize and fill a vector with all the filtered cell vertex indices, for output to a file.

Definition at line 496 of file data_out_base.cc.

◆ get_data_set_name()

std::string DataOutBase::DataOutFilter::get_data_set_name ( const unsigned int  set_num) const

Get the name of the data set indicated by the set number.

Definition at line 511 of file data_out_base.cc.

◆ get_data_set_dim()

unsigned int DataOutBase::DataOutFilter::get_data_set_dim ( const unsigned int  set_num) const

Get the dimensionality of the data set indicated by the set number.

Definition at line 519 of file data_out_base.cc.

◆ get_data_set()

const double * DataOutBase::DataOutFilter::get_data_set ( const unsigned int  set_num) const

Get the raw double valued data of the data set indicated by the set number.

Definition at line 527 of file data_out_base.cc.

◆ n_nodes()

unsigned int DataOutBase::DataOutFilter::n_nodes ( ) const

Return the number of nodes in this DataOutFilter. This may be smaller than the original number of nodes if filtering is enabled.

Definition at line 535 of file data_out_base.cc.

◆ n_cells()

unsigned int DataOutBase::DataOutFilter::n_cells ( ) const

Return the number of filtered cells in this DataOutFilter. Cells are not filtered so this will be the original number of cells.

Definition at line 543 of file data_out_base.cc.

◆ n_data_sets()

unsigned int DataOutBase::DataOutFilter::n_data_sets ( ) const

Return the number of filtered data sets in this DataOutFilter. Data sets are not filtered so this will be the original number of data sets.

Definition at line 551 of file data_out_base.cc.

◆ flush_points()

void DataOutBase::DataOutFilter::flush_points ( )

Empty functions to do base class inheritance.

Definition at line 559 of file data_out_base.cc.

◆ flush_cells()

void DataOutBase::DataOutFilter::flush_cells ( )

Empty functions to do base class inheritance.

Definition at line 565 of file data_out_base.cc.

◆ internal_add_cell()

void DataOutBase::DataOutFilter::internal_add_cell ( const unsigned int  cell_index,
const unsigned int  pt_index 
)
private

Record a cell vertex index based on the internal reordering.

Definition at line 468 of file data_out_base.cc.

Member Data Documentation

◆ flags

DataOutBase::DataOutFilterFlags DataOutBase::DataOutFilter::flags
private

Flags used to specify filtering behavior.

Definition at line 1554 of file data_out_base.h.

◆ node_dim

unsigned int DataOutBase::DataOutFilter::node_dim
private

The number of space dimensions in which the vertices represented by the current object live. This corresponds to the usual dim argument, but since this class is not templated on the dimension, we need to store it here.

Definition at line 1562 of file data_out_base.h.

◆ num_cells

unsigned int DataOutBase::DataOutFilter::num_cells
private

The number of cells stored in filtered_cells.

Definition at line 1568 of file data_out_base.h.

◆ existing_points

Map3DPoint DataOutBase::DataOutFilter::existing_points
private

Map of points to an internal index.

Definition at line 1573 of file data_out_base.h.

◆ filtered_points

std::map<unsigned int, unsigned int> DataOutBase::DataOutFilter::filtered_points
private

Map of actual point index to internal point index.

Definition at line 1578 of file data_out_base.h.

◆ filtered_cells

std::map<unsigned int, unsigned int> DataOutBase::DataOutFilter::filtered_cells
private

Map of cells to the filtered points.

Definition at line 1583 of file data_out_base.h.

◆ data_set_names

std::vector<std::string> DataOutBase::DataOutFilter::data_set_names
private

Data set names.

Definition at line 1588 of file data_out_base.h.

◆ data_set_dims

std::vector<unsigned int> DataOutBase::DataOutFilter::data_set_dims
private

Data set dimensions.

Definition at line 1593 of file data_out_base.h.

◆ data_sets

std::vector<std::vector<double> > DataOutBase::DataOutFilter::data_sets
private

Data set data.

Definition at line 1598 of file data_out_base.h.


The documentation for this class was generated from the following files: