normal_vector (const std::vector<Point<spacedim> > & vertices,
const Point<spacedim> &vertex) const
{
- return vertex-center;
+ Point<spacedim> n = vertex-center;
+ return n/n.norm();
}
template <int dim, int spacedim>
return normal;
}
else if(at_distance_R)
- return vertex-this->center;
+ return HyperBallBoundary<dim>::normal_vector(vertices,vertex);
else
{
Assert(false,
Triangulation<3> tria;
StraightBoundary<3> boundary;
- Boundary<3>::FaceVertexNormals normals;
+ std::vector<Point<3> > normals(GeometryInfo<3>::vertices_per_face);
+
for (unsigned int case_no=0; case_no<2; ++case_no)
{
deallog << "Case" << case_no << std::endl;
for (unsigned int face_no=0; face_no<GeometryInfo<3>::faces_per_cell; ++face_no)
{
face=cell->face(face_no);
- boundary.get_normals_at_vertices(face, normals);
+ std::vector<Point<3> > vs(GeometryInfo<3>::vertices_per_face);
+ for(unsigned int i=0; i<GeometryInfo<3>::vertices_per_face; ++i)
+ vs[i] = face->vertex(i);
+ boundary.get_normals_at_points(vs, normals);
for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_face; ++v)
- Assert ((boundary.normal_vector (face,
+ Assert ((boundary.normal_vector (vs,
face->vertex(v))
-
normals[v] / normals[v].norm()).norm()
Triangulation<2> tria;
StraightBoundary<2> boundary;
- Boundary<2>::FaceVertexNormals normals;
+ std::vector<Point<2> > normals(GeometryInfo<2>::vertices_per_face);
+
for (unsigned int case_no=0; case_no<2; ++case_no)
{
deallog << "Case" << case_no << std::endl;
for (unsigned int face_no=0; face_no<GeometryInfo<2>::faces_per_cell; ++face_no)
{
face=cell->face(face_no);
- boundary.get_normals_at_vertices(face, normals);
+ std::vector<Point<2> > vs(GeometryInfo<2>::vertices_per_face);
+ for(unsigned int i=0; i<GeometryInfo<2>::vertices_per_face; ++i)
+ vs[i] = face->vertex(i);
+ boundary.get_normals_at_points(vs, normals);
for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_face; ++v)
- Assert ((boundary.normal_vector (face,
+ Assert ((boundary.normal_vector (vs,
face->vertex(v))
-
normals[v] / normals[v].norm()).norm()
HyperBallBoundary<3> boundary (Point<3>(1,0,0));
Triangulation<3> tria;
- Boundary<3>::FaceVertexNormals normals;
+ std::vector<Point<3> > normals(GeometryInfo<3>::vertices_per_face);
GridGenerator::hyper_ball (tria, Point<3>(1,0,0), 3);
if (cell->at_boundary(face_no))
{
Triangulation<3>::face_iterator face = cell->face(face_no);
- boundary.get_normals_at_vertices(face, normals);
+ std::vector<Point<3> > vs(GeometryInfo<3>::vertices_per_face);
+ for(unsigned int i=0; i<GeometryInfo<3>::vertices_per_face; ++i)
+ vs[i] = face->vertex(i);
+ boundary.get_normals_at_points(vs, normals);
for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_face; ++v)
- Assert ((boundary.normal_vector (face,
+ Assert ((boundary.normal_vector (vs,
face->vertex(v))
-
normals[v] / normals[v].norm()).norm()
HyperBallBoundary<2> boundary (Point<2>(1,0));
Triangulation<2> tria;
- Boundary<2>::FaceVertexNormals normals;
+ std::vector<Point<2> > normals(GeometryInfo<2>::vertices_per_face);
GridGenerator::hyper_ball (tria, Point<2>(1,0), 3);
if (cell->at_boundary(face_no))
{
Triangulation<2>::face_iterator face = cell->face(face_no);
- boundary.get_normals_at_vertices(face, normals);
+ std::vector<Point<2> > vs(GeometryInfo<2>::vertices_per_face);
+ for(unsigned int i=0; i<GeometryInfo<2>::vertices_per_face; ++i)
+ vs[i] = face->vertex(i);
+ boundary.get_normals_at_points(vs, normals);
+
for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_face; ++v)
- Assert ((boundary.normal_vector (face,
+ Assert ((boundary.normal_vector (vs,
face->vertex(v))
-
normals[v] / normals[v].norm()).norm()
Triangulation<3> tria;
StraightBoundary<3> boundary;
- Boundary<3>::FaceVertexNormals normals;
+ std::vector<Point<3> > normals(GeometryInfo<3>::vertices_per_face);
+
for (unsigned int case_no=0; case_no<2; ++case_no)
{
deallog << "Case" << case_no << std::endl;
for (unsigned int face_no=0; face_no<GeometryInfo<3>::faces_per_cell; ++face_no)
{
face=cell->face(face_no);
- boundary.get_normals_at_vertices(face, normals);
+ std::vector<Point<3> > vs(GeometryInfo<3>::vertices_per_face);
+ for(unsigned int i=0; i<GeometryInfo<3>::vertices_per_face; ++i)
+ vs[i] = face->vertex(i);
+ boundary.get_normals_at_points(vs, normals);
for (double xi=0; xi<=1; xi+=0.234)
for (double eta=0; eta<=1; eta+=0.234)
normal /= normal.norm();
deallog << "p=" << p
- << ", n=" << boundary.normal_vector (face, p)
+ << ", n=" << boundary.normal_vector (vs, p)
<< std::endl;
- Assert ((boundary.normal_vector (face, p)
+ Assert ((boundary.normal_vector (vs, p)
-
normal).norm()
<
Triangulation<2> tria;
StraightBoundary<2> boundary;
- Boundary<2>::FaceVertexNormals normals;
+ std::vector<Point<2> > normals(GeometryInfo<2>::vertices_per_face);
+
for (unsigned int case_no=0; case_no<2; ++case_no)
{
deallog << "Case" << case_no << std::endl;
for (unsigned int face_no=0; face_no<GeometryInfo<2>::faces_per_cell; ++face_no)
{
face=cell->face(face_no);
- boundary.get_normals_at_vertices(face, normals);
+ std::vector<Point<2> > vs(GeometryInfo<2>::vertices_per_face);
+ for(unsigned int i=0; i<GeometryInfo<2>::vertices_per_face; ++i)
+ vs[i] = face->vertex(i);
+ boundary.get_normals_at_points(vs, normals);
for (double xi=0; xi<=1; xi+=0.234)
for (double eta=0; eta<=1; eta+=0.234)
normal /= normal.norm();
deallog << "p=" << p
- << ", n=" << boundary.normal_vector (face, p)
+ << ", n=" << boundary.normal_vector (vs, p)
<< std::endl;
- Assert ((boundary.normal_vector (face, p)
+ Assert ((boundary.normal_vector (vs, p)
-
normal).norm()
<
Triangulation<3> tria;
StraightBoundary<3> boundary;
- Boundary<3>::FaceVertexNormals normals;
+ std::vector<Point<3> > normals(GeometryInfo<3>::vertices_per_face);
+
for (unsigned int case_no=0; case_no<2; ++case_no)
{
deallog << "Case" << case_no << std::endl;
{
deallog << " Face" << face_no << std::endl;
face=cell->face(face_no);
- boundary.get_normals_at_vertices(face, normals);
+ std::vector<Point<3> > v(GeometryInfo<3>::vertices_per_face);
+ for(unsigned int i=0; i<GeometryInfo<3>::vertices_per_face; ++i)
+ v[i] = face->vertex(i);
+ boundary.get_normals_at_points(v, normals);
for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_face; ++v)
{
deallog << " vertex=" << face->vertex(v)
HyperBallBoundary<3> boundary (Point<3>(1,0,0));
Triangulation<3> tria;
- Boundary<3>::FaceVertexNormals normals;
+ std::vector<Point<3> > normals(GeometryInfo<3>::vertices_per_face);
GridGenerator::hyper_ball (tria, Point<3>(1,0,0), 3);
{
deallog << " Face" << face_no << std::endl;
Triangulation<3>::face_iterator face = cell->face(face_no);
- boundary.get_normals_at_vertices(face, normals);
+
+ std::vector<Point<3> > v(GeometryInfo<3>::vertices_per_face);
+ for(unsigned int i=0; i<GeometryInfo<3>::vertices_per_face; ++i)
+ v[i] = face->vertex(i);
+ boundary.get_normals_at_points(v, normals);
+
for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_face; ++v)
{
deallog << " vertex=" << face->vertex(v)