![]() |
Vulpes
0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
|
Namespaces | |
| namespace | internal |
| Helpers implementing VulPoly's Voronoi construction and cleanup. | |
| namespace | dist2d |
| namespace | dist3d |
| namespace | mesh2d |
| namespace | mesh3d |
| namespace | vulpoly |
| VulPoly meshing options and algorithm parameters. | |
Classes | |
| class | AbstractAgglomerationModel |
| Defines an abstract interface for mesh agglomeration strategies. More... | |
| class | GNNAgglomeration |
| GNN-based agglomeration model (GraphSAGE via TorchScript). More... | |
| class | GNNGraph |
| Graph wrapper with Torch tensors for features and edges. More... | |
| class | KMeansAgglomeration |
| Agglomeration model that clusters cell barycenters with K-Means. More... | |
| class | ParmetisAgglomeration |
| Agglomeration model that delegates partitioning to ParMETIS. More... | |
| class | Cell2D |
| class | Cell3D |
| class | DistanceExpression |
| Template class representing a generic signed distance expression. More... | |
| class | UnionDistance |
| Represents the union of two signed distance functions. More... | |
| class | IntersectDistance |
| Represents the intersection of two signed distance functions. More... | |
| class | DifferenceDistance |
| Represents the difference of two signed distance functions. More... | |
| class | KMeansBase |
| Base class template for KMeans clustering algorithms. More... | |
| class | KMeansNaive |
| Implementation of the Lloyd algorithm (also known as the naive KMeans) for clustering. More... | |
| class | MappingBase |
| class | CartesianMapping |
| class | SimplexMapping |
| class | Mesh2D |
| A class for a 2D mesh, inheriting from MeshBase. More... | |
| class | Mesh3D |
| Represents a 3D mesh. More... | |
| struct | Metadata |
| A structure to store global metadata. More... | |
| struct | MeshTag |
| A structure to store tags for different parts of a mesh. More... | |
| class | MeshBase |
| A base class for creating and managing mesh data structures. More... | |
| struct | VtuOptions |
| Configuration options for VTU file export. More... | |
| class | MeshExporterBase |
| Base class for exporting a mesh to VTK file formats. More... | |
| class | MeshExporter |
| Exports a single mesh as a single VTK grid. More... | |
| class | MeshExporterSubmesh |
| Exports a mesh as multiple VTK grids, one for each cell. More... | |
| class | MeshMetrics |
| A class template that can be used to compute various mesh metrics (CircleRatio, AreaToPerimeterRatio, UniformityRatio, VolumeDifference). More... | |
| class | ParallelMesh |
| This class wraps a serial mesh class and adds attributes and methods for parallelization. More... | |
| class | Triangulation |
| Performs triangulation of a 2D cell using the Triangle library. More... | |
| class | Tetrahedralization |
| Performs tetrahedralization of a 3D cell using the TetGen library. More... | |
| class | Simplexify |
| A templated class that simplifies a geometric cell into simplices (triangles or tetrahedra). More... | |
Typedefs | |
| using | CellInitOptionsType = std::underlying_type_t<CellInitOptions> |
| template<std::size_t Dim, typename FloatType, typename IndexType, typename = std::enable_if_t<(Dim == 2) || (Dim == 3)>> | |
| using | Cell |
| using | MetricsInitOptionsType = std::underlying_type_t<MetricsInitOptions> |
| template<typename DataType, int Dim> | |
| using | Point = Eigen::Matrix<DataType, Dim, 1, Eigen::ColMajor> |
| template<int32_t Dim, typename = std::enable_if_t<(Dim == 2) || (Dim == 3)>> | |
| using | VoronoiCell |
| Alias for the Voronoi cell type based on the dimensionality (2D or 3D). | |
Enumerations | |
| enum | MethodType { BisectNRef , MultFactor , DirectKWay , SegregateBisection } |
| enum class | SAGEType { Base = 0 , Heterogeneous } |
| Variants of pretrained GraphSAGE models supported by this backend. More... | |
| enum class | KMeansAlgType : u_int32_t { Base } |
| K-Means algorithm types. More... | |
| enum | CellInitOptions : uint32_t { CellInitVtxOnly = 0ULL , CellInitNormals = (1ULL << 0ULL) , CellInitLocalMaps = (1ULL << 1ULL) , CellInitInverseMaps = (1ULL << 2ULL) , CellInitEdgeToCompute = (1ULL << 3ULL) , CellInitFaces = (1ULL << 4ULL) , CellInitBBox = (1ULL << 5ULL) , CellInitDiameter = (1ULL << 6ULL) , CellInitMeasure = (1ULL << 7ULL) , CellInitBarycenter = (1ULL << 8ULL) , CellInitFaceDiameter = (1ULL << 9ULL) , CellInitFaceKb = (1ULL << 10ULL) , CellInitInscribedDiameter = (1ULL << 11ULL) , CellInitAll = 0xFFFFFFFFUL } |
| enum | DataMode : std::uint8_t { Ascii = vtkXMLWriterBase::Ascii , Binary = vtkXMLWriterBase::Binary , Base64 = vtkXMLWriterBase::Appended } |
| Specifies the data mode for writing XML files. More... | |
| enum | CoordinatePrecision : std::uint8_t { Float32 = VTK_FLOAT , Float64 = VTK_DOUBLE } |
| Specifies the precision for point coordinates in VTU files. More... | |
| enum | MetricId : uint32_t { CircleRatioID = 0ULL , AreaPerimeterRatioID , UniformityFactorID , VolumeDifferenceID } |
| An enum that definies the indexes of various metrics in the global metrics array. More... | |
| enum | MetricsInitOptions : uint32_t { CircleRatio = (1ULL << CircleRatioID) , AreaPerimeterRatio = (1ULL << AreaPerimeterRatioID) , UniformityFactor = (1ULL << UniformityFactorID) , VolumeDifference = (1ULL << VolumeDifferenceID) , AllMetrics = 0xFFFFFFFFUL } |
| An enum that can be used to specify the metrics that we desire to be computed. More... | |
Functions | |
| template<typename FloatType, int32_t Dim, typename D1, typename D2> | |
| UnionDistance< FloatType, Dim, D1, D2 > | operator| (const DistanceExpression< FloatType, Dim, D1 > &u, const DistanceExpression< FloatType, Dim, D2 > &v) |
| Create a union of two signed distance functions. | |
| template<typename FloatType, int32_t Dim, typename D1, typename D2> | |
| IntersectDistance< FloatType, Dim, D1, D2 > | operator& (const DistanceExpression< FloatType, Dim, D1 > &u, const DistanceExpression< FloatType, Dim, D2 > &v) |
| Create an intersection of two signed distance functions. | |
| template<typename FloatType, int32_t Dim, typename D1, typename D2> | |
| DifferenceDistance< FloatType, Dim, D1, D2 > | operator- (const DistanceExpression< FloatType, Dim, D1 > &u, const DistanceExpression< FloatType, Dim, D2 > &v) |
| Create a difference of two distance functions. | |
| template<typename FloatType, int32_t Dim, typename D> | |
| auto | computeDistance (const Point< FloatType, Dim > &point, const DistanceExpression< FloatType, Dim, D > &distance_function) |
| Computes the signed distance between a point and a shape defined by a distance function. | |
| template<typename T, size_t Dim> | |
| Eigen::Matrix< T, Dim, Eigen::Dynamic > | centersRandomPointPick (const Eigen::Matrix< T, Dim, Eigen::Dynamic > &X, size_t K, int32_t seed=0) |
| template<typename T, int Dim> | |
| Eigen::Matrix< T, Dim, Eigen::Dynamic > | centersRandomPointPickMap (Eigen::Map< const Eigen::Matrix< T, Dim, Eigen::Dynamic > > X, size_t K, int32_t seed=0) |
| template<typename T, int Dim> | |
| Eigen::Matrix< T, Dim, Eigen::Dynamic > | centersKMeansPP (Eigen::Map< const Eigen::Matrix< T, Dim, Eigen::Dynamic > > X, size_t K, int32_t seed=0) |
| template<typename T, int Dim> | |
| Eigen::Matrix< T, Dim, Eigen::Dynamic > | centersMaximin (Eigen::Map< const Eigen::Matrix< T, Dim, Eigen::Dynamic > > X, size_t K, int32_t seed=0) |
| template<typename T, int Dim> | |
| std::vector< T > | computeClosestCtrToCtrDist (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &mat) |
| template<std::size_t Dim> | |
| Eigen::Array< double, Dim, 1 > | computePeriodicShift (const Eigen::Matrix< double, Dim, 2 > &curr_bbox, const Eigen::Matrix< double, Dim, 2 > &neigh_bbox, const Eigen::Array< double, Dim, 1 > &period) |
| Compute periodic shift between two cells based on bboxes. | |
| template<typename MeshType> | |
| void | exportMesh (const MeshType &mesh, const std::string &filename) |
| template<typename MeshDerived> | |
| bool | shouldModifyPeriodicMesh (const MeshDerived &mesh) |
| Determines if a periodic mesh should be modified for export. | |
| template<typename ScalarType, typename IndexType> | |
| Mesh2D< ScalarType, IndexType > | reopenPeriodicMeshForExport (const Mesh2D< ScalarType, IndexType > &mesh) |
| Reopens a closed 2D periodic mesh for export. | |
| void | voronoi2D (const std::array< Point< double, 2 >, 2 > &bbox, const std::vector< Point< double, 2 > > &points, const std::function< void(voro::voronoicell_neighbor_2d &cell, int32_t id)> &cell_callback) |
| Computes a 2D Voronoi tessellation for a given set of points within a bounding box. | |
| void | voronoi3D (const std::array< Point< double, 3 >, 2 > &bbox, const std::vector< Point< double, 3 > > &points, const std::function< void(voro::voronoicell_neighbor &cell, int32_t id)> &cell_callback) |
| Computes a 3D Voronoi tessellation for a given set of points within a bounding box. | |
| template<int32_t Dim, typename = std::enable_if_t<(Dim == 2) || (Dim == 3)>> | |
| void | voronoi (const std::array< Point< double, Dim >, 2 > &bbox, std::vector< Point< double, Dim > > &points, const std::function< void(VoronoiCell< Dim > &cell, int32_t id)> &cell_callback) |
| Computes a Voronoi tessellation in either 2D or 3D space. | |
| using vulpes::geometry::Cell |
| using vulpes::geometry::CellInitOptionsType = std::underlying_type_t<CellInitOptions> |
| using vulpes::geometry::MetricsInitOptionsType = std::underlying_type_t<MetricsInitOptions> |
| using vulpes::geometry::Point = Eigen::Matrix<DataType, Dim, 1, Eigen::ColMajor> |
| using vulpes::geometry::VoronoiCell |
Alias for the Voronoi cell type based on the dimensionality (2D or 3D).
This template alias defines the appropriate type of Voronoi cell (either 2D or 3D) based on the provided dimensionality Dim. For Dim == 2, it resolves to voro::voronoicell_neighbor_2d, and for Dim == 3, it resolves to voro::voronoicell_neighbor.
| Dim | Dimensionality of the Voronoi tessellation. Must be either 2 or 3. |
| enum vulpes::geometry::CellInitOptions : uint32_t |
| enum vulpes::geometry::CoordinatePrecision : std::uint8_t |
Specifies the precision for point coordinates in VTU files.
This enum defines different precision levels for storing point coordinates, which affects file size and geometric accuracy.
| enum vulpes::geometry::DataMode : std::uint8_t |
Specifies the data mode for writing XML files.
This enum defines different methods for storing data within a VTK XML file, which affects how the data is encoded and compressed.
| Enumerator | |
|---|---|
| Ascii | Data is written as plain text (ASCII). |
| Binary | Data is written as raw binary. |
| Base64 | Data is appended in a Base64-encoded format. This is generally the recommended mode for efficiency. |
|
strong |
| enum vulpes::geometry::MetricId : uint32_t |
| enum vulpes::geometry::MetricsInitOptions : uint32_t |
An enum that can be used to specify the metrics that we desire to be computed.
This enum can be used with the bitwise operator to specify the metrics we want the MeshMetrics object to compute. If we want to compute all the metrics we can use the AllMetrics value
| Enumerator | |
|---|---|
| CircleRatio | |
| AreaPerimeterRatio | |
| UniformityFactor | |
| VolumeDifference | |
| AllMetrics | |
|
strong |
| Eigen::Matrix< T, Dim, Eigen::Dynamic > vulpes::geometry::centersKMeansPP | ( | Eigen::Map< const Eigen::Matrix< T, Dim, Eigen::Dynamic > > | X, |
| size_t | K, | ||
| int32_t | seed = 0 ) |
| Eigen::Matrix< T, Dim, Eigen::Dynamic > vulpes::geometry::centersMaximin | ( | Eigen::Map< const Eigen::Matrix< T, Dim, Eigen::Dynamic > > | X, |
| size_t | K, | ||
| int32_t | seed = 0 ) |
| Eigen::Matrix< T, Dim, Eigen::Dynamic > vulpes::geometry::centersRandomPointPick | ( | const Eigen::Matrix< T, Dim, Eigen::Dynamic > & | X, |
| size_t | K, | ||
| int32_t | seed = 0 ) |
| Eigen::Matrix< T, Dim, Eigen::Dynamic > vulpes::geometry::centersRandomPointPickMap | ( | Eigen::Map< const Eigen::Matrix< T, Dim, Eigen::Dynamic > > | X, |
| size_t | K, | ||
| int32_t | seed = 0 ) |
| std::vector< T > vulpes::geometry::computeClosestCtrToCtrDist | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | mat | ) |
| auto vulpes::geometry::computeDistance | ( | const Point< FloatType, Dim > & | point, |
| const DistanceExpression< FloatType, Dim, D > & | distance_function ) |
Computes the signed distance between a point and a shape defined by a distance function.
This function takes a point and a distance function (which conforms to the DistanceExpression interface) and computes the distance from the point to the shape represented by the distance function. The result is stored in a buffer and returned as a std::array of distances.
| FloatType | The type of floating-point value used for distance computation (e.g., float, double). |
| Dim | The dimensionality of the space (e.g., 2 for 2D, 3 for 3D). |
| D | The type of the distance function, which must inherit from DistanceExpression<FloatType, Dim, D>. |
| point | The point for which the distance to the shape is to be computed. |
| distance_function | The distance function object representing the shape. |
|
inline |
Compute periodic shift between two cells based on bboxes.
| Dim | Spatial dimension |
| curr_bbox | Bounding box of current cell (dim x 2: [min, max]) |
| neigh_bbox | Bounding box of neighbor cell (dim x 2: [min, max]) |
| period | Period in each dimension (0.0 = not periodic) |
Detects if neighbor cell is a periodic wrap by checking if center distance > period/2. Returns +/- period (in physical coordinates) for each wrapped dimension. The caller should apply jacobian_neigh_inv transformation to convert to neighbor ref space.
| void vulpes::geometry::exportMesh | ( | const MeshType & | mesh, |
| const std::string & | filename ) |
| IntersectDistance< FloatType, Dim, D1, D2 > vulpes::geometry::operator& | ( | const DistanceExpression< FloatType, Dim, D1 > & | u, |
| const DistanceExpression< FloatType, Dim, D2 > & | v ) |
Create an intersection of two signed distance functions.
| FloatType | The type of floating-point value. |
| Dim | The dimensionality of the space. |
| D1 | The first distance function. |
| D2 | The second distance function. |
| u | The first distance function object. |
| v | The second distance function object. |
| DifferenceDistance< FloatType, Dim, D1, D2 > vulpes::geometry::operator- | ( | const DistanceExpression< FloatType, Dim, D1 > & | u, |
| const DistanceExpression< FloatType, Dim, D2 > & | v ) |
Create a difference of two distance functions.
| FloatType | The type of floating-point value. |
| Dim | The dimensionality of the space. |
| D1 | The first distance function. |
| D2 | The second distance function. |
| u | The first distance function object. |
| v | The second distance function object. |
| UnionDistance< FloatType, Dim, D1, D2 > vulpes::geometry::operator| | ( | const DistanceExpression< FloatType, Dim, D1 > & | u, |
| const DistanceExpression< FloatType, Dim, D2 > & | v ) |
Create a union of two signed distance functions.
| FloatType | The type of floating-point value. |
| Dim | The dimensionality of the space. |
| D1 | The first distance function. |
| D2 | The second distance function. |
| u | The first distance function object. |
| v | The second distance function object. |
| Mesh2D< ScalarType, IndexType > vulpes::geometry::reopenPeriodicMeshForExport | ( | const Mesh2D< ScalarType, IndexType > & | mesh | ) |
Reopens a closed 2D periodic mesh for export.
This function creates a copy of the input mesh and reopens its periodic topology by restoring ghost cells. Only called for 2D periodic meshes that are in the closed state.
| ScalarType | The scalar type of the mesh (typically double). |
| IndexType | The index type of the mesh. |
| mesh | The closed periodic 2D mesh to reopen. |
| bool vulpes::geometry::shouldModifyPeriodicMesh | ( | const MeshDerived & | mesh | ) |
Determines if a periodic mesh should be modified for export.
A 2D mesh should be modified if it is a closed periodic mesh that would benefit from reopening for better visualization. Checks if the mesh is periodic and in the closed state (has MeshPeriodicTopologyClosed = 1).
| MeshDerived | The derived mesh class. |
| mesh | The mesh to check. |
| void vulpes::geometry::voronoi | ( | const std::array< Point< double, Dim >, 2 > & | bbox, |
| std::vector< Point< double, Dim > > & | points, | ||
| const std::function< void(VoronoiCell< Dim > &cell, int32_t id)> & | cell_callback ) |
Computes a Voronoi tessellation in either 2D or 3D space.
This function is a general wrapper that selects between 2D and 3D Voronoi tessellation based on the template parameter Dim. It calls either voronoi2D or voronoi3D internally.
| Dim | Dimensionality of the Voronoi tessellation. Must be either 2 or 3. |
| bbox | A bounding box defined by two corner points. The array should contain two Point<double, Dim> values representing the corners of the bounding box. |
| points | A vector of Point<double, Dim> representing the coordinates of the points for which the Voronoi diagram is to be computed. |
| cell_callback | A function callback that is invoked for each generated Voronoi cell. The callback function takes two parameters: the generated VoronoiCell<Dim> and an integer representing the ID of the cell. |
| void vulpes::geometry::voronoi2D | ( | const std::array< Point< double, 2 >, 2 > & | bbox, |
| const std::vector< Point< double, 2 > > & | points, | ||
| const std::function< void(voro::voronoicell_neighbor_2d &cell, int32_t id)> & | cell_callback ) |
Computes a 2D Voronoi tessellation for a given set of points within a bounding box.
This function utilizes the Voro++ library to generate Voronoi cells in a 2D space. Each generated Voronoi cell is passed to the provided callback function for further processing.
| bbox | A bounding box defined by two corner points. The array should contain two Point<double, 2> values representing the lower-left and upper-right corners. |
| points | A vector of Point<double, 2> representing the coordinates of the points for which the Voronoi diagram is to be computed. |
| cell_callback | A function callback that is invoked for each generated Voronoi cell. The callback function takes two parameters: the generated voro::voronoicell_neighbor_2d and an integer representing the ID of the cell. |
| void vulpes::geometry::voronoi3D | ( | const std::array< Point< double, 3 >, 2 > & | bbox, |
| const std::vector< Point< double, 3 > > & | points, | ||
| const std::function< void(voro::voronoicell_neighbor &cell, int32_t id)> & | cell_callback ) |
Computes a 3D Voronoi tessellation for a given set of points within a bounding box.
This function utilizes the Voro++ library to generate Voronoi cells in a 3D space. Each generated Voronoi cell is passed to the provided callback function for further processing.
| bbox | A bounding box defined by two corner points. The array should contain two Point<double, 3> values representing the lower-front-left and upper-back-right corners. |
| points | A vector of Point<double, 3> representing the coordinates of the points for which the Voronoi diagram is to be computed. |
| cell_callback | A function callback that is invoked for each generated Voronoi cell. The callback function takes two parameters: the generated voro::voronoicell_neighbor and an integer representing the ID of the cell. |