Classes | |
class | ExcInvalidNumberOfSubdivisions |
Public Types | |
enum | CurvedCellRegion { no_curved_cells, curved_boundary, curved_inner_cells } |
typedef DataOut_DoFData< DH, DH::dimension, DH::space_dimension > ::cell_iterator | cell_iterator |
typedef DataOut_DoFData< DH, DH::dimension, DH::space_dimension > ::active_cell_iterator | active_cell_iterator |
Public Member Functions | |
virtual void | build_patches (const unsigned int n_subdivisions=0, const unsigned int n_threads=multithread_info.n_default_threads) |
virtual void | build_patches (const Mapping< DH::dimension, DH::space_dimension > &mapping, const unsigned int n_subdivisions=0, const unsigned int n_threads=multithread_info.n_default_threads, const CurvedCellRegion curved_region=curved_boundary) |
virtual cell_iterator | first_cell () |
virtual cell_iterator | next_cell (const cell_iterator &cell) |
Private Member Functions | |
void | build_some_patches (internal::DataOut::ParallelData< DH::dimension, DH::space_dimension > &data) |
Private Attributes | |
CurvedCellRegion | curved_cell_region |
The only thing this class offers is the function build_patches() which loops over all cells of the triangulation stored by the attach_dof_handler() function of the base class and convert the data on these to actual patches which are the objects that are later output by the functions of the base classes. You can give a parameter to the function which determines how many subdivisions in each coordinate direction are to be performed, i.e. of how many subcells each patch shall consist. Default is one, but you may want to choose a higher number for higher order elements, so as two for quadratic elements, three for cubic elements three, and so on. The purpose of this parameter is because most graphics programs do not allow to specify higher order shape functions in the file formats: only data at vertices can be plotted and is then shown as a bilinear interpolation within the interior of cells. This may be insufficient if you have higher order finite elements, and the only way to achieve better output is to subdivide each cell of the mesh into several cells for graphical output.
Note that after having called build_patches() once, you can call one or more of the write() functions of DataOutInterface. You can therefore output the same data in more than one format without having to rebuild the patches.
The base classes of this class, DataOutBase, DataOutInterface and DataOut_DoFData() offer several interfaces of their own. Refer to the DataOutBase class's documentation for a discussion of the different output formats presently supported, DataOutInterface for ways of selecting which format to use upon output at run-time and without the need to adapt your program when new formats become available, as well as for flags to determine aspects of output. The DataOut_DoFData() class's documentation has an example of using nodal data to generate output.
By default, this class produces patches for all active cells. Sometimes, this is not what you want, maybe because they are simply too many (and too small to be seen individually) or because you only want to see a certain region of the domain (for example in parallel programs such as the step-18 example program), or for some other reason.
For this, internally build_patches() does not generate the sequence of cells to be converted into patches itself, but relies on the two functions first_cell() and next_cell(). By default, they return the first active cell, and the next active cell, respectively. Since they are virtual
functions, you may overload them to select other cells for output. If cells are not active, interpolated values are taken for output instead of the exact values on active cells.
The two functions are not constant, so you may store information within your derived class about the last accessed cell. This is useful if the information of the last cell which was accessed is not sufficient to determine the next one.
There is one caveat, however: if you have cell data (in contrast to nodal, or dof, data) such as error indicators, then you must make sure that first_cell() and next_cell() only walk over active cells, since cell data cannot be interpolated to a coarser cell. If you do have cell data and use this pair of functions and they return a non-active cell, then an exception will be thrown.
typedef DataOut_DoFData<DH,DH::dimension,DH::space_dimension>::cell_iterator DataOut< dim, DH >::cell_iterator |
Typedef to the iterator type of the dof handler class under consideration.
Reimplemented from DataOut_DoFData< DH, DH::dimension, DH::space_dimension >.
typedef DataOut_DoFData<DH,DH::dimension,DH::space_dimension>::active_cell_iterator DataOut< dim, DH >::active_cell_iterator |
Reimplemented from DataOut_DoFData< DH, DH::dimension, DH::space_dimension >.
enum DataOut::CurvedCellRegion |
virtual void DataOut< dim, DH >::build_patches | ( | const unsigned int | n_subdivisions = 0 , |
|
const unsigned int | n_threads = multithread_info.n_default_threads | |||
) | [virtual] |
This is the central function of this class since it builds the list of patches to be written by the low-level functions of the base class. See the general documentation of this class for further information.
The default value 0
of n_subdivisions
indicates that the value stored in DataOutInterface::default_subdivisions is to be used.
The function supports multithreading, if deal.II is compiled in multithreading mode. The default number of threads to be used to build the patches is set to multithread_info.n_default_threads
.
Referenced by DoFPrintSolverStep< dim, SOLVER, VECTOR >::print_vectors().
virtual void DataOut< dim, DH >::build_patches | ( | const Mapping< DH::dimension, DH::space_dimension > & | mapping, | |
const unsigned int | n_subdivisions = 0 , |
|||
const unsigned int | n_threads = multithread_info.n_default_threads , |
|||
const CurvedCellRegion | curved_region = curved_boundary | |||
) | [virtual] |
Same as above, except that the additional first parameter defines a mapping that is to be used in the generation of output. If n_subdivisions>1
, the points interior of subdivided patches which originate from cells at the boundary of the domain can be computed using the mapping, i.e. a higher order mapping leads to a representation of a curved boundary by using more subdivisions. Some mappings like MappingQEulerian result in curved cells in the interior of the domain. However, there is nor easy way to get this information from the Mapping. Thus the last argument curved_region
take one of three values resulting in no curved cells at all, curved cells at the boundary (default) or curved cells in the whole domain.
Even for non-curved cells the mapping argument can be used for the Eulerian mappings (see class MappingQ1Eulerian) where a mapping is used not only to determine the position of points interior to a cell, but also of the vertices. It offers an opportunity to watch the solution on a deformed triangulation on which the computation was actually carried out, even if the mesh is internally stored in its undeformed configuration and the deformation is only tracked by an additional vector that holds the deformation of each vertex.
mapping
argument should be replaced by a hp::MappingCollection in case of a hp::DoFHandler. virtual cell_iterator DataOut< dim, DH >::first_cell | ( | ) | [virtual] |
Return the first cell which we want output for. The default implementation returns the first active cell, but you might want to return other cells in a derived class.
virtual cell_iterator DataOut< dim, DH >::next_cell | ( | const cell_iterator & | cell | ) | [virtual] |
Return the next cell after cell
which we want output for. If there are no more cells, dofs->end()
shall be returned.
The default implementation returns the next active cell, but you might want to return other cells in a derived class. Note that the default implementation assumes that the given cell
is active, which is guaranteed as long as first_cell() is also used from the default implementation. Overloading only one of the two functions might not be a good idea.
void DataOut< dim, DH >::build_some_patches | ( | internal::DataOut< dim, DH >::ParallelData< DH::dimension, DH::space_dimension > & | data | ) | [private] |
Builds every n_threads's
patch. This function may be called in parallel. If multithreading is not used, the function is called once and generates all patches.
CurvedCellRegion DataOut< dim, DH >::curved_cell_region [private] |
Store in which region cells shall be curved, if a Mapping is provided.