17 #include <deal.II/base/memory_consumption.h> 18 #include <deal.II/hp/fe_collection.h> 20 DEAL_II_NAMESPACE_OPEN
24 template <
int dim,
int spacedim>
41 std::set<unsigned int> candidate_fes;
44 for (
unsigned int cur_fe = 0; cur_fe < fe_collection.
size(); cur_fe++)
48 for (std::set<unsigned int>::const_iterator it = fes.begin();
52 ExcIndexRangeType<unsigned int> (*it, 0, fe_collection.
size()));
53 domination = domination &
54 fe_collection[cur_fe].compare_for_face_domination
61 candidate_fes.insert(cur_fe);
66 if (candidate_fes.size() == 1)
68 return *candidate_fes.begin();
71 for (std::set<unsigned int>::const_iterator it = candidate_fes.begin(); it!=candidate_fes.end(); ++it)
74 for (std::set<unsigned int>::const_iterator ito = candidate_fes.begin(); ito!=candidate_fes.end(); ++ito)
77 domination = domination &
78 fe_collection[*it].compare_for_face_domination(fe_collection[*ito]);
91 template <
int dim,
int spacedim>
99 template <
int dim,
int spacedim>
104 ExcMessage (
"Need to pass at least one finite element."));
106 for (
unsigned int i = 0; i < fes.size(); ++i)
112 template <
int dim,
int spacedim>
120 if (finite_elements.size() != 0)
122 ExcMessage (
"All elements inside a collection need to have the " 123 "same number of vector components!"));
125 finite_elements.push_back (new_fe.
clone());
130 template <
int dim,
int spacedim>
136 ExcMessage (
"This collection contains no finite element."));
143 for (
unsigned int c=1; c<size(); ++c)
151 template <
int dim,
int spacedim>
157 ExcMessage (
"This collection contains no finite element."));
164 for (
unsigned int c=1; c<size(); ++c)
172 template <
int dim,
int spacedim>
178 ExcMessage (
"This collection contains no finite element."));
185 for (
unsigned int c=1; c<size(); ++c)
193 template <
int dim,
int spacedim>
199 ExcMessage (
"This collection contains no finite element."));
206 for (
unsigned int c=1; c<size(); ++c)
208 ExcMessage (
"Not all elements of this collection agree on what " 209 "the appropriate mask should be."));
215 template <
int dim,
int spacedim>
221 ExcMessage (
"This collection contains no finite element."));
228 for (
unsigned int c=1; c<size(); ++c)
230 ExcMessage (
"Not all elements of this collection agree on what " 231 "the appropriate mask should be."));
237 template <
int dim,
int spacedim>
243 ExcMessage (
"This collection contains no finite element."));
250 for (
unsigned int c=1; c<size(); ++c)
252 ExcMessage (
"Not all elements of this collection agree on what " 253 "the appropriate mask should be."));
259 template <
int dim,
int spacedim>
265 ExcMessage (
"This collection contains no finite element."));
272 for (
unsigned int c=1; c<size(); ++c)
274 ExcMessage (
"Not all elements of this collection agree on what " 275 "the appropriate mask should be."));
282 template <
int dim,
int spacedim>
288 ExcMessage (
"This collection contains no finite element."));
295 for (
unsigned int c=1; c<size(); ++c)
297 ExcMessage (
"Not all elements of this collection agree on what " 298 "the appropriate mask should be."));
305 template <
int dim,
int spacedim>
309 Assert (finite_elements.size () > 0, ExcNoFiniteElements());
311 const unsigned int nb = finite_elements[0]->n_blocks ();
312 for (
unsigned int i=1; i<finite_elements.size(); ++i)
313 Assert (finite_elements[i]->n_blocks() == nb,
314 ExcMessage (
"Not all finite elements in this collection have " 315 "the same number of components."));
322 template <
int dim,
int spacedim>
329 for (
unsigned int i=0; i<finite_elements.size(); ++i)
330 mem += finite_elements[i]->memory_consumption();
339 #include "fe_collection.inst" 342 DEAL_II_NAMESPACE_CLOSE
ComponentMask component_mask(const FEValuesExtractors::Scalar &scalar) const
static const unsigned int invalid_unsigned_int
std::size_t memory_consumption() const
unsigned int find_least_face_dominating_fe(const std::set< unsigned int > &fes) const
std::vector< bool > component_mask
unsigned int size() const
virtual std::unique_ptr< FiniteElement< dim, spacedim > > clone() const =0
unsigned int n_blocks() const
static ::ExceptionBase & ExcMessage(std::string arg1)
BlockMask block_mask(const FEValuesExtractors::Scalar &scalar) const
void push_back(const FiniteElement< dim, spacedim > &new_fe)
#define Assert(cond, exc)
std::vector< bool > block_mask
unsigned int n_components() const
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
static ::ExceptionBase & ExcInternalError()