Advanced Multi-Physics (AMP)
On-Line Documentation
DelaunayFaceList.h
Go to the documentation of this file.
1#ifndef included_AMP_DelaunayFaceList
2#define included_AMP_DelaunayFaceList
3
4#include <array>
5#include <cstdint>
6#include <stdint.h>
7#include <stdlib.h>
8#include <vector>
9
10#include "AMP/utils/DelaunayHelpers.h"
11#include "AMP/utils/extended_int.h"
12
13
15
16
24template<int NDIM>
26{
27public:
28 using Point = std::array<int, NDIM>;
29 using Triangle = std::array<int, NDIM + 1>;
30
40 FaceList( const int N, const Point *x, const int tri_id, const Triangle &tri );
41
43 int get_N_face() { return data.size(); }
44
61 void add_node( const int node_id,
62 std::vector<size_t> &unused,
63 size_t &N_tri,
64 std::vector<uint32_t> &new_tri_id,
65 std::vector<Triangle> &new_tri,
66 std::vector<Triangle> &new_tri_nab,
67 std::vector<int> &neighbor,
68 std::vector<int> &face_id );
69
70
72
88 void update_face( const int N,
89 const int old_tid[],
90 const int old_fid[],
91 const int new_tid[],
92 const int new_fid[],
93 const Triangle *tri );
94
95private:
96 static std::array<int64_t, NDIM> calc_surface_normal( const std::array<int, NDIM> x[] );
97
98private:
99 // Private constructors
100 FaceList(); // Empty constructor.
101 FaceList( const FaceList & ); // no implementation for copy
102 FaceList &operator=( const FaceList & ); // no implementation for copy
103
104 // Structure to store face information
106 int prev = -1;
107 int next = -1;
108 int tri_id = -1; // Triangle id
109 int face_id = -1; // Face id
110 int index[NDIM] = { -1 }; // Indicies of the face vertices
111 Point x[NDIM] = { { 0 } }; // Coordinates of the face vertices
112 };
113
114 // Data members
115 const int Nx; // The number of vertices
116 int hash_table[1024]; // Internal hash table to improve performance when search for a given face
117 const Point *x0; // The vertex coordinates
118 double xc[NDIM]; // A point within the centroid
119 std::vector<face_data_struct> data; // The stored data
120
121 // Function that determines the location of the triangle
122 bool outside_triangle( const Point *x, const Point &xi ) const;
123
124 // Function to get a unique index for each face
125 inline size_t get_face_index( int face, int tri ) { return face + tri * ( NDIM + 1 ); }
126
127 // Function to delete a set of faces
128 void delete_faces( std::vector<int> &ids );
129
130 // Function to check that the internal data is valid
132};
133
134} // namespace AMP::DelaunayTessellation
135
136#endif
static std::array< int64_t, NDIM > calc_surface_normal(const std::array< int, NDIM > x[])
void delete_faces(std::vector< int > &ids)
int get_N_face()
Function to get the number of faces on the convex hull.
bool outside_triangle(const Point *x, const Point &xi) const
std::array< int, NDIM+1 > Triangle
size_t get_face_index(int face, int tri)
void add_node(const int node_id, std::vector< size_t > &unused, size_t &N_tri, std::vector< uint32_t > &new_tri_id, std::vector< Triangle > &new_tri, std::vector< Triangle > &new_tri_nab, std::vector< int > &neighbor, std::vector< int > &face_id)
Function to add a node to the convex hull.
FaceList & operator=(const FaceList &)
std::vector< face_data_struct > data
void update_face(const int N, const int old_tid[], const int old_fid[], const int new_tid[], const int new_fid[], const Triangle *tri)
Function to update faces on the convex hull.
FaceList(const int N, const Point *x, const int tri_id, const Triangle &tri)
Standard constructor.
A class used to store information for a point.



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page