Reference documentation for deal.II version Git a34fcf9 2014-10-22 16:30:45 -0400
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Private Attributes | List of all members
hp::FECollection< dim, spacedim > Class Template Reference

#include <deal.II/hp/fe_collection.h>

Inheritance diagram for hp::FECollection< dim, spacedim >:
[legend]

Public Member Functions

 FECollection ()
 
 FECollection (const FiniteElement< dim, spacedim > &fe)
 
 FECollection (const FECollection< dim, spacedim > &fe_collection)
 
void push_back (const FiniteElement< dim, spacedim > &new_fe)
 
const FiniteElement< dim,
spacedim > & 
operator[] (const unsigned int index) const
 
unsigned int size () const
 
unsigned int n_components () const
 
unsigned int n_blocks () const
 
unsigned int max_dofs_per_vertex () const
 
unsigned int max_dofs_per_line () const
 
unsigned int max_dofs_per_quad () const
 
unsigned int max_dofs_per_hex () const
 
unsigned int max_dofs_per_face () const
 
unsigned int max_dofs_per_cell () const
 
std::size_t memory_consumption () const
 
bool hp_constraints_are_implemented () const
 
ComponentMask component_mask (const FEValuesExtractors::Scalar &scalar) const
 
ComponentMask component_mask (const FEValuesExtractors::Vector &vector) const
 
ComponentMask component_mask (const FEValuesExtractors::SymmetricTensor< 2 > &sym_tensor) const
 
ComponentMask component_mask (const BlockMask &block_mask) const
 
BlockMask block_mask (const FEValuesExtractors::Scalar &scalar) const
 
BlockMask block_mask (const FEValuesExtractors::Vector &vector) const
 
BlockMask block_mask (const FEValuesExtractors::SymmetricTensor< 2 > &sym_tensor) const
 
BlockMask block_mask (const ComponentMask &component_mask) const
 
 DeclException0 (ExcNoFiniteElements)
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
void subscribe (const char *identifier=0) const
 
void unsubscribe (const char *identifier=0) const
 
unsigned int n_subscriptions () const
 
void list_subscribers () const
 
 DeclException3 (ExcInUse, int, char *, std::string &,<< "Object of class "<< arg2<< " is still used by "<< arg1<< " other objects.\n"<< "(Additional information: "<< arg3<< ")\n"<< "Note the entry in the Frequently Asked Questions of "<< "deal.II (linked to from http://www.dealii.org/) for "<< "more information on what this error means.")
 
 DeclException2 (ExcNoSubscriber, char *, char *,<< "No subscriber with identifier \""<< arg2<< "\" did subscribe to this object of class "<< arg1)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::vector
< std_cxx11::shared_ptr< const
FiniteElement< dim, spacedim > > > 
finite_elements
 

Detailed Description

template<int dim, int spacedim>
class hp::FECollection< dim, spacedim >

This class acts as a collection of finite element objects used in the hp::DoFHandler. It is thus to a hp::DoFHandler what a FiniteElement is to a DoFHandler.

It implements the concepts stated in the hp Collections module described in the doxygen documentation.

In addition to offering access to the elements of the collection, this class provides access to the maximal number of degrees of freedom per vertex, line, etc, to allow allocation of as much memory as is necessary in the worst case when using the finite elements associated with the cells of a triangulation.

This class has not yet been implemented for the use in the codimension one case (spacedim != dim ).

Author
Wolfgang Bangerth, 2003

Definition at line 37 of file fe.h.

Constructor & Destructor Documentation

template<int dim, int spacedim>
hp::FECollection< dim, spacedim >::FECollection ( )

Default constructor. Leads to an empty collection that can later be filled using push_back().

template<int dim, int spacedim>
hp::FECollection< dim, spacedim >::FECollection ( const FiniteElement< dim, spacedim > &  fe)
explicit

Conversion constructor. This constructor creates a FECollection from a single finite element. More finite element objects can be added with push_back(), if desired, though it would probably be clearer to add all mappings the same way.

template<int dim, int spacedim>
hp::FECollection< dim, spacedim >::FECollection ( const FECollection< dim, spacedim > &  fe_collection)

Copy constructor.

Member Function Documentation

template<int dim, int spacedim>
void hp::FECollection< dim, spacedim >::push_back ( const FiniteElement< dim, spacedim > &  new_fe)

Add a finite element. This function generates a copy of the given element, i.e. you can do things like push_back(FE_Q<dim>(1));. The internal copy is later destroyed by this object upon destruction of the entire collection.

When a new element is added, it needs to have the same number of vector components as all other elements already in the collection.

template<int dim, int spacedim>
const FiniteElement< dim, spacedim > & hp::FECollection< dim, spacedim >::operator[] ( const unsigned int  index) const
inline

Get a reference to the given element in this collection.

Precondition
index must be between zero and the number of elements of the collection.

Definition at line 478 of file fe_collection.h.

template<int dim, int spacedim>
unsigned int hp::FECollection< dim, spacedim >::size ( ) const
inline

Return the number of finite element objects stored in this collection.

Definition at line 450 of file fe_collection.h.

template<int dim, int spacedim>
unsigned int hp::FECollection< dim, spacedim >::n_components ( ) const
inline

Return the number of vector components of the finite elements in this collection. This number must be the same for all elements in the collection.

This function calls FiniteElement::n_components. See the glossary for more information.

Definition at line 459 of file fe_collection.h.

template<int dim, int spacedim>
unsigned int hp::FECollection< dim, spacedim >::n_blocks ( ) const

Return the number of vector blocks of the finite elements in this collection. While this class ensures that all elements stored in it have the same number of vector components, there is no such guarantees for the number of blocks each element is made up of (an element may have fewer blocks than vector components; see the glossary for more information). For example, you may have an FECollection object that stores one copy of an FESystem with dim FE_Q objects and one copy of an FE_RaviartThomas element. Both have dim vector components but while the former has dim blocks the latter has only one. Consequently, this function will throw an assertion if the number of blocks is not the same for all elements. If they are the same, this function returns the result of FiniteElement::n_blocks().

template<int dim, int spacedim>
unsigned int hp::FECollection< dim, spacedim >::max_dofs_per_vertex ( ) const

Return the maximal number of degrees of freedom per vertex over all elements of this collection.

Definition at line 489 of file fe_collection.h.

template<int dim, int spacedim>
unsigned int hp::FECollection< dim, spacedim >::max_dofs_per_line ( ) const

Return the maximal number of degrees of freedom per line over all elements of this collection.

Definition at line 505 of file fe_collection.h.

template<int dim, int spacedim>
unsigned int hp::FECollection< dim, spacedim >::max_dofs_per_quad ( ) const

Return the maximal number of degrees of freedom per quad over all elements of this collection.

Definition at line 521 of file fe_collection.h.

template<int dim, int spacedim>
unsigned int hp::FECollection< dim, spacedim >::max_dofs_per_hex ( ) const

Return the maximal number of degrees of freedom per hex over all elements of this collection.

Definition at line 537 of file fe_collection.h.

template<int dim, int spacedim>
unsigned int hp::FECollection< dim, spacedim >::max_dofs_per_face ( ) const

Return the maximal number of degrees of freedom per face over all elements of this collection.

Definition at line 553 of file fe_collection.h.

template<int dim, int spacedim>
unsigned int hp::FECollection< dim, spacedim >::max_dofs_per_cell ( ) const

Return the maximal number of degrees of freedom per cell over all elements of this collection.

Definition at line 569 of file fe_collection.h.

template<int dim, int spacedim>
std::size_t hp::FECollection< dim, spacedim >::memory_consumption ( ) const

Return an estimate for the memory allocated for this object.

template<int dim, int spacedim>
bool hp::FECollection< dim, spacedim >::hp_constraints_are_implemented ( ) const

Return whether all elements in this collection implement the hanging node constraints in the new way, which has to be used to make elements "hp compatible". If this is not the case, the function returns false, which implies, that at least one element in the FECollection does not support the new face interface constraints. On the other hand, if this method does return true, this does not imply that the hp method will work!

This behaviour is related to the fact, that FiniteElement classes, which provide the new style hanging node constraints might still not provide them for all possible cases. If FE_Q and FE_RaviartThomas elements are included in the FECollection and both properly implement the get_face_interpolation_matrix method, this method will return true. But the get_face_interpolation_matrix might still fail to find an interpolation matrix between these two elements.

Definition at line 584 of file fe_collection.h.

template<int dim, int spacedim>
ComponentMask hp::FECollection< dim, spacedim >::component_mask ( const FEValuesExtractors::Scalar scalar) const

Return a component mask with as many elements as this object has vector components and of which exactly the one component is true that corresponds to the given argument.

Note
This function is the equivalent of FiniteElement::component_mask() with the same arguments. It verifies that it gets the same result from every one of the elements that are stored in this FECollection. If this is not the case, it throws an exception.
Parameters
scalarAn object that represents a single scalar vector component of this finite element.
Returns
A component mask that is false in all components except for the one that corresponds to the argument.
template<int dim, int spacedim>
ComponentMask hp::FECollection< dim, spacedim >::component_mask ( const FEValuesExtractors::Vector vector) const

Return a component mask with as many elements as this object has vector components and of which exactly the dim components are true that correspond to the given argument.

Note
This function is the equivalent of FiniteElement::component_mask() with the same arguments. It verifies that it gets the same result from every one of the elements that are stored in this FECollection. If this is not the case, it throws an exception.
Parameters
vectorAn object that represents dim vector components of this finite element.
Returns
A component mask that is false in all components except for the ones that corresponds to the argument.
template<int dim, int spacedim>
ComponentMask hp::FECollection< dim, spacedim >::component_mask ( const FEValuesExtractors::SymmetricTensor< 2 > &  sym_tensor) const

Return a component mask with as many elements as this object has vector components and of which exactly the dim*(dim+1)/2 components are true that correspond to the given argument.

Note
This function is the equivalent of FiniteElement::component_mask() with the same arguments. It verifies that it gets the same result from every one of the elements that are stored in this FECollection. If this is not the case, it throws an exception.
Parameters
sym_tensorAn object that represents dim*(dim+1)/2 components of this finite element that are jointly to be interpreted as forming a symmetric tensor.
Returns
A component mask that is false in all components except for the ones that corresponds to the argument.
template<int dim, int spacedim>
ComponentMask hp::FECollection< dim, spacedim >::component_mask ( const BlockMask block_mask) const

Given a block mask (see this glossary entry), produce a component mask (see this glossary entry) that represents the components that correspond to the blocks selected in the input argument. This is essentially a conversion operator from BlockMask to ComponentMask.

Note
This function is the equivalent of FiniteElement::component_mask() with the same arguments. It verifies that it gets the same result from every one of the elements that are stored in this FECollection. If this is not the case, it throws an exception.
Parameters
block_maskThe mask that selects individual blocks of the finite element
Returns
A mask that selects those components corresponding to the selected blocks of the input argument.
template<int dim, int spacedim>
BlockMask hp::FECollection< dim, spacedim >::block_mask ( const FEValuesExtractors::Scalar scalar) const

Return a block mask with as many elements as this object has blocks and of which exactly the one component is true that corresponds to the given argument. See the glossary for more information.

Note
This function will only succeed if the scalar referenced by the argument encompasses a complete block. In other words, if, for example, you pass an extractor for the single \(x\) velocity and this object represents an FE_RaviartThomas object, then the single scalar object you selected is part of a larger block and consequently there is no block mask that would represent it. The function will then produce an exception.
This function is the equivalent of FiniteElement::component_mask() with the same arguments. It verifies that it gets the same result from every one of the elements that are stored in this FECollection. If this is not the case, it throws an exception.
Parameters
scalarAn object that represents a single scalar vector component of this finite element.
Returns
A component mask that is false in all components except for the one that corresponds to the argument.
template<int dim, int spacedim>
BlockMask hp::FECollection< dim, spacedim >::block_mask ( const FEValuesExtractors::Vector vector) const

Return a component mask with as many elements as this object has vector components and of which exactly the dim components are true that correspond to the given argument. See the glossary for more information.

Note
This function is the equivalent of FiniteElement::component_mask() with the same arguments. It verifies that it gets the same result from every one of the elements that are stored in this FECollection. If this is not the case, it throws an exception.
The same caveat applies as to the version of the function above: The extractor object passed as argument must be so that it corresponds to full blocks and does not split blocks of this element.
Parameters
vectorAn object that represents dim vector components of this finite element.
Returns
A component mask that is false in all components except for the ones that corresponds to the argument.
template<int dim, int spacedim>
BlockMask hp::FECollection< dim, spacedim >::block_mask ( const FEValuesExtractors::SymmetricTensor< 2 > &  sym_tensor) const

Return a component mask with as many elements as this object has vector components and of which exactly the dim*(dim+1)/2 components are true that correspond to the given argument. See the glossary for more information.

Note
The same caveat applies as to the version of the function above: The extractor object passed as argument must be so that it corresponds to full blocks and does not split blocks of this element.
This function is the equivalent of FiniteElement::component_mask() with the same arguments. It verifies that it gets the same result from every one of the elements that are stored in this FECollection. If this is not the case, it throws an exception.
Parameters
sym_tensorAn object that represents dim*(dim+1)/2 components of this finite element that are jointly to be interpreted as forming a symmetric tensor.
Returns
A component mask that is false in all components except for the ones that corresponds to the argument.
template<int dim, int spacedim>
BlockMask hp::FECollection< dim, spacedim >::block_mask ( const ComponentMask component_mask) const

Given a component mask (see this glossary entry), produce a block mask (see this glossary entry) that represents the blocks that correspond to the components selected in the input argument. This is essentially a conversion operator from ComponentMask to BlockMask.

Note
This function will only succeed if the components referenced by the argument encompasses complete blocks. In other words, if, for example, you pass an component mask for the single \(x\) velocity and this object represents an FE_RaviartThomas object, then the single component you selected is part of a larger block and consequently there is no block mask that would represent it. The function will then produce an exception.
This function is the equivalent of FiniteElement::component_mask() with the same arguments. It verifies that it gets the same result from every one of the elements that are stored in this FECollection. If this is not the case, it throws an exception.
Parameters
component_maskThe mask that selects individual components of the finite element
Returns
A mask that selects those blocks corresponding to the selected blocks of the input argument.
template<int dim, int spacedim>
hp::FECollection< dim, spacedim >::DeclException0 ( ExcNoFiniteElements  )

Exception

Member Data Documentation

template<int dim, int spacedim>
std::vector<std_cxx11::shared_ptr<const FiniteElement<dim,spacedim> > > hp::FECollection< dim, spacedim >::finite_elements
private

Array of pointers to the finite elements stored by this collection.

Definition at line 440 of file fe_collection.h.


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