Public Types | Public Member Functions

MeshWorker::IntegrationInfoBox< dim, spacedim > Class Template Reference
[The MeshWorker interface]

List of all members.

Public Types

typedef IntegrationInfo< dim,
spacedim > 
CellInfo

Public Member Functions

 IntegrationInfoBox ()
void initialize (const FiniteElement< dim, spacedim > &el, const Mapping< dim, spacedim > &mapping, const BlockInfo *block_info=0)
template<typename VECTOR >
void initialize (const FiniteElement< dim, spacedim > &el, const Mapping< dim, spacedim > &mapping, const NamedData< VECTOR * > &data, const BlockInfo *block_info=0)
template<typename VECTOR >
void initialize (const FiniteElement< dim, spacedim > &el, const Mapping< dim, spacedim > &mapping, const NamedData< MGLevelObject< VECTOR > * > &data, const BlockInfo *block_info=0)
template<>
void initialize_gauss_quadrature (const unsigned int cp, const unsigned int, const unsigned int, bool force)
template<>
void initialize_gauss_quadrature (const unsigned int cp, const unsigned int, const unsigned int, bool force)
template<>
void initialize (const FiniteElement< 1, 1 > &el, const Mapping< 1, 1 > &mapping, const BlockInfo *block_info)
template<>
void initialize (const FiniteElement< 1, 2 > &el, const Mapping< 1, 2 > &mapping, const BlockInfo *block_info)

Public Attributes

Data vectors
MeshWorker::VectorSelector cell_selector
MeshWorker::VectorSelector boundary_selector
MeshWorker::VectorSelector face_selector
std_cxx1x::shared_ptr
< MeshWorker::VectorDataBase
< dim, spacedim > > 
cell_data
std_cxx1x::shared_ptr
< MeshWorker::VectorDataBase
< dim, spacedim > > 
boundary_data
std_cxx1x::shared_ptr
< MeshWorker::VectorDataBase
< dim, spacedim > > 
face_data

FEValues setup

UpdateFlags cell_flags
UpdateFlags boundary_flags
UpdateFlags face_flags
UpdateFlags neighbor_flags
Quadrature< dim > cell_quadrature
Quadrature< dim-1 > boundary_quadrature
Quadrature< dim-1 > face_quadrature
void initialize_update_flags ()
void add_update_flags_all (const UpdateFlags flags)
void add_update_flags_cell (const UpdateFlags flags)
void add_update_flags_boundary (const UpdateFlags flags)
void add_update_flags_face (const UpdateFlags flags)
void add_update_flags (const UpdateFlags flags, const bool cell=true, const bool boundary=true, const bool face=true, const bool neighbor=true)
void initialize_gauss_quadrature (unsigned int n_cell_points, unsigned int n_boundary_points, unsigned int n_face_points, const bool force=true)
std::size_t memory_consumption () const

Interface for MeshWorker::loop()

CellInfo cell
CellInfo boundary
CellInfo face
CellInfo subface
CellInfo neighbor
template<class DOFINFO >
void post_cell (const DoFInfoBox< dim, DOFINFO > &)
template<class DOFINFO >
void post_faces (const DoFInfoBox< dim, DOFINFO > &)

Detailed Description

template<int dim, int spacedim = dim>
class MeshWorker::IntegrationInfoBox< dim, spacedim >

The object holding the scratch data for integrating over cells and faces. IntegrationInfoBox serves three main purposes:

  1. It provides the interface needed by MeshWorker::loop(), namely the two functions post_cell() and post_faces(), as well as the data members cell, boundary, face, subface, and neighbor.

  2. It contains all information needed to initialize the FEValues and FEFaceValues objects in the IntegrationInfo data members.

  3. It stores information on finite element vectors and whether their data should be used to compute values or derivatives of functions at quadrature points.

  4. It makes educated guesses on quadrature rules and update flags, so that minimal code has to be written when default parameters are sufficient.

In order to allow for sufficient generality, a few steps have to be undertaken to use this class.

First, you should consider if you need values from any vectors in a NamedData object. If so, fill the VectorSelector objects cell_selector, boundary_selector and face_selector with their names and the data type (value, gradient, Hessian) to be extracted.

Afterwards, you will need to consider UpdateFlags for FEValues objects. A good start is initialize_update_flags(), which looks at the selectors filled before and adds all the flags needed to get the selection. Additional flags can be set with add_update_flags().

Finally, we need to choose quadrature formulas. In the simplest case, you might be happy with the default settings, which are n-point Gauss formulas. If only derivatives of the shape functions are used (update_values is not set) n equals the highest polynomial degree in the FiniteElement, if update_values is set, n is one higher than this degree. If you choose to use Gauss formulas of other size, use initialize_gauss_quadrature() with appropriate values. Otherwise, you can fill the variables cell_quadrature, boundary_quadrature and face_quadrature directly.

In order to save time, you can set the variables boundary_fluxes and interior_fluxes of the base class to false, thus telling the Meshworker::loop() not to loop over those faces.

All the information in here is used to set up IntegrationInfo objects correctly, typically in an IntegrationInfoBox.

Author:
Guido Kanschat, 2009

Definition at line 334 of file integration_info.h.


Member Typedef Documentation

template<int dim, int spacedim = dim>
typedef IntegrationInfo<dim, spacedim> MeshWorker::IntegrationInfoBox< dim, spacedim >::CellInfo

The type of the info object for cells.

Definition at line 342 of file integration_info.h.


Constructor & Destructor Documentation

template<int dim, int spacedim = dim>
MeshWorker::IntegrationInfoBox< dim, spacedim >::IntegrationInfoBox (  )

Default constructor.


Member Function Documentation

template<int dim, int sdim>
void MeshWorker::IntegrationInfoBox< dim, sdim >::initialize ( const FiniteElement< dim, sdim > &  el,
const Mapping< dim, sdim > &  mapping,
const BlockInfo block_info = 0 
) [inline]

Initialize the IntegrationInfo objects contained.

Before doing so, add update flags necessary to produce the data needed and also set uninitialized quadrature rules to Gauss formulas, which integrate polynomial bilinear forms exactly.

Definition at line 1107 of file integration_info.h.

References FiniteElementData< dim >::tensor_degree(), and update_values.

template<int dim, int sdim>
template<typename VECTOR >
void MeshWorker::IntegrationInfoBox< dim, sdim >::initialize ( const FiniteElement< dim, sdim > &  el,
const Mapping< dim, sdim > &  mapping,
const NamedData< VECTOR * > &  data,
const BlockInfo block_info = 0 
)

Initialize the IntegrationInfo objects contained.

Before doing so, add update flags necessary to produce the data needed and also set uninitialized quadrature rules to Gauss formulas, which integrate polynomial bilinear forms exactly.

Definition at line 1134 of file integration_info.h.

template<int dim, int sdim>
template<typename VECTOR >
void MeshWorker::IntegrationInfoBox< dim, sdim >::initialize ( const FiniteElement< dim, sdim > &  el,
const Mapping< dim, sdim > &  mapping,
const NamedData< MGLevelObject< VECTOR > * > &  data,
const BlockInfo block_info = 0 
)

Initialize the IntegrationInfo objects contained.

Before doing so, add update flags necessary to produce the data needed and also set uninitialized quadrature rules to Gauss formulas, which integrate polynomial bilinear forms exactly.

Definition at line 1165 of file integration_info.h.

template<int dim, int spacedim = dim>
void MeshWorker::IntegrationInfoBox< dim, spacedim >::initialize_update_flags (  )
template<int dim, int sdim>
void MeshWorker::IntegrationInfoBox< dim, sdim >::add_update_flags_all ( const UpdateFlags  flags ) [inline]

Add FEValues UpdateFlags for integration on all objects (cells, boundary faces and all interior faces).

Definition at line 1030 of file integration_info.h.

template<int dim, int sdim>
void MeshWorker::IntegrationInfoBox< dim, sdim >::add_update_flags_cell ( const UpdateFlags  flags ) [inline]

Add FEValues UpdateFlags for integration on cells.

Definition at line 1039 of file integration_info.h.

template<int dim, int sdim>
void MeshWorker::IntegrationInfoBox< dim, sdim >::add_update_flags_boundary ( const UpdateFlags  flags ) [inline]

Add FEValues UpdateFlags for integration on boundary faces.

Definition at line 1048 of file integration_info.h.

template<int dim, int sdim>
void MeshWorker::IntegrationInfoBox< dim, sdim >::add_update_flags_face ( const UpdateFlags  flags ) [inline]

Add FEValues UpdateFlags for integration on interior faces.

Definition at line 1057 of file integration_info.h.

template<int dim, int spacedim = dim>
void MeshWorker::IntegrationInfoBox< dim, spacedim >::add_update_flags ( const UpdateFlags  flags,
const bool  cell = true,
const bool  boundary = true,
const bool  face = true,
const bool  neighbor = true 
)

Add additional update flags to the ones already set in this program. The four boolean flags indicate wether the additional flags should be set for cell, boundary, interelement face for the cell itself or neighbor cell, or any combination thereof.

template<int dim, int sdim>
void MeshWorker::IntegrationInfoBox< dim, sdim >::initialize_gauss_quadrature ( unsigned int  n_cell_points,
unsigned int  n_boundary_points,
unsigned int  n_face_points,
const bool  force = true 
) [inline]

Assign n-point Gauss quadratures to each of the quadrature rules. Here, a size of zero points means that no loop over these grid entities should be performed.

If the parameter force is true, then all quadrature sets are filled with new quadrature ruels. If it is false, then only empty rules are changed.

Definition at line 1012 of file integration_info.h.

template<int dim, int spacedim = dim>
std::size_t MeshWorker::IntegrationInfoBox< dim, spacedim >::memory_consumption (  ) const

The memory used by this object.

template<int dim, int sdim>
template<class DOFINFO >
void MeshWorker::IntegrationInfoBox< dim, sdim >::post_cell ( const DoFInfoBox< dim, DOFINFO > &   )

A callback function which is called in the loop over all cells, after the action on a cell has been performed and before the faces are dealt with.

In order for this function to have this effect, at least either of the arguments boundary_worker or face_worker arguments of loop() should be nonzero. Additionally, cells_first should be true. If cells_first is false, this function is called before any action on a cell is taken.

And empty function in this class, but can be replaced in other classes given to loop() instead.

See loop() and cell_action() for more details of how this function can be used.

Definition at line 1196 of file integration_info.h.

template<int dim, int sdim>
template<class DOFINFO >
void MeshWorker::IntegrationInfoBox< dim, sdim >::post_faces ( const DoFInfoBox< dim, DOFINFO > &   )

A callback function which is called in the loop over all cells, after the action on the faces of a cell has been performed and before the cell itself is dealt with (assumes cells_first is false).

In order for this function to have a reasonable effect, at least either of the arguments boundary_worker or face_worker arguments of loop() should be nonzero. Additionally, cells_first should be false.

And empty function in this class, but can be replaced in other classes given to loop() instead.

See loop() and cell_action() for more details of how this function can be used.

Definition at line 1203 of file integration_info.h.

template<>
void MeshWorker::IntegrationInfoBox< 1, 1 >::initialize_gauss_quadrature ( const unsigned int  cp,
const unsigned  int,
const unsigned  int,
bool  force 
) [inline]

Definition at line 984 of file integration_info.h.

template<>
void MeshWorker::IntegrationInfoBox< 1, 2 >::initialize_gauss_quadrature ( const unsigned int  cp,
const unsigned  int,
const unsigned  int,
bool  force 
) [inline]

Definition at line 998 of file integration_info.h.

template<>
void MeshWorker::IntegrationInfoBox< 1, 1 >::initialize ( const FiniteElement< 1, 1 > &  el,
const Mapping< 1, 1 > &  mapping,
const BlockInfo block_info 
) [inline]
template<>
void MeshWorker::IntegrationInfoBox< 1, 2 >::initialize ( const FiniteElement< 1, 2 > &  el,
const Mapping< 1, 2 > &  mapping,
const BlockInfo block_info 
) [inline]

Member Data Documentation

template<int dim, int spacedim = dim>
UpdateFlags MeshWorker::IntegrationInfoBox< dim, spacedim >::cell_flags

The set of update flags for boundary cell integration.

Defaults to update_JxW_values.

Definition at line 486 of file integration_info.h.

template<int dim, int spacedim = dim>
UpdateFlags MeshWorker::IntegrationInfoBox< dim, spacedim >::boundary_flags

The set of update flags for boundary face integration.

Defaults to update_JxW_values and update_normal_vectors.

Definition at line 495 of file integration_info.h.

template<int dim, int spacedim = dim>
UpdateFlags MeshWorker::IntegrationInfoBox< dim, spacedim >::face_flags

The set of update flags for interior face integration.

Defaults to update_JxW_values and update_normal_vectors.

Definition at line 505 of file integration_info.h.

template<int dim, int spacedim = dim>
UpdateFlags MeshWorker::IntegrationInfoBox< dim, spacedim >::neighbor_flags

The set of update flags for interior face integration.

Defaults to update_default, since quadrature weights are taken from the other cell.

Definition at line 516 of file integration_info.h.

template<int dim, int spacedim = dim>
Quadrature<dim> MeshWorker::IntegrationInfoBox< dim, spacedim >::cell_quadrature

The quadrature rule used on cells.

Definition at line 522 of file integration_info.h.

template<int dim, int spacedim = dim>
Quadrature<dim-1> MeshWorker::IntegrationInfoBox< dim, spacedim >::boundary_quadrature

The quadrature rule used on boundary faces.

Definition at line 528 of file integration_info.h.

template<int dim, int spacedim = dim>
Quadrature<dim-1> MeshWorker::IntegrationInfoBox< dim, spacedim >::face_quadrature

The quadrature rule used on interior faces.

Definition at line 534 of file integration_info.h.

template<int dim, int spacedim = dim>
MeshWorker::VectorSelector MeshWorker::IntegrationInfoBox< dim, spacedim >::cell_selector

Initialize the VectorSelector objects cell_selector, boundary_selector and face_selector in order to save computational eeffort. If no selectors are used, then values for all named vectors in DoFInfo::global_data will be computed in all quadrature points.

This function will also add UpdateFlags to the flags stored in this class. Select the vectors from DoFInfo::global_data that should be computed in the quadrature points on cells.

Definition at line 566 of file integration_info.h.

template<int dim, int spacedim = dim>
MeshWorker::VectorSelector MeshWorker::IntegrationInfoBox< dim, spacedim >::boundary_selector

Select the vectors from DoFInfo::global_data that should be computed in the quadrature points on boundary faces.

Definition at line 575 of file integration_info.h.

template<int dim, int spacedim = dim>
MeshWorker::VectorSelector MeshWorker::IntegrationInfoBox< dim, spacedim >::face_selector

Select the vectors from DoFInfo::global_data that should be computed in the quadrature points on interior faces.

Definition at line 584 of file integration_info.h.

template<int dim, int spacedim = dim>
std_cxx1x::shared_ptr<MeshWorker::VectorDataBase<dim, spacedim> > MeshWorker::IntegrationInfoBox< dim, spacedim >::cell_data

Definition at line 586 of file integration_info.h.

template<int dim, int spacedim = dim>
std_cxx1x::shared_ptr<MeshWorker::VectorDataBase<dim, spacedim> > MeshWorker::IntegrationInfoBox< dim, spacedim >::boundary_data

Definition at line 587 of file integration_info.h.

template<int dim, int spacedim = dim>
std_cxx1x::shared_ptr<MeshWorker::VectorDataBase<dim, spacedim> > MeshWorker::IntegrationInfoBox< dim, spacedim >::face_data

Definition at line 588 of file integration_info.h.

template<int dim, int spacedim = dim>
CellInfo MeshWorker::IntegrationInfoBox< dim, spacedim >::cell

The info object for a cell.

Definition at line 666 of file integration_info.h.

template<int dim, int spacedim = dim>
CellInfo MeshWorker::IntegrationInfoBox< dim, spacedim >::boundary

The info object for a boundary face.

Definition at line 671 of file integration_info.h.

template<int dim, int spacedim = dim>
CellInfo MeshWorker::IntegrationInfoBox< dim, spacedim >::face

The info object for a regular interior face, seen from the first cell.

Definition at line 677 of file integration_info.h.

template<int dim, int spacedim = dim>
CellInfo MeshWorker::IntegrationInfoBox< dim, spacedim >::subface

The info object for the refined side of an interior face seen from the first cell.

Definition at line 684 of file integration_info.h.

template<int dim, int spacedim = dim>
CellInfo MeshWorker::IntegrationInfoBox< dim, spacedim >::neighbor

The info object for an interior face, seen from the other cell.

Definition at line 690 of file integration_info.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Fri Feb 3 2012 06:04:15 by doxygen 1.7.2