Reference documentation for deal.II version 8.5.1
Public Member Functions | Private Attributes | List of all members
OpenCASCADE::NormalToMeshProjectionBoundary< dim, spacedim > Class Template Reference

#include <deal.II/opencascade/boundary_lib.h>

Inheritance diagram for OpenCASCADE::NormalToMeshProjectionBoundary< dim, spacedim >:
[legend]

Public Member Functions

 NormalToMeshProjectionBoundary (const TopoDS_Shape &sh, const double tolerance=1e-7)
 
virtual Point< spacedim > project_to_manifold (const std::vector< Point< spacedim > > &surrounding_points, const Point< spacedim > &candidate) const
 
- Public Member Functions inherited from Boundary< dim, spacedim >
virtual ~Boundary ()
 
virtual void get_intermediate_points_on_line (const typename Triangulation< dim, spacedim >::line_iterator &line, std::vector< Point< spacedim > > &points) const
 
virtual void get_intermediate_points_on_quad (const typename Triangulation< dim, spacedim >::quad_iterator &quad, std::vector< Point< spacedim > > &points) const
 
void get_intermediate_points_on_face (const typename Triangulation< dim, spacedim >::face_iterator &face, std::vector< Point< spacedim > > &points) const
 
virtual Point< spacedim > project_to_surface (const typename Triangulation< dim, spacedim >::line_iterator &line, const Point< spacedim > &candidate) const
 
virtual Point< spacedim > project_to_surface (const typename Triangulation< dim, spacedim >::quad_iterator &quad, const Point< spacedim > &candidate) const
 
virtual Point< spacedim > project_to_surface (const typename Triangulation< dim, spacedim >::hex_iterator &hex, const Point< spacedim > &candidate) const
 
- Public Member Functions inherited from FlatManifold< dim, spacedim >
 FlatManifold (const Tensor< 1, spacedim > &periodicity=Tensor< 1, spacedim >(), const double tolerance=1e-10)
 
virtual Point< spacedim > get_new_point (const Quadrature< spacedim > &quad) const 1
 
virtual Point< spacedim > get_new_point (const std::vector< Point< spacedim > > &surrounding_points, const std::vector< double > &weights) const
 
virtual void add_new_points (const std::vector< Point< spacedim > > &surrounding_points, const Table< 2, double > &weights, std::vector< Point< spacedim > > &new_points) const
 
virtual Tensor< 1, spacedim > get_tangent_vector (const Point< spacedim > &x1, const Point< spacedim > &x2) const
 
const Tensor< 1, spacedim > & get_periodicity () const
 
- Public Member Functions inherited from Manifold< dim, spacedim >
virtual ~Manifold ()
 
virtual Point< spacedim > get_intermediate_point (const Point< spacedim > &p1, const Point< spacedim > &p2, const double w) const
 
virtual Point< spacedim > get_new_point_on_line (const typename Triangulation< dim, spacedim >::line_iterator &line) const
 
virtual Point< spacedim > get_new_point_on_quad (const typename Triangulation< dim, spacedim >::quad_iterator &quad) const
 
virtual Point< spacedim > get_new_point_on_hex (const typename Triangulation< dim, spacedim >::hex_iterator &hex) const
 
Point< spacedim > get_new_point_on_face (const typename Triangulation< dim, spacedim >::face_iterator &face) const
 
Point< spacedim > get_new_point_on_cell (const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
 
virtual Tensor< 1, spacedim > normal_vector (const typename Triangulation< dim, spacedim >::face_iterator &face, const Point< spacedim > &p) const
 
virtual void get_normals_at_vertices (const typename Triangulation< dim, spacedim >::face_iterator &face, FaceVertexNormals &face_vertex_normals) const
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
 Subscriptor (Subscriptor &&)
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
Subscriptoroperator= (Subscriptor &&)
 
void subscribe (const char *identifier=0) const
 
void unsubscribe (const char *identifier=0) const
 
unsigned int n_subscriptions () const
 
void list_subscribers () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

const TopoDS_Shape sh
 
const Point< 3 > direction
 
const double tolerance
 

Additional Inherited Members

- Public Types inherited from Manifold< dim, spacedim >
typedef Tensor< 1, spacedim > FaceVertexNormals[GeometryInfo< dim >::vertices_per_face]
 
- Static Public Member Functions inherited from Subscriptor
static ::ExceptionBaseExcInUse (int arg1, char *arg2, std::string &arg3)
 
static ::ExceptionBaseExcNoSubscriber (char *arg1, char *arg2)
 
- Protected Member Functions inherited from Boundary< dim, spacedim >
const std::vector< Point< 1 > > & get_line_support_points (const unsigned int n_intermediate_points) const
 

Detailed Description

template<int dim, int spacedim>
class OpenCASCADE::NormalToMeshProjectionBoundary< dim, spacedim >

A Boundary object based on OpenCASCADE TopoDS_Shape where new points are first computed by averaging the surrounding points in the same way as FlatManifold does, and then projecting them using OpenCASCADE utilities onto the manifold along a direction which is an estimation of the surrounding points (hence mesh cell) normal.

The direction normal to the mesh is particularly useful because it is the direction in which the mesh is missing nodes. For instance, during the refinement of a cell a new node is initially created around the baricenter of the cell. This location somehow ensures a uniform distance from the nodes of the old cell. Projecting such cell baricenter onto the CAD surface in the direction normal to the original cell will then retain uniform distance from the points of the original cell. Of course, at the stage of mesh generation, no dof handler nor finite element are defined, and such direction has to be estimated. For the case in which 8 surrounding points are present, 4 different triangles are identified with the points assigned, and the normals of such triangles are averaged to obtain the approximation of the normal to the cell.

The case in which 2 surrounding points are present (i.e.:a cell edge is being refined) is of course more tricky. The average of the CAD surface normals at the 2 surrounding points is first computed, and then projected onto the plane normal to the segment linking the surrounding points. This again is an attempt to have the new point with equal distance with respect to the surrounding points

This class only operates with CAD faces and makes the assumption that the shape you pass to it contains at least one face. If that is not the case, an Exception is thrown. In debug mode there is a sanity check to make sure that the surrounding points (the ones used in project_to_manifold()) actually live on the Manifold, i.e., calling OpenCASCADE::closest_point() on those points leaves them untouched. If this is not the case, an ExcPointNotOnManifold is thrown.

Notice that this type of Boundary descriptor may fail to give results if the triangulation to be refined is close to the boundary of the given TopoDS_Shape, or when the normal direction estimated from the surrounding points does not intersect the shape. An exception is thrown when this happens.

Author
Luca Heltai, Andrea Mola, 2011–2014.

Definition at line 221 of file boundary_lib.h.

Constructor & Destructor Documentation

◆ NormalToMeshProjectionBoundary()

template<int dim, int spacedim>
OpenCASCADE::NormalToMeshProjectionBoundary< dim, spacedim >::NormalToMeshProjectionBoundary ( const TopoDS_Shape &  sh,
const double  tolerance = 1e-7 
)

Construct a Boundary object which will project points on the TopoDS_Shape sh, along a direction which is approximately normal to the mesh cell.

Definition at line 141 of file boundary_lib.cc.

Member Function Documentation

◆ project_to_manifold()

template<int dim, int spacedim>
Point< spacedim > OpenCASCADE::NormalToMeshProjectionBoundary< dim, spacedim >::project_to_manifold ( const std::vector< Point< spacedim > > &  surrounding_points,
const Point< spacedim > &  candidate 
) const
virtual

Perform the actual projection onto the manifold. This function, in debug mode, checks that each of the surrounding_points is within tolerance from the given TopoDS_Shape. If this is not the case, an exception is thrown.

Reimplemented from FlatManifold< dim, spacedim >.

Definition at line 154 of file boundary_lib.cc.

Member Data Documentation

◆ sh

template<int dim, int spacedim>
const TopoDS_Shape OpenCASCADE::NormalToMeshProjectionBoundary< dim, spacedim >::sh
private

The topological shape which is used internally to project points. You can construct such a shape by calling the OpenCASCADE::read_IGES() function, which will create a TopoDS_Shape with the geometry contained in the IGES file.

Definition at line 249 of file boundary_lib.h.

◆ direction

template<int dim, int spacedim>
const Point<3> OpenCASCADE::NormalToMeshProjectionBoundary< dim, spacedim >::direction
private

Direction used to project new points on the shape.

Definition at line 254 of file boundary_lib.h.

◆ tolerance

template<int dim, int spacedim>
const double OpenCASCADE::NormalToMeshProjectionBoundary< dim, spacedim >::tolerance
private

Relative tolerance used by this class to compute distances.

Definition at line 259 of file boundary_lib.h.


The documentation for this class was generated from the following files: