Cleanup manifolds.
// ---------------------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
#include <deal.II/matrix_free/fe_evaluation.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/lac/constraint_matrix.h>
#include <deal.II/lac/full_matrix.h>
template <int dim, int fe_degree>
void test ()
{
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
+
if (dim < 3 || fe_degree < 2)
tria.refine_global(1);
tria.begin(tria.n_levels()-1)->set_refine_flag();
// ---------------------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
#include <deal.II/matrix_free/fe_evaluation.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/lac/constraint_matrix.h>
#include <deal.II/lac/full_matrix.h>
template <int dim>
void test ()
{
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
+
if (dim == 2)
tria.refine_global(1);
tria.begin(tria.n_levels()-1)->set_refine_flag();
// ---------------------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
#include <deal.II/matrix_free/fe_evaluation.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/lac/constraint_matrix.h>
#include <deal.II/lac/full_matrix.h>
template <int dim, int fe_degree>
void test ()
{
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
+
tria.refine_global(5-dim);
tria.begin(tria.n_levels()-1)->set_refine_flag();
tria.last()->set_refine_flag();
// ---------------------------------------------------------------------
//
-// Copyright (C) 2013 - 2015 by the deal.II authors
+// Copyright (C) 2013 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
#include <deal.II/lac/block_vector.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/grid/tria_boundary_lib.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/dofs/dof_handler.h>
template <int dim, int fe_degree>
void test ()
{
+ SphericalManifold<dim> manifold;
+ HyperShellBoundary<dim> boundary;
Triangulation<dim> triangulation;
GridGenerator::hyper_shell (triangulation, Point<dim>(),
0.5, 1., 96, true);
- static HyperShellBoundary<dim> boundary;
- triangulation.set_boundary (0, boundary);
- triangulation.set_boundary (1, boundary);
+ triangulation.set_all_manifold_ids(0);
+ triangulation.set_all_manifold_ids_on_boundary(1);
+ triangulation.set_manifold (0, manifold);
+ triangulation.set_manifold (1, boundary);
+
triangulation.begin_active()->set_refine_flag();
triangulation.last()->set_refine_flag();
triangulation.execute_coarsening_and_refinement();
stokes_sub_blocks[dim] = 1;
DoFRenumbering::component_wise (dof_handler, stokes_sub_blocks);
- std::set<unsigned char> no_normal_flux_boundaries;
- no_normal_flux_boundaries.insert (0);
+ std::set<types::boundary_id> no_normal_flux_boundaries;
no_normal_flux_boundaries.insert (1);
DoFTools::make_hanging_node_constraints (dof_handler,
constraints);
deallog.pop();
}
}
-
template <int dim, int fe_degree>
void test ()
{
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
+
// refine first and last cell
tria.begin(tria.n_levels()-1)->set_refine_flag();
tria.last()->set_refine_flag();
do_test <dim, fe_degree, double> (dof, constraints);
}
-
-//------------------ get_functions_common.h ------------------------
-// Version: $Name$
+// ---------------------------------------------------------------------
//
-//------------------ get_functions_common.h ------------------------
+// Copyright (C) 2011 - 2016 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
// this is a template for getting the function values and comparing them with
#include <deal.II/lac/vector.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/lac/constraint_matrix.h>
void test ()
{
typedef double number;
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
+
// refine first and last cell
tria.begin(tria.n_levels()-1)->set_refine_flag();
tria.last()->set_refine_flag();
MatrixFreeTest<dim,fe_degree,fe_degree+1,number> mf (mf_data, mapping);
mf.test_functions (solution);
}
-
void test ()
{
typedef double number;
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
+
// refine first and last cell
tria.begin(tria.n_levels()-1)->set_refine_flag();
tria.last()->set_refine_flag();
mf.test_functions(solution);
deallog << std::endl;
}
-
void test ()
{
typedef double number;
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
+
// refine first and last cell
tria.begin(tria.n_levels()-1)->set_refine_flag();
tria.last()->set_refine_flag();
MatrixFreeTest<dim,fe_degree,fe_degree+1,number> mf (mf_data, mapping);
mf.test_functions (solution);
}
-
void test ()
{
typedef double number;
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
+
// refine first and last cell
tria.begin(tria.n_levels()-1)->set_refine_flag();
tria.last()->set_refine_flag();
sub_test <dim,fe_degree,fe_degree+3,number> (dof, constraints, mf_data,
solution);
}
-
#include <deal.II/lac/vector.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/lac/constraint_matrix.h>
template <int dim, int fe_degree>
void test ()
{
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_shell (tria, Point<dim>(), 1., 2., 96, true);
- static const HyperShellBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
- tria.set_boundary (1, boundary);
+ tria.set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
// refine a few cells
for (unsigned int i=0; i<11-3*dim; ++i)
deallog.pop();
}
}
-
#include <deal.II/lac/vector.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/lac/constraint_matrix.h>
void test ()
{
typedef double number;
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
typename Triangulation<dim>::active_cell_iterator
cell = tria.begin_active (),
endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
+
+ cell = tria.begin_active ();
for (; cell!=endc; ++cell)
if (cell->center().norm()<1e-8)
cell->set_refine_flag();
deallog.pop();
}
}
-
#include <deal.II/lac/vector.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/lac/constraint_matrix.h>
{
// create hyper ball geometry and refine some
// cells
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
typename Triangulation<dim>::active_cell_iterator
cell = tria.begin_active (),
endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
+
+ cell = tria.begin_active ();
for (; cell!=endc; ++cell)
if (cell->center().norm()<1e-8)
cell->set_refine_flag();
deallog.pop();
}
}
-
// ---------------------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
#include <deal.II/matrix_free/fe_evaluation.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/fe/mapping_q.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/fe_dgq.h>
template <int dim, int fe_degree>
void test ()
{
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
+
if (dim < 3 || fe_degree < 2)
tria.refine_global(1);
tria.begin(tria.n_levels()-1)->set_refine_flag();
tria.last()->set_refine_flag();
tria.execute_coarsening_and_refinement();
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active (),
- endc = tria.end();
+ cell = tria.begin_active ();
for (; cell!=endc; ++cell)
if (cell->center().norm()<1e-8)
cell->set_refine_flag();
#include <deal.II/matrix_free/fe_evaluation.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/fe/mapping_q.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/fe_dgq.h>
template <int dim, int fe_degree>
void test ()
{
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
+
if (dim < 3 || fe_degree < 2)
tria.refine_global(1);
tria.begin(tria.n_levels()-1)->set_refine_flag();
tria.last()->set_refine_flag();
tria.execute_coarsening_and_refinement();
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active (),
- endc = tria.end();
+ cell = tria.begin_active ();
for (; cell!=endc; ++cell)
if (cell->center().norm()<1e-8)
cell->set_refine_flag();
ConstraintMatrix constraints;
constraints.close();
- do_test<dim, fe_degree, double> (dof, constraints);
+ do_test<dim, fe_degree, double, fe_degree+1> (dof, constraints);
}
constraints);
constraints.close();
- do_test<dim, fe_degree, double> (dof, constraints);
+ do_test<dim, fe_degree, double, fe_degree+1> (dof, constraints);
}
constraints);
constraints.close();
- do_test<dim, fe_degree, double> (dof, constraints);
+ do_test<dim, fe_degree, double, fe_degree+1> (dof, constraints);
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2013 - 2014 by the deal.II authors
+// Copyright (C) 2013 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
template <int dim, int fe_degree>
void test ()
{
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_shell (tria, Point<dim>(),
0.5, 1., 96, true);
- static const HyperShellBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
- tria.set_boundary (1, boundary);
+ tria.set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
if (dim == 2)
tria.refine_global (2);
DoFTools::make_hanging_node_constraints(dof, constraints);
constraints.close();
- do_test<dim, fe_degree, double> (dof, constraints);
+ do_test<dim, fe_degree, double, fe_degree+1> (dof, constraints);
}
DoFTools::make_hanging_node_constraints(dof, constraints);
constraints.close();
- do_test<dim, fe_degree, double> (dof, constraints);
+ do_test<dim, fe_degree, double, fe_degree+1> (dof, constraints);
}
constraints);
constraints.close();
- do_test<dim, fe_degree, double> (dof, constraints);
+ do_test<dim, fe_degree, double, fe_degree+1> (dof, constraints);
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2013 - 2014-2014 by the deal.II authors
+// Copyright (C) 2013 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
template <int dim, int fe_degree>
void test ()
{
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
typename Triangulation<dim>::active_cell_iterator
cell = tria.begin_active (),
endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
+ cell = tria.begin_active();
for (; cell!=endc; ++cell)
if (cell->center().norm()<1e-8)
cell->set_refine_flag();
constraints);
constraints.close();
- do_test<dim, fe_degree, double> (dof, constraints);
+ do_test<dim, fe_degree, double, fe_degree+1> (dof, constraints);
// test with coloring only as well
- do_test<dim, fe_degree, double> (dof, constraints, 2);
+ do_test<dim, fe_degree, double, fe_degree+1> (dof, constraints, 2);
}
constraints);
constraints.close();
- do_test<dim, fe_degree, double> (dof, constraints);
+ do_test<dim, fe_degree, double, fe_degree+1> (dof, constraints);
}
constraints);
constraints.close();
- do_test<dim, fe_degree, double> (dof, constraints);
+ do_test<dim, fe_degree, double, fe_degree+1> (dof, constraints);
}
// ---------------------------------------------------------------------
//
-// Copyright (C) 2014 by the deal.II authors
+// Copyright (C) 2014 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
template <int dim, int fe_degree>
void test ()
{
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
if (dim < 3 || fe_degree < 2)
tria.refine_global(1);
tria.begin(tria.n_levels()-1)->set_refine_flag();
tria.last()->set_refine_flag();
tria.execute_coarsening_and_refinement();
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active (),
- endc = tria.end();
+ cell = tria.begin_active ();
for (; cell!=endc; ++cell)
if (cell->center().norm()<1e-8)
cell->set_refine_flag();
dof.distribute_dofs(fe);
ConstraintMatrix constraints;
- do_test<dim, fe_degree, double> (dof, constraints);
+ do_test<dim, fe_degree, double, fe_degree+1> (dof, constraints);
}
-
#include <deal.II/matrix_free/fe_evaluation.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/lac/constraint_matrix.h>
template <int dim, int fe_degree>
void test ()
{
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
+
if (dim < 3 || fe_degree < 2)
tria.refine_global(1);
tria.begin(tria.n_levels()-1)->set_refine_flag();
tria.last()->set_refine_flag();
tria.execute_coarsening_and_refinement();
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active (),
- endc = tria.end();
+ cell = tria.begin_active ();
for (; cell!=endc; ++cell)
if (cell->center().norm()<1e-8)
cell->set_refine_flag();
#include <deal.II/matrix_free/fe_evaluation.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/lac/constraint_matrix.h>
template <int dim, int fe_degree>
void test ()
{
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
+
if (dim < 3 || fe_degree < 2)
tria.refine_global(1);
tria.begin(tria.n_levels()-1)->set_refine_flag();
tria.last()->set_refine_flag();
tria.execute_coarsening_and_refinement();
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active (),
- endc = tria.end();
+ cell = tria.begin_active ();
for (; cell!=endc; ++cell)
if (cell->center().norm()<1e-8)
cell->set_refine_flag();
// ---------------------------------------------------------------------
//
-// Copyright (C) 2014 by the deal.II authors
+// Copyright (C) 2014 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
template <int dim, int fe_degree>
void test ()
{
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
if (dim < 3 || fe_degree < 2)
tria.refine_global(1);
tria.begin(tria.n_levels()-1)->set_refine_flag();
tria.last()->set_refine_flag();
tria.execute_coarsening_and_refinement();
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active (),
- endc = tria.end();
+ cell = tria.begin_active ();
for (; cell!=endc; ++cell)
if (cell->center().norm()<1e-8)
cell->set_refine_flag();
constraints);
constraints.close();
- do_test<dim, fe_degree, double> (dof, constraints);
+ do_test<dim, fe_degree, double, fe_degree+1> (dof, constraints);
}
-
-
-
-//------------------ matrix_vector_common.h ------------------------
-// Version: $Name$
+// ---------------------------------------------------------------------
//
-//------------------ matrix_vector_common.h ------------------------
+// Copyright (C) 2013 - 2016 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
// this is a template for matrix-vector products with the Helmholtz equation
#include <deal.II/lac/vector.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/lac/constraint_matrix.h>
-template <int dim, int fe_degree, typename number>
+template <int dim, int fe_degree, typename number, int n_q_points_1d>
void do_test (const DoFHandler<dim> &dof,
const ConstraintMatrix &constraints,
const unsigned int parallel_option = 0)
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
//std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
+ MappingQGeneric<dim> mapping(fe_degree);
MatrixFree<dim,number> mf_data;
{
- const QGauss<1> quad (fe_degree+1);
+ const QGauss<1> quad (n_q_points_1d);
typename MatrixFree<dim,number>::AdditionalData data;
if (parallel_option == 1)
data.tasks_parallel_scheme =
}
data.tasks_block_size = 7;
- mf_data.reinit (dof, constraints, quad, data);
+ mf_data.reinit (mapping, dof, constraints, quad, data);
}
- MatrixFreeTest<dim,fe_degree,number> mf (mf_data);
+ MatrixFreeTest<dim,fe_degree,number,Vector<number>,n_q_points_1d> mf (mf_data);
Vector<number> in (dof.n_dofs()), out (dof.n_dofs());
Vector<number> in_dist (dof.n_dofs());
Vector<number> out_dist (in_dist);
}
SparseMatrix<double> sparse_matrix (sparsity);
{
- QGauss<dim> quadrature_formula(fe_degree+1);
+ QGauss<dim> quadrature_formula(n_q_points_1d);
- FEValues<dim> fe_values (dof.get_fe(), quadrature_formula,
+ FEValues<dim> fe_values (mapping, dof.get_fe(), quadrature_formula,
update_values | update_gradients |
update_JxW_values);
deallog.pop();
}
}
-
// ---------------------------------------------------------------------
//
-// Copyright (C) 2013 - 2015 by the deal.II authors
+// Copyright (C) 2013 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
#include <deal.II/lac/block_vector.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/dofs/dof_renumbering.h>
template <int dim, int fe_degree>
void test ()
{
- Triangulation<dim> tria;
+ const SphericalManifold<dim> manifold;
+ Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
tria.refine_global(4-dim);
// refine a few cells
deallog.pop();
}
}
-
constraints.close();
deallog.threshold_double (5e-6);
- do_test<dim, fe_degree, float> (dof, constraints);
+ do_test<dim, fe_degree, float, fe_degree+1> (dof, constraints);
}
std::pair<unsigned int,unsigned int> subrange_deg =
data.create_cell_subrange_hp (cell_range, 1);
if (subrange_deg.second > subrange_deg.first)
- helmholtz_operator<dim,1,Vector<Number> > (data, dst, src,
- subrange_deg);
+ helmholtz_operator<dim,1,Vector<Number>,2> (data, dst, src,
+ subrange_deg);
subrange_deg = data.create_cell_subrange_hp (cell_range, 2);
if (subrange_deg.second > subrange_deg.first)
- helmholtz_operator<dim,2,Vector<Number> > (data, dst, src,
- subrange_deg);
+ helmholtz_operator<dim,2,Vector<Number>,3> (data, dst, src,
+ subrange_deg);
subrange_deg = data.create_cell_subrange_hp (cell_range, 3);
if (subrange_deg.second > subrange_deg.first)
- helmholtz_operator<dim,3,Vector<Number> > (data, dst, src,
- subrange_deg);
+ helmholtz_operator<dim,3,Vector<Number>,4> (data, dst, src,
+ subrange_deg);
subrange_deg = data.create_cell_subrange_hp (cell_range, 4);
if (subrange_deg.second > subrange_deg.first)
- helmholtz_operator<dim,4,Vector<Number> > (data, dst, src,
- subrange_deg);
+ helmholtz_operator<dim,4,Vector<Number>,5> (data, dst, src,
+ subrange_deg);
subrange_deg = data.create_cell_subrange_hp (cell_range, 5);
if (subrange_deg.second > subrange_deg.first)
- helmholtz_operator<dim,5,Vector<Number> > (data, dst, src,
- subrange_deg);
+ helmholtz_operator<dim,5,Vector<Number>,6> (data, dst, src,
+ subrange_deg);
subrange_deg = data.create_cell_subrange_hp (cell_range, 6);
if (subrange_deg.second > subrange_deg.first)
- helmholtz_operator<dim,6,Vector<Number> > (data, dst, src,
- subrange_deg);
+ helmholtz_operator<dim,6,Vector<Number>,7> (data, dst, src,
+ subrange_deg);
subrange_deg = data.create_cell_subrange_hp (cell_range, 7);
if (subrange_deg.second > subrange_deg.first)
- helmholtz_operator<dim,7,Vector<Number> > (data, dst, src,
- subrange_deg);
+ helmholtz_operator<dim,7,Vector<Number>,8> (data, dst, src,
+ subrange_deg);
}
void vmult (Vector<Number> &dst,
return;
typedef double number;
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
tria.refine_global(1);
// refine a few cells
const double diff_norm = result_mf.linfty_norm();
deallog << "Norm of difference: " << diff_norm << std::endl << std::endl;
}
-
-//------------------ matrix_vector_common.h ------------------------
-// Version: $Name$
+// ---------------------------------------------------------------------
//
-//------------------ matrix_vector_common.h ------------------------
+// Copyright (C) 2013 - 2016 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
// this is a template for matrix-vector products with the Helmholtz equation
#include <deal.II/lac/la_parallel_vector.h>
-template <int dim, int fe_degree, typename VectorType>
+template <int dim, int fe_degree, typename VectorType, int n_q_points_1d>
void
helmholtz_operator (const MatrixFree<dim,typename VectorType::value_type> &data,
VectorType &dst,
const std::pair<unsigned int,unsigned int> &cell_range)
{
typedef typename VectorType::value_type Number;
- FEEvaluation<dim,fe_degree,fe_degree+1,1,Number> fe_eval (data);
+ FEEvaluation<dim,fe_degree,n_q_points_1d,1,Number> fe_eval (data);
const unsigned int n_q_points = fe_eval.n_q_points;
for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
-template <int dim, int fe_degree, typename Number, typename VectorType=Vector<Number> >
+template <int dim, int fe_degree, typename Number, typename VectorType=Vector<Number>, int n_q_points_1d=fe_degree+1>
class MatrixFreeTest
{
public:
VectorType &,
const VectorType &,
const std::pair<unsigned int,unsigned int> &)>
- wrap = helmholtz_operator<dim,fe_degree,VectorType>;
+ wrap = helmholtz_operator<dim,fe_degree,VectorType,n_q_points_1d>;
data.cell_loop (wrap, dst, src);
};
// ---------------------------------------------------------------------
//
-// Copyright (C) 2013 - 2015 by the deal.II authors
+// Copyright (C) 2013 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
template <int dim, int fe_degree>
void test ()
{
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
tria.refine_global(5-dim);
FE_Q<dim> fe (fe_degree);
//std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
// set up MatrixFree
+ MappingQGeneric<dim> mapping(fe_degree);
QGauss<1> quad (fe_degree+1);
MatrixFree<dim> mf_data;
- mf_data.reinit (dof, constraints, quad);
+ mf_data.reinit (mapping, dof, constraints, quad);
SparsityPattern sparsity;
SparseMatrix<double> system_matrix;
{
mg_constraints[level].close();
typename MatrixFree<dim>::AdditionalData data;
data.level_mg_handler = level;
- mg_matrices[level].reinit(dof, mg_constraints[level], quad, data);
+ mg_matrices[level].reinit(mapping, dof, mg_constraints[level], quad, data);
DynamicSparsityPattern csp;
csp.reinit (dof.n_dofs(level), dof.n_dofs(level));
// discretization and on all levels
{
QGauss<dim> quad (fe_degree+1);
- FEValues<dim> fe_values (fe, quad,
+ FEValues<dim> fe_values (mapping, fe, quad,
update_values | update_gradients |
update_JxW_values);
const unsigned int n_quadrature_points = quad.size();
}
deallog << std::endl;
}
-
// ---------------------------------------------------------------------
//
-// Copyright (C) 2013 - 2015 by the deal.II authors
+// Copyright (C) 2013 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
#include <deal.II/lac/block_vector.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/grid/tria_boundary_lib.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/dofs/dof_handler.h>
template <int dim, int fe_degree>
void test ()
{
+ SphericalManifold<dim> manifold;
+ HyperShellBoundary<dim> boundary;
Triangulation<dim> triangulation;
GridGenerator::hyper_shell (triangulation, Point<dim>(),
0.5, 1., 96, true);
- static HyperShellBoundary<dim> boundary;
- triangulation.set_boundary (0, boundary);
- triangulation.set_boundary (1, boundary);
+ triangulation.set_all_manifold_ids(0);
+ triangulation.set_all_manifold_ids_on_boundary(1);
+ triangulation.set_manifold (0, manifold);
+ triangulation.set_manifold (1, boundary);
+
triangulation.begin_active()->set_refine_flag();
triangulation.last()->set_refine_flag();
triangulation.execute_coarsening_and_refinement();
stokes_sub_blocks[dim] = 1;
DoFRenumbering::component_wise (dof_handler, stokes_sub_blocks);
- std::set<unsigned char> no_normal_flux_boundaries;
+ std::set<types::boundary_id> no_normal_flux_boundaries;
no_normal_flux_boundaries.insert (0);
no_normal_flux_boundaries.insert (1);
DoFTools::make_hanging_node_constraints (dof_handler,
deallog.pop();
}
}
-
#include <deal.II/lac/vector.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/lac/constraint_matrix.h>
template <int dim, int fe_degree>
void test ()
{
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
+
// refine first and last cell
tria.begin(tria.n_levels()-1)->set_refine_flag();
tria.last()->set_refine_flag();
#include <deal.II/lac/vector.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/lac/constraint_matrix.h>
void test ()
{
typedef double number;
+ const SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active (),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ cell->face(f)->set_all_manifold_ids(0);
+ tria.set_manifold (0, manifold);
tria.refine_global(5-dim);
MappingQ<dim> mapping (4);
deallog.pop();
}
}
-
#define CALL_METHOD(degree) \
subrange_deg = data.create_cell_subrange_hp(cell_range, degree); \
if (subrange_deg.second > subrange_deg.first) \
- helmholtz_operator<dim,degree,Vector<Number> > (data, dst, src, subrange_deg)
+ helmholtz_operator<dim,degree,Vector<Number>,degree+1> (data, dst, src, subrange_deg)
CALL_METHOD(1);
CALL_METHOD(2);
do_test<dim,float>(parallel_option);
deallog.pop();
}
-