-/* ---------------------------------------------------------------------
- * $Id$
- *
- * Copyright (C) 1999 - 2013 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.
- *
- * ---------------------------------------------------------------------
-
- */
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 1999 - 2013 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.
+//
+// ---------------------------------------------------------------------
// @sect3{Include files}
// And this for the declarations of the `sqrt' and `fabs' functions:
#include <cmath>
-#include <deal.II/../../source/grid/manifold_lib.cc>
-
// The final step in importing deal.II is this: All deal.II functions and
// classes are in a namespace <code>dealii</code>, to make sure they don't
// clash with symbols from other libraries you may want to use in conjunction
// Now we want to write a graphical representation of the mesh to an output
// file. The GridOut class of deal.II can do that in a number of different
// output formats; here, we choose encapsulated postscript (eps) format:
- std::ofstream out ("grid-1.msh");
+ std::ofstream out ("grid-1.eps");
GridOut grid_out;
- grid_out.write_msh (triangulation, out);
+ grid_out.write_eps (triangulation, out);
}
// We then fill it with a ring domain. The center of the ring shall be the
// point (1,0), and inner and outer radius shall be 0.5 and 1. The number of
// circumferential cells could be adjusted automatically by this function,
- // but we choose to set it explicitly to 10 as the last argument:
+ // but we choose to set it explicitely to 10 as the last argument:
const Point<2> center (1,0);
const double inner_radius = 0.5,
outer_radius = 1.0;
GridGenerator::hyper_shell (triangulation,
center, inner_radius, outer_radius,
10);
-
- Triangulation<2>::active_cell_iterator
- cell = triangulation.begin_active(),
- endc = triangulation.end();
-
// By default, the triangulation assumes that all boundaries are straight
// and given by the cells of the coarse grid (which we just created). It
// uses this information when cells at the boundary are refined and new
// In order to demonstrate how to write a loop over all cells, we will
// refine the grid in five steps towards the inner circle of the domain:
for (unsigned int step=0; step<5; ++step)
- // triangulation.refine_global(1);
-
- // if(false)
{
// Next, we need an iterator which points to a cell and which we will
// move over all active cells one by one (active cells are those that
// Finally, after these five iterations of refinement, we want to again
// write the resulting mesh to a file, again in eps format. This works just
// as above:
- std::ofstream out ("grid-2.msh");
+ std::ofstream out ("grid-2.eps");
GridOut grid_out;
- grid_out.write_msh (triangulation, out);
+ grid_out.write_eps (triangulation, out);
// At this point, all objects created in this function will be destroyed in
// fine.
}
-void test_case()
-{
- const unsigned int dim = 2;
-
- std::vector<Point<dim> > ps(2);
- ps[0] = Point<dim>(1.0,1.0);
- ps[1] = Point<dim>(-1.0,1.0);
-
- std::vector<double> ws(2, .5);
-
- PolarManifold<dim> manifold;
-
- Point<dim> p = manifold.get_new_point(ps, ws);
- std::cout << "Point 0 : " << ps[0]
- << ", Point 1: " << ps[1]
- << ", computed point: " << p << std::endl;
-
-
-}
-
// @sect3{The main function}
// two subfunctions, which produce the two grids.
int main ()
{
- // first_grid ();
+ first_grid ();
second_grid ();
- test_case();
}
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_out.h>
#include <deal.II/dofs/dof_handler.h>
// radius equals one.
Triangulation<dim> triangulation;
GridGenerator::hyper_ball (triangulation);
- static const HyperBallBoundary<dim> boundary;
- triangulation.set_boundary (0, boundary);
+ static const PolarManifold<dim> boundary;
+ triangulation.set_manifold (0, boundary);
// Next generate output for this grid and for a once refined grid. Note
// that we have hidden the mesh refinement in the loop header, which might
Triangulation<dim> triangulation;
GridGenerator::hyper_ball (triangulation);
- static const HyperBallBoundary<dim> boundary;
- triangulation.set_boundary (0, boundary);
+ static const PolarManifold<dim> boundary;
+ triangulation.set_manifold (0, boundary);
const MappingQ<dim> mapping (degree);
Triangulation<dim> triangulation;
GridGenerator::hyper_ball (triangulation);
- static const HyperBallBoundary<dim> boundary;
- triangulation.set_boundary (0, boundary);
+ static const PolarManifold<dim> boundary;
+ triangulation.set_manifold (0, boundary);
const MappingQ<dim> mapping (degree);
const FE_Q<dim> fe (1);
#include <deal.II/lac/constraint_matrix.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/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/dofs/dof_handler.h>
void LaplaceProblem<dim>::run ()
{
GridGenerator::hyper_ball (triangulation);
- static const HyperBallBoundary<dim> boundary;
- triangulation.set_boundary (0, boundary);
+ static const PolarManifold<dim> boundary;
+ triangulation.set_manifold (0, boundary);
for (unsigned int cycle=0; cycle<6; ++cycle, triangulation.refine_global(1))
{
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/grid/grid_refinement.h>
#include <deal.II/dofs/dof_handler.h>
// the origin, created in the same way as shown in step-6. The mesh is
// globally refined twice followed later on by several adaptive cycles:
GridGenerator::hyper_ball (triangulation);
- static const HyperBallBoundary<dim> boundary;
- triangulation.set_boundary (0, boundary);
+ static const PolarManifold<dim> boundary;
+ triangulation.set_manifold (0, boundary);
triangulation.refine_global(2);
// The Newton iteration starts next. During the first step we do not have
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_refinement.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_tools.h>
{
GridGenerator::hyper_ball (triangulation);
- static const HyperBallBoundary<dim> boundary;
- triangulation.set_boundary (0, boundary);
+ static const PolarManifold<dim> boundary;
+ triangulation.set_manifold (0, boundary);
triangulation.refine_global (1);
}
#include <deal.II/grid/grid_refinement.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.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/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/grid/grid_refinement.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/grid/grid_tools.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/dofs/dof_accessor.h>
// z-axis. Note that the boundary objects need to live as long as the
// triangulation does; we can achieve this by making the objects static,
// which means that they live as long as the program runs:
- static const CylinderBoundary<dim> inner_cylinder (inner_radius, 2);
- static const CylinderBoundary<dim> outer_cylinder (outer_radius, 2);
+ static const CylinderManifold<dim> inner_cylinder (inner_radius, 2);
+ static const CylinderManifold<dim> outer_cylinder (outer_radius, 2);
// We then attach these two objects to the triangulation, and make them
// correspond to boundary indicators 2 and 3:
- triangulation.set_boundary (2, inner_cylinder);
- triangulation.set_boundary (3, outer_cylinder);
+ triangulation.set_manifold (2, inner_cylinder);
+ triangulation.set_manifold (3, outer_cylinder);
// There's one more thing we have to take care of (we should have done so
// above already, but for didactic reasons it was more appropriate to
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
// However, the next file is new. We need this include file for the
// association of degrees of freedom ("DoF"s) to vertices, lines, and cells:
center, inner_radius, outer_radius,
10);
- static const HyperShellBoundary<2> boundary_description(center);
- triangulation.set_boundary (0, boundary_description);
+ static const PolarManifold<2> boundary_description(center);
+ triangulation.set_manifold (0, boundary_description);
for (unsigned int step=0; step<5; ++step)
{
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/grid/grid_tools.h>
#include <deal.II/grid/grid_refinement.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.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/dofs/dof_accessor.h>
{
const Point<dim> center;
GridGenerator::hyper_ball (triangulation, center, 1.);
- static const HyperBallBoundary<dim> boundary_description (center, 1.);
- triangulation.set_boundary (0,boundary_description);
+ static const PolarManifold<dim> boundary_description (center);
+ triangulation.set_manifold (0,boundary_description);
triangulation.refine_global (7);
time_step = GridTools::minimal_cell_diameter(triangulation) /
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.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/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.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/dofs/dof_accessor.h>
// program and thereby longer than the triangulation object we will
// associated with it. We then assign this boundary-object to the part of
// the boundary with boundary indicator 1:
- static const HyperBallBoundary<dim> boundary(focal_point, radius);
- triangulation.set_boundary(1, boundary);
+ static const PolarManifold<dim> boundary(focal_point);
+ triangulation.set_manifold (1, boundary);
// Now global refinement is executed. Cells near the transducer location
// will be automatically refined according to the circle shaped boundary
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/grid/filtered_iterator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/grid/grid_tools.h>
#include <deal.II/grid/grid_refinement.h>
EquationData::R1,
(dim==3) ? 96 : 12,
true);
- static HyperShellBoundary<dim> boundary;
- triangulation.set_boundary (0, boundary);
- triangulation.set_boundary (1, boundary);
+ static PolarManifold<dim> boundary;
+ triangulation.set_manifold (0, boundary);
+ triangulation.set_manifold (1, boundary);
global_Omega_diameter = GridTools::diameter (triangulation);
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_in.h>
#include <deal.II/grid/grid_out.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/dofs/dof_accessor.h>
//
// Experimenting a little with the computation of the angles gives very
// accurate results for simpler geometries. To verify this you can comment
- // out, in the read_domain() method, the tria.set_boundary(1, boundary)
+ // out, in the read_domain() method, the tria.set_manifold (1, boundary)
// line, and check the alpha that is generated by the program. By removing
// this call, whenever the mesh is refined new nodes will be placed along
// the straight lines that made up the coarse mesh, rather than be pulled
void BEMProblem<dim>::read_domain()
{
static const Point<dim> center = Point<dim>();
- static const HyperBallBoundary<dim-1, dim> boundary(center,1.);
+ static const PolarManifold<dim> boundary(center);
std::ifstream in;
switch (dim)
gi.attach_triangulation (tria);
gi.read_ucd (in);
- tria.set_boundary(1, boundary);
+ tria.set_manifold (1, boundary);
}
#include <deal.II/grid/grid_refinement.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/grid/grid_in.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/multigrid/multigrid.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/grid/tria_accessor.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_tools.h>
#include <deal.II/lac/full_matrix.h>
template <int spacedim>
void LaplaceBeltramiProblem<spacedim>::make_grid_and_dofs ()
{
- static HyperBallBoundary<dim,spacedim> surface_description;
- triangulation.set_boundary (0, surface_description);
+ static PolarManifold<spacedim> surface_description;
+ triangulation.set_manifold (0, surface_description);
{
Triangulation<spacedim> volume_mesh;
#include <deal.II/grid/grid_tools.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_renumbering.h>
#include <deal.II/fe/fe_q.h>
GridTools::transform(&rotate_half_sphere, triangulation);
Point < dim > shift(0.5, 0.5, 0.5);
GridTools::shift(shift, triangulation);
- static HyperBallBoundary<dim> boundary_description(Point<dim>(0.5,0.5,0.5), radius);
- triangulation.set_boundary (0, boundary_description);
+ static PolarManifold<dim> boundary_description(Point<dim>(0.5,0.5,0.5));
+ triangulation.set_manifold (0, boundary_description);
triangulation.refine_global(n_initial_refinements);
#include <deal.II/grid/grid_tools.h>
#include <deal.II/grid/grid_in.h>
#include <deal.II/grid/tria.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/fe/fe_dgp_monomial.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/fe/fe_q.h>
GridGenerator::hyper_ball (triangulation);
//GridGenerator::hyper_cube (triangulation, -1, 1);
- static const HyperBallBoundary<dim> boundary;
- triangulation.set_boundary (0, boundary);
+ static const PolarManifold<dim> boundary;
+ triangulation.set_manifold (0, boundary);
triangulation.refine_global (2);
}
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_tools.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/grid/grid_out.h>
#include <deal.II/grid/grid_in.h>
// an object that describes a circle (i.e., a hyper ball) with appropriate
// center and radius and assign it to the triangulation. We can then refine
// twice:
- const HyperBallBoundary<2> boundary_description(Point<2>(0,0), 0.25);
- triangulation.set_boundary (1, boundary_description);
+ const PolarManifold<2> boundary_description(Point<2>(0,0));
+ triangulation.set_manifold (1, boundary_description);
triangulation.refine_global(2);
// The mesh so generated is then passed to the function that generates
// object is destroyed first in this function since it was declared after
// the triangulation).
mesh_info (triangulation, "grid-3.eps");
- triangulation.set_boundary (1);
+ triangulation.set_manifold (1);
}
// There is one snag to doing things as shown above: If one moves the nodes on
// We will use a circular domain, and the object describing the boundary of it
// comes from this file:
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
// This is C++ ...
#include <fstream>
// the first example. Note that the HyperBallBoundary constructor takes two
// parameters, the center of the ball and the radius, but that their default
// (the origin and 1.0) are the ones which we would like to use here.
- static const HyperBallBoundary<dim> boundary;
- triangulation.set_boundary (0, boundary);
+ static const PolarManifold<dim> boundary;
+ triangulation.set_manifold (0, boundary);
for (unsigned int cycle=0; cycle<6; ++cycle)
{
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_out.h>
#include <deal.II/grid/grid_refinement.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_refinement.h>
#include <deal.II/grid/tria_iterator.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/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_renumbering.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/fe/fe_values.h>
{
GridGenerator::hyper_ball (triangulation);
- static const HyperBallBoundary<dim> boundary;
- triangulation.set_boundary (0, boundary);
+ static const PolarManifold<dim> boundary;
+ triangulation.set_manifold (0, boundary);
triangulation.refine_global (1);
}
#include <deal.II/grid/grid_refinement.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.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/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/grid/grid_refinement.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.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/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/grid/grid_refinement.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.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/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_tools.h>