for (const auto &p : fe_systems)
extract(p);
+ const ReferenceCell reference_cell = fes.front()->reference_cell();
+ (void)reference_cell;
+ Assert(std::all_of(fes.begin(),
+ fes.end(),
+ [reference_cell](const FiniteElement<dim, spacedim> *fe) {
+ return fe->reference_cell() == reference_cell;
+ }),
+ ExcMessage("You cannot combine finite elements defined on "
+ "different reference cells into a combined element "
+ "such as an FESystem or FE_Enriched object."));
+
initialize(fes, multiplicities);
}
# endif
for (unsigned int m = 0; m < multiplicities[base]; ++m)
block_indices.push_back(fes[base]->n_dofs_per_cell());
+ const ReferenceCell reference_cell = fes.front()->reference_cell();
+ Assert(std::all_of(fes.begin(),
+ fes.end(),
+ [reference_cell](
+ const FiniteElement<dim, spacedim> *fe) {
+ return fe->reference_cell() == reference_cell;
+ }),
+ ExcMessage("You cannot combine finite elements defined on "
+ "different reference cells into a combined element "
+ "such as an FESystem or FE_Enriched object."));
return FiniteElementData<dim>(dpo,
- fes.front()->reference_cell(),
+ reference_cell,
(do_tensor_product ?
multiplied_n_components :
n_components),
{
AssertDimension(fes.size(), multiplicities.size());
+ const ReferenceCell reference_cell = fes.front()->reference_cell();
+ Assert(std::all_of(fes.begin(),
+ fes.end(),
+ [reference_cell](
+ const FiniteElement<dim, spacedim> *fe) {
+ return fe->reference_cell() == reference_cell;
+ }),
+ ExcMessage("You cannot combine finite elements defined on "
+ "different reference cells into a combined element "
+ "such as an FESystem or FE_Enriched object."));
+
// first count the number of dofs and components that will emerge from the
// given FEs
unsigned int n_shape_functions = 0;
// for each shape function, copy the flags from the base element to this
// one, taking into account multiplicities, and other complications
unsigned int total_index = 0;
- for (const unsigned int vertex_number :
- fes.front()->reference_cell().vertex_indices())
+ for (const unsigned int vertex_number : reference_cell.vertex_indices())
{
for (unsigned int base = 0; base < fes.size(); ++base)
for (unsigned int m = 0; m < multiplicities[base]; ++m)
}
// 2. Lines
- for (const unsigned int line_number :
- fes.front()->reference_cell().line_indices())
+ for (const unsigned int line_number : reference_cell.line_indices())
{
for (unsigned int base = 0; base < fes.size(); ++base)
for (unsigned int m = 0; m < multiplicities[base]; ++m)
// 3. Quads
for (unsigned int quad_number = 0;
quad_number <
- (dim == 2 ?
- 1 :
- (dim == 3 ? fes.front()->reference_cell().n_faces() : 0));
+ (dim == 2 ? 1 : (dim == 3 ? reference_cell.n_faces() : 0));
++quad_number)
{
for (unsigned int base = 0; base < fes.size(); ++base)
fes.size() > 0,
ExcMessage(
"This function only makes sense if at least one FiniteElement is provided."));
+
+ const ReferenceCell reference_cell = fes.front()->reference_cell();
+ Assert(std::all_of(fes.begin(),
+ fes.end(),
+ [reference_cell](
+ const FiniteElement<dim, spacedim> *fe) {
+ return fe->reference_cell() == reference_cell;
+ }),
+ ExcMessage("You cannot combine finite elements defined on "
+ "different reference cells into a combined element "
+ "such as an FESystem or FE_Enriched object."));
+
// first count the number of dofs and components that will emerge from the
// given FEs
unsigned int n_shape_functions = 0;
// to this one, taking into account multiplicities, multiple components in
// base elements, and other complications
unsigned int total_index = 0;
- for (const unsigned int vertex_number :
- fes.front()->reference_cell().vertex_indices())
+ for (const unsigned int vertex_number : reference_cell.vertex_indices())
{
unsigned int comp_start = 0;
for (unsigned int base = 0; base < fes.size(); ++base)
}
// 2. Lines
- for (const unsigned int line_number :
- fes.front()->reference_cell().line_indices())
+ for (const unsigned int line_number : reference_cell.line_indices())
{
unsigned int comp_start = 0;
for (unsigned int base = 0; base < fes.size(); ++base)
// 3. Quads
for (unsigned int quad_number = 0;
quad_number <
- (dim == 2 ?
- 1 :
- (dim == 3 ? fes.front()->reference_cell().n_faces() : 0));
+ (dim == 2 ? 1 : (dim == 3 ? reference_cell.n_faces() : 0));
++quad_number)
{
unsigned int comp_start = 0;
{
const std::vector<const FiniteElement<dim, spacedim> *> fes = {&fe1, &fe2};
const std::vector<unsigned int> multiplicities = {n1, n2};
+
+ const ReferenceCell reference_cell = fes.front()->reference_cell();
+ (void)reference_cell;
+ Assert(std::all_of(fes.begin(),
+ fes.end(),
+ [reference_cell](const FiniteElement<dim, spacedim> *fe) {
+ return fe->reference_cell() == reference_cell;
+ }),
+ ExcMessage("You cannot combine finite elements defined on "
+ "different reference cells into a combined element "
+ "such as an FESystem or FE_Enriched object."));
+
initialize(fes, multiplicities);
}
&fe2,
&fe3};
const std::vector<unsigned int> multiplicities = {n1, n2, n3};
+
+ const ReferenceCell reference_cell = fes.front()->reference_cell();
+ (void)reference_cell;
+ Assert(std::all_of(fes.begin(),
+ fes.end(),
+ [reference_cell](const FiniteElement<dim, spacedim> *fe) {
+ return fe->reference_cell() == reference_cell;
+ }),
+ ExcMessage("You cannot combine finite elements defined on "
+ "different reference cells into a combined element "
+ "such as an FESystem or FE_Enriched object."));
+
initialize(fes, multiplicities);
}
&fe3,
&fe4};
const std::vector<unsigned int> multiplicities = {n1, n2, n3, n4};
+
+ const ReferenceCell reference_cell = fes.front()->reference_cell();
+ (void)reference_cell;
+ Assert(std::all_of(fes.begin(),
+ fes.end(),
+ [reference_cell](const FiniteElement<dim, spacedim> *fe) {
+ return fe->reference_cell() == reference_cell;
+ }),
+ ExcMessage("You cannot combine finite elements defined on "
+ "different reference cells into a combined element "
+ "such as an FESystem or FE_Enriched object."));
+
initialize(fes, multiplicities);
}
const std::vector<const FiniteElement<dim, spacedim> *> fes = {
&fe1, &fe2, &fe3, &fe4, &fe5};
const std::vector<unsigned int> multiplicities = {n1, n2, n3, n4, n5};
+
+ const ReferenceCell reference_cell = fes.front()->reference_cell();
+ (void)reference_cell;
+ Assert(std::all_of(fes.begin(),
+ fes.end(),
+ [reference_cell](const FiniteElement<dim, spacedim> *fe) {
+ return fe->reference_cell() == reference_cell;
+ }),
+ ExcMessage("You cannot combine finite elements defined on "
+ "different reference cells into a combined element "
+ "such as an FESystem or FE_Enriched object."));
+
initialize(fes, multiplicities);
}
FETools::Compositing::compute_nonzero_components(fes, multiplicities))
, base_elements(count_nonzeros(multiplicities))
{
+ const ReferenceCell reference_cell = fes.front()->reference_cell();
+ (void)reference_cell;
+ Assert(std::all_of(fes.begin(),
+ fes.end(),
+ [reference_cell](const FiniteElement<dim, spacedim> *fe) {
+ return fe->reference_cell() == reference_cell;
+ }),
+ ExcMessage("You cannot combine finite elements defined on "
+ "different reference cells into a combined element "
+ "such as an FESystem or FE_Enriched object."));
+
initialize(fes, multiplicities);
}