Poster of Linux kernelThe best gift for a Linux geek
TetGenWrapper

TetGenWrapper

Section: C Library Functions (3) Updated: Thu Apr 7 2011
Local index Up
 

NAME

TetGenWrapper -  

SYNOPSIS


#include <mesh_tetgen_support.h>  

Public Member Functions


TetGenWrapper ()

~TetGenWrapper ()

void set_switches (const std::string &s)

void run_tetgen ()

int get_numberoftetrahedra ()

int get_numberoftrifaces ()

void set_numberofpoints (const int i)

int get_numberofpoints ()

void set_numberoffacets (const int i)

void set_numberofholes (const int i)

void set_numberofregions (const int i)

void set_pointlist (const int numofpoints)

void set_facetlist (const int numoffacets, const int numofholes)

void set_regionlist (const int numofregions)

void set_node (const int i, const REAL x, const REAL y, const REAL z)

void get_output_node (const int i, REAL &x, REAL &y, REAL &z)

int get_element_node (const int i, const int j)

int get_triface_node (const int i, const int j)

REAL get_element_attribute (const int i)

void set_hole (const int i, const REAL x, const REAL y, const REAL z)

void set_facet_numberofpolygons (const int i, const int num)

void set_facet_numberofholes (const int i, const int num)

void set_facet_polygonlist (const int i, const int numofpolygons)

void set_polygon_numberofvertices (const int i, const int j, const int num)

void set_polygon_vertexlist (const int i, const int j, const int numofvertices)

void set_vertex (const int i, const int j, const int k, const int nodeindex)

void set_region (const int i, const REAL x, const REAL y, const REAL z, const REAL attribute, const REAL vol_constraint)
 

Public Attributes


tetgenio tetgen_data

tetgenio * tetgen_output

tetgenmesh tetgen_mesh

tetgenbehavior tetgen_be
 

Detailed Description

Abstract class TetGenWrapper provides an interface for basic access to TetGen data structures and methods.

Definition at line 47 of file mesh_tetgen_support.h.  

Constructor & Destructor Documentation

 

TetGenWrapper::TetGenWrapper ()Constructor.

Definition at line 37 of file mesh_tetgen_support.C.

References tetgen_data, and tetgen_output.

{
  tetgen_output = new tetgenio;

  this->tetgen_data.mesh_dim                = 3;
  this->tetgen_data.numberofpointattributes = 0;
  this->tetgen_data.firstnumber             = 0;
}
 

TetGenWrapper::~TetGenWrapper ()Destructor. Empty.

Definition at line 48 of file mesh_tetgen_support.C.

References tetgen_output.

{
  delete tetgen_output;
}
 

Member Function Documentation

 

REAL TetGenWrapper::get_element_attribute (const inti)Method returns attribute of element i in TetGen output.

Definition at line 126 of file mesh_tetgen_support.C.

References tetgen_output.

{
  libmesh_assert(tetgen_output->numberoftetrahedronattributes>0);
  return tetgen_output->tetrahedronattributelist[tetgen_output->numberoftetrahedronattributes*i];
}
 

int TetGenWrapper::get_element_node (const inti, const intj)Method returns index of jth node from element i in TetGen output.

Definition at line 112 of file mesh_tetgen_support.C.

References tetgen_output.

Referenced by TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), and TetGenMeshInterface::triangulate_pointset().

{
  return tetgen_output->tetrahedronlist[i*4+j];
}
 

int TetGenWrapper::get_numberofpoints ()Method returns number of nodes in TetGen output.

Definition at line 105 of file mesh_tetgen_support.C.

References tetgen_output.

Referenced by TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole().

{
  return tetgen_output->numberofpoints;
}
 

int TetGenWrapper::get_numberoftetrahedra ()Method returns number of tetrahedra in TetGen output.

Definition at line 91 of file mesh_tetgen_support.C.

References tetgen_output.

Referenced by TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), and TetGenMeshInterface::triangulate_pointset().

{
  return tetgen_output->numberoftetrahedra;
}
 

int TetGenWrapper::get_numberoftrifaces ()Method returns number of triangle surface elts. in TetGen output.

Definition at line 98 of file mesh_tetgen_support.C.

References tetgen_output.

Referenced by TetGenMeshInterface::pointset_convexhull().

{
  return tetgen_output->numberoftrifaces;
}
 

void TetGenWrapper::get_output_node (const inti, REAL &x, REAL &y, REAL &z)Method returns coordinates of point i in TetGen output.

Definition at line 82 of file mesh_tetgen_support.C.

References tetgen_output.

Referenced by TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole().

{
  x = tetgen_output->pointlist[3*i];
  y = tetgen_output->pointlist[3*i+1];
  z = tetgen_output->pointlist[3*i+2];
}
 

int TetGenWrapper::get_triface_node (const inti, const intj)Method returns index of jth node from surface triangle i in TetGen output.

Definition at line 119 of file mesh_tetgen_support.C.

References tetgen_output.

Referenced by TetGenMeshInterface::pointset_convexhull().

{
  return tetgen_output->trifacelist[i*3+j];
}
 

void TetGenWrapper::run_tetgen ()Method starts triangulization.

Definition at line 155 of file mesh_tetgen_support.C.

References tetgen_be, tetgen_data, and tetgen_output.

Referenced by TetGenMeshInterface::pointset_convexhull(), TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), and TetGenMeshInterface::triangulate_pointset().

{
  // Call tetrahedralize from the TetGen library.
  tetrahedralize(&tetgen_be, &tetgen_data, tetgen_output);
}
 

void TetGenWrapper::set_facet_numberofholes (const inti, const intnum)Method sets number of holes for facet i in TetGen input.

Definition at line 211 of file mesh_tetgen_support.C.

References tetgen_data.

Referenced by set_facet_polygonlist().

{
  this->tetgen_data.facetlist[i].numberofholes = num;
}
 

void TetGenWrapper::set_facet_numberofpolygons (const inti, const intnum)Method sets number of polygons for facet i in TetGen input.

Definition at line 204 of file mesh_tetgen_support.C.

References tetgen_data.

Referenced by set_facet_polygonlist().

{
  this->tetgen_data.facetlist[i].numberofpolygons = num;
}
 

void TetGenWrapper::set_facet_polygonlist (const inti, const intnumofpolygons)Method allocates memory, sets number of polygons for facet i in TetGen input.

Definition at line 219 of file mesh_tetgen_support.C.

References set_facet_numberofholes(), set_facet_numberofpolygons(), and tetgen_data.

Referenced by TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole().

{
  set_facet_numberofpolygons(i, numofpolygons);
  set_facet_numberofholes(i, 0);
  this->tetgen_data.facetlist[i].polygonlist = new tetgenio::polygon[numofpolygons];
  for (int j=0; j<this->tetgen_data.facetlist[i].numberofpolygons; j++)
    this->tetgen_data.init(&(this->tetgen_data.facetlist[i].polygonlist[j]));
}
 

void TetGenWrapper::set_facetlist (const intnumoffacets, const intnumofholes)Method allocates memory, sets number of facets, holes in TetGen input.

Definition at line 184 of file mesh_tetgen_support.C.

References set_numberoffacets(), set_numberofholes(), and tetgen_data.

Referenced by TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole().

{
  set_numberoffacets(numoffacets);
  set_numberofholes(numofholes);
  this->tetgen_data.facetlist = new tetgenio::facet[this->tetgen_data.numberoffacets];
  for (int i=0; i<numoffacets; i++)
    this->tetgen_data.init(&(this->tetgen_data.facetlist[i]));
  this->tetgen_data.holelist = new REAL[this->tetgen_data.numberofholes * 3];
}
 

void TetGenWrapper::set_hole (const inti, const REALx, const REALy, const REALz)Method sets coordinates of hole i in TetGen input.

Definition at line 65 of file mesh_tetgen_support.C.

References tetgen_data.

Referenced by TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole().

{
  int index = i*3;
  tetgen_data.holelist[index++] = x;
  tetgen_data.holelist[index++] = y;
  tetgen_data.holelist[index++] = z;
}
 

void TetGenWrapper::set_node (const inti, const REALx, const REALy, const REALz)Method sets coordinates of point i in TetGen input.

Definition at line 55 of file mesh_tetgen_support.C.

References tetgen_data.

Referenced by TetGenMeshInterface::pointset_convexhull(), TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), and TetGenMeshInterface::triangulate_pointset().

{
  int index = i*3;
  tetgen_data.pointlist[index++] = x;
  tetgen_data.pointlist[index++] = y;
  tetgen_data.pointlist[index++] = z;
}
 

void TetGenWrapper::set_numberoffacets (const inti)Method sets number of facets in TetGen input.

Definition at line 163 of file mesh_tetgen_support.C.

References tetgen_data.

Referenced by set_facetlist().

{ 
  this->tetgen_data.numberoffacets = i;
}
 

void TetGenWrapper::set_numberofholes (const inti)Method sets number of holes in TetGen input.

Definition at line 170 of file mesh_tetgen_support.C.

References tetgen_data.

Referenced by set_facetlist().

{ 
  this->tetgen_data.numberofholes = i;
}
 

void TetGenWrapper::set_numberofpoints (const inti)Method sets number of nodes in TetGen input.

Definition at line 75 of file mesh_tetgen_support.C.

References tetgen_data.

Referenced by set_pointlist().

{
  tetgen_data.numberofpoints = i;
}
 

void TetGenWrapper::set_numberofregions (const inti)Method sets number of regions in TetGen input.

Definition at line 177 of file mesh_tetgen_support.C.

References tetgen_data.

Referenced by set_regionlist().

{
  this->tetgen_data.numberofregions = i;
}
 

void TetGenWrapper::set_pointlist (const intnumofpoints)Method allocates memory, sets number of nodes in TetGen input.

Definition at line 134 of file mesh_tetgen_support.C.

References set_numberofpoints(), and tetgen_data.

Referenced by TetGenMeshInterface::pointset_convexhull(), TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), and TetGenMeshInterface::triangulate_pointset().

{
  this->set_numberofpoints(numofpoints);
  this->tetgen_data.pointlist = new REAL[tetgen_data.numberofpoints * 3];
}
 

void TetGenWrapper::set_polygon_numberofvertices (const inti, const intj, const intnum)Method sets number of vertices for polygon j, facet i in TetGen input.

Definition at line 230 of file mesh_tetgen_support.C.

References tetgen_data.

Referenced by set_polygon_vertexlist().

{
  this->tetgen_data.facetlist[i].polygonlist[j].numberofvertices = num;
}
 

void TetGenWrapper::set_polygon_vertexlist (const inti, const intj, const intnumofvertices)Method allocates memory, sets number of vertices for polygon j, facet i in TetGen input.

Definition at line 237 of file mesh_tetgen_support.C.

References set_polygon_numberofvertices(), and tetgen_data.

Referenced by TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole().

{
  set_polygon_numberofvertices(i, j, numofvertices);
  this->tetgen_data.facetlist[i].polygonlist[j].vertexlist = new int[numofvertices];
}
 

void TetGenWrapper::set_region (const inti, const REALx, const REALy, const REALz, const REALattribute, const REALvol_constraint)Method sets coordinates, attribute and volume constraint for region i in TetGen input. Note that coordinates and attributes will only be considered if the corresponding switches are enabled. See TetGen documentation for more details.

Definition at line 253 of file mesh_tetgen_support.C.

References tetgen_data.

{
  int index = i*5;
  tetgen_data.regionlist[index++] = x;
  tetgen_data.regionlist[index++] = y;
  tetgen_data.regionlist[index++] = z;
  tetgen_data.regionlist[index++] = attribute;
  tetgen_data.regionlist[index++] = vol_constraint;
}
 

void TetGenWrapper::set_regionlist (const intnumofregions)Method allocates memory, sets number of regions in TetGen input.

Definition at line 196 of file mesh_tetgen_support.C.

References set_numberofregions(), and tetgen_data.

{
  set_numberofregions(numofregions);
  this->tetgen_data.regionlist = new REAL[this->tetgen_data.numberofregions * 5];
}
 

void TetGenWrapper::set_switches (const std::string &s)Method set TetGen commandline switches

Definition at line 142 of file mesh_tetgen_support.C.

References tetgen_be.

Referenced by TetGenMeshInterface::pointset_convexhull(), TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), and TetGenMeshInterface::triangulate_pointset().

{
  // Copy the string to a temporary buffer for passing to the C API
  char buffer[256];
  libmesh_assert (s.size() < sizeof(buffer)-1);
  buffer[ s.copy( buffer , sizeof( buffer ) - 1 ) ] = ' ' ;
  
  if (!tetgen_be.parse_commandline(buffer)) 
    std::cout << 'TetGen replies: Wrong switches!' << std::endl;
}
 

void TetGenWrapper::set_vertex (const inti, const intj, const intk, const intnodeindex)Method sets index of ith facet, jth polygon, kth vertex in TetGen input.

Definition at line 246 of file mesh_tetgen_support.C.

References tetgen_data.

Referenced by TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole().

{
  this->tetgen_data.facetlist[i].polygonlist[j].vertexlist[k] = nodeindex;
}
 

Member Data Documentation

 

tetgenbehavior TetGenWrapper::tetgen_beTetGen control class (from the TetGen library).

Definition at line 211 of file mesh_tetgen_support.h.

Referenced by run_tetgen(), and set_switches().  

tetgenio TetGenWrapper::tetgen_dataTetGen input structure.

Definition at line 196 of file mesh_tetgen_support.h.

Referenced by run_tetgen(), set_facet_numberofholes(), set_facet_numberofpolygons(), set_facet_polygonlist(), set_facetlist(), set_hole(), set_node(), set_numberoffacets(), set_numberofholes(), set_numberofpoints(), set_numberofregions(), set_pointlist(), set_polygon_numberofvertices(), set_polygon_vertexlist(), set_region(), set_regionlist(), set_vertex(), and TetGenWrapper().  

tetgenmesh TetGenWrapper::tetgen_meshTetGen mesh structure (from the TetGen library).

Definition at line 206 of file mesh_tetgen_support.h.  

tetgenio* TetGenWrapper::tetgen_outputTetGen output structure.

Definition at line 201 of file mesh_tetgen_support.h.

Referenced by get_element_attribute(), get_element_node(), get_numberofpoints(), get_numberoftetrahedra(), get_numberoftrifaces(), get_output_node(), get_triface_node(), run_tetgen(), TetGenWrapper(), and ~TetGenWrapper().

 

Author

Generated automatically by Doxygen for libMesh from the source code.


 

Index

NAME
SYNOPSIS
Public Member Functions
Public Attributes
Detailed Description
Constructor & Destructor Documentation
TetGenWrapper::TetGenWrapper ()Constructor.
TetGenWrapper::~TetGenWrapper ()Destructor. Empty.
Member Function Documentation
REAL TetGenWrapper::get_element_attribute (const inti)Method returns attribute of element i in TetGen output.
int TetGenWrapper::get_element_node (const inti, const intj)Method returns index of jth node from element i in TetGen output.
int TetGenWrapper::get_numberofpoints ()Method returns number of nodes in TetGen output.
int TetGenWrapper::get_numberoftetrahedra ()Method returns number of tetrahedra in TetGen output.
int TetGenWrapper::get_numberoftrifaces ()Method returns number of triangle surface elts. in TetGen output.
void TetGenWrapper::get_output_node (const inti, REAL &x, REAL &y, REAL &z)Method returns coordinates of point i in TetGen output.
int TetGenWrapper::get_triface_node (const inti, const intj)Method returns index of jth node from surface triangle i in TetGen output.
void TetGenWrapper::run_tetgen ()Method starts triangulization.
void TetGenWrapper::set_facet_numberofholes (const inti, const intnum)Method sets number of holes for facet i in TetGen input.
void TetGenWrapper::set_facet_numberofpolygons (const inti, const intnum)Method sets number of polygons for facet i in TetGen input.
void TetGenWrapper::set_facet_polygonlist (const inti, const intnumofpolygons)Method allocates memory, sets number of polygons for facet i in TetGen input.
void TetGenWrapper::set_facetlist (const intnumoffacets, const intnumofholes)Method allocates memory, sets number of facets, holes in TetGen input.
void TetGenWrapper::set_hole (const inti, const REALx, const REALy, const REALz)Method sets coordinates of hole i in TetGen input.
void TetGenWrapper::set_node (const inti, const REALx, const REALy, const REALz)Method sets coordinates of point i in TetGen input.
void TetGenWrapper::set_numberoffacets (const inti)Method sets number of facets in TetGen input.
void TetGenWrapper::set_numberofholes (const inti)Method sets number of holes in TetGen input.
void TetGenWrapper::set_numberofpoints (const inti)Method sets number of nodes in TetGen input.
void TetGenWrapper::set_numberofregions (const inti)Method sets number of regions in TetGen input.
void TetGenWrapper::set_pointlist (const intnumofpoints)Method allocates memory, sets number of nodes in TetGen input.
void TetGenWrapper::set_polygon_numberofvertices (const inti, const intj, const intnum)Method sets number of vertices for polygon j, facet i in TetGen input.
void TetGenWrapper::set_polygon_vertexlist (const inti, const intj, const intnumofvertices)Method allocates memory, sets number of vertices for polygon j, facet i in TetGen input.
void TetGenWrapper::set_region (const inti, const REALx, const REALy, const REALz, const REALattribute, const REALvol_constraint)Method sets coordinates, attribute and volume constraint for region i in TetGen input. Note that coordinates and attributes will only be considered if the corresponding switches are enabled. See TetGen documentation for more details.
void TetGenWrapper::set_regionlist (const intnumofregions)Method allocates memory, sets number of regions in TetGen input.
void TetGenWrapper::set_switches (const std::string &s)Method set TetGen commandline switches
void TetGenWrapper::set_vertex (const inti, const intj, const intk, const intnodeindex)Method sets index of ith facet, jth polygon, kth vertex in TetGen input.
Member Data Documentation
tetgenbehavior TetGenWrapper::tetgen_beTetGen control class (from the TetGen library).
tetgenio TetGenWrapper::tetgen_dataTetGen input structure.
tetgenmesh TetGenWrapper::tetgen_meshTetGen mesh structure (from the TetGen library).
tetgenio* TetGenWrapper::tetgen_outputTetGen output structure.
Author

This document was created by man2html, using the manual pages.
Time: 21:57:17 GMT, April 16, 2011