#endif
-namespace internal
+namespace hp
{
- namespace hp
+ /**
+ * Base class for the <tt>hp::FE*Values</tt> classes, storing the data
+ * that is common to them. The main task of this class is to provide a
+ * table where for every combination of finite element, mapping, and
+ * quadrature object from their corresponding collection objects there is
+ * a matching ::FEValues, ::FEFaceValues, or ::FESubfaceValues object. To
+ * make things more efficient, however, these FE*Values objects are only
+ * created once requested (lazy allocation).
+ *
+ * The first template parameter denotes the space dimension we are in, the
+ * second the dimensionality of the object that we integrate on, i.e. for
+ * usual @p hp::FEValues it is equal to the first one, while for face
+ * integration it is one less. The third template parameter indicates the
+ * type of underlying non-hp FE*Values base type, i.e. it could either be
+ * ::FEValues, ::FEFaceValues, or ::FESubfaceValues.
+ *
+ * @ingroup hp
+ *
+ * @author Wolfgang Bangerth, 2003
+ */
+ template <int dim, int q_dim, class FEValuesType>
+ class FEValuesBase
{
+ public:
/**
- * Base class for the <tt>hp::FE*Values</tt> classes, storing the data
- * that is common to them. The main task of this class is to provide a
- * table where for every combination of finite element, mapping, and
- * quadrature object from their corresponding collection objects there is
- * a matching ::FEValues, ::FEFaceValues, or ::FESubfaceValues object. To
- * make things more efficient, however, these FE*Values objects are only
- * created once requested (lazy allocation).
- *
- * The first template parameter denotes the space dimension we are in, the
- * second the dimensionality of the object that we integrate on, i.e. for
- * usual @p hp::FEValues it is equal to the first one, while for face
- * integration it is one less. The third template parameter indicates the
- * type of underlying non-hp FE*Values base type, i.e. it could either be
- * dealii::FEValues, dealii::FEFaceValues, or dealii::FESubfaceValues.
+ * Constructor. Set the fields of this class to the values indicated by
+ * the parameters to the constructor.
+ */
+ FEValuesBase(
+ const MappingCollection<dim, FEValuesType::space_dimension>
+ &mapping_collection,
+ const FECollection<dim, FEValuesType::space_dimension> &fe_collection,
+ const QCollection<q_dim> & q_collection,
+ const UpdateFlags update_flags);
+ /**
+ * Constructor. This constructor is equivalent to the other one except
+ * that it makes the object use a $Q_1$ mapping (i.e., an object of type
+ * MappingQGeneric(1)) implicitly.
+ */
+ FEValuesBase(
+ const FECollection<dim, FEValuesType::space_dimension> &fe_collection,
+ const QCollection<q_dim> & q_collection,
+ const UpdateFlags update_flags);
+
+ /**
+ * Get a reference to the collection of finite element objects used
+ * here.
+ */
+ const FECollection<dim, FEValuesType::space_dimension> &
+ get_fe_collection() const;
+
+ /**
+ * Get a reference to the collection of mapping objects used here.
+ */
+ const MappingCollection<dim, FEValuesType::space_dimension> &
+ get_mapping_collection() const;
+
+ /**
+ * Get a reference to the collection of quadrature objects used here.
+ */
+ const QCollection<q_dim> &
+ get_quadrature_collection() const;
+
+ /**
+ * Get the underlying update flags.
+ */
+ UpdateFlags
+ get_update_flags() const;
+
+ /**
+ * Return a reference to the @p FEValues object selected by the last
+ * call to select_fe_values(). select_fe_values() in turn is called when
+ * you called the @p reinit function of the <tt>hp::FE*Values</tt> class
+ * the last time.
+ */
+ const FEValuesType &
+ get_present_fe_values() const;
+
+ protected:
+ /**
+ * Select a FEValues object suitable for the given FE, quadrature, and
+ * mapping indices. If such an object doesn't yet exist, create one.
*
- * @ingroup hp
+ * The function returns a writable reference so that derived classes can
+ * also reinit() the selected FEValues object.
+ */
+ FEValuesType &
+ select_fe_values(const unsigned int fe_index,
+ const unsigned int mapping_index,
+ const unsigned int q_index);
+
+ protected:
+ /**
+ * A pointer to the collection of finite elements to be used.
+ */
+ const SmartPointer<const FECollection<dim, FEValuesType::space_dimension>,
+ FEValuesBase<dim, q_dim, FEValuesType>>
+ fe_collection;
+
+ /**
+ * A pointer to the collection of mappings to be used.
+ */
+ const SmartPointer<
+ const MappingCollection<dim, FEValuesType::space_dimension>,
+ FEValuesBase<dim, q_dim, FEValuesType>>
+ mapping_collection;
+
+ /**
+ * Copy of the quadrature collection object provided to the constructor.
+ */
+ const QCollection<q_dim> q_collection;
+
+ private:
+ /**
+ * A table in which we store pointers to fe_values objects for different
+ * finite element, mapping, and quadrature objects from our collection.
+ * The first index indicates the index of the finite element within the
+ * fe_collection, the second the index of the mapping within the mapping
+ * collection, and the last one the index of the quadrature formula
+ * within the q_collection.
*
- * @author Wolfgang Bangerth, 2003
+ * Initially, all entries have zero pointers, and we will allocate them
+ * lazily as needed in select_fe_values().
+ */
+ Table<3, std::shared_ptr<FEValuesType>> fe_values_table;
+
+ /**
+ * Set of indices pointing at the fe_values object selected last time
+ * the select_fe_value() function was called.
+ */
+ TableIndices<3> present_fe_values_index;
+
+ /**
+ * Values of the update flags as given to the constructor.
*/
- template <int dim, int q_dim, class FEValuesType>
- class FEValuesBase
- {
- public:
- /**
- * Constructor. Set the fields of this class to the values indicated by
- * the parameters to the constructor.
- */
- FEValuesBase(
- const dealii::hp::MappingCollection<dim, FEValuesType::space_dimension>
- &mapping_collection,
- const dealii::hp::FECollection<dim, FEValuesType::space_dimension>
- & fe_collection,
- const dealii::hp::QCollection<q_dim> &q_collection,
- const dealii::UpdateFlags update_flags);
- /**
- * Constructor. This constructor is equivalent to the other one except
- * that it makes the object use a $Q_1$ mapping (i.e., an object of type
- * MappingQGeneric(1)) implicitly.
- */
- FEValuesBase(
- const dealii::hp::FECollection<dim, FEValuesType::space_dimension>
- & fe_collection,
- const dealii::hp::QCollection<q_dim> &q_collection,
- const UpdateFlags update_flags);
-
- /**
- * Get a reference to the collection of finite element objects used
- * here.
- */
- const dealii::hp::FECollection<dim, FEValuesType::space_dimension> &
- get_fe_collection() const;
-
- /**
- * Get a reference to the collection of mapping objects used here.
- */
- const dealii::hp::MappingCollection<dim, FEValuesType::space_dimension> &
- get_mapping_collection() const;
-
- /**
- * Get a reference to the collection of quadrature objects used here.
- */
- const dealii::hp::QCollection<q_dim> &
- get_quadrature_collection() const;
-
- /**
- * Get the underlying update flags.
- */
- UpdateFlags
- get_update_flags() const;
-
- /**
- * Return a reference to the @p FEValues object selected by the last
- * call to select_fe_values(). select_fe_values() in turn is called when
- * you called the @p reinit function of the <tt>hp::FE*Values</tt> class
- * the last time.
- */
- const FEValuesType &
- get_present_fe_values() const;
-
- protected:
- /**
- * Select a FEValues object suitable for the given FE, quadrature, and
- * mapping indices. If such an object doesn't yet exist, create one.
- *
- * The function returns a writable reference so that derived classes can
- * also reinit() the selected FEValues object.
- */
- FEValuesType &
- select_fe_values(const unsigned int fe_index,
- const unsigned int mapping_index,
- const unsigned int q_index);
-
- protected:
- /**
- * A pointer to the collection of finite elements to be used.
- */
- const SmartPointer<
- const dealii::hp::FECollection<dim, FEValuesType::space_dimension>,
- FEValuesBase<dim, q_dim, FEValuesType>>
- fe_collection;
-
- /**
- * A pointer to the collection of mappings to be used.
- */
- const SmartPointer<
- const dealii::hp::MappingCollection<dim, FEValuesType::space_dimension>,
- FEValuesBase<dim, q_dim, FEValuesType>>
- mapping_collection;
-
- /**
- * Copy of the quadrature collection object provided to the constructor.
- */
- const dealii::hp::QCollection<q_dim> q_collection;
-
- private:
- /**
- * A table in which we store pointers to fe_values objects for different
- * finite element, mapping, and quadrature objects from our collection.
- * The first index indicates the index of the finite element within the
- * fe_collection, the second the index of the mapping within the mapping
- * collection, and the last one the index of the quadrature formula
- * within the q_collection.
- *
- * Initially, all entries have zero pointers, and we will allocate them
- * lazily as needed in select_fe_values().
- */
- dealii::Table<3, std::shared_ptr<FEValuesType>> fe_values_table;
-
- /**
- * Set of indices pointing at the fe_values object selected last time
- * the select_fe_value() function was called.
- */
- TableIndices<3> present_fe_values_index;
-
- /**
- * Values of the update flags as given to the constructor.
- */
- const UpdateFlags update_flags;
- };
-
- } // namespace hp
-
-} // namespace internal
+ const UpdateFlags update_flags;
+ };
+
+} // namespace hp
namespace hp
* @author Wolfgang Bangerth, 2003
*/
template <int dim, int spacedim = dim>
- class FEValues : public dealii::internal::hp::
- FEValuesBase<dim, dim, dealii::FEValues<dim, spacedim>>
+ class FEValues
+ : public hp::FEValuesBase<dim, dim, dealii::FEValues<dim, spacedim>>
{
public:
static const unsigned int dimension = dim;
*/
template <int dim, int spacedim = dim>
class FEFaceValues
- : public dealii::internal::hp::
- FEValuesBase<dim, dim - 1, dealii::FEFaceValues<dim, spacedim>>
+ : public hp::FEValuesBase<dim, dim - 1, dealii::FEFaceValues<dim, spacedim>>
{
public:
/**
*/
template <int dim, int spacedim = dim>
class FESubfaceValues
- : public dealii::internal::hp::
+ : public hp::
FEValuesBase<dim, dim - 1, dealii::FESubfaceValues<dim, spacedim>>
{
public:
// -------------- inline and template functions --------------
-namespace internal
+namespace hp
{
- namespace hp
+ template <int dim, int q_dim, class FEValuesType>
+ inline const FEValuesType &
+ FEValuesBase<dim, q_dim, FEValuesType>::get_present_fe_values() const
{
- template <int dim, int q_dim, class FEValuesType>
- inline const FEValuesType &
- FEValuesBase<dim, q_dim, FEValuesType>::get_present_fe_values() const
- {
- return *fe_values_table(present_fe_values_index);
- }
-
+ return *fe_values_table(present_fe_values_index);
+ }
- template <int dim, int q_dim, class FEValuesType>
- inline const dealii::hp::FECollection<dim, FEValuesType::space_dimension> &
- FEValuesBase<dim, q_dim, FEValuesType>::get_fe_collection() const
- {
- return *fe_collection;
- }
+ template <int dim, int q_dim, class FEValuesType>
+ inline const FECollection<dim, FEValuesType::space_dimension> &
+ FEValuesBase<dim, q_dim, FEValuesType>::get_fe_collection() const
+ {
+ return *fe_collection;
+ }
- template <int dim, int q_dim, class FEValuesType>
- inline const dealii::hp::MappingCollection<dim,
- FEValuesType::space_dimension> &
- FEValuesBase<dim, q_dim, FEValuesType>::get_mapping_collection() const
- {
- return *mapping_collection;
- }
+ template <int dim, int q_dim, class FEValuesType>
+ inline const MappingCollection<dim, FEValuesType::space_dimension> &
+ FEValuesBase<dim, q_dim, FEValuesType>::get_mapping_collection() const
+ {
+ return *mapping_collection;
+ }
- template <int dim, int q_dim, class FEValuesType>
- inline const dealii::hp::QCollection<q_dim> &
- FEValuesBase<dim, q_dim, FEValuesType>::get_quadrature_collection() const
- {
- return q_collection;
- }
+ template <int dim, int q_dim, class FEValuesType>
+ inline const QCollection<q_dim> &
+ FEValuesBase<dim, q_dim, FEValuesType>::get_quadrature_collection() const
+ {
+ return q_collection;
+ }
- template <int dim, int q_dim, class FEValuesType>
- inline dealii::UpdateFlags
- FEValuesBase<dim, q_dim, FEValuesType>::get_update_flags() const
- {
- return update_flags;
- }
- } // namespace hp
-} // namespace internal
+ template <int dim, int q_dim, class FEValuesType>
+ inline UpdateFlags
+ FEValuesBase<dim, q_dim, FEValuesType>::get_update_flags() const
+ {
+ return update_flags;
+ }
+} // namespace hp
DEAL_II_NAMESPACE_CLOSE
DEAL_II_NAMESPACE_OPEN
-namespace internal
+namespace hp
{
- namespace hp
- {
- // -------------------------- FEValuesBase -------------------------
-
- template <int dim, int q_dim, class FEValuesType>
- FEValuesBase<dim, q_dim, FEValuesType>::FEValuesBase(
- const dealii::hp::MappingCollection<dim, FEValuesType::space_dimension>
- &mapping_collection,
- const dealii::hp::FECollection<dim, FEValuesType::space_dimension>
- & fe_collection,
- const dealii::hp::QCollection<q_dim> &q_collection,
- const UpdateFlags update_flags)
- : fe_collection(&fe_collection)
- , mapping_collection(&mapping_collection)
- , q_collection(q_collection)
- , fe_values_table(fe_collection.size(),
- mapping_collection.size(),
- q_collection.size())
- , present_fe_values_index(numbers::invalid_unsigned_int,
- numbers::invalid_unsigned_int,
- numbers::invalid_unsigned_int)
- , update_flags(update_flags)
- {}
-
-
- template <int dim, int q_dim, class FEValuesType>
- FEValuesBase<dim, q_dim, FEValuesType>::FEValuesBase(
- const dealii::hp::FECollection<dim, FEValuesType::space_dimension>
- & fe_collection,
- const dealii::hp::QCollection<q_dim> &q_collection,
- const UpdateFlags update_flags)
- : fe_collection(&fe_collection)
- , mapping_collection(
- &dealii::hp::StaticMappingQ1<dim, FEValuesType::space_dimension>::
- mapping_collection)
- , q_collection(q_collection)
- , fe_values_table(fe_collection.size(), 1, q_collection.size())
- , present_fe_values_index(numbers::invalid_unsigned_int,
- numbers::invalid_unsigned_int,
- numbers::invalid_unsigned_int)
- , update_flags(update_flags)
- {}
-
-
-
- template <int dim, int q_dim, class FEValuesType>
- FEValuesType &
- FEValuesBase<dim, q_dim, FEValuesType>::select_fe_values(
- const unsigned int fe_index,
- const unsigned int mapping_index,
- const unsigned int q_index)
- {
- Assert(fe_index < fe_collection->size(),
- ExcIndexRange(fe_index, 0, fe_collection->size()));
- Assert(mapping_index < mapping_collection->size(),
- ExcIndexRange(mapping_index, 0, mapping_collection->size()));
- Assert(q_index < q_collection.size(),
- ExcIndexRange(q_index, 0, q_collection.size()));
-
-
- // set the triple of indices
- // that we want to work with
- present_fe_values_index =
- TableIndices<3>(fe_index, mapping_index, q_index);
-
- // first check whether we
- // already have an object for
- // this particular combination
- // of indices
- if (fe_values_table(present_fe_values_index).get() == nullptr)
- fe_values_table(present_fe_values_index) =
- std::make_shared<FEValuesType>((*mapping_collection)[mapping_index],
- (*fe_collection)[fe_index],
- q_collection[q_index],
- update_flags);
-
- // now there definitely is one!
- return *fe_values_table(present_fe_values_index);
- }
- } // namespace hp
-} // namespace internal
+ // -------------------------- FEValuesBase -------------------------
+
+ template <int dim, int q_dim, class FEValuesType>
+ FEValuesBase<dim, q_dim, FEValuesType>::FEValuesBase(
+ const dealii::hp::MappingCollection<dim, FEValuesType::space_dimension>
+ &mapping_collection,
+ const dealii::hp::FECollection<dim, FEValuesType::space_dimension>
+ & fe_collection,
+ const dealii::hp::QCollection<q_dim> &q_collection,
+ const UpdateFlags update_flags)
+ : fe_collection(&fe_collection)
+ , mapping_collection(&mapping_collection)
+ , q_collection(q_collection)
+ , fe_values_table(fe_collection.size(),
+ mapping_collection.size(),
+ q_collection.size())
+ , present_fe_values_index(numbers::invalid_unsigned_int,
+ numbers::invalid_unsigned_int,
+ numbers::invalid_unsigned_int)
+ , update_flags(update_flags)
+ {}
+
+
+ template <int dim, int q_dim, class FEValuesType>
+ FEValuesBase<dim, q_dim, FEValuesType>::FEValuesBase(
+ const dealii::hp::FECollection<dim, FEValuesType::space_dimension>
+ & fe_collection,
+ const dealii::hp::QCollection<q_dim> &q_collection,
+ const UpdateFlags update_flags)
+ : fe_collection(&fe_collection)
+ , mapping_collection(
+ &dealii::hp::StaticMappingQ1<dim, FEValuesType::space_dimension>::
+ mapping_collection)
+ , q_collection(q_collection)
+ , fe_values_table(fe_collection.size(), 1, q_collection.size())
+ , present_fe_values_index(numbers::invalid_unsigned_int,
+ numbers::invalid_unsigned_int,
+ numbers::invalid_unsigned_int)
+ , update_flags(update_flags)
+ {}
+
+
+ template <int dim, int q_dim, class FEValuesType>
+ FEValuesType &
+ FEValuesBase<dim, q_dim, FEValuesType>::select_fe_values(
+ const unsigned int fe_index,
+ const unsigned int mapping_index,
+ const unsigned int q_index)
+ {
+ Assert(fe_index < fe_collection->size(),
+ ExcIndexRange(fe_index, 0, fe_collection->size()));
+ Assert(mapping_index < mapping_collection->size(),
+ ExcIndexRange(mapping_index, 0, mapping_collection->size()));
+ Assert(q_index < q_collection.size(),
+ ExcIndexRange(q_index, 0, q_collection.size()));
+
+
+ // set the triple of indices
+ // that we want to work with
+ present_fe_values_index = TableIndices<3>(fe_index, mapping_index, q_index);
+
+ // first check whether we
+ // already have an object for
+ // this particular combination
+ // of indices
+ if (fe_values_table(present_fe_values_index).get() == nullptr)
+ fe_values_table(present_fe_values_index) =
+ std::make_shared<FEValuesType>((*mapping_collection)[mapping_index],
+ (*fe_collection)[fe_index],
+ q_collection[q_index],
+ update_flags);
+
+ // now there definitely is one!
+ return *fe_values_table(present_fe_values_index);
+ }
+} // namespace hp
namespace hp
const hp::FECollection<dim, spacedim> & fe_collection,
const hp::QCollection<dim> & q_collection,
const UpdateFlags update_flags)
- : internal::hp::FEValuesBase<dim, dim, dealii::FEValues<dim, spacedim>>(
- mapping,
- fe_collection,
- q_collection,
- update_flags)
+ : hp::FEValuesBase<dim, dim, dealii::FEValues<dim, spacedim>>(mapping,
+ fe_collection,
+ q_collection,
+ update_flags)
{}
const hp::FECollection<dim, spacedim> &fe_collection,
const hp::QCollection<dim> & q_collection,
const UpdateFlags update_flags)
- : internal::hp::FEValuesBase<dim, dim, dealii::FEValues<dim, spacedim>>(
- fe_collection,
- q_collection,
- update_flags)
+ : hp::FEValuesBase<dim, dim, dealii::FEValues<dim, spacedim>>(fe_collection,
+ q_collection,
+ update_flags)
{}
const hp::FECollection<dim, spacedim> & fe_collection,
const hp::QCollection<dim - 1> & q_collection,
const UpdateFlags update_flags)
- : internal::hp::
- FEValuesBase<dim, dim - 1, dealii::FEFaceValues<dim, spacedim>>(
- mapping,
- fe_collection,
- q_collection,
- update_flags)
+ : hp::FEValuesBase<dim, dim - 1, dealii::FEFaceValues<dim, spacedim>>(
+ mapping,
+ fe_collection,
+ q_collection,
+ update_flags)
{}
const hp::FECollection<dim, spacedim> &fe_collection,
const hp::QCollection<dim - 1> & q_collection,
const UpdateFlags update_flags)
- : internal::hp::
- FEValuesBase<dim, dim - 1, dealii::FEFaceValues<dim, spacedim>>(
- fe_collection,
- q_collection,
- update_flags)
+ : hp::FEValuesBase<dim, dim - 1, dealii::FEFaceValues<dim, spacedim>>(
+ fe_collection,
+ q_collection,
+ update_flags)
{}
const hp::FECollection<dim, spacedim> & fe_collection,
const hp::QCollection<dim - 1> & q_collection,
const UpdateFlags update_flags)
- : internal::hp::
- FEValuesBase<dim, dim - 1, dealii::FESubfaceValues<dim, spacedim>>(
- mapping,
- fe_collection,
- q_collection,
- update_flags)
+ : hp::FEValuesBase<dim, dim - 1, dealii::FESubfaceValues<dim, spacedim>>(
+ mapping,
+ fe_collection,
+ q_collection,
+ update_flags)
{}
const hp::FECollection<dim, spacedim> &fe_collection,
const hp::QCollection<dim - 1> & q_collection,
const UpdateFlags update_flags)
- : internal::hp::
- FEValuesBase<dim, dim - 1, dealii::FESubfaceValues<dim, spacedim>>(
- fe_collection,
- q_collection,
- update_flags)
+ : hp::FEValuesBase<dim, dim - 1, dealii::FESubfaceValues<dim, spacedim>>(
+ fe_collection,
+ q_collection,
+ update_flags)
{}