MGLevelObject<VectorType> & dst,
const InVector & src) const
{
- Assert(copy_indices.size() ==
- dof_handler.get_triangulation().n_global_levels(),
- ExcMessage("MGTransfer::build() has not been called!"));
+ assert_built(dof_handler);
AssertIndexRange(dst.max_level(),
dof_handler.get_triangulation().n_global_levels());
AssertIndexRange(dst.min_level(), dst.max_level() + 1);
OutVector & dst,
const MGLevelObject<VectorType> &src) const
{
- (void)dof_handler;
- Assert(copy_indices.size() ==
- dof_handler.get_triangulation().n_global_levels(),
- ExcMessage("MGTransfer::build() has not been called!"));
+ assert_built(dof_handler);
AssertIndexRange(src.max_level(),
dof_handler.get_triangulation().n_global_levels());
AssertIndexRange(src.min_level(), src.max_level() + 1);
OutVector & dst,
const MGLevelObject<VectorType> &src) const
{
- (void)dof_handler;
- Assert(copy_indices.size() ==
- dof_handler.get_triangulation().n_global_levels(),
- ExcMessage("MGTransfer::build() has not been called!"));
+ assert_built(dof_handler);
// For non-DG: degrees of freedom in the refinement face may need special
// attention, since they belong to the coarse level, but have fine level
// basis functions
component_to_block_map = map;
}
+template <typename VectorType>
+template <int dim, int spacedim>
+void
+MGLevelGlobalTransfer<VectorType>::assert_built(
+ const DoFHandler<dim, spacedim> &dof_handler) const
+{
+ (void)dof_handler;
+ Assert(copy_indices.size() ==
+ dof_handler.get_triangulation().n_global_levels(),
+ ExcMessage("MGTransfer::build() has not been called!"));
+}
/* --------- MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector> -------
MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &dst,
const LinearAlgebra::distributed::Vector<Number2> & src) const
{
- Assert(copy_indices.size() ==
- dof_handler.get_triangulation().n_global_levels(),
- ExcMessage("MGTransfer::build() has not been called!"));
+ assert_built(dof_handler);
copy_to_mg(dof_handler, dst, src, false);
}
const LinearAlgebra::distributed::Vector<Number2> & src,
const bool solution_transfer) const
{
- Assert(copy_indices.size() ==
- dof_handler.get_triangulation().n_global_levels(),
- ExcMessage("MGTransfer::build() has not been called!"));
+ assert_built(dof_handler);
LinearAlgebra::distributed::Vector<Number> &this_ghosted_global_vector =
solution_transfer ? solution_ghosted_global_vector : ghosted_global_vector;
const std::vector<Table<2, unsigned int>> &this_copy_indices =
solution_transfer ? solution_copy_indices_level_mine :
copy_indices_level_mine;
- (void)dof_handler;
-
AssertIndexRange(dst.max_level(),
dof_handler.get_triangulation().n_global_levels());
AssertIndexRange(dst.min_level(), dst.max_level() + 1);
LinearAlgebra::distributed::Vector<Number2> & dst,
const MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &src) const
{
- (void)dof_handler;
- Assert(copy_indices.size() ==
- dof_handler.get_triangulation().n_global_levels(),
- ExcMessage("MGTransfer::build() has not been called!"));
+ assert_built(dof_handler);
AssertIndexRange(src.max_level(),
dof_handler.get_triangulation().n_global_levels());
AssertIndexRange(src.min_level(), src.max_level() + 1);
LinearAlgebra::distributed::Vector<Number2> &dst,
const MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &src) const
{
- (void)dof_handler;
- Assert(copy_indices.size() ==
- dof_handler.get_triangulation().n_global_levels(),
- ExcMessage("MGTransfer::build() has not been called!"));
+ assert_built(dof_handler);
// For non-DG: degrees of freedom in the refinement face may need special
// attention, since they belong to the coarse level, but have fine level
// basis functions
component_to_block_map = map;
}
+template <typename Number>
+template <int dim, int spacedim>
+void
+MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<Number>>::assert_built(
+ const DoFHandler<dim, spacedim> &dof_handler) const
+{
+ (void)dof_handler;
+ Assert(copy_indices.size() ==
+ dof_handler.get_triangulation().n_global_levels(),
+ ExcMessage("MGTransfer::build() has not been called!"));
+}
+
DEAL_II_NAMESPACE_CLOSE