compute_nonzero_components(fe, n_elements)),
base_elements(1)
{
+ this->base_to_block_indices.reinit(0, 0);
+ this->base_to_block_indices.push_back(n_elements);
base_elements[0] = ElementPair(fe.clone(), n_elements);
base_elements[0].first->subscribe (typeid(*this).name());
initialize ();
fe2, n2)),
base_elements(2)
{
+ this->base_to_block_indices.reinit(0, 0);
+ this->base_to_block_indices.push_back(n1);
+ this->base_to_block_indices.push_back(n2);
base_elements[0] = ElementPair(fe1.clone(), n1);
base_elements[0].first->subscribe (typeid(*this).name());
base_elements[1] = ElementPair(fe2.clone(), n2);
base_elements[1].first->subscribe (typeid(*this).name());
- this->first_block_of_base_table.push_back(n1);
initialize ();
}
fe3, n3)),
base_elements(3)
{
+ this->base_to_block_indices.reinit(0, 0);
+ this->base_to_block_indices.push_back(n1);
+ this->base_to_block_indices.push_back(n2);
+ this->base_to_block_indices.push_back(n3);
base_elements[0] = ElementPair(fe1.clone(), n1);
base_elements[0].first->subscribe (typeid(*this).name());
base_elements[1] = ElementPair(fe2.clone(), n2);
base_elements[1].first->subscribe (typeid(*this).name());
base_elements[2] = ElementPair(fe3.clone(), n3);
base_elements[2].first->subscribe (typeid(*this).name());
- this->first_block_of_base_table.push_back(n1);
- this->first_block_of_base_table.push_back(n1+n2);
initialize ();
}
fe4 ,n4)),
base_elements(4)
{
+ this->base_to_block_indices.reinit(0, 0);
+ this->base_to_block_indices.push_back(n1);
+ this->base_to_block_indices.push_back(n2);
+ this->base_to_block_indices.push_back(n3);
+ this->base_to_block_indices.push_back(n4);
base_elements[0] = ElementPair(fe1.clone(), n1);
base_elements[0].first->subscribe (typeid(*this).name());
base_elements[1] = ElementPair(fe2.clone(), n2);
base_elements[2].first->subscribe (typeid(*this).name());
base_elements[3] = ElementPair(fe4.clone(), n4);
base_elements[3].first->subscribe (typeid(*this).name());
- this->first_block_of_base_table.push_back(n1);
- this->first_block_of_base_table.push_back(n1+n2);
- this->first_block_of_base_table.push_back(n1+n2+n3);
initialize ();
}
fe5, n5)),
base_elements(5)
{
+ this->base_to_block_indices.reinit(0, 0);
+ this->base_to_block_indices.push_back(n1);
+ this->base_to_block_indices.push_back(n2);
+ this->base_to_block_indices.push_back(n3);
+ this->base_to_block_indices.push_back(n4);
+ this->base_to_block_indices.push_back(n5);
+
base_elements[0] = ElementPair(fe1.clone(), n1);
base_elements[0].first->subscribe (typeid(*this).name());
base_elements[1] = ElementPair(fe2.clone(), n2);
base_elements[3].first->subscribe (typeid(*this).name());
base_elements[4] = ElementPair(fe5.clone(), n5);
base_elements[4].first->subscribe (typeid(*this).name());
- this->first_block_of_base_table.push_back(n1);
- this->first_block_of_base_table.push_back(n1+n2);
- this->first_block_of_base_table.push_back(n1+n2+n3);
- this->first_block_of_base_table.push_back(n1+n2+n3+n4);
initialize ();
}
std::ostringstream namebuf;
namebuf << "FESystem<" << dim << ">[";
- for (unsigned int i=0; i<n_base_elements(); ++i)
+ for (unsigned int i=0; i< this->n_base_elements(); ++i)
{
namebuf << base_element(i).get_name();
- if (element_multiplicity(i) != 1)
- namebuf << '^' << element_multiplicity(i);
- if (i != n_base_elements()-1)
+ if (this->element_multiplicity(i) != 1)
+ namebuf << '^' << this->element_multiplicity(i);
+ if (i != this->n_base_elements()-1)
namebuf << '-';
}
namebuf << ']';
FiniteElement<dim,spacedim>*
FESystem<dim,spacedim>::clone() const
{
- switch (n_base_elements())
+ switch (this->n_base_elements())
{
case 1:
return new FESystem(base_element(0),
- element_multiplicity(0));
+ this->element_multiplicity(0));
case 2:
return new FESystem(base_element(0),
- element_multiplicity(0),
+ this->element_multiplicity(0),
base_element(1),
- element_multiplicity(1));
+ this->element_multiplicity(1));
case 3:
return new FESystem(base_element(0),
- element_multiplicity(0),
+ this->element_multiplicity(0),
base_element(1),
- element_multiplicity(1),
+ this->element_multiplicity(1),
base_element(2),
- element_multiplicity(2));
+ this->element_multiplicity(2));
case 4:
return new FESystem(base_element(0),
- element_multiplicity(0),
+ this->element_multiplicity(0),
base_element(1),
- element_multiplicity(1),
+ this->element_multiplicity(1),
base_element(2),
- element_multiplicity(2),
+ this->element_multiplicity(2),
base_element(3),
- element_multiplicity(3));
+ this->element_multiplicity(3));
case 5:
return new FESystem(base_element(0),
- element_multiplicity(0),
+ this->element_multiplicity(0),
base_element(1),
- element_multiplicity(1),
+ this->element_multiplicity(1),
base_element(2),
- element_multiplicity(2),
+ this->element_multiplicity(2),
base_element(3),
- element_multiplicity(3),
+ this->element_multiplicity(3),
base_element(4),
- element_multiplicity(4));
+ this->element_multiplicity(4));
default:
Assert(false, ExcNotImplemented());
}
template <int dim, int spacedim>
void
-FESystem<dim,spacedim>::
-get_interpolation_matrix (const FiniteElement<dim,spacedim> &x_source_fe,
- FullMatrix<double> &interpolation_matrix) const
+FESystem<dim,spacedim>::get_interpolation_matrix (
+ const FiniteElement<dim,spacedim> &x_source_fe,
+ FullMatrix<double> &interpolation_matrix) const
{
Assert (interpolation_matrix.m() == this->dofs_per_cell,
ExcDimensionMismatch (interpolation_matrix.m(),
// condition 2: same number of
// basis elements
- AssertThrow (n_base_elements() == source_fe.n_base_elements(),
+ AssertThrow (this->n_base_elements() == source_fe.n_base_elements(),
typename FEL::
ExcInterpolationNotImplemented());
// condition 3: same number of
// basis elements
- for (unsigned int i=0; i<n_base_elements(); ++i)
- AssertThrow (element_multiplicity(i) ==
+ for (unsigned int i=0; i< this->n_base_elements(); ++i)
+ AssertThrow (this->element_multiplicity(i) ==
source_fe.element_multiplicity(i),
typename FEL::
ExcInterpolationNotImplemented());
// continuing and assembling the
// one big matrix from the small
// ones of the base elements
- std::vector<FullMatrix<double> > base_matrices (n_base_elements());
- for (unsigned int i=0; i<n_base_elements(); ++i)
+ std::vector<FullMatrix<double> > base_matrices (this->n_base_elements());
+ for (unsigned int i=0; i<this->n_base_elements(); ++i)
{
base_matrices[i].reinit (base_element(i).dofs_per_cell,
source_fe.base_element(i).dofs_per_cell);
UpdateFlags out = update_default;
// generate maximal set of flags
// that are necessary
- for (unsigned int base_no=0; base_no<n_base_elements(); ++base_no)
+ for (unsigned int base_no=0; base_no<this->n_base_elements(); ++base_no)
out |= base_element(base_no).update_once(flags);
return out;
}
UpdateFlags out = update_default;
// generate maximal set of flags
// that are necessary
- for (unsigned int base_no=0; base_no<n_base_elements(); ++base_no)
+ for (unsigned int base_no=0; base_no<this->n_base_elements(); ++base_no)
out |= base_element(base_no).update_each(flags);
// second derivatives are handled
const Quadrature<dim> &quadrature) const
{
UpdateFlags flags = flags_;
- InternalData* data = new InternalData(n_base_elements());
+ InternalData* data = new InternalData(this->n_base_elements());
data->update_once = update_once (flags);
data->update_each = update_each (flags);
// get data objects from each of
// the base elements and store them
- for (unsigned int base_no=0; base_no<n_base_elements(); ++base_no)
+ for (unsigned int base_no=0; base_no<this->n_base_elements(); ++base_no)
{
typename Mapping<dim,spacedim>::InternalDataBase *base_fe_data_base =
base_element(base_no).get_data(sub_flags, mapping, quadrature);
const Quadrature<dim-1> &quadrature) const
{
UpdateFlags flags = flags_;
- InternalData* data = new InternalData(n_base_elements());
+ InternalData* data = new InternalData(this->n_base_elements());
data->update_once = update_once (flags);
data->update_each = update_each (flags);
data->initialize_2nd (this, mapping, QProjector<dim>::project_to_all_faces(quadrature));
}
- for (unsigned int base_no=0; base_no<n_base_elements(); ++base_no)
+ for (unsigned int base_no=0; base_no<this->n_base_elements(); ++base_no)
{
typename Mapping<dim,spacedim>::InternalDataBase *base_fe_data_base =
base_element(base_no).get_face_data(sub_flags, mapping, quadrature);
const Quadrature<dim-1> &quadrature) const
{
UpdateFlags flags = flags_;
- InternalData* data = new InternalData(n_base_elements());
+ InternalData* data = new InternalData(this->n_base_elements());
data->update_once = update_once (flags);
data->update_each = update_each (flags);
data->initialize_2nd (this, mapping, QProjector<dim>::project_to_all_subfaces(quadrature));
}
- for (unsigned int base_no=0; base_no<n_base_elements(); ++base_no)
+ for (unsigned int base_no=0; base_no<this->n_base_elements(); ++base_no)
{
typename Mapping<dim,spacedim>::InternalDataBase *base_fe_data_base =
base_element(base_no).get_subface_data(sub_flags, mapping, quadrature);
template <int dim, int spacedim>
void
-FESystem<dim,spacedim>::
-fill_fe_face_values (const Mapping<dim,spacedim> &mapping,
- const typename Triangulation<dim,spacedim>::cell_iterator &cell,
- const unsigned int face_no,
- const Quadrature<dim-1> &quadrature,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- typename Mapping<dim,spacedim>::InternalDataBase &fe_data,
- FEValuesData<dim,spacedim> &data) const
+FESystem<dim,spacedim>::fill_fe_face_values (
+ const Mapping<dim,spacedim> &mapping,
+ const typename Triangulation<dim,spacedim>::cell_iterator &cell,
+ const unsigned int face_no,
+ const Quadrature<dim-1> &quadrature,
+ typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ typename Mapping<dim,spacedim>::InternalDataBase &fe_data,
+ FEValuesData<dim,spacedim> &data) const
{
compute_fill (mapping, cell, face_no, invalid_face_number, quadrature,
CellSimilarity::none, mapping_data, fe_data, data);
// (and: how should it know
// of their existence,
// after all).
- for (unsigned int base_no=0; base_no<n_base_elements(); ++base_no)
+ for (unsigned int base_no=0; base_no<this->n_base_elements(); ++base_no)
{
// Pointer needed to get
// the update flags of the
// let base elements update the
// necessary data
- for (unsigned int base_no=0; base_no<n_base_elements(); ++base_no)
+ for (unsigned int base_no=0; base_no<this->n_base_elements(); ++base_no)
{
const FiniteElement<dim,spacedim> &
base_fe = base_element(base_no);
this->face_system_to_component_table.resize(this->dofs_per_face);
unsigned total_index = 0;
- for (unsigned int base=0; base < n_base_elements(); ++base)
- for (unsigned int m = 0; m < element_multiplicity(base); ++m)
- for (unsigned int k=0; k<base_element(base).n_components(); ++k)
- this->component_to_base_table[total_index++]
- = std::make_pair(std::make_pair(base,k), m);
+ this->block_indices_data.reinit(0,0);
+
+ for (unsigned int base=0; base < this->n_base_elements(); ++base)
+ for (unsigned int m = 0; m < this->element_multiplicity(base); ++m)
+ {
+ this->block_indices_data.push_back(base_element(base).dofs_per_cell);
+ for (unsigned int k=0; k<base_element(base).n_components(); ++k)
+ this->component_to_base_table[total_index++]
+ = std::make_pair(std::make_pair(base,k), m);
+ }
Assert (total_index == this->component_to_base_table.size(),
ExcInternalError());
-
+
// Initialize index tables.
// Multi-component base elements
// have to be thought of. For
++vertex_number)
{
unsigned comp_start = 0;
- for(unsigned int base=0; base<n_base_elements(); ++base)
- for (unsigned int m=0; m<element_multiplicity(base);
+ for(unsigned int base=0; base<this->n_base_elements(); ++base)
+ for (unsigned int m=0; m<this->element_multiplicity(base);
++m, comp_start+=base_element(base).n_components())
for (unsigned int local_index = 0;
local_index < base_element(base).dofs_per_vertex;
++line_number)
{
unsigned comp_start = 0;
- for (unsigned int base=0; base<n_base_elements(); ++base)
- for (unsigned int m=0; m<element_multiplicity(base);
+ for (unsigned int base=0; base<this->n_base_elements(); ++base)
+ for (unsigned int m=0; m<this->element_multiplicity(base);
++m, comp_start+=base_element(base).n_components())
for (unsigned int local_index = 0;
local_index < base_element(base).dofs_per_line;
++quad_number)
{
unsigned int comp_start = 0;
- for (unsigned int base=0; base<n_base_elements(); ++base)
- for (unsigned int m=0; m<element_multiplicity(base);
+ for (unsigned int base=0; base<this->n_base_elements(); ++base)
+ for (unsigned int m=0; m<this->element_multiplicity(base);
++m, comp_start += base_element(base).n_components())
for (unsigned int local_index = 0;
local_index < base_element(base).dofs_per_quad;
++hex_number)
{
unsigned int comp_start = 0;
- for(unsigned int base=0; base<n_base_elements(); ++base)
- for (unsigned int m=0; m<element_multiplicity(base);
+ for(unsigned int base=0; base<this->n_base_elements(); ++base)
+ for (unsigned int m=0; m<this->element_multiplicity(base);
++m, comp_start+=base_element(base).n_components())
for (unsigned int local_index = 0;
local_index < base_element(base).dofs_per_hex;
++vertex_number)
{
unsigned int comp_start = 0;
- for(unsigned int base=0; base<n_base_elements(); ++base)
- for (unsigned int m=0; m<element_multiplicity(base);
+ for(unsigned int base=0; base<this->n_base_elements(); ++base)
+ for (unsigned int m=0; m<this->element_multiplicity(base);
++m, comp_start += base_element(base).n_components())
for (unsigned int local_index = 0;
local_index < base_element(base).dofs_per_vertex;
++line_number)
{
unsigned comp_start = 0;
- for(unsigned base = 0; base < n_base_elements(); ++base)
- for (unsigned m=0; m<element_multiplicity(base);
+ for(unsigned base = 0; base < this->n_base_elements(); ++base)
+ for (unsigned m=0; m<this->element_multiplicity(base);
++m, comp_start += base_element(base).n_components())
for (unsigned local_index = 0;
local_index < base_element(base).dofs_per_line;
++quad_number)
{
unsigned comp_start = 0;
- for(unsigned base=0; base<n_base_elements(); ++base)
- for (unsigned m=0; m<element_multiplicity(base);
+ for(unsigned base=0; base<this->n_base_elements(); ++base)
+ for (unsigned m=0; m<this->element_multiplicity(base);
++m, comp_start += base_element(base).n_components())
for (unsigned local_index = 0;
local_index < base_element(base).dofs_per_quad;
// composed element empty as well;
// however, the rest of the element
// is usable
- for (unsigned int base=0; base<n_base_elements(); ++base)
+ for (unsigned int base=0; base<this->n_base_elements(); ++base)
if (base_element(base).constraints_are_implemented() == false)
return;
bool do_restriction = true;
bool do_prolongation = true;
- for (unsigned int i=0; i<n_base_elements(); ++i)
+ for (unsigned int i=0; i<this->n_base_elements(); ++i)
{
if (base_element(i).restriction[ref_case-1][0].n() == 0)
do_restriction = false;
// an empty array to
// demonstrate that
// fact
- for (unsigned int base_el=0; base_el<n_base_elements(); ++base_el)
+ for (unsigned int base_el=0; base_el<this->n_base_elements(); ++base_el)
if (!base_element(base_el).has_support_points())
{
this->unit_support_points.resize(0);
const unsigned int
base = this->system_to_base_table[i].first.first,
base_index = this->system_to_base_table[i].second;
- Assert (base<n_base_elements(), ExcInternalError());
+ Assert (base<this->n_base_elements(), ExcInternalError());
Assert (base_index<base_element(base).unit_support_points.size(),
ExcInternalError());
this->unit_support_points[i] = base_element(base).unit_support_points[base_index];
// or not. this is, for example, the case
// for the stable Stokes element Q(p)^dim
// \times DGP(p-1).
- for (unsigned int base_el=0; base_el<n_base_elements(); ++base_el)
+ for (unsigned int base_el=0; base_el<this->n_base_elements(); ++base_el)
if (!base_element(base_el).has_support_points()
&&
(base_element(base_el).dofs_per_face > 0))
// element, copy the shift information of
// the base elements
unsigned int index = 0;
- for (unsigned int b=0; b<n_base_elements();++b)
+ for (unsigned int b=0; b<this->n_base_elements();++b)
{
const Table<2,int> &temp
= this->base_element(b).adjust_quad_dof_index_for_face_orientation_table;
- for (unsigned int c=0; c<element_multiplicity(b); ++c)
+ for (unsigned int c=0; c<this->element_multiplicity(b); ++c)
{
for (unsigned int i=0; i<temp.size(0); ++i)
for (unsigned int j=0; j<8; ++j)
Assert (this->adjust_line_dof_index_for_line_orientation_table.size()==
this->dofs_per_line, ExcInternalError());
index = 0;
- for (unsigned int b=0; b<n_base_elements();++b)
+ for (unsigned int b=0; b<this->n_base_elements();++b)
{
const std::vector<int> &temp2
= this->base_element(b).adjust_line_dof_index_for_line_orientation_table;
- for (unsigned int c=0; c<element_multiplicity(b); ++c)
+ for (unsigned int c=0; c<this->element_multiplicity(b); ++c)
{
std::copy(temp2.begin(), temp2.end(),
this->adjust_line_dof_index_for_line_orientation_table.begin()
FESystem<dim,spacedim>::
hp_constraints_are_implemented () const
{
- for (unsigned int b=0; b<n_base_elements(); ++b)
+ for (unsigned int b=0; b<this->n_base_elements(); ++b)
if (base_element(b).hp_constraints_are_implemented() == false)
return false;
// or if have to move on to the
// next base element
++multiplicity;
- if (multiplicity == element_multiplicity(base_index))
+ if (multiplicity == this->element_multiplicity(base_index))
{
multiplicity = 0;
++base_index;
// of the present element. if so,
// we should have reached the end
// of the other one as well
- if (base_index == n_base_elements())
+ if (base_index == this->n_base_elements())
{
Assert (base_index_other == fe_other_system->n_base_elements(),
ExcInternalError());
// or if have to move on to the
// next base element
++multiplicity;
- if (multiplicity == element_multiplicity(base_index))
+ if (multiplicity == this->element_multiplicity(base_index))
{
multiplicity = 0;
++base_index;
// of the present element. if so,
// we should have reached the end
// of the other one as well
- if (base_index == n_base_elements())
+ if (base_index == this->n_base_elements())
{
Assert (base_index_other == fe_other_system->n_base_elements(),
ExcInternalError());
// or if have to move on to the
// next base element
++multiplicity;
- if (multiplicity == element_multiplicity(base_index))
+ if (multiplicity == this->element_multiplicity(base_index))
{
multiplicity = 0;
++base_index;
// of the present element. if so,
// we should have reached the end
// of the other one as well
- if (base_index == n_base_elements())
+ if (base_index == this->n_base_elements())
{
Assert (base_index_other == fe_other_system->n_base_elements(),
ExcInternalError());
-template <int dim, int spacedim>
-unsigned int
-FESystem<dim,spacedim>::n_base_elements () const
-{
- return base_elements.size();
-}
-
-
-
-template <int dim, int spacedim>
-unsigned int
-FESystem<dim,spacedim>::element_multiplicity (const unsigned int index) const
-{
- Assert (index < base_elements.size(),
- ExcIndexRange(index, 0, base_elements.size()));
- return base_elements[index].second;
-}
-
-
-
template <int dim, int spacedim>
bool
FESystem<dim,spacedim>::has_support_on_face (const unsigned int shape_index,