inline
void
extract_dofs_by_component (const DH &dof,
- const std::vector<bool> &component_select,
- const bool sort_by_blocks,
- std::vector<unsigned char> &dofs_by_component)
+ const std::vector<bool> &component_select,
+ const bool sort_by_blocks,
+ std::vector<unsigned char> &dofs_by_component)
{
const dealii::hp::FECollection<DH::dimension,DH::space_dimension>
- fe_collection (dof.get_fe());
+ fe_collection (dof.get_fe());
Assert (fe_collection.n_components() < 256, ExcNotImplemented());
Assert (dofs_by_component.size() == dof.n_locally_owned_dofs(),
- ExcDimensionMismatch(dofs_by_component.size(),
- dof.n_locally_owned_dofs()));
+ ExcDimensionMismatch(dofs_by_component.size(),
+ dof.n_locally_owned_dofs()));
- // next set up a table for the
- // degrees of freedom on each of
- // the cells whether it is
- // something interesting or not
+ // next set up a table for the degrees
+ // of freedom on each of the cells
+ // (regardless of the fact whether it
+ // is listed in the component_select
+ // argument or not)
+ //
+ // for each element 'f' of the
+ // FECollection,
+ // local_component_association[f][d]
+ // then returns the vector component
+ // that degree of freedom 'd' belongs
+ // to (or, in the case of
+ // sort_by_blocks, the block that it
+ // corresponds to)
std::vector<std::vector<unsigned char> > local_component_association
- (fe_collection.size());
+ (fe_collection.size());
for (unsigned int f=0; f<fe_collection.size(); ++f)
- {
- const FiniteElement<DH::dimension,DH::space_dimension> &fe =
- fe_collection[f];
- local_component_association[f].resize(fe.dofs_per_cell);
- if (sort_by_blocks == true)
- {
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- local_component_association[f][i]
- = fe.system_to_block_index(i).first;
- }
- else
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- if (fe.is_primitive(i))
- local_component_association[f][i] =
- fe.system_to_component_index(i).first;
- else
+ {
+ const FiniteElement<DH::dimension,DH::space_dimension> &fe =
+ fe_collection[f];
+ local_component_association[f].resize(fe.dofs_per_cell);
+ if (sort_by_blocks == true)
+ // compute the block each
+ // local dof belongs to
+ {
+ for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+ local_component_association[f][i]
+ = fe.system_to_block_index(i).first;
+ }
+ else
+ // compute the component each
+ // local dof belongs to
+ for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+ if (fe.is_primitive(i))
+ local_component_association[f][i] =
+ fe.system_to_component_index(i).first;
+ else
// if this shape function is
// not primitive, then we have
// to work harder. we have to