Skip to content

Commit

Permalink
Merge pull request #62 from ctlee/curvature_export
Browse files Browse the repository at this point in the history
Support for custom region points and mean curvature export in BlendGAMer
  • Loading branch information
ctlee authored Nov 15, 2023
2 parents 56ebb81 + e763a2e commit f684c67
Show file tree
Hide file tree
Showing 18 changed files with 301 additions and 20,473 deletions.
14 changes: 10 additions & 4 deletions include/gamer/SurfaceMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#pragma once

#include <iostream>
#include <limits>
#include <memory>
#include <stdexcept>
#include <string>
Expand Down Expand Up @@ -52,6 +53,8 @@ struct SMGlobal {
bool useVolumeConstraint;
/// Flag that determines if the mesh represents a hole or not
bool ishole;
/// Region point
Eigen::Vector3d regionPoint;

/**
* @brief Default constructor
Expand All @@ -65,7 +68,10 @@ struct SMGlobal {
SMGlobal(int marker = -1, float volumeConstraint = -1,
bool useVolumeConstraint = false, bool ishole = false)
: marker(marker), volumeConstraint(volumeConstraint),
useVolumeConstraint(useVolumeConstraint), ishole(ishole) {}
useVolumeConstraint(useVolumeConstraint), ishole(ishole),
regionPoint(std::numeric_limits<double>::max(),
std::numeric_limits<double>::max(),
std::numeric_limits<double>::max()) {}
};

struct SMVertex : Vertex {
Expand Down Expand Up @@ -545,7 +551,7 @@ void selectFlipEdges(
// faces. "
// << "Returning..." << std::endl;
gamer_runtime_error("SurfaceMesh is not pseudomanifold. Found "
"an edge connected to more than 2 faces.");
"an edge connected to more than 2 faces.");
} else if (up.size() < 2) // Edge is a boundary
{
// std::cerr << "This edge participates in fewer than 2
Expand Down Expand Up @@ -1102,9 +1108,9 @@ std::vector<std::unique_ptr<SurfaceMesh>> splitSurfaces(SurfaceMesh &mesh);

/**
* @brief Cache face and vertex normals
*
*
* A zero vector normal will be stored instead of raising an error
*
*
* @param mesh Surface mesh of interest
*/
void cacheNormals(SurfaceMesh &mesh);
Expand Down
23 changes: 22 additions & 1 deletion include/gamer/TetMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct TMVertexProperties {
struct TMVertex : Vertex, TMVertexProperties {
TMVertex() : TMVertex(Vertex(), TMVertexProperties()) {}
template <typename... Args>
TMVertex(Args &&... args) : TMVertex(Vertex(std::forward<Args>(args)...)) {}
TMVertex(Args &&...args) : TMVertex(Vertex(std::forward<Args>(args)...)) {}
TMVertex(Vertex v) : TMVertex(v, TMVertexProperties(-1)) {}
TMVertex(Vertex v, TMVertexProperties p) : Vertex(v), TMVertexProperties(p) {}

Expand Down Expand Up @@ -323,6 +323,16 @@ makeTetMesh(const std::vector<SurfaceMesh const *> &surfmeshes,
*/
std::unique_ptr<SurfaceMesh> extractSurface(const TetMesh &mesh);

/**
* @brief Extracts the boundary surfaces of a tetrahedral mesh from
* boundary markers
*
* @param[in] mesh The mesh
*
* @return Bounding surface meshes
*/
std::unique_ptr<SurfaceMesh> extractSurfaceFromBoundary(const TetMesh &mesh);

/**
* @brief Laplacian smoothing of tetrahedral mesh
*
Expand Down Expand Up @@ -382,4 +392,15 @@ void writeTriangle(const std::string &filename, const TetMesh &mesh);
* @return Tetrahedral mesh
*/
std::unique_ptr<TetMesh> readDolfin(const std::string &filename);

/**
* @brief Compute curvatures and write them to dolfin file
*
* @param filename The filename
* @param mesh The mesh
* @param tetmesh Tetrahedral mesh
*/
void curvatureMDSBtoDolfin(const std::string &filename, const SurfaceMesh &mesh,
const TetMesh &tetmesh);

} // end namespace gamer
2 changes: 1 addition & 1 deletion libraries/tetgen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.5)

project(Tetgen VERSION 1.6.0)

Expand Down
62 changes: 0 additions & 62 deletions libraries/triangle/A.poly

This file was deleted.

99 changes: 0 additions & 99 deletions libraries/triangle/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit f684c67

Please sign in to comment.