CMLEdgeMesher Class Reference

The edge mesher generates nodes on a curve with uniform or biased spacing. More...

#include <CMLEdgeMesher.hpp>

Inheritance diagram for CMLEdgeMesher:

CMLMesher List of all members.

Core mesher

bool generate_mesh_uniform (int num_intervals, int &num_points_out)
 Generate a uniformly spaced edge mesh.
bool generate_mesh_biased_ratio (int num_intervals, double ratio, bool dual_biased, bool bias_from_start, int &num_points_out)
 Generate an edge mesh with node spacing biased from start to end given the number of intervals and a size ratio.
bool generate_mesh_biased_ratio (double fine_length, double ratio, bool dual_biased, bool bias_from_start, int &num_points_out)
 Generate an edge mesh with node spacing biased from start to end given the size of the smallest interval and a size ratio.
bool generate_mesh_biased_length (double first_length, double last_length, bool dual_biased, bool bias_from_start, int &num_points_out)
 Generate an edge mesh with node spacing biased from start to end given the size of the first and last intervals.
bool generate_mesh_biased_delta (int num_points, double first_delta, bool dual_biased, bool bias_from_start)
 Generate an edge mesh with node spacing biased from start to end given the number of intervals and the size of the first segement.
bool generate_mesh_sizing (CMLSizeEval *sizing_function, int &num_points_out)
 Generate an edge mesh with node spacing based on a sizing function.
static bool bias_factors_coarse_fine (double curve_length, double fine_size, double &coarse_size, bool dual_biased, int &num_intervals, double &ratio)
 Calculates bias factors given the length of the smallest (fine) and the largest (coarse) segments.
static bool bias_factors_size_intervals (double curve_length, double fine_size, int num_intervals, bool dual_biased, double &ratio)
 Calculates bias factors given the smallest (fine) size and the number of intervals.
static bool bias_factors_size_ratio (double curve_length, double fine_size, double &ratio, bool dual_biased, int &num_intervals, double &coarse_size)
 Calculates bias factors given the smallest (fine) size and a size ratio.

Public Member Functions

Constructor/Destructor
 CMLEdgeMesher (CMLCurveEval *const curve_eval, CML::OutputMsg msg_level=CML::STANDARD)
 Constructor for class.
virtual ~CMLEdgeMesher ()
 A virtual destructor for the class.
Mesh output
bool get_mesh (int num_points_out, double *const points)
 Retrieve the computed node coordinates along the edge.
int get_points_buf (int buf_size, double *const points, int start_index=0)
 Retrieve the generated points one buffer at a time.
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.
virtual void set_progress_handler (CMLProgress *h)
 Use an alternate progress 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 edge mesher generates nodes on a curve with uniform or biased spacing.

The CAMAL edge mesher computes node coordinates along a curve defined by a CMLCurveEval object. Node placement is controlled by interval and bias information.


Constructor & Destructor Documentation

CMLEdgeMesher::CMLEdgeMesher ( CMLCurveEval *const   curve_eval,
CML::OutputMsg  msg_level = CML::STANDARD 
)

Constructor for class.

Parameters:
curve_eval A pointer to a CMLCurveEval object that will perform geometric curve evaluations during meshing.
msg_level An optional parameter that controls the amount of output. The default value is CML::STANDARD. A value of CML::NONE causes the edge mesher to suppress all output.
See also:
set_msg_level()


Member Function Documentation

static bool CMLEdgeMesher::bias_factors_coarse_fine ( double  curve_length,
double  fine_size,
double &  coarse_size,
bool  dual_biased,
int &  num_intervals,
double &  ratio 
) [static]

Calculates bias factors given the length of the smallest (fine) and the largest (coarse) segments.

Parameters:
curve_length The length of the curve to calculate bias factors on.
fine_size The size of the shortest spacing in the bias.
coarse_size The desired size of the largest spacing in the bias.
This parameter is modified by the function to return the actual largest spacing.
dual_biased true if biased spacing of nodes should be mirrored about center point of the curve.
num_intervals Calculated number of edge segments to create in the resulting mesh.
ratio Calculated ratio of lengths of adjacent edge segments for biasing. The length of each segment will be the length of the previous edge segment times ratio.
Returns:
true if successful, false otherwise

static bool CMLEdgeMesher::bias_factors_size_intervals ( double  curve_length,
double  fine_size,
int  num_intervals,
bool  dual_biased,
double &  ratio 
) [static]

Calculates bias factors given the smallest (fine) size and the number of intervals.

Parameters:
curve_length The length of the curve to calculate bias factors on.
fine_size The size of the shortest spacing in the bias.
num_intervals The number of edge segments to create in the resulting mesh.
dual_biased true if biased spacing of nodes should be mirrored about center point of the curve.
ratio Calculated ratio of lengths of adjacent edge segments for biasing. The length of each segment will be the length of the previous edge segment times ratio.
Returns:
true if successful, false otherwise

static bool CMLEdgeMesher::bias_factors_size_ratio ( double  curve_length,
double  fine_size,
double &  ratio,
bool  dual_biased,
int &  num_intervals,
double &  coarse_size 
) [static]

Calculates bias factors given the smallest (fine) size and a size ratio.

Parameters:
curve_length The length of the curve to calculate bias factors on.
fine_size The size of the shortest spacing in the bias.
ratio Calculated ratio of lengths of adjacent edge segments for biasing. The length of each segment will be the length of the previous edge segment times
dual_biased true if biased spacing of nodes should be mirrored about center point of the curve.
num_intervals Calculated number of edge segments to create in the resulting mesh.
coarse_size The desired size of the largest spacing in the bias.
This parameter is modified by the function to return the actual largest spacing.
Returns:
true if successful, false otherwise

virtual void CMLEdgeMesher::close_log_file (  )  [virtual]

Close an open log file.

See also:
open_log_file()

Implements CMLMesher.

bool CMLEdgeMesher::generate_mesh_biased_delta ( int  num_points,
double  first_delta,
bool  dual_biased,
bool  bias_from_start 
)

Generate an edge mesh with node spacing biased from start to end given the number of intervals and the size of the first segement.

Parameters:
num_points The number of points that will be generated, including the start point and end point.
first_delta The length of the first edge on the curve.
dual_biased true if biased spacing of nodes should be mirrored about center point of the curve.
bias_from_start true if biasing should start from the start of the curve.
This parameter is ignored if dual_biased is true.
Returns:
true if successful, false otherwise
Note:
The number of points computed will be one more than the number of edge segments in the mesh. For closed curves, the first and last points will be identical.

bool CMLEdgeMesher::generate_mesh_biased_length ( double  first_length,
double  last_length,
bool  dual_biased,
bool  bias_from_start,
int &  num_points_out 
)

Generate an edge mesh with node spacing biased from start to end given the size of the first and last intervals.

Parameters:
first_length The length of the first edge segment
last_length The length of the last edge segment
dual_biased true if biased spacing of nodes should be mirrored about center point of the curve.
bias_from_start true if biasing should start from the start of the curve.
This parameter is ignored if dual_biased if true.
num_points_out The total number of points generated including the start point and end point.
Returns:
true if successful, false otherwise
Note:
The number of points computed will be one more than the number of edge segments in the mesh. For closed curves, the first and last points will be identical.

bool CMLEdgeMesher::generate_mesh_biased_ratio ( double  fine_length,
double  ratio,
bool  dual_biased,
bool  bias_from_start,
int &  num_points_out 
)

Generate an edge mesh with node spacing biased from start to end given the size of the smallest interval and a size ratio.

Parameters:
fine_length The length of the smallest edge segment.
ratio The ratio of lengths of adjacent edge segments for biasing. The length of each segment will be the length of the previous edge segment times the ratio.
dual_biased true if biased spacing of nodes should be mirrored about center point of the curve.
bias_from_start true if biasing should start from the start of the curve.
This parameter is ignored if dual_biased if true.
num_points_out The total number of points generated including the start point and end point.
Returns:
true if successful, false otherwise
Note:
The number of points computed will be one more than the number of edge segments in the mesh. For closed curves, the first and last points will be identical.

bool CMLEdgeMesher::generate_mesh_biased_ratio ( int  num_intervals,
double  ratio,
bool  dual_biased,
bool  bias_from_start,
int &  num_points_out 
)

Generate an edge mesh with node spacing biased from start to end given the number of intervals and a size ratio.

Parameters:
num_intervals The number of edge segments to create in the resulting mesh.
ratio The ratio of lengths of adjacent edge segments for biasing. The length of each segment will be the length of the previous edge segment times the ratio.
dual_biased true if biased spacing of nodes should be mirrored about center point of the curve.
bias_from_start true if biasing should start from the start of the curve.
This parameter is ignored if dual_biased if true.
num_points_out The total number of points generated including the start point and end point.
Returns:
true if successful, false otherwise
Note:
The number of points computed will be num_intervals + 1. For closed curves, the first and last points will be identical.

bool CMLEdgeMesher::generate_mesh_sizing ( CMLSizeEval sizing_function,
int &  num_points_out 
)

Generate an edge mesh with node spacing based on a sizing function.

Parameters:
sizing_function a pointer to a CMLSizeEval object that returns the desired mesh size at a given point.
num_points_out The total number of points generated including the start point and end point.
Returns:
true if successful, false otherwise
Note:
The number of points computed will be one more than the number of edge segments in the mesh. For closed curves, the first and last points will be identical.

bool CMLEdgeMesher::generate_mesh_uniform ( int  num_intervals,
int &  num_points_out 
)

Generate a uniformly spaced edge mesh.

Parameters:
num_intervals The number of edge segments to create in the resulting mesh.
num_points_out The total number of points generated including the start point and end point.
Returns:
true if successful, false otherwise
Note:
The number of points computed will be num_intervals + 1. For closed curves, the first and last points will be identical.

bool CMLEdgeMesher::get_mesh ( int  num_points_out,
double *const   points 
)

Retrieve the computed node coordinates along the edge.

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.
Returns:
true if successful, false otherwise

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

Get the value of the message level flag.

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

Implements CMLMesher.

int CMLEdgeMesher::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.

virtual void CMLEdgeMesher::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()

Implements CMLMesher.

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

Use an alternate output message handler.

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

Implements CMLMesher.

virtual void CMLEdgeMesher::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()

Implements CMLMesher.

virtual void CMLEdgeMesher::set_progress_handler ( CMLProgress *  h  )  [virtual]

Use an alternate progress handler.

Parameters:
h A pointer to a progress hander derived from CMLProgress.

Implements CMLMesher.

virtual void CMLEdgeMesher::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.

Implements CMLMesher.


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