Reference documentation for deal.II version 9.3.3
|
#include <deal.II/hp/fe_collection.h>
Classes | |
struct | DefaultHierarchy |
Public Member Functions | |
FECollection () | |
FECollection (const FiniteElement< dim, spacedim > &fe) | |
template<class... FETypes> | |
FECollection (const FETypes &... fes) | |
FECollection (const std::vector< const FiniteElement< dim, spacedim > * > &fes) | |
FECollection (const FECollection< dim, spacedim > &)=default | |
FECollection (FECollection< dim, spacedim > &&) noexcept(std::is_nothrow_move_constructible< std::vector< std::shared_ptr< const FiniteElement< dim, spacedim > > > >::value &&std::is_nothrow_move_constructible< std::function< unsigned int(const typename hp::FECollection< dim, spacedim > &, const unsigned int)> >::value)=default | |
FECollection< dim, spacedim > & | operator= (FECollection< dim, spacedim > &&)=default |
bool | operator== (const FECollection< dim, spacedim > &fe_collection) const |
bool | operator!= (const FECollection< dim, spacedim > &fe_collection) const |
void | push_back (const FiniteElement< dim, spacedim > &new_fe) |
unsigned int | n_components () const |
unsigned int | n_blocks () const |
unsigned int | max_degree () 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 |
bool | hp_constraints_are_implemented () const |
std::set< unsigned int > | find_common_fes (const std::set< unsigned int > &fes, const unsigned int codim=0) const |
std::set< unsigned int > | find_enclosing_fes (const std::set< unsigned int > &fes, const unsigned int codim=0) const |
unsigned int | find_dominating_fe (const std::set< unsigned int > &fes, const unsigned int codim=0) const |
unsigned int | find_dominated_fe (const std::set< unsigned int > &fes, const unsigned int codim=0) const |
unsigned int | find_dominating_fe_extended (const std::set< unsigned int > &fes, const unsigned int codim=0) const |
unsigned int | find_dominated_fe_extended (const std::set< unsigned int > &fes, const unsigned int codim=0) const |
void | set_hierarchy (const std::function< unsigned int(const typename hp::FECollection< dim, spacedim > &, const unsigned int)> &next, const std::function< unsigned int(const typename hp::FECollection< dim, spacedim > &, const unsigned int)> &prev) |
void | set_default_hierarchy () |
std::vector< unsigned int > | get_hierarchy_sequence (const unsigned int fe_index=0) const |
unsigned int | next_in_hierarchy (const unsigned int fe_index) const |
unsigned int | previous_in_hierarchy (const unsigned int fe_index) 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 |
void | push_back (const std::shared_ptr< const FiniteElement< dim, dim > > &new_entry) |
const FiniteElement< dim, dim > & | operator[] (const unsigned int index) const |
unsigned int | size () const |
std::size_t | memory_consumption () const |
Static Public Member Functions | |
Exceptions | |
static ::ExceptionBase & | ExcNoFiniteElements () |
Private Attributes | |
std::function< unsigned int(const typename hp::FECollection< dim, spacedim > &, const unsigned int)> | hierarchy_next |
std::function< unsigned int(const typename hp::FECollection< dim, spacedim > &, const unsigned int)> | hierarchy_prev |
std::vector< std::shared_ptr< const FiniteElement< dim, dim > > > | entries |
Subscriptor functionality | |
Classes derived from Subscriptor provide a facility to subscribe to this object. This is mostly used by the SmartPointer class. | |
std::atomic< unsigned int > | counter |
std::map< std::string, unsigned int > | counter_map |
std::vector< std::atomic< bool > * > | validity_pointers |
const std::type_info * | object_info |
void | subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
void | unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
unsigned int | n_subscriptions () const |
template<typename StreamType > | |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
static ::ExceptionBase & | ExcInUse (int arg1, std::string arg2, std::string arg3) |
static ::ExceptionBase & | ExcNoSubscriber (std::string arg1, std::string arg2) |
using | map_value_type = decltype(counter_map)::value_type |
using | map_iterator = decltype(counter_map)::iterator |
static std::mutex | mutex |
void | check_no_subscribers () const noexcept |
This class acts as a collection of finite element objects used in the 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
).
Definition at line 53 of file fe_collection.h.
hp::FECollection< dim, spacedim >::FECollection |
Default constructor. Leads to an empty collection that can later be filled using push_back(). Establishes a hierarchy of finite elements corresponding to their index in the collection.
Definition at line 240 of file fe_collection.cc.
|
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.
Definition at line 248 of file fe_collection.cc.
|
explicit |
Constructor. This constructor creates a FECollection from one or more finite element objects passed to the constructor. For this call to be valid, all arguments need to be of types derived from class FiniteElement<dim,spacedim>.
Definition at line 768 of file fe_collection.h.
hp::FECollection< dim, spacedim >::FECollection | ( | const std::vector< const FiniteElement< dim, spacedim > * > & | fes | ) |
Constructor. Same as above but for any number of elements. Pointers to the elements are passed in a vector to this constructor. As above, the finite element objects pointed to by the argument are not actually used other than to create copies internally. Consequently, you can delete these pointers immediately again after calling this constructor.
Definition at line 258 of file fe_collection.cc.
|
default |
Copy constructor.
|
defaultnoexcept |
Move constructor.
|
default |
Move assignment operator.
|
inline |
Equality comparison operator. All stored FiniteElement objects are compared in order.
Definition at line 807 of file fe_collection.h.
|
inline |
Non-equality comparison operator. All stored FiniteElement objects are compared in order.
Definition at line 825 of file fe_collection.h.
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.
Definition at line 273 of file fe_collection.cc.
|
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 788 of file fe_collection.h.
unsigned int hp::FECollection< dim, spacedim >::n_blocks |
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().
Definition at line 566 of file fe_collection.cc.
unsigned int hp::FECollection< dim, spacedim >::max_degree |
Return the maximum of values returned by FiniteElement::get_degree() over all elements of this collection.
Definition at line 835 of file fe_collection.h.
unsigned int hp::FECollection< dim, spacedim >::max_dofs_per_vertex |
Return the maximal number of degrees of freedom per vertex over all elements of this collection.
Definition at line 850 of file fe_collection.h.
unsigned int hp::FECollection< dim, spacedim >::max_dofs_per_line |
Return the maximal number of degrees of freedom per line over all elements of this collection.
Definition at line 865 of file fe_collection.h.
unsigned int hp::FECollection< dim, spacedim >::max_dofs_per_quad |
Return the maximal number of degrees of freedom per quad over all elements of this collection.
Definition at line 880 of file fe_collection.h.
unsigned int hp::FECollection< dim, spacedim >::max_dofs_per_hex |
Return the maximal number of degrees of freedom per hex over all elements of this collection.
Definition at line 895 of file fe_collection.h.
unsigned int hp::FECollection< dim, spacedim >::max_dofs_per_face |
Return the maximal number of degrees of freedom per face over all elements of this collection.
Definition at line 910 of file fe_collection.h.
unsigned int hp::FECollection< dim, spacedim >::max_dofs_per_cell |
Return the maximal number of degrees of freedom per cell over all elements of this collection.
Definition at line 925 of file fe_collection.h.
bool hp::FECollection< dim, spacedim >::hp_constraints_are_implemented |
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 behavior 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 939 of file fe_collection.h.
std::set< unsigned int > hp::FECollection< dim, spacedim >::find_common_fes | ( | const std::set< unsigned int > & | fes, |
const unsigned int | codim = 0 |
||
) | const |
Return the indices of finite elements in this FECollection that dominate all elements associated with the provided set of indices fes
.
You may find information about the domination behavior of finite elements in their respective class documentation or in the implementation of their inherited member function FiniteElement::compare_for_domination(). Consider that a finite element may or may not dominate itself (e.g. FE_Nothing elements).
For example, if a FECollection consists of {FE_Q(1),FE_Q(2),FE_Q(3),FE_Q(4)}
elements and we are looking for the finite elements that dominate the middle elements of this collection (i.e., fes
is {1,2}
), then the answer is {FE_Q(1),FE_Q(2)
and therefore this function will return their indices in the FECollection, namely {0,1}
.
The codim
parameter describes the codimension of the investigated subspace and specifies that it is subject to this comparison. See FiniteElement::compare_for_domination() for more information.
Definition at line 27 of file fe_collection.cc.
std::set< unsigned int > hp::FECollection< dim, spacedim >::find_enclosing_fes | ( | const std::set< unsigned int > & | fes, |
const unsigned int | codim = 0 |
||
) | const |
Return the indices of finite elements in this FECollection that are dominated by all elements associated with the provided set of indices fes
.
You may find information about the domination behavior of finite elements in their respective class documentation or in the implementation of their inherited member function FiniteElement::compare_for_domination(). Consider that a finite element may or may not dominate itself (e.g. FE_Nothing elements).
For example, if a FECollection consists of {FE_Q(1),FE_Q(2),FE_Q(3),FE_Q(4)}
elements and we are looking for the finite elements that are dominated by the middle elements of this collection (i.e., fes
is {1,2}
), then the answer is {FE_Q(3),FE_Q(4)
and therefore this function will return their indices in the FECollection, namely {2,3}
.
The codim
parameter describes the codimension of the investigated subspace and specifies that it is subject to this comparison. See FiniteElement::compare_for_domination() for more information.
Definition at line 67 of file fe_collection.cc.
unsigned int hp::FECollection< dim, spacedim >::find_dominating_fe | ( | const std::set< unsigned int > & | fes, |
const unsigned int | codim = 0 |
||
) | const |
Return the index of a finite element from the provided set of indices fes
that dominates all other elements of this very set.
You may find information about the domination behavior of finite elements in their respective class documentation or in the implementation of their inherited member function FiniteElement::compare_for_domination(). Consider that a finite element may or may not dominate itself (e.g. FE_Nothing elements).
If this set consists of exactly one element, we consider it to be the dominating one and return its corresponding index. Further, if the function is not able to find a finite element at all, it returns numbers::invalid_unsigned_int.
For example, if a FECollection consists of {FE_Q(1),FE_Q(2),FE_Q(3),FE_Q(4)}
elements and we are looking for the dominating finite element among the middle elements of this collection (i.e., fes
is {1,2}
), then the answer is FE_Q(2) and therefore this function will return its index in the FECollection, namely 1
.
It is of course possible that there is more than one element that dominates all selected elements. For example, if the collection consists of {FE_Q(1),FE_Q(1),FE_Q(2),FE_Q(2)}
and fes
covers all indices, then one could return zero or one. In that case, the function returns either 0
or 1
since there is no tie-breaker between the two.
The codim
parameter describes the codimension of the investigated subspace and specifies that it is subject to this comparison. See FiniteElement::compare_for_domination() for more information.
Definition at line 107 of file fe_collection.cc.
unsigned int hp::FECollection< dim, spacedim >::find_dominated_fe | ( | const std::set< unsigned int > & | fes, |
const unsigned int | codim = 0 |
||
) | const |
Return the index of a finite element from the provided set of indices fes
that is dominated by all other elements of this very set.
You may find information about the domination behavior of finite elements in their respective class documentation or in the implementation of their inherited member function FiniteElement::compare_for_domination(). Consider that a finite element may or may not dominate itself (e.g. FE_Nothing elements).
If this set consists of exactly one element, we consider it to be the dominated one and return its corresponding index. Further, if the function is not able to find a finite element at all, it returns numbers::invalid_unsigned_int.
For example, if a FECollection consists of {FE_Q(1),FE_Q(2),FE_Q(3),FE_Q(4)}
elements and we are looking for the dominated finite element among the middle elements of this collection (i.e., fes
is {1,2}
), then the answer is FE_Q(3) and therefore this function will return its index in the FECollection, namely 2
.
It is of course possible that there is more than one element that is dominated by all selected elements. For example, if the collection consists of {FE_Q(1),FE_Q(1),FE_Q(2),FE_Q(2)}
and fes
covers all indices, then one could return two or three. In that case, the function returns either 2
or 3
since there is no tie-breaker between the two.
The codim
parameter describes the codimension of the investigated subspace and specifies that it is subject to this comparison. See FiniteElement::compare_for_domination() for more information.
Definition at line 154 of file fe_collection.cc.
unsigned int hp::FECollection< dim, spacedim >::find_dominating_fe_extended | ( | const std::set< unsigned int > & | fes, |
const unsigned int | codim = 0 |
||
) | const |
Return the index of a finite element from the provided set of indices fes
that dominates all other elements of this very set. If we do not succeed, we extend our search on the whole collection by picking the least dominating one, which is the element that describes the largest finite element space of which all of the finite elements of the provided set fes
are part of.
You may find information about the domination behavior of finite elements in their respective class documentation or in the implementation of their inherited member function FiniteElement::compare_for_domination(). Consider that a finite element may or may not dominate itself (e.g. FE_Nothing elements).
If this set consists of exactly one element, we consider it to be the dominated one and return its corresponding index. Further, if the function is not able to find a finite element at all, it returns numbers::invalid_unsigned_int.
The codim
parameter describes the codimension of the investigated subspace and specifies that it is subject to this comparison. See FiniteElement::compare_for_domination() for more information.
Definition at line 201 of file fe_collection.cc.
unsigned int hp::FECollection< dim, spacedim >::find_dominated_fe_extended | ( | const std::set< unsigned int > & | fes, |
const unsigned int | codim = 0 |
||
) | const |
Return the index of a finite element from the provided set of indices fes
that is dominated by all other elements of this very set. If we do not succeed, we extend our search on the whole collection by picking the most dominated one, which is the element that describes the smallest finite element space which includes all finite elements of the provided set fes
.
You may find information about the domination behavior of finite elements in their respective class documentation or in the implementation of their inherited member function FiniteElement::compare_for_domination(). Consider that a finite element may or may not dominate itself (e.g. FE_Nothing elements).
If this set consists of exactly one element, we consider it to be the dominating one and return its corresponding index. Further, if the function is not able to find a finite element at all, it returns numbers::invalid_unsigned_int.
The codim
parameter describes the codimension of the investigated subspace and specifies that it is subject to this comparison. See FiniteElement::compare_for_domination() for more information.
Definition at line 221 of file fe_collection.cc.
void hp::FECollection< dim, spacedim >::set_hierarchy | ( | const std::function< unsigned int(const typename hp::FECollection< dim, spacedim > &, const unsigned int)> & | next, |
const std::function< unsigned int(const typename hp::FECollection< dim, spacedim > &, const unsigned int)> & | prev | ||
) |
Set functions determining the hierarchy of finite elements, i.e. a function next
that returns the index of the finite element following the given one, and a function prev
returning the preceding one.
Both functions expect an hp::FECollection to be passed along with a finite element index, on whose basis the new index will be found and returned.
Definition at line 291 of file fe_collection.cc.
void hp::FECollection< dim, spacedim >::set_default_hierarchy |
Set the default hierarchy corresponding to the index of each finite element in the collection.
This default hierarchy is established with functions DefaultHierarchy::next_index() and DefaultHierarchy::previous_index().
Definition at line 308 of file fe_collection.cc.
std::vector< unsigned int > hp::FECollection< dim, spacedim >::get_hierarchy_sequence | ( | const unsigned int | fe_index = 0 | ) | const |
Returns a sequence of FE indices that corresponds to the registered hierarchy in ascending order, i.e., FE indices are sorted from lowest to highest level.
Multiple sequences of FE indices are possible with a single custom hierarchy that can be registered with set_hierarchy(). This function will return the sequence that contains the user-provided index fe_index
which could be located anywhere inside the sequence. The default hierarchy set via set_default_hierarchy(), which corresponds to FE indices in ascending order, consists of only one sequence.
This function can be used, for example, to verify that your provided hierarchy covers all elements in the desired order.
Only one sequence of FE indices exists if the size of the returned container equals the number of elements of this object, i.e., FECollection::size().
Definition at line 319 of file fe_collection.cc.
unsigned int hp::FECollection< dim, spacedim >::next_in_hierarchy | ( | const unsigned int | fe_index | ) | const |
Function returning the index of the finite element following the given fe_index
in hierarchy.
By default, the index succeeding fe_index
will be returned. If fe_index
already corresponds to the last index, the last index will be returned. A custom hierarchy can be supplied via the member function set_hierachy().
Definition at line 365 of file fe_collection.cc.
unsigned int hp::FECollection< dim, spacedim >::previous_in_hierarchy | ( | const unsigned int | fe_index | ) | const |
Function returning the index of the finite element preceding the given fe_index
in hierarchy.
By default, the index preceding fe_index
will be returned. If fe_index
already corresponds to the first index, the first index will be returned. A custom hierarchy can be supplied via the member function set_hierachy().
Definition at line 380 of file fe_collection.cc.
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.
scalar | An object that represents a single scalar vector component of this finite element. |
Definition at line 395 of file fe_collection.cc.
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.
vector | An object that represents dim vector components of this finite element. |
Definition at line 415 of file fe_collection.cc.
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.
sym_tensor | An object that represents dim*(dim+1)/2 components of this finite element that are jointly to be interpreted as forming a symmetric tensor. |
Definition at line 435 of file fe_collection.cc.
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.
block_mask | The mask that selects individual blocks of the finite element |
Definition at line 455 of file fe_collection.cc.
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.
scalar | An object that represents a single scalar vector component of this finite element. |
Definition at line 476 of file fe_collection.cc.
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.
vector | An object that represents dim vector components of this finite element. |
Definition at line 498 of file fe_collection.cc.
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.
sym_tensor | An object that represents dim*(dim+1)/2 components of this finite element that are jointly to be interpreted as forming a symmetric tensor. |
Definition at line 520 of file fe_collection.cc.
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.
component_mask | The mask that selects individual components of the finite element |
Definition at line 543 of file fe_collection.cc.
|
inherited |
Add a new object.
Definition at line 53 of file collection.h.
|
inlineinherited |
Return the object which was specified by the user for the active FE index which is provided as a parameter to this method.
index
must be between zero and the number of elements of the collection. Definition at line 62 of file collection.h.
|
inlineinherited |
Return the number of objects stored in this container.
Definition at line 68 of file collection.h.
|
inherited |
Determine an estimate for the memory consumption (in bytes) of this object.
Definition at line 75 of file collection.h.
|
private |
Function returning the index of the finite element following the given one in hierarchy.
Definition at line 751 of file fe_collection.h.
|
private |
Function returning the index of the finite element preceding the given one in hierarchy.
Definition at line 759 of file fe_collection.h.
|
privateinherited |
The real container, which stores pointers to the different objects.
Definition at line 81 of file collection.h.