--- /dev/null
+New: Codim one instantiations for make_hanging_node_constraints.
+<br>
+(Sebastian Stark, 2020/05/05)
} // namespace
- template <typename number>
- void
- make_hp_hanging_node_constraints(const dealii::DoFHandler<1> &,
- AffineConstraints<number> &)
- {
- // nothing to do for regular dof handlers in 1d
- }
-
-
- template <typename number>
- void
- make_oldstyle_hanging_node_constraints(const dealii::DoFHandler<1> &,
- AffineConstraints<number> &,
- std::integral_constant<int, 1>)
- {
- // nothing to do for regular dof handlers in 1d
- }
-
- template <typename number>
+ template <typename number, int spacedim>
void
make_hp_hanging_node_constraints(
- const dealii::hp::DoFHandler<1> & /*dof_handler*/,
+ const dealii::hp::DoFHandler<1, spacedim> & /*dof_handler*/,
AffineConstraints<number> & /*constraints*/)
{
- // we may have to compute constraints for vertices. gotta think about that
- // a bit more
-
- // TODO[WB]: think about what to do here...
+ // nothing to do for dof handlers in 1d
}
- template <typename number>
+ template <typename number, int spacedim>
void
make_oldstyle_hanging_node_constraints(
- const dealii::hp::DoFHandler<1> & /*dof_handler*/,
+ const dealii::hp::DoFHandler<1, spacedim> & /*dof_handler*/,
AffineConstraints<number> & /*constraints*/,
std::integral_constant<int, 1>)
{
- // we may have to compute constraints for vertices. gotta think about that
- // a bit more
-
- // TODO[WB]: think about what to do here...
- }
-
-
- template <typename number>
- void
- make_hp_hanging_node_constraints(const dealii::DoFHandler<1, 2> &,
- AffineConstraints<number> &)
- {
- // nothing to do for regular dof handlers in 1d
- }
-
-
- template <typename number>
- void
- make_oldstyle_hanging_node_constraints(const dealii::DoFHandler<1, 2> &,
- AffineConstraints<number> &,
- std::integral_constant<int, 1>)
- {
- // nothing to do for regular dof handlers in 1d
+ // nothing to do for dof handlers in 1d
}
- template <typename number>
+ template <typename number, int spacedim>
void
- make_hp_hanging_node_constraints(const dealii::DoFHandler<1, 3> &,
- AffineConstraints<number> &)
+ make_hp_hanging_node_constraints(
+ const dealii::DoFHandler<1, spacedim> & /*dof_handler*/,
+ AffineConstraints<number> & /*constraints*/)
{
- // nothing to do for regular dof handlers in 1d
+ // nothing to do for dof handlers in 1d
}
- template <typename number>
+ template <typename number, int spacedim>
void
- make_oldstyle_hanging_node_constraints(const dealii::DoFHandler<1, 3> &,
- AffineConstraints<number> &,
- std::integral_constant<int, 1>)
+ make_oldstyle_hanging_node_constraints(
+ const dealii::DoFHandler<1, spacedim> & /*dof_handler*/,
+ AffineConstraints<number> & /*constraints*/,
+ std::integral_constant<int, 1>)
{
- // nothing to do for regular dof handlers in 1d
+ // nothing to do for dof handlers in 1d
}
-
-
template <typename DoFHandlerType, typename number>
void
make_oldstyle_hanging_node_constraints(
//
// ---------------------------------------------------------------------
-// co-dim instantiations not for hp-DoFHandler
-for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS)
- {
-#if deal_II_dimension < deal_II_space_dimension
- template void DoFTools::make_hanging_node_constraints(
- const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
- AffineConstraints<double> &);
-
- template void DoFTools::make_hanging_node_constraints(
- const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
- AffineConstraints<float> &);
-
-# ifdef DEAL_II_WITH_COMPLEX_VALUES
- template void DoFTools::make_hanging_node_constraints(
- const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
- AffineConstraints<std::complex<double>> &);
-# endif
-#endif
- }
-
for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
{
- template void DoFTools::make_hanging_node_constraints(
- const DH<deal_II_dimension, deal_II_dimension> &,
- AffineConstraints<double> &);
-
- template void DoFTools::make_hanging_node_constraints(
- const DH<deal_II_dimension, deal_II_dimension> &,
- AffineConstraints<float> &);
-
-#ifdef DEAL_II_WITH_COMPLEX_VALUES
- template void DoFTools::make_hanging_node_constraints(
- const DH<deal_II_dimension, deal_II_dimension> &,
- AffineConstraints<std::complex<double>> &);
-#endif
-
template void DoFTools::make_periodicity_constraints(
const DH<deal_II_dimension>::face_iterator &,
const DH<deal_II_dimension>::face_iterator &,
S : REAL_AND_COMPLEX_SCALARS)
{
#if deal_II_dimension <= deal_II_space_dimension
+ template void DoFTools::make_hanging_node_constraints(
+ const DH<deal_II_dimension, deal_II_space_dimension> &,
+ AffineConstraints<S> &);
+
template void DoFTools::make_zero_boundary_constraints(
const DH<deal_II_dimension, deal_II_space_dimension> &,
AffineConstraints<S> &,
// method. It uses a triangulation with one refined element beside an
// unrefined element to create the constraints for this configuration.
-template <int dim>
+template <int dim, int spacedim>
int
-generate_grid(Triangulation<dim> &tria)
+generate_grid(Triangulation<dim, spacedim> &tria)
{
Point<dim> p1, p2;
std::vector<unsigned int> sub_div;
-template <int dim>
+template <int dim, int spacedim>
void
-test_constraints(hp::FECollection<dim> &fe_coll)
+test_constraints(hp::FECollection<dim, spacedim> &fe_coll)
{
- Triangulation<dim> tria;
+ Triangulation<dim, spacedim> tria;
// Setup a rectangular domain
// where one cell is h-refined,
// Now assign increasing
// active_fe_indices to
// the different cells.
- hp::DoFHandler<dim> dof_handler(tria);
- typename hp::DoFHandler<dim>::active_cell_iterator cell = dof_handler
- .begin_active(),
- endc = dof_handler.end();
- unsigned int fe_indx = 0;
+ hp::DoFHandler<dim, spacedim> dof_handler(tria);
+ typename hp::DoFHandler<dim, spacedim>::active_cell_iterator
+ cell = dof_handler.begin_active(),
+ endc = dof_handler.end();
+ unsigned int fe_indx = 0;
for (; cell != endc; ++cell)
{
cell->set_active_fe_index(fe_indx);
}
-template <int dim>
+template <int dim, int spacedim>
void
-test_constraints_old(FiniteElement<dim> &fe)
+test_constraints_old(FiniteElement<dim, spacedim> &fe)
{
- Triangulation<dim> tria;
+ Triangulation<dim, spacedim> tria;
// Setup a rectangular domain
// where one cell is h-refined,
// Now assign increasing
// active_fe_indices to
// the different cells.
- DoFHandler<dim> dof_handler(tria);
+ DoFHandler<dim, spacedim> dof_handler(tria);
// Distribute DoFs;
dof_handler.distribute_dofs(fe);
constraint_matrix.print(deallog.get_file_stream());
}
-int
-main()
+template <int dim, int spacedim>
+void
+check()
{
- initlog();
- deallog.get_file_stream().precision(2);
-
- FE_Q<2> fe_1(1);
- FE_Q<2> fe_2(2);
- FE_Q<2> fe_3(QIterated<1>(QTrapez<1>(), 3));
+ FE_Q<dim, spacedim> fe_1(1);
+ FE_Q<dim, spacedim> fe_2(2);
+ FE_Q<dim, spacedim> fe_3(QIterated<1>(QTrapez<1>(), 3));
- hp::FECollection<2> fe_coll2;
+ hp::FECollection<dim, spacedim> fe_coll2;
fe_coll2.push_back(fe_3);
fe_coll2.push_back(fe_2);
fe_coll2.push_back(fe_2);
fe_coll2.push_back(fe_2);
fe_coll2.push_back(fe_3);
- test_constraints<2>(fe_coll2);
+ test_constraints<dim, spacedim>(fe_coll2);
+
+ test_constraints_old<dim, spacedim>(fe_1);
+}
+
+
+
+int
+main()
+{
+ initlog();
+ deallog.get_file_stream().precision(2);
- test_constraints_old<2>(fe_1);
+ check<2, 2>();
+ check<2, 3>();
return 0;
}
DEAL::DoFs: 11
8 0: 0.50
8 2: 0.50
+DEAL::DoFs: 48
+ 4 24: -0.33
+ 4 1: 0.33
+ 4 3: 1.0
+ 25 24: -0.25
+ 25 1: 0.12
+ 25 3: 1.1
+ 26 24: 0.19
+ 26 1: -0.031
+ 26 3: 0.84
+ 38 24: -0.33
+ 38 1: 0.33
+ 38 3: 1.0
+ 39 24: -0.25
+ 39 1: 0.62
+ 39 3: 0.63
+ 40 18: 0.22
+ 40 25: -0.11
+ 40 28: 0.89
+ 41 18: -0.11
+ 41 25: 0.22
+ 41 28: 0.89
+ 36 18: 0.22
+ 36 31: -0.11
+ 36 33: 0.89
+ 37 18: -0.11
+ 37 31: 0.22
+ 37 33: 0.89
+DEAL::DoFs: 11
+ 8 0: 0.50
+ 8 2: 0.50