An abstract base class for SurfaceMesh, LineMesh, TetrahedralMesh, and HexahedralMesh would be nice. Something we've discussed for awhile. This would be a templated mesh class of Npts number of points per element. Each cell in a structured mesh has the same number of points. This class would mainly exists as a need to meta program with meshes. Most geometric libraries do something similar.
One simple use case is the abstract class "getCellWeights". Whose signature would look like:
Eigen::Vector<double, NumberOfPts, 1> getCellWeights(int cellId, const Vec3d& ptInCell);
Which would barycentric interpolate for a cell (triangle, tet, line, hexahedron, ...). Someone can then easily write a template function that works for any cell.
Also getTriangleIndices, getTetraIndices should all just be changed to getIndices in the base. This way someon can template over these classes and just use getIndices. Also consider renaming indices to cells. getCells()
Functions for the base class:
Eigen::Vector<double, NPts, 1> getCellWeights(int cellId, const Vec3d& ptInCell): Computes interpolation weights (usually barycentric) void getCellBounds(int cellId, Vec3d& min, Vec3d& max): Computes bounding box of a single cell double getCellVolume(int cellId): Computes the signed volume of a cell Eigen::Vector<int, NPts, 1> getCell(): Gets single cells indices std::shared_ptr<VecDataArray<int, NPts> getIndices(): Gets the cell indices void setIndices(std::shared_ptr<VecDataArray<int, NPts>> indices): Set the cell indices