CMLTetMesher Class Reference

The tet-mesher fills a volume with tetrahedra. More...

#include <CMLTetMesher.hpp>

List of all members.

Public Member Functions

Constructor/Destructor
 CMLTetMesher (CML::OutputMsg msg_level=CML::STANDARD)
 A class constructor with an optional output parameter.
virtual ~CMLTetMesher ()
 A virtual destructor for the class.
Mesh input
bool set_boundary_mesh (int num_points_in, double *const points, int num_tris, int *const tris, int num_free_points=0, double *const el_size=NULL, int *const point_ids=NULL)
 Supply the surface mesh describing the volume boundary.
bool set_free_edges (int num_edges, int *const edges)
 Supply interior edges that will be included in the tetrahedral mesh.
bool set_free_tris (int num_tris, int *const tris)
 Supply interior triangles that will be included in the tetrahedral mesh.
bool set_tet_mesh (int num_points_in, double *const points, int num_tris, int *const tris, int num_tets, int *const tets, int num_free_points=0, double *const el_size=NULL, int *const point_ids=NULL)
 Supply an initial tetrahedral mesh for remeshing.
bool set_background_mesh (int num_pnts_bgr, double *const pnts_bgr, int num_tets_bgr, int *const tets_bgr, double *const el_size_bgr)
 Supply a background mesh to the tet-mesher for adaptive meshing.
Core mesher
bool generate_mesh (int &num_points_out, int &num_tets)
 Generate a tetrahedral mesh for the volume.
bool regenerate_mesh (int &num_points_out, int &num_tets)
 Regenerate a tetrahedral mesh for the volume.
Mesh output
bool get_mesh (int num_points_out, double *const points, int num_tets, int *const tets, double *const el_size=NULL)
 Retrieve the generated tetrahedral mesh.
int get_points_buf (int buf_size, double *const points, int start_index=0)
 Retrieve the generated points one buffer at a time.
int get_tets_buf (int buf_size, int *const tets, int start_index=0)
 Retrieve the generated tetrahedrons one buffer at a time.
int get_sizes_buf (int buf_size, double *const el_size, int start_index=0)
 Retrieve the generated element size at corresponding points one buffer at a time.
Mesher properties
void set_field_points (bool enable)
 Enables or disables generation of field points.
bool get_field_points ()
 Returns the current setting for field points.
Message output control
virtual CML::OutputMsg get_msg_level () const
 Get the value of the message level flag.
virtual void set_msg_level (CML::OutputMsg level)
 Set the value of the message level flag.
virtual void open_log_file (const char *filename, bool append=false)
 Open a log file to record algorithm output.
virtual void close_log_file ()
 Close an open log file.
virtual void set_message_handler (CubitMessageHandler *h)
 Use an alternate output message handler.
CAMAL version
virtual int get_major_version () const
 Returns the major version number.
virtual int get_minor_version () const
 Returns the minor version number.
virtual int get_subminor_version () const
 Returns the subminor version (patch) number.
virtual int get_allint_version () const
 Returns version number as one integer.
virtual const char * get_version_string ()
 Returns version number as a string.
Mesher properties
virtual void set_sizing_function (CML::SizingType type, double size1=-1.0, double size2=-1.0)
 Set a sizing function and its parameters.


Detailed Description

The tet-mesher fills a volume with tetrahedra.

An existing tetrahedral mesh may be used a input also. If it is, then the tetrahedral mesher attempts to improve the mesh by adding additional field points and elements.

See also:
set_tet_mesh() and regenerate_mesh().


Constructor & Destructor Documentation

CMLTetMesher::CMLTetMesher ( CML::OutputMsg  msg_level = CML::STANDARD  ) 

A class constructor with an optional output parameter.

Parameters:
msg_level An enumberated constant that controls the amount of output. The default value CML::STANDARD. A value of CML::NONE causes the tet-mesher to suppress all output.
See also:
set_msg_level()


Member Function Documentation

virtual void CMLTetMesher::close_log_file (  )  [virtual]

Close an open log file.

See also:
open_log_file()

bool CMLTetMesher::generate_mesh ( int &  num_points_out,
int &  num_tets 
)

Generate a tetrahedral mesh for the volume.

Parameters:
num_points_out The total number of point generated including the input points
num_tets The number of tetrahedra generated
Returns:
true if successful, false otherwise
Note:
These two output values are useful for dynamically allocating the memory necessary to retrieve the tetrahedral mesh with get_mesh().

bool CMLTetMesher::get_mesh ( int  num_points_out,
double *const   points,
int  num_tets,
int *const   tets,
double *const   el_size = NULL 
)

Retrieve the generated tetrahedral mesh.

Parameters:
num_points_out The number of points to retrieve. This should be the same number returned by generate_mesh().
points An array of points in the generated mesh (array size = 3 * num_points_out.)
The first three array values are the x, y and z coordinates of the first point. The next three are for the second point, then the third, etc.
num_tets The number of tetrahedra to retrieve. This should be the same number returned by generate_mesh().
tets An array defining the connectivity of the generated mesh (array size = 4 * num_tets.)
The first four array values are the indices in the points array of the first tetrahedron's corner points. The second four describes the second tetrahedron, then the third, etc. The first three indices of a tetrahedron are entered in a counter-clockwise direction around one face when viewed from outside the tetrahedron. The fourth index is the corner opposite this face. Indices range from 0 to num_points_out - 1 since the points array is zero-based.
el_size An optional array of edge lengths corresponding to the points (array size = num_points_out.)
This array of edge lengths may be useful in a subsequent call to the adaptive tet-mesher.
Returns:
true if successful, false otherwise

virtual CML::OutputMsg CMLTetMesher::get_msg_level (  )  const [virtual]

Get the value of the message level flag.

Returns:
The current message level flag.
See also:
set_msg_level()

int CMLTetMesher::get_points_buf ( int  buf_size,
double *const   points,
int  start_index = 0 
)

Retrieve the generated points one buffer at a time.

Parameters:
buf_size The length of the points array.
points The output buffer for points. A maximum of length/3 points will be copied to this buffer.
start_index The index of the first output point.
Returns:
The number of points returned in points buffer. Returns zero if start_index is greater than the number of points in the array.
Note:
To return all points, begin with start_index = 0 and increment it by the return value until the return value is zero.

int CMLTetMesher::get_sizes_buf ( int  buf_size,
double *const   el_size,
int  start_index = 0 
)

Retrieve the generated element size at corresponding points one buffer at a time.

Parameters:
buf_size The length of the el_size array.
el_size The output buffer for element size. A maximum of length size values will be copied to this buffer.
start_index The index of the first output size value.
Returns:
The number of size values returned in el_size buffer. Returns zero if start_index is greater than the number of size values in the array.
Note:
To return all size values, begin with start_index = 0 and increment it by the return value until the return value is zero.

int CMLTetMesher::get_tets_buf ( int  buf_size,
int *const   tets,
int  start_index = 0 
)

Retrieve the generated tetrahedrons one buffer at a time.

Parameters:
buf_size The length of the tets buffer array.
tets The output buffer for tetrahedrons. A maximum of length/4 tetrahedrons will be copied to this buffer.
start_index The index of the first output tetrahedron.
Returns:
The number of tetrahedrons returned in tets buffer. Returns zero if start_index is greater than the number of tetrahedrons in the array.
Note:
To return all tetrahedrons, begin with start_index = 0 and increment it by the return value until the return value is zero.

virtual void CMLTetMesher::open_log_file ( const char *  filename,
bool  append = false 
) [virtual]

Open a log file to record algorithm output.

Parameters:
filename The log file name
append Appends to the file filename if it exists
See also:
close_log_file()

bool CMLTetMesher::regenerate_mesh ( int &  num_points_out,
int &  num_tets 
)

Regenerate a tetrahedral mesh for the volume.

Parameters:
num_points_out The total number of point generated including the input points
num_tets The number of tetrahedra generated
Returns:
true if successful, false otherwise
See also:
set_tet_mesh()
Note:
These two output values are useful for dynamically allocating the memory necessary to retrieve the tetrahedral mesh with get_mesh().

bool CMLTetMesher::set_background_mesh ( int  num_pnts_bgr,
double *const   pnts_bgr,
int  num_tets_bgr,
int *const   tets_bgr,
double *const   el_size_bgr 
)

Supply a background mesh to the tet-mesher for adaptive meshing.

Parameters:
num_pnts_bgr The number of points in the background mesh.
pnts_bgr The points in the background mesh (array size = 3 * num_pnts_bgr.)
The first three array values are the x, y and z coordinates of the first point in the background mesh. The next three are for the second point, then the third, etc.
num_tets_bgr The number of tetrahedra in the background mesh.
tets_bgr Connectivity of the tetrahedra in the background mesh (array size = 4 * num_tets_bgr.)
The first four array values are the indices in the points array of the first tetrahedron's corner points. The second four describes the second tetrahedron, then the third, etc. The first three indices of a tetrahedron are entered in a counter-clockwise direction around one face when viewed from outside the tetrahedron. The fourth index is the corner opposite this face. Indices range from 0 to num_points_out - 1 since the points array is zero-based.
el_size_bgr The desired edge length at each point in the background mesh (array size = num_pnts_bgr.)
Each value in the element size array cooresponds to the point at the same index.
Returns:
true if successful, false otherwise
Supplying a background mesh will activate the adaptive tet-mesher. The generated mesh will be constrained to the edge lengths specified in the el_size array.

Note:
Free interior points, edges and triangles are not supported by the adaptive tet-mesher. If supplied, they are ignored.

bool CMLTetMesher::set_boundary_mesh ( int  num_points_in,
double *const   points,
int  num_tris,
int *const   tris,
int  num_free_points = 0,
double *const   el_size = NULL,
int *const   point_ids = NULL 
)

Supply the surface mesh describing the volume boundary.

Parameters:
num_points_in The number of points in the surface mesh plus any optional free interior points.
points An array of points (array size = 3 * num_points_in.)
The first three array values are the x, y and z coordinates of the first point. The next three are for the second point, then the third, etc. Free interior points, if any, will appear in the final tetrahedral mesh.
num_tris The number of triangles in the surface mesh.
tris An array defining the connectivity of the surface mesh (array size = 3 * num_tris.)
The first three array values (triplet) are the indices in the points array of the first triangle's corner points. The second triplet describes the second triangle, then the third, etc. The indices are entered in a counter-clockwise direction when viewed from outside the volume. Indices range from 0 to num_points_in - 1 since the points array is zero-based.
num_free_points The number of optional interior points that will appear in the final tetrahedral mesh. These points may be used to define free edges and free triangles that are not part of the boundary surface. These edges and triangles will also appear in the final mesh.
Note:
Place the free nodes at the end of the points array described above.
Parameters:
el_size An optional array of edge lengths cooresponding to the points (array size = num_points_in.)
Edge lengths at free points define the size of internal tetrahedra. All others may be 0. There is no reason to specify this array if the model has no free interior points.
point_ids An optional array whose values are the user's identifiers for the points (array size = num_points_in.)
Messages generated by the tet-mesher use this array to translate from internal point identifiers to user identifiers.
Returns:
true if successful, false otherwise.

void CMLTetMesher::set_field_points ( bool  enable  ) 

Enables or disables generation of field points.

Parameters:
enable True to enable generation of field points; false to disable. The default setting is true.

bool CMLTetMesher::set_free_edges ( int  num_edges,
int *const   edges 
)

Supply interior edges that will be included in the tetrahedral mesh.

Parameters:
num_edges The number of edges interior to the volume.
edges An array defining the end points of the free edges (array size = 2 * num_edges.)
The first two array values are the indices of the points at each end of the first edge. The next two are the indices of the second edge's end-points, then the third, etc. Indices range from 0 to num_points_in - 1 since the points array is zero-based.
Returns:
true if successful, false otherwise
Note:
One or both end-points must be free points inside the volume.
Free edges are not supported by the adpative tet-mesher.

bool CMLTetMesher::set_free_tris ( int  num_tris,
int *const   tris 
)

Supply interior triangles that will be included in the tetrahedral mesh.

Parameters:
num_tris The number of triangles interior to the volume.
tris An array defining the connectivity of the free triangles (array size = 3 * num_tris.)
The first three array values (triplet) are the indices in the points array of the first triangle's corner points. The second triplet describes the second triangle, then the third, etc. Indices range from 0 to num_points_in - 1 since the points array is zero-based.
Returns:
true if successful, false otherwise
Note:
One or more triangle corners must be free points inside the volume.
Free triangles are not supported by the adpative tet-mesher.

virtual void CMLTetMesher::set_message_handler ( CubitMessageHandler *  h  )  [virtual]

Use an alternate output message handler.

Parameters:
h A pointer to a message handler derived from CubitMessageHandler.

virtual void CMLTetMesher::set_msg_level ( CML::OutputMsg  level  )  [virtual]

Set the value of the message level flag.

Parameters:
level The value of the message level is an enumerated constant. The default value is CML::STANDARD and generates minimal output. A value of CML::VERBOSE generates more output, and a value of CML::DEBUG generates output helpful to developers. A value of CML::NONE causes the mesher to suppress all output.
See also:
get_msg_level()

virtual void CMLTetMesher::set_sizing_function ( CML::SizingType  type,
double  size1 = -1.0,
double  size2 = -1.0 
) [virtual]

Set a sizing function and its parameters.

Parameters:
type The enum of sizing function for the triangle mesher or paver.
size1 The constant size for CONSTANT_SIZING function and the minimum size for all others.
size2 The maximum size for all sizing functions.

bool CMLTetMesher::set_tet_mesh ( int  num_points_in,
double *const   points,
int  num_tris,
int *const   tris,
int  num_tets,
int *const   tets,
int  num_free_points = 0,
double *const   el_size = NULL,
int *const   point_ids = NULL 
)

Supply an initial tetrahedral mesh for remeshing.

Parameters:
num_points_in The number of points in the surface mesh plus any optional free interior points.
points An array of points (array size = 3 * num_points_in.)
The first three array values are the x, y and z coordinates of the first point. The next three are for the second point, then the third, etc. Free interior points, if any, will appear in the final tetrahedral mesh.
num_tris The number of triangles in the surface mesh.
tris An array defining the connectivity of the surface mesh (array size = 3 * num_tris.)
The first three array values (triplet) are the indices in the points array of the first triangle's corner points. The second triplet describes the second triangle, then the third, etc. The indices are entered in a counter-clockwise direction when viewed from outside the volume. Indices range from 0 to num_points_in - 1 since the points array is zero-based.
num_tets The number of tetrahedra in the initial mesh.
tets Connectivity of the tetrahedra in the initial mesh (array size = 4 * num_tets_bgr.)
The first four array values are the indices in the points array of the first tetrahedron's corner points. The second four describes the second tetrahedron, then the third, etc. The first three indices of a tetrahedron are entered in a counter-clockwise direction around one face when viewed from outside the tetrahedron. The fourth index is the corner opposite this face. Indices range from 0 to num_points_out - 1 since the points array is zero-based.
num_free_points The number of optional interior points that will appear in the final tetrahedral mesh. These points may be used to define free edges and free triangles that are not part of the boundary surface. These edges and triangles will also appear in the final mesh.
Note:
Place the free nodes at the end of the points array described above.
Parameters:
el_size An optional array of edge lengths cooresponding to the points (array size = num_points_in.)
Edge lengths at free points define the size of internal tetrahedra. All others may be 0. There is no reason to specify this array if the model has no free interior points.
point_ids An optional array whose values are the user's identifiers for the points (array size = num_points_in.)
Messages generated by the tet-mesher use this array to translate from internal point identifiers to user identifiers.
Returns:
true if successful, false otherwise.
See also:
regenerate_mesh()


The documentation for this class was generated from the following file:

CAMAL 5.2-0 documentation created on 1 Jun 2010
Comments to csimsoft.com