*/
const unsigned int n_components;
- /**
- * This flag determines how the restriction
- * of data from child cells to its mother
- * is to be done. In this, it also
- * determines in which way the restriction
- * matrices of the derived class are to
- * be used.
- *
- * For most elements, the mode is the
- * following. Consider a 1d linear element,
- * with two children and nodal values
- * 1 and 2 on the first child, and 2 and 4
- * on the second child. The restriction
- * to the mother child then yields the
- * values 1 and four, i.e. the values on
- * the mother cell can be obtained by
- * pointwise interpolation, where for each
- * nodal value on the mother child one
- * point on exactly one child exists.
- * However, already on the quadratic
- * element, the midpoint on the mother
- * element can be obtained from any of
- * the two children, which however would
- * both yield the same value due to
- * continuity. What we do in practice
- * is to compute them from both sides
- * and set them, rather than add them up.
- * This makes some things much easier. In
- * practice, if a degree of freedom on
- * one of the child cells yields a
- * nonzero contribution to one of the
- * degrees of freedom on the mother
- * cell, we overwrite the value on
- * the mother cell. This way, when setting
- * up the restriction matrices, we do not
- * have to track which child is responsible
- * for setting a given value on the mother
- * cell. We call this the non-additive
- * mode.
- *
- * The other possibility would be to
- * add up the contributions from the
- * different children. This would mean
- * that both of the inner endpoint of
- * the quadratic child elements above
- * would have a weight of 1/2 with
- * respect to the midpoint value on
- * the mother cell. However, this also
- * means that we have to first compute
- * the restriction to the mother cell
- * by addition from the child cells, and
- * afterwards set them to the global
- * vector. The same process, adding
- * up the local contributions to the
- * global vector is not possible since
- * we do not know how many coarse cells
- * contribute to nodes on the boundary.
- *
- * In contrast to the non-additive mode
- * described above, which is the simplest
- * way for elements can be interpolated
- * from its children, interpolation is
- * not possible for piecewise constant
- * elements, to name only one example.
- * Here, the value on the mother cell
- * has to be taken the average of the
- * values on the children, i.e. all
- * children contribute alike to the
- * one degree of freedom. Here, we have
- * to sum up the contributions of all
- * child cells with the same weight,
- * and the non-additive mode of above
- * would only set the value on the mother
- * cell to the value of one of the child
- * cell, irrespective of the values on the
- * other cells.
- *
- * Similarly, for discontinuous linear
- * elements, it might be better to not
- * interpolate the values at the corners
- * from the child cells, but to take a
- * better average, for example
- * interpolating at the centers of the
- * child cells; in that case, the
- * contributions of the child cells
- * have to be additive as well.
- *
- * Given these notes, the flag under
- * consideration has to be set to #false#
- * for the usual continuous Lagrange
- * elements, and #true# for the other
- * cases mentioned above. The main function
- * where it is used is
- * #DoFAccessor::get_interpolated_dof_values#.
- */
- const bool restriction_is_additive;
-
/**
* Default constructor. Constructs
* an element
FiniteElementData (const unsigned int dofs_per_vertex,
const unsigned int dofs_per_line,
const unsigned int n_transform_functions,
- const unsigned int n_components,
- const bool restriction_is_additive);
+ const unsigned int n_components);
/**
* Constructor for a 2-dimensional
const unsigned int dofs_per_line,
const unsigned int dofs_per_quad,
const unsigned int n_transform_functions,
- const unsigned int n_components,
- const bool restriction_is_additive);
+ const unsigned int n_components);
/**
* Constructor for a 3-dimensional
const unsigned int dofs_per_quad,
const unsigned int dofs_per_hex,
const unsigned int n_transform_functions,
- const unsigned int n_components,
- const bool restriction_is_additive);
+ const unsigned int n_components);
/**
* Declare this destructor virtual in
* matrices explicitely after calling
* this base class' constructor.
*/
- FiniteElementBase (const FiniteElementData<dim> &fe_data);
+ FiniteElementBase (const FiniteElementData<dim> &fe_data,
+ const vector<bool> &restriction_is_additive_flags);
/**
* Return a readonly reference to the
* element.
*/
unsigned int component_to_base(unsigned int index) const;
-
+
+ /**
+ * Access the #restriction_is_additive_flag#
+ * field. See there for more information on
+ * its contents.
+ */
+ bool restriction_is_additive (const unsigned int component) const;
/**
* Exception
* element.
*/
vector<unsigned int> component_to_base_table;
+
+ /**
+ * This flag determines how the restriction
+ * of data from child cells to its mother
+ * is to be done. In this, it also
+ * determines in which way the restriction
+ * matrices of the derived class are to
+ * be used.
+ *
+ * For most elements, the mode is the
+ * following. Consider a 1d linear element,
+ * with two children and nodal values
+ * 1 and 2 on the first child, and 2 and 4
+ * on the second child. The restriction
+ * to the mother child then yields the
+ * values 1 and four, i.e. the values on
+ * the mother cell can be obtained by
+ * pointwise interpolation, where for each
+ * nodal value on the mother child one
+ * point on exactly one child exists.
+ * However, already on the quadratic
+ * element, the midpoint on the mother
+ * element can be obtained from any of
+ * the two children, which however would
+ * both yield the same value due to
+ * continuity. What we do in practice
+ * is to compute them from both sides
+ * and set them, rather than add them up.
+ * This makes some things much easier. In
+ * practice, if a degree of freedom on
+ * one of the child cells yields a
+ * nonzero contribution to one of the
+ * degrees of freedom on the mother
+ * cell, we overwrite the value on
+ * the mother cell. This way, when setting
+ * up the restriction matrices, we do not
+ * have to track which child is responsible
+ * for setting a given value on the mother
+ * cell. We call this the non-additive
+ * mode.
+ *
+ * The other possibility would be to
+ * add up the contributions from the
+ * different children. This would mean
+ * that both of the inner endpoint of
+ * the quadratic child elements above
+ * would have a weight of 1/2 with
+ * respect to the midpoint value on
+ * the mother cell. However, this also
+ * means that we have to first compute
+ * the restriction to the mother cell
+ * by addition from the child cells, and
+ * afterwards set them to the global
+ * vector. The same process, adding
+ * up the local contributions to the
+ * global vector is not possible since
+ * we do not know how many coarse cells
+ * contribute to nodes on the boundary.
+ *
+ * In contrast to the non-additive mode
+ * described above, which is the simplest
+ * way for elements can be interpolated
+ * from its children, interpolation is
+ * not possible for piecewise constant
+ * elements, to name only one example.
+ * Here, the value on the mother cell
+ * has to be taken the average of the
+ * values on the children, i.e. all
+ * children contribute alike to the
+ * one degree of freedom. Here, we have
+ * to sum up the contributions of all
+ * child cells with the same weight,
+ * and the non-additive mode of above
+ * would only set the value on the mother
+ * cell to the value of one of the child
+ * cell, irrespective of the values on the
+ * other cells.
+ *
+ * Similarly, for discontinuous linear
+ * elements, it might be better to not
+ * interpolate the values at the corners
+ * from the child cells, but to take a
+ * better average, for example
+ * interpolating at the centers of the
+ * child cells; in that case, the
+ * contributions of the child cells
+ * have to be additive as well.
+ *
+ * Given these notes, the flag under
+ * consideration has to be set to #false#
+ * for the usual continuous Lagrange
+ * elements, and #true# for the other
+ * cases mentioned above. The main function
+ * where it is used is
+ * #DoFAccessor::get_interpolated_dof_values#.
+ * There is one flag per component.
+ */
+ const vector<bool> restriction_is_additive_flags;
};
/**
* Constructor
*/
- FiniteElement (const FiniteElementData<dim> &fe_data);
+ FiniteElement (const FiniteElementData<dim> &fe_data,
+ const vector<bool> restriction_is_additive_flags);
/**
* Destructor. Only declared to have a
return component_to_base_table[index];
}
+template <int dim>
+inline
+bool
+FiniteElementBase<dim>::restriction_is_additive (const unsigned int component) const
+{
+ Assert(component<n_components,
+ ExcIndexRange(component, 0, n_components));
+ return restriction_is_additive_flags[component];
+}
+
+
/*---------------------------- fe.h ---------------------------*/
/* end of #ifndef __fe_H */
#endif
const FiniteElementData<dim> &fe3,
const unsigned int N3);
+
+ /**
+ * Helper function used in the constructor:
+ * takes a #FiniteElement# object
+ * and returns an boolean vector including
+ * the #restriction_is_additive_flags# of
+ * the mixed element consisting of #N#
+ * elements of the sub-element #fe#.
+ */
+ static vector<bool>
+ compute_restriction_is_additive_flags (const FiniteElement<dim> &fe,
+ const unsigned int N);
+ /**
+ * Same as above for mixed elements
+ * with two different sub-elements.
+ */
+ static vector<bool>
+ compute_restriction_is_additive_flags (const FiniteElement<dim> &fe1,
+ const unsigned int N1,
+ const FiniteElement<dim> &fe2,
+ const unsigned int N2);
+
+ /**
+ * Same as above for mixed elements
+ * with three different sub-elements.
+ */
+ static vector<bool>
+ compute_restriction_is_additive_flags (const FiniteElement<dim> &fe1,
+ const unsigned int N1,
+ const FiniteElement<dim> &fe2,
+ const unsigned int N2,
+ const FiniteElement<dim> &fe3,
+ const unsigned int N3);
+
/**
* This function is simply singled out of
* the constructor. It sets up the
-template<int dim>
-inline unsigned int
-FESystem<dim>::element_multiplicity(unsigned int index) const
-{
- Assert (index < base_elements.size(),
- ExcIndexRange(index, 0, base_elements.size()));
- return base_elements[index].second;
-}
-
-
-
-template <int dim>
-inline const FiniteElement<dim>&
-FESystem<dim>::base_element(unsigned int index) const
-{
- Assert (index < base_elements.size(),
- ExcIndexRange(index, 0, base_elements.size()));
- return *base_elements[index].first;
-}
-
-
-
template <int dim>
template <class FE>
FESystem<dim>::FESystem (const FE &fe, const unsigned int n_elements) :
- FiniteElement<dim> (multiply_dof_numbers(fe, n_elements)),
+ FiniteElement<dim> (multiply_dof_numbers(fe, n_elements),
+ compute_restriction_is_additive_flags (fe, n_elements)),
base_elements(1)
{
base_elements[0] = ElementPair(new FE, n_elements);
FESystem<dim>::FESystem (const FE1 &fe1, const unsigned int n1,
const FE2 &fe2, const unsigned int n2)
:
- FiniteElement<dim> (multiply_dof_numbers(fe1, n1, fe2, n2)),
+ FiniteElement<dim> (multiply_dof_numbers(fe1, n1, fe2, n2),
+ compute_restriction_is_additive_flags (fe1, n1,
+ fe2, n2)),
base_elements(2)
{
Assert(fe1.n_transform_functions == fe2.n_transform_functions,
:
FiniteElement<dim> (multiply_dof_numbers(fe1, n1,
fe2, n2,
- fe3, n3)),
+ fe3, n3),
+ compute_restriction_is_additive_flags (fe1, n1,
+ fe2, n2,
+ fe3, n3)),
base_elements(3)
{
Assert(fe1.n_transform_functions == fe2.n_transform_functions,
+template<int dim>
+inline unsigned int
+FESystem<dim>::element_multiplicity(unsigned int index) const
+{
+ Assert (index < base_elements.size(),
+ ExcIndexRange(index, 0, base_elements.size()));
+ return base_elements[index].second;
+}
+
+
+
+template <int dim>
+inline const FiniteElement<dim>&
+FESystem<dim>::base_element(unsigned int index) const
+{
+ Assert (index < base_elements.size(),
+ ExcIndexRange(index, 0, base_elements.size()));
+ return *base_elements[index].first;
+}
+
+
+
+
+
+
/*---------------------------- fe_lib.system.h ---------------------------*/
/* end of #ifndef __fe_system_H */
*/
FEQ1Mapping (const unsigned int dofs_per_vertex,
const unsigned int dofs_per_line,
- const unsigned int dofs_per_quad =0,
- const unsigned int dofs_per_hex =0,
- const unsigned int n_components =1,
- const bool restriction_is_additive=false);
+ const unsigned int dofs_per_quad,
+ const unsigned int dofs_per_hex,
+ const unsigned int n_components,
+ const vector<bool> restriction_is_additive_flags);
/**
* Return the value of the #i#th shape
interpolated_values.clear ();
- const bool restriction_is_additive
- = dof_handler->get_fe().restriction_is_additive;
-
for (unsigned int child=0; child<GeometryInfo<dim>::children_per_cell;
++child)
{
// end in adding up the contribution
// from nodes on boundaries of
// children more than once.
- if (restriction_is_additive)
+ for (unsigned int i=0; i<total_dofs; ++i)
{
- for (unsigned int i=0; i<total_dofs; ++i)
+ const unsigned int component
+ = dof_handler->get_fe().system_to_component_index(i).first;
+
+ if (dof_handler->get_fe().restriction_is_additive(component))
interpolated_values(i) += tmp2(i);
- }
- else
- {
- for (unsigned int i=0; i<total_dofs; ++i)
+ else
if (tmp2(i) != 0)
interpolated_values(i) = tmp2(i);
- };
- };
+ }
+ }
};
};
const unsigned int dofs_per_quad,
const unsigned int dofs_per_hex,
const unsigned int n_transform_functions,
- const unsigned int n_components,
- const bool restriction_is_additive) :
+ const unsigned int n_components) :
dofs_per_vertex(dofs_per_vertex),
dofs_per_line(dofs_per_line),
dofs_per_quad(dofs_per_quad),
* dofs_per_line),
total_dofs (first_hex_index+dofs_per_hex),
n_transform_functions (n_transform_functions),
- n_components(n_components),
- restriction_is_additive(restriction_is_additive)
+ n_components(n_components)
{
Assert(dim==3, ExcDimensionMismatch(3,dim));
};
const unsigned int dofs_per_line,
const unsigned int dofs_per_quad,
const unsigned int n_transform_functions,
- const unsigned int n_components,
- const bool restriction_is_additive) :
+ const unsigned int n_components) :
dofs_per_vertex(dofs_per_vertex),
dofs_per_line(dofs_per_line),
dofs_per_quad(dofs_per_quad),
* dofs_per_line),
total_dofs (first_quad_index+dofs_per_quad),
n_transform_functions (n_transform_functions),
- n_components(n_components),
- restriction_is_additive(restriction_is_additive)
+ n_components(n_components)
{
Assert(dim==2, ExcDimensionMismatch(2,dim));
};
FiniteElementData<dim>::FiniteElementData (const unsigned int dofs_per_vertex,
const unsigned int dofs_per_line,
const unsigned int n_transform_functions,
- const unsigned int n_components,
- const bool restriction_is_additive) :
+ const unsigned int n_components) :
dofs_per_vertex(dofs_per_vertex),
dofs_per_line(dofs_per_line),
dofs_per_quad(0),
* dofs_per_line),
total_dofs (first_line_index+dofs_per_line),
n_transform_functions (n_transform_functions),
- n_components(n_components),
- restriction_is_additive(restriction_is_additive)
+ n_components(n_components)
{
Assert(dim==1, ExcDimensionMismatch(1,dim));
};
(dofs_per_quad == f.dofs_per_quad) &&
(dofs_per_hex == f.dofs_per_hex) &&
(n_transform_functions == f.n_transform_functions) &&
- (n_components == f.n_components) &&
- (restriction_is_additive == f.restriction_is_additive));
+ (n_components == f.n_components));
};
template <int dim>
-FiniteElementBase<dim>::FiniteElementBase (const FiniteElementData<dim> &fe_data) :
+FiniteElementBase<dim>::FiniteElementBase (const FiniteElementData<dim> &fe_data,
+ const vector<bool> &restriction_is_additive_flags) :
FiniteElementData<dim> (fe_data),
system_to_component_table(total_dofs),
face_system_to_component_table(dofs_per_face),
component_to_system_table(n_components, vector<unsigned>(total_dofs)),
face_component_to_system_table(n_components, vector<unsigned>(dofs_per_face)),
- component_to_base_table(n_components)
+ component_to_base_table(n_components),
+ restriction_is_additive_flags(restriction_is_additive_flags)
{
+ Assert(restriction_is_additive_flags.size()==fe_data.n_components,
+ ExcWrongFieldDimension(restriction_is_additive_flags.size(),fe_data.n_components));
+
for (unsigned int i=0; i<GeometryInfo<dim>::children_per_cell; ++i)
{
restriction[i].reinit (total_dofs, total_dofs);
-
-
/*------------------------------- FiniteElement ----------------------*/
template <int dim>
-FiniteElement<dim>::FiniteElement (const FiniteElementData<dim> &fe_data) :
- FiniteElementBase<dim> (fe_data) {};
+FiniteElement<dim>::FiniteElement (const FiniteElementData<dim> &fe_data,
+ const vector<bool> restriction_is_additive_flags) :
+ FiniteElementBase<dim> (fe_data,
+ restriction_is_additive_flags) {};
#if deal_II_dimension == 1
template <>
FECrissCross<1>::FECrissCross () :
// set more or less invalid data
- FiniteElement<1> (FiniteElementData<1> (0,0,0,0))
+ FiniteElement<1> (FiniteElementData<1> (0,0,0,0),
+ vector<bool>())
{
Assert (false, ExcNotUseful());
};
template <>
FECrissCross<2>::FECrissCross () :
- FiniteElement<2> (FiniteElementData<2> (1,0,1,5,1))
+ FiniteElement<2> (FiniteElementData<2> (1,0,1,5,1),
+ vector<bool> (1, false))
{
interface_constraints(0,0) = 1./2.;
interface_constraints(0,1) = 1./2.;
template <>
FEQ3<1>::FEQ3 () :
- FEQ1Mapping<1> (1, 2) {
+ FEQ1Mapping<1> (1, 2, 0, 0, 1,
+ vector<bool> (1, false)) {
initialize_matrices ();
};
template <>
FEQ3<1>::FEQ3 (const int) :
- FEQ1Mapping<1> (0, 4)
+ FEQ1Mapping<1> (0, 4, 0, 0, 1,
+ vector<bool> (1, false))
{
initialize_matrices ();
};
template <>
FEQ3<2>::FEQ3 () :
- FEQ1Mapping<2> (1, 2, 4)
+ FEQ1Mapping<2> (1, 2, 4, 0, 1,
+ vector<bool> (1, false))
{
interface_constraints(0,0) = -1.0/16.0;
interface_constraints(0,1) = -1.0/16.0;
template <>
FEQ3<2>::FEQ3 (const int) :
- FEQ1Mapping<2> (0, 0, 16)
+ FEQ1Mapping<2> (0, 0, 16, 0, 1,
+ vector<bool> (1, false))
{
initialize_matrices ();
};
template <>
FEQ3<3>::FEQ3 () :
- FEQ1Mapping<3> (1, 2, 4, 8)
+ FEQ1Mapping<3> (1, 2, 4, 8, 1,
+ vector<bool> (1, false))
{
interface_constraints(0,0) = 1.0/256.0;
interface_constraints(0,1) = 1.0/256.0;
template <>
FEQ3<3>::FEQ3 (const int) :
- FEQ1Mapping<3> (0, 0, 0, 64)
+ FEQ1Mapping<3> (0, 0, 0, 64, 1,
+ vector<bool> (1, false))
{
initialize_matrices ();
};
(dim==2 ? 1 : 0),
(dim==3 ? 1 : 0),
1,
- true)
+ vector<bool> (1, true))
{
for (unsigned int i=0; i<GeometryInfo<dim>::children_per_cell; ++i)
{
template <>
FEQ1<1>::FEQ1 () :
- FEQ1Mapping<1> (1, 0)
+ FEQ1Mapping<1> (1, 0, 0, 0, 1,
+ vector<bool> (1, false))
{
initialize_matrices ();
};
template <>
FEQ1<1>::FEQ1 (const int) :
- FEQ1Mapping<1> (0, 2)
+ FEQ1Mapping<1> (0, 2, 0, 0, 1,
+ vector<bool> (1, false))
{
initialize_matrices ();
};
template <>
FEQ1<2>::FEQ1 () :
- FEQ1Mapping<2> (1, 0, 0)
+ FEQ1Mapping<2> (1, 0, 0, 0, 1,
+ vector<bool> (1, false))
{
interface_constraints(0,0) = 1./2.;
interface_constraints(0,1) = 1./2.;
template <>
FEQ1<2>::FEQ1 (const int) :
- FEQ1Mapping<2> (0, 0, 4)
+ FEQ1Mapping<2> (0, 0, 4, 0, 1,
+ vector<bool> (1, false))
{
initialize_matrices ();
};
template <>
FEQ1<3>::FEQ1 () :
- FEQ1Mapping<3> (1, 0, 0, 0)
+ FEQ1Mapping<3> (1, 0, 0, 0, 1,
+ vector<bool> (1, false))
{
interface_constraints(0,0) = 1.0/4.0;
interface_constraints(0,1) = 1.0/4.0;
template <>
FEQ1<3>::FEQ1 (const int) :
- FEQ1Mapping<3> (0, 0, 0, 8)
+ FEQ1Mapping<3> (0, 0, 0, 8, 1,
+ vector<bool> (1, false))
{
initialize_matrices ();
};
template <>
FEQ2<1>::FEQ2 () :
- FEQ1Mapping<1> (1, 1) {
+ FEQ1Mapping<1> (1, 1, 0, 0, 1,
+ vector<bool> (1, false)) {
initialize_matrices ();
};
template <>
FEQ2<1>::FEQ2 (const int) :
- FEQ1Mapping<1> (0, 3) {
+ FEQ1Mapping<1> (0, 3, 0, 0, 1,
+ vector<bool> (1, false)) {
initialize_matrices ();
};
template <>
double
FEQ2<1>::shape_value(const unsigned int i,
- const Point<1> &p) const
+ const Point<1> &p) const
{
Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
const double xi = p(0);
template <>
Tensor<1,1>
FEQ2<1>::shape_grad(const unsigned int i,
- const Point<1> &p) const
+ const Point<1> &p) const
{
Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
const double xi = p(0);
template <>
Tensor<2,1>
FEQ2<1>::shape_grad_grad (const unsigned int i,
- const Point<1> &) const
+ const Point<1> &) const
{
Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
template <>
void FEQ2<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell,
- FullMatrix<double> &local_mass_matrix) const {
+ FullMatrix<double> &local_mass_matrix) const {
Assert (local_mass_matrix.n() == total_dofs,
ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
Assert (local_mass_matrix.m() == total_dofs,
template <>
FEQ2<2>::FEQ2 () :
- FEQ1Mapping<2> (1, 1, 1)
+ FEQ1Mapping<2> (1, 1, 1, 0, 1,
+ vector<bool> (1, false))
{
interface_constraints(0,2) = 1.0;
interface_constraints(1,0) = 3./8.;
template <>
FEQ2<2>::FEQ2 (const int) :
- FEQ1Mapping<2> (0, 0, 9)
+ FEQ1Mapping<2> (0, 0, 9, 0, 1,
+ vector<bool> (1, false))
{
initialize_matrices ();
};
template <>
FEQ2<3>::FEQ2 () :
- FEQ1Mapping<3> (1, 1, 1, 1)
+ FEQ1Mapping<3> (1, 1, 1, 1, 1,
+ vector<bool> (1, false))
{
interface_constraints(0,8) = 1.0;
interface_constraints(1,4) = 1.0;
template <>
FEQ2<3>::FEQ2 (const int) :
- FEQ1Mapping<3> (0, 0, 0, 27)
+ FEQ1Mapping<3> (0, 0, 0, 27, 1,
+ vector<bool> (1, false))
{
initialize_matrices ();
};
template <>
FEQ4<1>::FEQ4 () :
- FEQ1Mapping<1> (1, 3) {
+ FEQ1Mapping<1> (1, 3, 0, 0, 1,
+ vector<bool> (1, false)) {
initialize_matrices ();
};
template <>
FEQ4<1>::FEQ4 (const int) :
- FEQ1Mapping<1> (0, 5) {
+ FEQ1Mapping<1> (0, 5, 0, 0, 1,
+ vector<bool> (1, false)) {
initialize_matrices ();
};
template <>
FEQ4<2>::FEQ4 () :
- FEQ1Mapping<2> (1, 3, 9)
+ FEQ1Mapping<2> (1, 3, 9, 0, 1,
+ vector<bool> (1, false))
{
interface_constraints(0,3) = 1.0;
interface_constraints(1,0) = 35.0/128.0;
template <>
FEQ4<2>::FEQ4 (const int) :
- FEQ1Mapping<2> (0, 0, 25)
+ FEQ1Mapping<2> (0, 0, 25, 0, 1,
+ vector<bool> (1, false))
{
initialize_matrices ();
};
#endif
+template <int dim>
+vector<bool>
+FESystem<dim>::compute_restriction_is_additive_flags (const FiniteElement<dim> &fe,
+ const unsigned int n_elements)
+{
+ vector<bool> tmp;
+ for (unsigned int i=0; i<n_elements; ++i)
+ for (unsigned int component=0; component<fe.n_components; ++component)
+ tmp.push_back (fe.restriction_is_additive (component));
+ return tmp;
+};
+
+
+template <int dim>
+vector<bool>
+FESystem<dim>::compute_restriction_is_additive_flags (const FiniteElement<dim> &fe1,
+ const unsigned int N1,
+ const FiniteElement<dim> &fe2,
+ const unsigned int N2)
+{
+ vector<bool> tmp;
+ for (unsigned int i=0; i<N1; ++i)
+ for (unsigned int component=0; component<fe1.n_components; ++component)
+ tmp.push_back (fe1.restriction_is_additive (component));
+ for (unsigned int i=0; i<N2; ++i)
+ for (unsigned int component=0; component<fe2.n_components; ++component)
+ tmp.push_back (fe2.restriction_is_additive (component));
+ return tmp;
+};
+
+
+template <int dim>
+vector<bool>
+FESystem<dim>::compute_restriction_is_additive_flags (const FiniteElement<dim> &fe1,
+ const unsigned int N1,
+ const FiniteElement<dim> &fe2,
+ const unsigned int N2,
+ const FiniteElement<dim> &fe3,
+ const unsigned int N3)
+{
+ vector<bool> tmp;
+ for (unsigned int i=0; i<N1; ++i)
+ for (unsigned int component=0; component<fe1.n_components; ++component)
+ tmp.push_back (fe1.restriction_is_additive (component));
+ for (unsigned int i=0; i<N2; ++i)
+ for (unsigned int component=0; component<fe2.n_components; ++component)
+ tmp.push_back (fe2.restriction_is_additive (component));
+ for (unsigned int i=0; i<N3; ++i)
+ for (unsigned int component=0; component<fe3.n_components; ++component)
+ tmp.push_back (fe3.restriction_is_additive (component));
+ return tmp;
+};
+
+
+
+
template <int dim>
double
FESystem<dim>::shape_value (const unsigned int i,
const unsigned int dofs_per_quad,
const unsigned int dofs_per_hex,
const unsigned int n_components,
- const bool restriction_is_additive) :
+ const vector<bool> restriction_is_additive_flags) :
FiniteElement<1> (FiniteElementData<1> (dofs_per_vertex,
dofs_per_line,
GeometryInfo<1>::vertices_per_cell,
- n_components,
- restriction_is_additive))
+ n_components),
+ restriction_is_additive_flags)
{
Assert (dofs_per_quad==0, ExcInvalidData());
Assert (dofs_per_hex==0, ExcInvalidData());
const unsigned int dofs_per_quad,
const unsigned int dofs_per_hex,
const unsigned int n_components,
- const bool restriction_is_additive) :
+ const vector<bool> restriction_is_additive_flags) :
FiniteElement<2> (FiniteElementData<2> (dofs_per_vertex,
dofs_per_line,
dofs_per_quad,
GeometryInfo<2>::vertices_per_cell,
- n_components,
- restriction_is_additive))
+ n_components),
+ restriction_is_additive_flags)
{
Assert (dofs_per_hex == 0, ExcInvalidData());
};
const unsigned int dofs_per_quad,
const unsigned int dofs_per_hex,
const unsigned int n_components,
- const bool restriction_is_additive) :
+ const vector<bool> restriction_is_additive_flags) :
FiniteElement<3> (FiniteElementData<3> (dofs_per_vertex,
dofs_per_line,
dofs_per_quad,
dofs_per_hex,
GeometryInfo<3>::vertices_per_cell,
- n_components,
- restriction_is_additive))
+ n_components),
+ restriction_is_additive_flags)
{};