17 #include <deal.II/base/memory_consumption.h> 19 #include <deal.II/hp/fe_collection.h> 21 DEAL_II_NAMESPACE_OPEN
25 template <
int dim,
int spacedim>
28 const std::set<unsigned int> &fes)
const 43 std::set<unsigned int> candidate_fes;
46 for (
unsigned int cur_fe = 0; cur_fe < fe_collection.
size(); cur_fe++)
51 for (std::set<unsigned int>::const_iterator it = fes.begin();
56 ExcIndexRangeType<unsigned int>(*it,
58 fe_collection.
size()));
60 domination & fe_collection[cur_fe].compare_for_face_domination(
68 candidate_fes.insert(cur_fe);
73 if (candidate_fes.size() == 1)
75 return *candidate_fes.begin();
78 for (std::set<unsigned int>::const_iterator it = candidate_fes.begin();
79 it != candidate_fes.end();
84 for (std::set<unsigned int>::const_iterator ito =
85 candidate_fes.begin();
86 ito != candidate_fes.end();
91 domination & fe_collection[*it].compare_for_face_domination(
106 template <
int dim,
int spacedim>
115 template <
int dim,
int spacedim>
120 ExcMessage(
"Need to pass at least one finite element."));
122 for (
unsigned int i = 0; i < fes.size(); ++i)
128 template <
int dim,
int spacedim>
138 if (finite_elements.size() != 0)
140 ExcMessage(
"All elements inside a collection need to have the " 141 "same number of vector components!"));
143 finite_elements.push_back(new_fe.
clone());
148 template <
int dim,
int spacedim>
154 ExcMessage(
"This collection contains no finite element."));
161 for (
unsigned int c = 1; c < size(); ++c)
168 template <
int dim,
int spacedim>
174 ExcMessage(
"This collection contains no finite element."));
181 for (
unsigned int c = 1; c < size(); ++c)
188 template <
int dim,
int spacedim>
194 ExcMessage(
"This collection contains no finite element."));
201 for (
unsigned int c = 1; c < size(); ++c)
208 template <
int dim,
int spacedim>
213 ExcMessage(
"This collection contains no finite element."));
220 for (
unsigned int c = 1; c < size(); ++c)
222 ExcMessage(
"Not all elements of this collection agree on what " 223 "the appropriate mask should be."));
229 template <
int dim,
int spacedim>
235 ExcMessage(
"This collection contains no finite element."));
242 for (
unsigned int c = 1; c < size(); ++c)
244 ExcMessage(
"Not all elements of this collection agree on what " 245 "the appropriate mask should be."));
251 template <
int dim,
int spacedim>
257 ExcMessage(
"This collection contains no finite element."));
264 for (
unsigned int c = 1; c < size(); ++c)
266 ExcMessage(
"Not all elements of this collection agree on what " 267 "the appropriate mask should be."));
273 template <
int dim,
int spacedim>
279 ExcMessage(
"This collection contains no finite element."));
286 for (
unsigned int c = 1; c < size(); ++c)
288 ExcMessage(
"Not all elements of this collection agree on what " 289 "the appropriate mask should be."));
296 template <
int dim,
int spacedim>
302 ExcMessage(
"This collection contains no finite element."));
309 for (
unsigned int c = 1; c < size(); ++c)
311 ExcMessage(
"Not all elements of this collection agree on what " 312 "the appropriate mask should be."));
319 template <
int dim,
int spacedim>
323 Assert(finite_elements.size() > 0, ExcNoFiniteElements());
325 const unsigned int nb = finite_elements[0]->n_blocks();
326 for (
unsigned int i = 1; i < finite_elements.size(); ++i)
327 Assert(finite_elements[i]->n_blocks() == nb,
328 ExcMessage(
"Not all finite elements in this collection have " 329 "the same number of components."));
336 template <
int dim,
int spacedim>
342 for (
unsigned int i = 0; i < finite_elements.size(); ++i)
343 mem += finite_elements[i]->memory_consumption();
352 #include "fe_collection.inst" 355 DEAL_II_NAMESPACE_CLOSE
ComponentMask component_mask(const FEValuesExtractors::Scalar &scalar) const
static const unsigned int invalid_unsigned_int
BlockMask block_mask(const FEValuesExtractors::Scalar &scalar) const
std::vector< bool > component_mask
unsigned int size() const
virtual std::unique_ptr< FiniteElement< dim, spacedim > > clone() const =0
static::ExceptionBase & ExcMessage(std::string arg1)
void push_back(const FiniteElement< dim, spacedim > &new_fe)
#define Assert(cond, exc)
unsigned int n_blocks() const
unsigned int n_components() const
std::vector< bool > block_mask
unsigned int find_least_face_dominating_fe(const std::set< unsigned int > &fes) const
std::size_t memory_consumption() const
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
static::ExceptionBase & ExcInternalError()