1.5.1
CCC
 
Delaunay.cpp File Reference
#include "Basic/Utilities.hpp"
#include "Db/Db.hpp"
#include "Db/DbGrid.hpp"
#include "Mesh/AMesh.hpp"
#include "Mesh/MeshEStandard.hpp"
#include "Mesh/Delaunay.hpp"
#include "Core/io.hpp"
#include <math.h>
#include <stdio.h>

Functions

int MSS (int ndim, int ipol, int icas, int icorn, int idim)
 
VectorDouble extend_grid (DbGrid *db, const VectorDouble &gext, int *nout)
 
VectorDouble extend_point (Db *db, const VectorDouble &gext, int *nout)
 
VectorDouble get_db_extension (Db *dbin, Db *dbout, int *nout)
 
static int st_load_segment (DbGrid *dbgrid, VectorInt &mesh, VectorInt &order, int ipos, int ix1, int ix2)
 
static int st_load_triangle (DbGrid *dbgrid, VectorInt &mesh, VectorInt &order, int ipos, int ix1, int iy1, int ix2, int iy2, int ix3, int iy3)
 
static int st_load_tetra (DbGrid *dbgrid, VectorInt &mesh, VectorInt &order, int ipos, int ix1, int iy1, int iz1, int ix2, int iy2, int iz2, int ix3, int iy3, int iz3, int ix4, int iy4, int iz4)
 
static MeshEStandardst_ultimate_regular_grid (Db *dbgrid, int ndim, int nmesh, int ncorner, VectorInt &meshes, VectorInt &order)
 
AMeshmeshes_turbo_2D_grid_build (DbGrid *dbgrid)
 
int meshes_2D_write (const char *file_name, const char *obj_name, int verbose, int ndim, int ncode, int ntri, int npoints, const VectorInt &ntcode, const VectorInt &triangles, const VectorDouble &points)
 
void mesh_stats (int ndim, int ncorner, int nmesh, const int *meshes, const double *points)
 
AMeshmeshes_turbo_3D_grid_build (DbGrid *dbgrid)
 
AMeshmeshes_turbo_1D_grid_build (DbGrid *dbgrid)
 

Function Documentation

◆ extend_grid()

VectorDouble extend_grid ( DbGrid db,
const VectorDouble gext,
int *  nout 
)

Extend a Grid by gext

Returns
The coordinates of the extension points (Dimension: number * ndim)
Parameters
[in]dbOutput Db grid structure
[in]gextArray of domain dilation
[out]noutNumber of extension points
Remarks
The returned array 'ext' must be freed by the calling function

◆ extend_point()

VectorDouble extend_point ( Db db,
const VectorDouble gext,
int *  nout 
)

Extend a Point Domain by gext

Returns
The coordinates of the extension points (Dimension: number * ndim)
Parameters
[in]dbOutput Db grid structure
[in]gextArray of domain dilation
[out]noutNumber of extension points
Remarks
The returned array 'ext' must be freed by the calling function

◆ get_db_extension()

VectorDouble get_db_extension ( Db dbin,
Db dbout,
int *  nout 
)

Define the maximum extension between dbin and/or dbout

Returns
Array of extensions
Parameters
[in]dbinDb input (optional)
[in]dboutDb output (optional)
[out]noutNumber of extension points
Remarks
The calling function must free the returned array 'ext'
with its dimension: ndim * 2^ndim

◆ mesh_stats()

void mesh_stats ( int  ndim,
int  ncorner,
int  nmesh,
const int *  meshes,
const double *  points 
)

Calculate the statistics on a set of meshes

Parameters
[in]ndimSpace dimension
[in]ncornerNumber of corners for each mesh
[in]nmeshNumber of meshes
[in]meshesArray of vertex indices for each mesh
[in]pointsArray of 'ndim' coordinates for mesh vertex

◆ meshes_2D_write()

int meshes_2D_write ( const char *  file_name,
const char *  obj_name,
int  verbose,
int  ndim,
int  ncode,
int  ntri,
int  npoints,
const VectorInt ntcode,
const VectorInt triangles,
const VectorDouble points 
)

Dump the contents of a triangulation in an ASCII file according to the STL format

Parameters
[in]file_nameNmae of the created ASCII file
[in]obj_nameName assigned to the object
[in]verboseVerbose flag
[in]ndimSpace dimension
[in]ncodeNumber of different codes
[in]ntriNumber of triangles (expected)
[in]npointsNumber of poins (expected)
[in]ntcodeArray of number of triangles per code
[in]trianglesArray of vertex indices for each triangle
[in]pointsArray of 3-D coordinates for triangle vertices

◆ meshes_turbo_1D_grid_build()

AMesh* meshes_turbo_1D_grid_build ( DbGrid dbgrid)

Build the regular meshing from a 1-D grid

Returns
The newly created AMesh structure
Parameters
[in]dbgridDb structure

◆ meshes_turbo_2D_grid_build()

AMesh* meshes_turbo_2D_grid_build ( DbGrid dbgrid)

Build the regular 2-D grid meshing

Returns
Pointer to the newly created AMesh structure
Parameters
[in]dbgridDb structure

◆ meshes_turbo_3D_grid_build()

AMesh* meshes_turbo_3D_grid_build ( DbGrid dbgrid)

Build the regular 3-D grid meshing

Returns
Pointer to the newly created AMesh structure
Parameters
[in]dbgridDb structure

◆ MSS()

int MSS ( int  ndim,
int  ipol,
int  icas,
int  icorn,
int  idim 
)

Returns the shift value for the apex('icorn')

Returns
Shift value
Parameters
[in]ndimSpace dimension (1, 2 or 3)
[in]ipolRank of the polarization (starting from 0)
[in]icasRank of the case (starting from 0)
[in]icornRank of the corner (starting from 0)
[in]idimRank of the coordinate (starting from 0)
Remarks
This function returns the shift value to be applied to each
coordinate index, for each apex for each mesh which constitutes
the partition of a cell into meshes (using Turbo facility)
When 'ndim' is provided as negative, a special case is programmed

◆ st_load_segment()

static int st_load_segment ( DbGrid dbgrid,
VectorInt mesh,
VectorInt order,
int  ipos,
int  ix1,
int  ix2 
)
static

Load the vertices in a segment and check if the segment is masked

Returns
1 If the segment is valid because at least one vertex is active
Parameters
[in]dbgridDb structure
[in]iposPosition of newly created mesh information
[in]ix1Grid index along X for the vertex #1
[in]ix2Grid index along X for the vertex #2
[out]meshArray of triangle ranks (dimension = 3)
[out]orderArray of relative ranks
Remarks
The values in 'order' are the absolute indices (starting from 1),
negative if the grid node is masked off

◆ st_load_tetra()

static int st_load_tetra ( DbGrid dbgrid,
VectorInt mesh,
VectorInt order,
int  ipos,
int  ix1,
int  iy1,
int  iz1,
int  ix2,
int  iy2,
int  iz2,
int  ix3,
int  iy3,
int  iz3,
int  ix4,
int  iy4,
int  iz4 
)
static

Load the vertices in a tetrahedron and check if the tetrahedron is masked

Returns
1 If the tetrahedron is valid because at least one vertex is active
Parameters
[in]dbgridDb structure
[in]meshArray of triangle ranks (dimension = 4)
[in]orderArray of relative ranks
[in]iposPosition of newly created mesh information
[in]ix1Grid index along X for the vertex #1
[in]iy1Grid index along Y for the vertex #1
[in]iz1Grid index along Z for the vertex #1
[in]ix2Grid index along X for the vertex #2
[in]iy2Grid index along Y for the vertex #2
[in]iz2Grid index along Z for the vertex #2
[in]ix3Grid index along X for the vertex #3
[in]iy3Grid index along Y for the vertex #3
[in]iz3Grid index along Z for the vertex #3
[in]ix4Grid index along X for the vertex #4
[in]iy4Grid index along Y for the vertex #4
[in]iz4Grid index along Z for the vertex #4
Remarks
The values in 'order' are the absolute indices (starting from 1),
negative if the grid node is masked off

◆ st_load_triangle()

static int st_load_triangle ( DbGrid dbgrid,
VectorInt mesh,
VectorInt order,
int  ipos,
int  ix1,
int  iy1,
int  ix2,
int  iy2,
int  ix3,
int  iy3 
)
static

Load the vertices in a triangle and check if the triangle is masked

Returns
1 If the triangle is valid because at least one vertex is active
Parameters
[in]dbgridDb structure
[in]iposPosition of newly created mesh information
[in]ix1Grid index along X for the vertex #1
[in]iy1Grid index along Y for the vertex #1
[in]ix2Grid index along X for the vertex #2
[in]iy2Grid index along Y for the vertex #2
[in]ix3Grid index along X for the vertex #3
[in]iy3Grid index along Y for the vertex #3
[out]meshArray of triangle ranks (dimension = 3)
[out]orderArray of relative ranks
Remarks
The values in 'order' are the absolute indices (starting from 1),
negative if the grid node is masked off

◆ st_ultimate_regular_grid()

static MeshEStandard* st_ultimate_regular_grid ( Db dbgrid,
int  ndim,
int  nmesh,
int  ncorner,
VectorInt meshes,
VectorInt order 
)
static

Perform the ultimate task for the regular grid

Returns
Pointer to the newly created MeshEStandard structure
Parameters
[in]dbgridDb structure
[in]ndimSpace dimension
[in]nmeshCurrent number of meshes
[in]ncornerNumber of corner per mesh
[in]meshesInitial array of meshes
[in]orderArray of relative ranks