* @}
*/
- /**
- * @name Generic Functions
- *
- * Functions to support code that generically uses both DoFHandler and
- * hp::DoFHandler.
- * @{
- */
- /**
- * Maximal number of degrees of freedom on a cell.
- *
- * @deprecated Use <code>dh.get_fe_collection().max_dofs_per_cell()</code>.
- *
- * @relatesalso DoFHandler
- */
- template <int dim, int spacedim>
- DEAL_II_DEPRECATED unsigned int
- max_dofs_per_cell(const DoFHandler<dim, spacedim> &dh);
-
-
- /**
- * Maximal number of degrees of freedom on a face.
- *
- * This function exists for both non-hp and hp DoFHandlers, to allow for a
- * uniform interface to query this property.
- *
- * @deprecated Use <code>dh.get_fe_collection().max_dofs_per_face()</code>.
- *
- * @relatesalso DoFHandler
- */
- template <int dim, int spacedim>
- DEAL_II_DEPRECATED unsigned int
- max_dofs_per_face(const DoFHandler<dim, spacedim> &dh);
-
- /**
- * Maximal number of degrees of freedom on a vertex.
- *
- * This function exists for both non-hp and hp DoFHandlers, to allow for a
- * uniform interface to query this property.
- *
- * @deprecated Use <code>dh.get_fe_collection().max_dofs_per_vertex()</code>.
- *
- * @relatesalso DoFHandler
- */
- template <int dim, int spacedim>
- DEAL_II_DEPRECATED unsigned int
- max_dofs_per_vertex(const DoFHandler<dim, spacedim> &dh);
-
- /**
- * Maximal number of degrees of freedom on a vertex.
- *
- * This function exists for both non-hp and hp DoFHandlers, to allow for a
- * uniform interface to query this property.
- *
- * @deprecated Use <code>dh.get_fe_collection().max_dofs_per_vertex()</code>.
- *
- * @relatesalso hp::DoFHandler
- */
- template <int dim, int spacedim>
- DEAL_II_DEPRECATED unsigned int
- max_dofs_per_vertex(const DoFHandler<dim, spacedim> &dh);
-
- /**
- * Number of vector components in the finite element object used by this
- * DoFHandler.
- *
- * This function exists for both non-hp and hp DoFHandlers, to allow for a
- * uniform interface to query this property.
- *
- * @deprecated Use <code>dh.get_fe_collection().n_components()</code>.
- *
- * @relatesalso DoFHandler
- */
- template <int dim, int spacedim>
- DEAL_II_DEPRECATED unsigned int
- n_components(const DoFHandler<dim, spacedim> &dh);
-
- /**
- * Number of vector components in the finite element object used by this
- * DoFHandler.
- *
- * This function exists for both non-hp and hp DoFHandlers, to allow for a
- * uniform interface to query this property.
- *
- * @deprecated Use <code>dh.get_fe_collection().n_components()</code>.
- *
- * @relatesalso hp::DoFHandler
- */
- template <int dim, int spacedim>
- DEAL_II_DEPRECATED unsigned int
- n_components(const DoFHandler<dim, spacedim> &dh);
-
- /**
- * Find out whether the first FiniteElement used by this DoFHandler is
- * primitive or not.
- *
- * This function exists for both non-hp and hp DoFHandlers, to allow for a
- * uniform interface to query this property.
- *
- * @deprecated Use <code>dh.get_fe(0).is_primitive()</code>.
- *
- * @relatesalso DoFHandler
- */
- template <int dim, int spacedim>
- DEAL_II_DEPRECATED bool
- fe_is_primitive(const DoFHandler<dim, spacedim> &dh);
-
- /**
- * Find out whether the first FiniteElement used by this DoFHandler is
- * primitive or not.
- *
- * This function exists for both non-hp and hp DoFHandlers, to allow for a
- * uniform interface to query this property.
- *
- * @deprecated Use <code>dh.get_fe(0).is_primitive()</code>.
- *
- * @relatesalso hp::DoFHandler
- */
- template <int dim, int spacedim>
- DEAL_II_DEPRECATED bool
- fe_is_primitive(const DoFHandler<dim, spacedim> &dh);
-
- /**
- * @}
- */
-
/**
* @name Sparsity pattern generation
* @{
const types::subdomain_id subdomain_id,
std::vector<bool> & selected_dofs);
-
- /**
- * Extract the set of global DoF indices that are owned by the current
- * processor. For regular DoFHandler objects, this set is the complete set
- * with all DoF indices. In either case, it equals what
- * DoFHandler::locally_owned_dofs() returns.
- *
- * @deprecated Use DoFHandler::locally_owned_dofs() directly instead of this
- * function.
- */
- template <typename DoFHandlerType>
- DEAL_II_DEPRECATED void
- extract_locally_owned_dofs(const DoFHandlerType &dof_handler,
- IndexSet & dof_set);
-
-
/**
* Extract the set of global DoF indices that are active on the current
* DoFHandler. For regular DoFHandlers, these are all DoF indices, but for
// ---------------------- inline and template functions --------------------
- template <int dim, int spacedim>
- inline unsigned int
- max_dofs_per_cell(const DoFHandler<dim, spacedim> &dh)
- {
- if (dh.hp_capability_enabled == true)
- return dh.get_fe_collection().max_dofs_per_cell();
- else
- return dh.get_fe().dofs_per_cell;
- }
-
-
- template <int dim, int spacedim>
- inline unsigned int
- max_dofs_per_face(const DoFHandler<dim, spacedim> &dh)
- {
- if (dh.hp_capability_enabled == true)
- return dh.get_fe_collection().max_dofs_per_face();
- else
- return dh.get_fe().dofs_per_face;
- }
-
-
- template <int dim, int spacedim>
- inline unsigned int
- max_dofs_per_vertex(const DoFHandler<dim, spacedim> &dh)
- {
- if (dh.hp_capability_enabled == true)
- return dh.get_fe_collection().max_dofs_per_vertex();
- else
- return dh.get_fe().dofs_per_vertex;
- }
-
-
- template <int dim, int spacedim>
- inline unsigned int
- n_components(const DoFHandler<dim, spacedim> &dh)
- {
- if (dh.hp_capability_enabled == true)
- return dh.get_fe(0).n_components();
- else
- return dh.get_fe().n_components();
- }
-
-
-
- template <int dim, int spacedim>
- inline bool
- fe_is_primitive(const DoFHandler<dim, spacedim> &dh)
- {
- if (dh.hp_capability_enabled == true)
- return dh.get_fe(0).is_primitive();
- else
- return dh.get_fe().is_primitive();
- }
-
-
template <typename DoFHandlerType, class Comp>
void
map_support_points_to_dofs(
// this does not lead to
// reallocation of memory
Vector<typename OutVector::value_type> u1_local(
- DoFTools::max_dofs_per_cell(dof1));
+ dof1.get_fe_collection().max_dofs_per_cell());
Vector<typename OutVector::value_type> u2_local(
- DoFTools::max_dofs_per_cell(dof2));
+ dof2.get_fe_collection().max_dofs_per_cell());
// have a map for interpolation matrices.
// Using a unique_ptr makes sure that the
(void)endc2;
std::vector<types::global_dof_index> dofs;
- dofs.reserve(DoFTools::max_dofs_per_cell(dof2));
+ dofs.reserve(dof2.get_fe_collection().max_dofs_per_cell());
u2 = typename OutVector::value_type(0.);
OutVector touch_count(u2);
#endif
Vector<typename OutVector::value_type> u1_local(
- DoFTools::max_dofs_per_cell(dof1));
+ dof1.get_fe_collection().max_dofs_per_cell());
Vector<typename OutVector::value_type> u1_int_local(
- DoFTools::max_dofs_per_cell(dof1));
+ dof1.get_fe_collection().max_dofs_per_cell());
const types::subdomain_id subdomain_id =
dof1.get_triangulation().locally_owned_subdomain();
{
// For a given boundary id, find which vector component is on the boundary
// and set a zero boundary constraint for those degrees of freedom.
- const unsigned int n_components = DoFTools::n_components(dof);
+ const unsigned int n_components = dof.get_fe_collection().n_components();
AssertIndexRange(first_vector_component + dim - 1, n_components);
ComponentMask comp_mask(n_components, false);
ExcMessage("You cannot specify the special boundary indicator "
"for interior faces in your function map."));
- const unsigned int n_components = DoFTools::n_components(dof);
+ const unsigned int n_components = dof.get_fe_collection().n_components();
for (typename std::map<types::boundary_id,
const Function<spacedim, number> *>::const_iterator
i = function_map.begin();
// field to store the indices
std::vector<types::global_dof_index> face_dofs;
- face_dofs.reserve(DoFTools::max_dofs_per_face(dof));
+ face_dofs.reserve(dof.get_fe_collection().max_dofs_per_face());
// array to store the values of the boundary function at the boundary
// points. have two arrays for scalar and vector functions to use the
// more efficient one respectively
std::vector<number> dof_values_scalar;
std::vector<Vector<number>> dof_values_system;
- dof_values_scalar.reserve(DoFTools::max_dofs_per_face(dof));
- dof_values_system.reserve(DoFTools::max_dofs_per_face(dof));
+ dof_values_scalar.reserve(
+ dof.get_fe_collection().max_dofs_per_face());
+ dof_values_system.reserve(
+ dof.get_fe_collection().max_dofs_per_face());
// before we start with the loop over all cells create an hp::FEValues
// object that holds the interpolation points of all finite elements
std::vector<types::subdomain_id> subdomain_association(
n_dofs, numbers::invalid_subdomain_id);
std::vector<types::global_dof_index> local_dof_indices;
- local_dof_indices.reserve(DoFTools::max_dofs_per_cell(dof_handler));
+ local_dof_indices.reserve(
+ dof_handler.get_fe_collection().max_dofs_per_cell());
// loop over all cells and record which subdomain a DoF belongs to.
// give to the smaller subdomain_id in case it is on an interface
std::vector<types::subdomain_id> level_subdomain_association(
n_dofs_on_level, numbers::invalid_subdomain_id);
std::vector<types::global_dof_index> local_dof_indices;
- local_dof_indices.reserve(DoFTools::max_dofs_per_cell(dof_handler));
+ local_dof_indices.reserve(
+ dof_handler.get_fe_collection().max_dofs_per_cell());
// loop over all cells and record which subdomain a DoF belongs to.
// interface goes to proccessor with smaller subdomain id
AssertDimension(cell_data.size(), tria.n_active_cells());
AssertDimension(dof_data.size(), dof_handler.n_dofs());
- AssertIndexRange(component, n_components(dof_handler));
- Assert(fe_is_primitive(dof_handler) == true,
- typename FiniteElement<dim>::ExcFENotPrimitive());
+ const auto &fe_collection = dof_handler.get_fe_collection();
+ AssertIndexRange(component, fe_collection.n_components());
+ for (unsigned int i = 0; i < fe_collection.size(); ++i)
+ {
+ Assert(fe_collection[i].is_primitive() == true,
+ typename FiniteElement<dim>::ExcFENotPrimitive());
+ }
// store a flag whether we should care about different components. this
// is just a simplification, we could ask for this at every single
// place equally well
- const bool consider_components = (n_components(dof_handler) != 1);
+ const bool consider_components =
+ (dof_handler.get_fe_collection().n_components() != 1);
// zero out the components that we will touch
if (consider_components == false)
dof_handler.n_locally_owned_dofs());
internal::get_component_association(
dof_handler,
- dof_handler.get_fe_collection().component_mask(
- FEValuesExtractors::Scalar(component)),
+ fe_collection.component_mask(FEValuesExtractors::Scalar(component)),
component_dofs);
for (unsigned int i = 0; i < dof_data.size(); ++i)
dof_handler.begin_active(),
endc = dof_handler.end();
std::vector<types::global_dof_index> dof_indices;
- dof_indices.reserve(max_dofs_per_cell(dof_handler));
+ dof_indices.reserve(fe_collection.max_dofs_per_cell());
for (unsigned int present_cell = 0; cell != endc; ++cell, ++present_cell)
{
const FiniteElement<DoFHandlerType::dimension,
DoFHandlerType::space_dimension> &fe = dof.get_fe();
- Assert(component_mask.represents_n_components(n_components(dof)),
+ Assert(component_mask.represents_n_components(
+ dof.get_fe_collection().n_components()),
ExcMessage(
"The given component mask is not sized correctly to represent the "
"components of the given finite element."));
// two special cases: no component is selected, and all components are
// selected, both rather stupid, but easy to catch
- if (component_mask.n_selected_components(n_components(dof)) == 0)
+ if (component_mask.n_selected_components(
+ dof.get_fe_collection().n_components()) == 0)
{
std::fill_n(selected_dofs.begin(), dof.n_dofs(level), false);
return;
}
- else if (component_mask.n_selected_components(n_components(dof)) ==
- n_components(dof))
+ else if (component_mask.n_selected_components(
+ dof.get_fe_collection().n_components()) ==
+ dof.get_fe_collection().n_components())
{
std::fill_n(selected_dofs.begin(), dof.n_dofs(level), true);
return;
IndexSet & selected_dofs,
const std::set<types::boundary_id> &boundary_ids)
{
- Assert(component_mask.represents_n_components(n_components(dof_handler)),
+ Assert(component_mask.represents_n_components(
+ dof_handler.get_fe_collection().n_components()),
ExcMessage("Component mask has invalid size."));
Assert(boundary_ids.find(numbers::internal_face_boundary_id) ==
boundary_ids.end(),
// is selected, or all
const bool check_vector_component =
((component_mask.represents_the_all_selected_mask() == false) ||
- (component_mask.n_selected_components(n_components(dof_handler)) !=
- n_components(dof_handler)));
+ (component_mask.n_selected_components(
+ dof_handler.get_fe_collection().n_components()) !=
+ dof_handler.get_fe_collection().n_components()));
std::vector<types::global_dof_index> face_dof_indices;
- face_dof_indices.reserve(max_dofs_per_face(dof_handler));
+ face_dof_indices.reserve(
+ dof_handler.get_fe_collection().max_dofs_per_face());
// now loop over all cells and check whether their faces are at the
// boundary. note that we need not take special care of single lines
std::vector<bool> & selected_dofs,
const std::set<types::boundary_id> &boundary_ids)
{
- Assert(component_mask.represents_n_components(n_components(dof_handler)),
+ Assert(component_mask.represents_n_components(
+ dof_handler.get_fe_collection().n_components()),
ExcMessage("This component mask has the wrong size."));
Assert(boundary_ids.find(numbers::internal_face_boundary_id) ==
boundary_ids.end(),
selected_dofs.clear();
selected_dofs.resize(dof_handler.n_dofs(), false);
std::vector<types::global_dof_index> cell_dof_indices;
- cell_dof_indices.reserve(max_dofs_per_cell(dof_handler));
+ cell_dof_indices.reserve(
+ dof_handler.get_fe_collection().max_dofs_per_cell());
// now loop over all cells and check whether their faces are at the
// boundary. note that we need not take special care of single lines
};
std::vector<types::global_dof_index> local_dof_indices;
- local_dof_indices.reserve(max_dofs_per_cell(dof_handler));
+ local_dof_indices.reserve(
+ dof_handler.get_fe_collection().max_dofs_per_cell());
// Get all the dofs that live on the subdomain:
std::set<types::global_dof_index> predicate_dofs;
std::fill_n(selected_dofs.begin(), dof_handler.n_dofs(), false);
std::vector<types::global_dof_index> local_dof_indices;
- local_dof_indices.reserve(max_dofs_per_cell(dof_handler));
+ local_dof_indices.reserve(
+ dof_handler.get_fe_collection().max_dofs_per_cell());
// this function is similar to the make_sparsity_pattern function, see
// there for more information
numbers::invalid_subdomain_id);
std::vector<types::global_dof_index> local_dof_indices;
- local_dof_indices.reserve(max_dofs_per_cell(dof_handler));
+ local_dof_indices.reserve(
+ dof_handler.get_fe_collection().max_dofs_per_cell());
// loop over all cells and record which subdomain a DoF belongs to.
// give to the smaller subdomain_id in case it is on an interface
IndexSet index_set(dof_handler.n_dofs());
std::vector<types::global_dof_index> local_dof_indices;
- local_dof_indices.reserve(max_dofs_per_cell(dof_handler));
+ local_dof_indices.reserve(
+ dof_handler.get_fe_collection().max_dofs_per_cell());
// first generate an unsorted list of all indices which we fill from
// the back. could also insert them directly into the IndexSet, but
numbers::invalid_dof_index);
std::vector<types::global_dof_index> dofs_on_face;
- dofs_on_face.reserve(max_dofs_per_face(dof_handler));
+ dofs_on_face.reserve(dof_handler.get_fe_collection().max_dofs_per_face());
types::global_dof_index next_boundary_index = 0;
// now loop over all cells and check whether their faces are at the
return;
std::vector<types::global_dof_index> dofs_on_face;
- dofs_on_face.reserve(max_dofs_per_face(dof_handler));
+ dofs_on_face.reserve(dof_handler.get_fe_collection().max_dofs_per_face());
types::global_dof_index next_boundary_index = 0;
typename DoFHandlerType::active_cell_iterator cell =
"zero or equal to the number of components in the finite "
"element."));
- const unsigned int n_components = DoFTools::n_components(dof);
+ const unsigned int n_components = dof.get_fe_collection().n_components();
Assert(component_mask.n_selected_components(n_components) > 0,
ComponentMask::ExcNoComponentSelected());
// a field to store the indices on the face
std::vector<types::global_dof_index> face_dofs;
- face_dofs.reserve(max_dofs_per_face(dof));
+ face_dofs.reserve(dof.get_fe_collection().max_dofs_per_face());
// a field to store the indices on the cell
std::vector<types::global_dof_index> cell_dofs;
- cell_dofs.reserve(max_dofs_per_cell(dof));
+ cell_dofs.reserve(dof.get_fe_collection().max_dofs_per_cell());
typename DoFHandlerType<dim, spacedim>::active_cell_iterator
cell = dof.begin_active(),
"than the locally owned one does not make sense."));
std::vector<types::global_dof_index> dofs_on_this_cell;
- dofs_on_this_cell.reserve(max_dofs_per_cell(dof));
+ dofs_on_this_cell.reserve(dof.get_fe_collection().max_dofs_per_cell());
typename DoFHandlerType::active_cell_iterator cell = dof.begin_active(),
endc = dof.end();
#endif
std::vector<types::global_dof_index> dofs_on_this_face;
- dofs_on_this_face.reserve(max_dofs_per_face(dof));
+ dofs_on_this_face.reserve(dof.get_fe_collection().max_dofs_per_face());
// loop over all faces to check whether they are at a boundary. note
// that we need not take special care of single lines (using
#endif
std::vector<types::global_dof_index> dofs_on_this_face;
- dofs_on_this_face.reserve(max_dofs_per_face(dof));
+ dofs_on_this_face.reserve(dof.get_fe_collection().max_dofs_per_face());
typename DoFHandlerType::active_cell_iterator cell = dof.begin_active(),
endc = dof.end();
for (; cell != endc; ++cell)
std::vector<types::global_dof_index> dofs_on_this_cell;
std::vector<types::global_dof_index> dofs_on_other_cell;
- dofs_on_this_cell.reserve(max_dofs_per_cell(dof));
- dofs_on_other_cell.reserve(max_dofs_per_cell(dof));
+ dofs_on_this_cell.reserve(dof.get_fe_collection().max_dofs_per_cell());
+ dofs_on_other_cell.reserve(dof.get_fe_collection().max_dofs_per_cell());
typename DoFHandlerType::active_cell_iterator cell = dof.begin_active(),
endc = dof.end();
dof.get_fe_collection();
std::vector<types::global_dof_index> dofs_on_this_cell(
- DoFTools::max_dofs_per_cell(dof));
+ dof.get_fe_collection().max_dofs_per_cell());
std::vector<types::global_dof_index> dofs_on_other_cell(
- DoFTools::max_dofs_per_cell(dof));
+ dof.get_fe_collection().max_dofs_per_cell());
const unsigned int n_components = fe.n_components();
AssertDimension(int_mask.size(0), n_components);
if (boundary_indices[i].size() == 0)
boundary_indices[i] = IndexSet(dof.n_dofs(i));
- const unsigned int n_components = DoFTools::n_components(dof);
+ const unsigned int n_components = dof.get_fe_collection().n_components();
const bool fe_is_system = (n_components != 1);
std::vector<types::global_dof_index> local_dofs;
- local_dofs.reserve(DoFTools::max_dofs_per_face(dof));
+ local_dofs.reserve(dof.get_fe_collection().max_dofs_per_face());
std::fill(local_dofs.begin(), local_dofs.end(), numbers::invalid_dof_index);
std::vector<std::vector<types::global_dof_index>> dofs_by_level(