rsvs3D  0.0.0
Codes for the c++ implementation of the 3D RSVS
tetgenrsvs.hpp File Reference

Interface between the RSVS project and tetgen. More...

#include <algorithm>
#include <array>
#include <string>
#include <vector>
#include "mesh.hpp"
#include "tetgen.h"

Go to the source code of this file.

Classes

class  tetgen::io_safe
 Class for memory safe interface with tetgen.h. More...
 
class  tetgen::apiparam
 

Typedefs

typedef std::array< std::array< double, 3 >, 2 > tetgen::dombounds
 Type defining domain boundaries. More...
 

Functions

std::vector< int > tetgen::RSVSVoronoiMesh (const std::vector< double > &vecPts, mesh &vosMesh, mesh &snakMesh, tetgen::apiparam &inparam)
 Genrates Snaking and VOS RSVS meshes from the voronoi diagram of a set of points. More...
 
void tetgen::SnakeToSU2 (const snake &snakein, const std::string &fileName, tetgen::apiparam &inparam)
 Genrates an SU2 mesh file from a snake. More...
 
tetgenmesh * tetgen::rsvstetrahedralize (const char *switches, tetgen::io_safe *in, tetgen::io_safe *out, tetgen::io_safe *addin=NULL, tetgen::io_safe *bgmin=NULL)
 
void tetgen::input::POINTGRIDS (const mesh &meshdomain, tetgen::io_safe &tetin, const tetgen::apiparam &tetgenParam, bool generateVoroBound=false)
 
void tetgen::input::RSVSGRIDS (const mesh &meshdomain, tetgen::io_safe &tetin, const tetgen::apiparam &tetgenParam)
 
void tetgen::input::RSVSGRIDS (const mesh &meshdomain, const mesh &meshboundary, tetgen::io_safe &tetin, const tetgen::apiparam &tetgenParam)
 
void tetgen::input::RSVS2CFD (const snake &snakein, tetgen::io_safe &tetin, const tetgen::apiparam &tetgenParam)
 
mesh tetgen::output::VORO2MESH (tetgen::io_safe &tetout)
 
void tetgen::output::SU2 (const char *fileName, const tetgenio &tetout)
 
dombounds tetgen::output::GetBoundBox (io_safe &tetout)
 
mesh tetgen::output::TET2MESH (tetgen::io_safe &tetout)
 Translates a tetgen output to the RSVS native mesh format. More...
 
void tetgen::internal::CloseVoronoiMesh (mesh &meshout, tetgen::io_safe &tetout, std::vector< int > &rayEdges, int DEINCR, tetgen::dombounds boundBox)
 
template<class T , class V >
double tetgen::internal::ProjectRay (int count, const tetgen::dombounds &boundBox, const T &dir, const V &orig, double minDist=0.0)
 Project voronoi diagram rays to the bounding Box. More...
 
void tetgen::internal::MeshData2Tetgenio (const mesh &meshgeom, tetgen::io_safe &tetin, int facetOffset, int pointOffset, int pointMarker, const std::vector< double > &pointMtrList, const std::vector< double > &facetConstr, int facetConstrOffset)
 
void tetgen::internal::Mesh2Tetgenio (const mesh &meshgeom, const mesh &meshdomain, tetgen::io_safe &tetin, int numHoles)
 
void tetgen::internal::Mesh2TetgenioPoints (const mesh &meshgeom, const mesh &meshdomain, tetgen::io_safe &tetin)
 
void tetgen::internal::PointCurvature2Metric (std::vector< double > &vertCurvature, const tetgen::apiparam &inparam)
 
void tetgen::voronoi::GenerateInternalPoints (const mesh &meshin, int nLevels, tetgen::io_safe &tetinPts)
 Generate points inside volume cells of a mesh. More...
 
std::vector< bool > tetgen::voronoi::Points2VoroAndTetmesh (const std::vector< double > &vecPts, mesh &voroMesh, mesh &tetMesh, const tetgen::apiparam &inparam)
 
std::vector< bool > tetgen::voronoi::BoundaryFacesFromPoints (const mesh &meshin, const std::vector< int > &boundaryPts)
 
void tetgen::test::LoadData (mesh &snakeMesh, mesh &voluMesh, snake &snakein, mesh &triMesh)
 
int tetgen::test::api ()
 
int tetgen::test::call ()
 
int tetgen::test::CFD ()
 
int tetgen::test::RSVSVORO ()
 
int tetgen::test::RSVSVORO_Contain ()
 
int tetgen::test::RSVSVOROFunc (const std::vector< double > &vecPts={}, double distanceTol=0.26, const char *tecoutStr="../TESTOUT/rsvs_voro.plt")
 
int tetgen::test::RSVSVOROFunc_contain (int nPts=0, double distanceTol=0.26, const char *tecoutStr="../TESTOUT/rsvs_voro_contain.plt")
 
int Test_RSVSvoro_init ()
 

Detailed Description

Interface between the RSVS project and tetgen.

Definition in file tetgenrsvs.hpp.

Typedef Documentation

◆ dombounds

typedef std::array<std::array<double, 3>, 2> tetgen::dombounds

Type defining domain boundaries.

Simple short hand for a matrix of 2*3 doubles.

Definition at line 40 of file tetgenrsvs.hpp.

Function Documentation

◆ GenerateInternalPoints()

void tetgen::voronoi::GenerateInternalPoints ( const mesh meshin,
int  nLevels,
tetgen::io_safe tetinPts 
)

Generate points inside volume cells of a mesh.

Parameters
[in]meshinThe input mesh
[in]nLevelsThe number of layers of points in each cell.
tetinPtsA tetgen io object which can be passed directly to tetrahedralize ast he fourth input.

Definition at line 1176 of file tetgenrsvs.cpp.

◆ ProjectRay()

template<class T , class V >
double tetgen::internal::ProjectRay ( int  count,
const tetgen::dombounds boundBox,
const T &  dir,
const V &  orig,
double  minDist = 0.0 
)

Project voronoi diagram rays to the bounding Box.

Parameters
[in]countnumber of coordinates
[in]boundBoxThe bounds of the domain (array<array<double,3>,2>)
[in]dirvector with direction (pointing in)
[in]origThe origin of the ray
[in]minDistThe minimum allowable stretch distance
Template Parameters
Ttype of dir: an iterable of size count
Vtype of orig: an iterable of size count
Returns
Distance along the ray at which the boundBox is encountered.

Definition at line 252 of file tetgenrsvs.hpp.

◆ RSVSVoronoiMesh()

std::vector< int > tetgen::RSVSVoronoiMesh ( const std::vector< double > &  vecPts,
mesh vosMesh,
mesh snakMesh,
tetgen::apiparam inparam 
)

Genrates Snaking and VOS RSVS meshes from the voronoi diagram of a set of points.

Parameters
[in]vecPtsa vector of input points (3 coordinate) followed by a target volume fraction. Vecpts is a 1D vector with 4 values per point.
vosMeshThe vos mesh
snakMeshThe snaking mesh
inparamThe tetgen interface parameter at input.
Returns
Returns the mapping of the original points to the snake mesh volumes.

Definition at line 876 of file tetgenrsvs.cpp.

◆ SnakeToSU2()

void tetgen::SnakeToSU2 ( const snake snakein,
const std::string &  fileName,
tetgen::apiparam inparam 
)

Genrates an SU2 mesh file from a snake.

Uses tetgen to generate a volume mesh around a snake and outputs it to the SU2 format.

Parameters
[in]snakeinA snake which needs to be meshed
[in]fileNameThe file name
inparamtetgen interface parameter object. Used to define boundary growth rate and element sizes.

Definition at line 1017 of file tetgenrsvs.cpp.

◆ SU2()

void tetgen::output::SU2 ( const char *  fileName,
const tetgenio &  tetout 
)
 Ouputs a tetgen io object to an SU2 mesh file.

 File format: https://su2code.github.io/docs/Mesh-File/

 @param      fileName  is a string with the path to the target mesh

fileName

Parameters
tetoutis tetgenio object (safe)
Exceptions
invalid_argumentif fileName cannot be opened.

Definition at line 413 of file tetgenrsvs.cpp.

◆ TET2MESH()

mesh tetgen::output::TET2MESH ( tetgen::io_safe tetout)

Translates a tetgen output to the RSVS native mesh format.

Parameters
tetoutthe tetgenio object containing a mesh to be translated to the native RSVS mesh format.
Returns
mesh object containing the translated grid.
Exceptions
invalid_argumentif tetout was generated without passing the neighbour flag to tetgen (-nn)

Definition at line 1043 of file tetgenrsvs.cpp.