Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
DataOutBase::DataOutFilter Class Reference

#include <data_out_base.h>

Classes

struct  Point3Comp
 

Public Member Functions

 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 (unsigned int index, unsigned int start, unsigned int d1, unsigned int d2, unsigned int d3)
 
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 doubleget_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

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

Private Member Functions

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

Private Attributes

DataOutBase::DataOutFilterFlags flags
 Flags used to specify filtering behavior.
 
int node_dim
 Dimensionality of the nodes, used to properly output filtered data.
 
int n_cell_verts
 Number of vertices per cell.
 
Map3DPoint existing_points
 Map of points to an internal index.
 
std::map< unsigned int,
unsigned int
filtered_points
 Map of actual point index to internal point index.
 
std::map< unsigned int,
unsigned int
filtered_cells
 Map of cells to the filtered points.
 
std::vector< std::string > data_set_names
 Data set names.
 
std::vector< unsigned intdata_set_dims
 Data set dimensions.
 
std::vector< std::vector
< double > > 
data_sets
 Data set data.
 

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 corner of each cell. This means that data is output multiple times for each vertex of the mesh. 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.

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 writing multiple node locations for the same vertex and defining data at these nodes). 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 from any of the adjacent cells.

Definition at line 1229 of file data_out_base.h.

Member Function Documentation

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.

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.

template<int dim>
void DataOutBase::DataOutFilter::write_cell ( unsigned int  index,
unsigned int  start,
unsigned int  d1,
unsigned int  d2,
unsigned int  d3 
)

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

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.

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.

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.

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

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

Definition at line 1320 of file data_out_base.h.

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

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

Definition at line 1328 of file data_out_base.h.

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

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

Definition at line 1336 of file data_out_base.h.

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

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 1345 of file data_out_base.h.

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

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 1354 of file data_out_base.h.

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

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 1363 of file data_out_base.h.

void DataOutBase::DataOutFilter::flush_points ( )
inline

Empty functions to do base class inheritance.

Definition at line 1371 of file data_out_base.h.

void DataOutBase::DataOutFilter::flush_cells ( )
inline

Empty functions to do base class inheritance.

Definition at line 1376 of file data_out_base.h.


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