![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
Classes | |
| struct | TriangleProjectionData |
| struct | hash_cell |
| struct | equal_cell |
Enumerations | |
| enum class | ParticleTriangleContactIndicator : std::uint8_t { face_contact , edge_contact , vertex_contact , no_contact } |
Functions | |
| template<int dim> | |
| void | vertices_cell_mapping (const DoFHandler< dim > &dof_handler, std::map< unsigned int, std::set< typename DoFHandler< dim >::active_cell_iterator > > &vertices_cell_map) |
| template<int dim> | |
| void | vertices_cell_mapping_with_periodic_boundaries (const DoFHandler< dim > &dof_handler, std::map< unsigned int, std::set< typename DoFHandler< dim >::active_cell_iterator > > &vertices_cell_map) |
| template<int dim> | |
| DoFHandler< dim >::active_cell_iterator | find_cell_around_point_with_tree (const DoFHandler< dim > &dof_handler, const Point< dim > &point) |
| template<int dim> | |
| DoFHandler< dim >::active_cell_iterator | find_cell_around_point_with_neighbors (const DoFHandler< dim > &dof_handler, std::map< unsigned int, std::set< typename DoFHandler< dim >::active_cell_iterator > > &vertices_cell_map, const typename DoFHandler< dim >::active_cell_iterator &cell, const Point< dim > &point) |
| template<int dim> | |
| std::vector< typename DoFHandler< dim >::active_cell_iterator > | find_cells_around_cell (std::map< unsigned int, std::set< typename DoFHandler< dim >::active_cell_iterator > > &vertices_cell_map, const typename DoFHandler< dim >::active_cell_iterator &cell) |
| template<int dim> | |
| std::vector< typename DoFHandler< dim >::active_cell_iterator > | find_cells_around_flat_cell (const DoFHandler< dim > &dof_handler, const typename DoFHandler< dim - 1, dim >::active_cell_iterator &cell, std::map< unsigned int, std::set< typename DoFHandler< dim >::active_cell_iterator > > &vertices_cell_map) |
| template<int dim> | |
| std::vector< typename DoFHandler< dim >::active_cell_iterator > | find_cells_around_edge (const DoFHandler< dim > &dof_handler, std::map< unsigned int, std::set< typename DoFHandler< dim >::active_cell_iterator > > &vertices_cell_map, const typename DoFHandler< dim >::active_cell_iterator &cell, Point< dim > &point_1, Point< dim > &point_2) |
| template<int dim> | |
| void | flag_cells_in_refinement_box (const DoFHandler< dim > &dof_handler, const Triangulation< dim > &box_triangulation) |
| template<int dim> | |
| std::vector< typename DoFHandler< dim >::active_cell_iterator > | find_cells_in_cells (const DoFHandler< dim > &dof_handler, const typename DoFHandler< dim >::active_cell_iterator &cell) |
| template<int dim> | |
| bool | cell_cut_by_flat (const typename DoFHandler< dim >::active_cell_iterator &cell, const typename DoFHandler< dim - 1, dim >::active_cell_iterator &cell_flat) |
| template<int dim> | |
| bool | cell_pierced_by_edge (const typename DoFHandler< dim >::active_cell_iterator &cell, const TriaIterator< CellAccessor< 1, dim > > &cell_edge) |
| template<int dim> | |
| bool | cell_pierced_by_edge (const typename DoFHandler< dim >::active_cell_iterator &cell, Point< dim > point_1, Point< dim > point_2) |
| template<int spacedim, int structdim> | |
| std::pair< std::pair< Point< spacedim >, bool >, Tensor< 1, spacedim > > | project_to_d_linear_object (const typename DoFHandler< structdim, spacedim >::active_cell_iterator &object, const Point< spacedim > &trial_point) |
| template<int dim> | |
| std::vector< typename DoFHandler< dim >::active_cell_iterator > | find_boundary_cells_in_sphere (const DoFHandler< dim > &dof_handler, const Point< dim > ¢er, const double radius) |
| template<int spacedim, int structdim> | |
| std::map< typename DoFHandler< spacedim >::active_cell_iterator, std::map< unsigned int, typename DoFHandler< structdim, spacedim >::active_cell_iterator > > | find_cells_cut_by_object (const DoFHandler< spacedim > &dof_handler, std::map< unsigned int, std::set< typename DoFHandler< spacedim >::active_cell_iterator > > &vertices_cell_map, std::vector< SerialSolid< structdim, spacedim > > &list_of_objects) |
| template<int dim> | |
| TriangleProjectionData< dim > | prepare_triangle_projection_data (const std::vector< Point< dim > > &triangle) |
| template<int dim> | |
| std::tuple< bool, Point< 3 >, Tensor< 1, 3 >, ParticleTriangleContactIndicator > | find_particle_triangle_projection (const TriangleProjectionData< dim > &triangle_data, const Point< dim > &particle_position, const double cutoff_distance) |
| template<int dim> | |
| double | find_point_triangle_distance (const std::vector< Point< dim > > &triangle_vertices, const Point< dim > &point) |
| template<int dim> | |
| std::vector< Point< dim > > | find_line_sphere_intersection (const Point< dim > &line_start, const Tensor< 1, dim > &line_direction, const Point< dim > &sphere_center, const double &sphere_diameter) |
| template<int dim> | |
| double | find_point_line_distance (const Point< dim > &line_origin, const Tensor< 1, dim > &line_direction, const Point< dim > &point) |
| template<int dim> | |
| Tensor< 1, dim > | angular_to_linear_velocity (const double omega, const Tensor< 1, dim > &point, const unsigned int rotation_axis_direction=2) |
| template<int dim> | |
| void | rotate_mapping (const DoFHandler< dim > &dof_handler, MappingQCache< dim > &mapping_cache, const Mapping< dim > &mapping, const double rotation_angle, const Point< dim > ¢er_of_rotation=Point< dim >(), const unsigned int rotation_axis_direction=2) |
| template<int dim, int spacedim> | |
| void | vertices_cell_mapping (const Triangulation< dim, spacedim > &tria, std::map< unsigned int, std::set< typename Triangulation< dim, spacedim >::active_cell_iterator > > &vertices_cell_map) |
| template<int dim, int spacedim = dim> | |
| std::vector< typename Triangulation< dim, spacedim >::active_cell_iterator > | find_cells_around_cell (std::map< unsigned int, std::set< typename Triangulation< dim, spacedim >::active_cell_iterator > > &vertices_cell_map, const typename Triangulation< dim, spacedim >::active_cell_iterator &cell) |
|
strong |
Indicates the type of contact between a particle and a triangle.
| Enumerator | |
|---|---|
| face_contact | |
| edge_contact | |
| vertex_contact | |
| no_contact | |
Definition at line 289 of file lethe_grid_tools.h.
|
inline |
Transform angular velocity into linear velocity considering that the angular velocity omega is constant in all directions.
| [in] | omega | Angular velocity value |
| [in] | point | Coordinates of the point at which the linear velocity is being calculated |
| [in] | rotation_axis_direction | Direction of the rotation axis. In 2D, we apply a rotation around the z-axis. |
point Definition at line 490 of file lethe_grid_tools.h.
| bool LetheGridTools::cell_cut_by_flat | ( | const typename DoFHandler< dim >::active_cell_iterator & | cell, |
| const typename DoFHandler< dim - 1, dim >::active_cell_iterator & | cell_flat ) |
Return a bool that indicates if a cell is cut by a flat cell.
| cell | The cell that we want to check. |
| cell_flat | The cell that describes the flat. |
Definition at line 792 of file lethe_grid_tools.cc.
References cell_pierced_by_edge(), and project_to_d_linear_object().
| bool LetheGridTools::cell_pierced_by_edge | ( | const typename DoFHandler< dim >::active_cell_iterator & | cell, |
| const TriaIterator< CellAccessor< 1, dim > > & | cell_edge ) |
Return a bool that say if a cell is cut by a edge cell.
| cell | The cell that we want to check. |
| cell_edge | The cell that describes the edge. |
Definition at line 430 of file lethe_grid_tools.cc.
| bool LetheGridTools::cell_pierced_by_edge | ( | const typename DoFHandler< dim >::active_cell_iterator & | cell, |
| Point< dim > | point_1, | ||
| Point< dim > | point_2 ) |
Return a bool that say if a cell is cut by a edge cell.
| cell | The cell that we want to check. |
| point_1 | The first point that describes the edge |
| point_2 | The second point that describes the edge |
Definition at line 531 of file lethe_grid_tools.cc.
References cell_pierced_by_edge().
| std::vector< typename DoFHandler< dim >::active_cell_iterator > LetheGridTools::find_boundary_cells_in_sphere | ( | const DoFHandler< dim > & | dof_handler, |
| const Point< dim > & | center, | ||
| const double | radius ) |
Function returns all the boundary cells with at least one vertex in a sphere.
| dof_handler | the dof handler containing all the elements. |
| center | The center of the sphere. |
| radius | The radius of the sphere. |
Definition at line 253 of file lethe_grid_tools.cc.
| DoFHandler< dim >::active_cell_iterator LetheGridTools::find_cell_around_point_with_neighbors | ( | const DoFHandler< dim > & | dof_handler, |
| std::map< unsigned int, std::set< typename DoFHandler< dim >::active_cell_iterator > > & | vertices_cell_map, | ||
| const typename DoFHandler< dim >::active_cell_iterator & | cell, | ||
| const Point< dim > & | point ) |
Return the cell around a point based on an initial guess of a nearby cell.
| cell | The initial cell. We suspect that the point is in one of the neighbours of this cell. |
| point | The point around which we want to find the cell. |
| vertices_cell_map | see vertices_cell_mapping function description. |
Definition at line 340 of file lethe_grid_tools.cc.
References find_cell_around_point_with_tree(), and find_cells_around_cell().
| DoFHandler< dim >::active_cell_iterator LetheGridTools::find_cell_around_point_with_tree | ( | const DoFHandler< dim > & | dof_handler, |
| const Point< dim > & | point ) |
Return the cell around a point by starting from the least refined level and iterating over children.
| point | The point around which we want to find the cell. |
Definition at line 146 of file lethe_grid_tools.cc.
| std::vector< typename DoFHandler< dim >::active_cell_iterator > LetheGridTools::find_cells_around_cell | ( | std::map< unsigned int, std::set< typename DoFHandler< dim >::active_cell_iterator > > & | vertices_cell_map, |
| const typename DoFHandler< dim >::active_cell_iterator & | cell ) |
Return a vector of cells around a cell. The vector of cells includes all the cells that share a vertex with the initial cell, including the initial cell.
| cell | The initial cell. We want to know all the cells that share a vertex with this cell. |
| vertices_cell_map | see vertices_cell_mapping function description. |
Definition at line 367 of file lethe_grid_tools.cc.
| std::vector< typename Triangulation< dim, spacedim >::active_cell_iterator > LetheGridTools::find_cells_around_cell | ( | std::map< unsigned int, std::set< typename Triangulation< dim, spacedim >::active_cell_iterator > > & | vertices_cell_map, |
| const typename Triangulation< dim, spacedim >::active_cell_iterator & | cell ) |
Return a vector of cells around a cell. This vector includes all the cells that share a vertex with the initial cell, including the initial cell.
| cell | The initial cell. We want to know all the cells that share a vertex with this cell. |
| vertices_cell_map | Map of vertex ids to the set of neighbor cells. |
Definition at line 1916 of file lethe_grid_tools.cc.
| std::vector< typename DoFHandler< dim >::active_cell_iterator > LetheGridTools::find_cells_around_edge | ( | const DoFHandler< dim > & | dof_handler, |
| std::map< unsigned int, std::set< typename DoFHandler< dim >::active_cell_iterator > > & | vertices_cell_map, | ||
| const typename DoFHandler< dim >::active_cell_iterator & | cell, | ||
| Point< dim > & | point_1, | ||
| Point< dim > & | point_2 ) |
Return a vector of cells around an edge cell in spacedim. An edge cell as a dim of 1.
| point_1 | The first point that describes the edge |
| point_2 | The second point that describes the edge |
| vertices_cell_map | see vertices_cell_mapping function description. |
Definition at line 683 of file lethe_grid_tools.cc.
References cell_pierced_by_edge(), find_cell_around_point_with_tree(), find_cells_around_cell(), and find_cells_around_flat_cell().
| std::vector< typename DoFHandler< dim >::active_cell_iterator > LetheGridTools::find_cells_around_flat_cell | ( | const DoFHandler< dim > & | dof_handler, |
| const typename DoFHandler< dim - 1, dim >::active_cell_iterator & | cell, | ||
| std::map< unsigned int, std::set< typename DoFHandler< dim >::active_cell_iterator > > & | vertices_cell_map ) |
Return a vector of cells around a flat cell in spacedim. A flat cell has a dim of spacedim-1.
| cell | The cell that describes the flat. We want to know all the cells that are cut by the flat. |
| vertices_cell_map | see vertices_cell_mapping function description. |
Definition at line 914 of file lethe_grid_tools.cc.
References cell_cut_by_flat(), find_cell_around_point_with_tree(), and find_cells_around_cell().
| std::map< typename DoFHandler< spacedim >::active_cell_iterator, std::map< unsigned int, typename DoFHandler< structdim, spacedim >::active_cell_iterator > > LetheGridTools::find_cells_cut_by_object | ( | const DoFHandler< spacedim > & | dof_handler, |
| std::map< unsigned int, std::set< typename DoFHandler< spacedim >::active_cell_iterator > > & | vertices_cell_map, | ||
| std::vector< SerialSolid< structdim, spacedim > > & | list_of_objects ) |
Function returns all the cells cut by a list of object defined by a mesh.
| dof_handler | the dof handler containing all the elements. |
| vertices_cell_map | An objects that maps the vertices to cells. |
| list_of_objects | Solid objects |
Definition at line 993 of file lethe_grid_tools.cc.
References find_cells_around_flat_cell().
| std::vector< typename DoFHandler< dim >::active_cell_iterator > LetheGridTools::find_cells_in_cells | ( | const DoFHandler< dim > & | dof_handler, |
| const typename DoFHandler< dim >::active_cell_iterator & | cell ) |
Return a vector of cells from the dof_handler that are inside a cell from another mesh.
| cell | Describes the volume for which we want to obtain the enclosed cells. |
Definition at line 394 of file lethe_grid_tools.cc.
| std::vector< Point< dim > > LetheGridTools::find_line_sphere_intersection | ( | const Point< dim > & | line_start, |
| const Tensor< 1, dim > & | line_direction, | ||
| const Point< dim > & | sphere_center, | ||
| const double & | sphere_diameter ) |
Calculates the intersection points between a line and a sphere. The full calculation is taken from Geometric Tools for Computer Graphics, Eberly 2003 Chapter 11.3.2 - LINEAR COMPONENTS AND A SPHERE. The entire reference is available at: https://www.sciencedirect.com/science/article/pii/B978155860594750014X.
| [in] | line_start | The starting point of the line |
| [in] | line_direction | The direction of the line |
| [in] | sphere_center | The center of the sphere |
| [in] | sphere_diameter | The diameter of the sphere |
Definition at line 1725 of file lethe_grid_tools.cc.
| std::tuple< bool, Point< 3 >, Tensor< 1, 3 >, ParticleTriangleContactIndicator > LetheGridTools::find_particle_triangle_projection | ( | const TriangleProjectionData< dim > & | triangle_data, |
| const Point< dim > & | particle_position, | ||
| const double | cutoff_distance ) |
Finds the contact point between a triangle (defined using three vertices) and a particle center, the normal contact vector and the contact type. The particle center is first compared to the plane formed by the triangle. If the particle is farther from the plane than the defined cutoff distance, the function returns right away with a "pass_distance_check = false". Otherwise, the full contact point calculation is taken from Geometric Tools for Computer Graphics, Eberly 2003 Chapter 10.3.2 - Point to triangle. The entire reference is available at: https://www.sciencedirect.com/science/article/pii/B9781558605947500138 A full implementation of the above reference is also available here: https://www.geometrictools.com/Documentation/DistancePoint3Triangle3.pdf Variables name are taken straight from this reference to ensure a better readability.
| dim | An integer that denotes the number of spatial dimensions. |
| triangle_data | Precomputed particle-independent geometric data of the triangle, from prepare_triangle_projection_data. Reusing it across several particles tested against the same triangle avoids recomputing this triangle's edge vectors, normal and fundamental-form coefficients for each particle. |
| particle_position | Location of the particle center. |
| cutoff_distance | Largest distance between the particle center and the plane of the triangle for which the projection is calculated. |
|
inline |
Calculate the minimum distance between a point and a line (defined using its orign and direction). The full calculation is taken from Geometric Tools for Computer Graphics, Eberly 2003 Chapter 10.2 - Point to linear component. The entire reference is available at: https://www.sciencedirect.com/science/article/pii/B9781558605947500138 A full implementation of the above reference is also available here: https://www.geometrictools.com/Documentation/DistancePointLine.pdf Variables name are taken straight from this reference to ensure a better readability.
| [in] | line_origin | Origin of the line (any point on the line) |
| [in] | line_direction | Vector tangent to the line |
| [in] | point | A point for which we want to find the minimum distance to the line |
return distance
Definition at line 446 of file lethe_grid_tools.h.
| double LetheGridTools::find_point_triangle_distance | ( | const std::vector< Point< dim > > & | triangle_vertices, |
| const Point< dim > & | point ) |
Calculates the distance between points and a triangle (defined using three vertices). The full calculation is taken from Geometric Tools for Computer Graphics, Eberly 2003 Chapter 10.3.2 - Point to triangle. The entire reference is available at: https://www.sciencedirect.com/science/article/pii/B9781558605947500138 A full implementation of the above reference is also available here: https://www.geometrictools.com/Documentation/DistancePoint3Triangle3.pdf Variables name are taken straight from this reference to ensure a better readability.
| triangle_vertices | A vector of points that defines a triangle |
| point | A point for which we want to find the distance to the triangle |
Definition at line 1514 of file lethe_grid_tools.cc.
| void LetheGridTools::flag_cells_in_refinement_box | ( | const DoFHandler< dim > & | dof_handler, |
| const Triangulation< dim > & | box_triangulation ) |
Flag for refinement of all the cells of a triangulation which lie within a refinement box.
| [in] | dof_handler | The DoFHandler of the triangulation whose cells must be flagged. No dofs need to be distributed on it, since the search is purely geometric. |
| [in] | box_triangulation | The triangulation delimiting the refinement box, as built by build_refinement_box_triangulation() |
Definition at line 1973 of file lethe_grid_tools.cc.
References find_cells_in_cells().
| TriangleProjectionData< dim > LetheGridTools::prepare_triangle_projection_data | ( | const std::vector< Point< dim > > & | triangle | ) |
Precomputes the particle-independent geometric data of a triangle (see TriangleProjectionData) used by find_particle_triangle_projection.
| dim | An integer that denotes the number of spatial dimensions. |
| triangle | A vector of points that defines a triangle |
| std::pair< std::pair< Point< spacedim >, bool >, Tensor< 1, spacedim > > LetheGridTools::project_to_d_linear_object | ( | const typename DoFHandler< structdim, spacedim >::active_cell_iterator & | object, |
| const Point< spacedim > & | trial_point ) |
A copy of the project_to_d_linear from dealii that also outputs the normal of the flat.
| object | The flat or the edge. |
| trial_point | The point we project on the flat or edge |
Definition at line 562 of file lethe_grid_tools.cc.
| void LetheGridTools::rotate_mapping | ( | const DoFHandler< dim > & | dof_handler, |
| MappingQCache< dim > & | mapping_cache, | ||
| const Mapping< dim > & | mapping, | ||
| const double | rotation_angle, | ||
| const Point< dim > & | center_of_rotation = Point<dim>(), | ||
| const unsigned int | rotation_axis_direction = 2 ) |
Rotate the mapping according to the rotation angle in a rotor-stator configuration.
| [in] | dof_handler | DofHandler of the triangulation |
| [in,out] | mapping_cache | Rotated mapping |
| [in] | mapping | Current mapping |
| [in] | rotation_angle | Rotation angle of the rotor domain |
| [in] | center_of_rotation | Center of rotation of the rotor domain. Default is the origin |
| [in] | rotation_axis_direction | Direction of the rotation axis |
Definition at line 1787 of file lethe_grid_tools.cc.
| void LetheGridTools::vertices_cell_mapping | ( | const DoFHandler< dim > & | dof_handler, |
| std::map< unsigned int, std::set< typename DoFHandler< dim >::active_cell_iterator > > & | vertices_cell_map ) |
Map the vertex index to the cells that includes that vertex.
| dof_handler | DofHandler of the triangulation on which to create the map |
| vertices_cell_map | The map container of vertex ids with its set of neighbor cells |
Definition at line 22 of file lethe_grid_tools.cc.
| void LetheGridTools::vertices_cell_mapping | ( | const Triangulation< dim, spacedim > & | tria, |
| std::map< unsigned int, std::set< typename Triangulation< dim, spacedim >::active_cell_iterator > > & | vertices_cell_map ) |
Map the vertex index to the cells which include that vertex.
| tria | Triangulation |
| vertices_cell_map | The map container of vertex ids with its set of neighbor cells. |
Definition at line 1861 of file lethe_grid_tools.cc.
| void LetheGridTools::vertices_cell_mapping_with_periodic_boundaries | ( | const DoFHandler< dim > & | dof_handler, |
| std::map< unsigned int, std::set< typename DoFHandler< dim >::active_cell_iterator > > & | vertices_cell_map ) |
Map the vertex index to the cells on periodic boundaries that includes the periodic coinciding vertex.
| dof_handler | DofHandler of the triangulation on which to create the map |
| vertices_cell_map | The map of vertex ids at periodic boundary to the set of periodic neighbor cells |
Definition at line 53 of file lethe_grid_tools.cc.