BezierMesh Class Reference

The CellComplex of Bezier Cells. More...

#include </usr1/tp517/Tumble/trunk/src/tumble/beziermesh.h>

Inheritance diagram for BezierMesh:

[legend]
Collaboration diagram for BezierMesh:
[legend]
List of all members.

Point location helpers

Helpers for the point location functions. They return the containment dimension; also, they return by reference a tuple that contains the point.

The sampler and sample_id_map allow getting a n^(1/3) sized sample in O(n^(1/3)) time out of the hash_set that holds the triangles.

std::vector< BezierTriangle * > sampler
hashers::hash_map< BezierTriangle *,
int > 
sample_id_map
BezierTrianglefind_start_triangle (const Point2D &pt)
 Given a point to locat, find a good starting triangle to use in BezierMesh::locate_point().
int locate_point_in_quadratic_triangle (const Point2D &, BezierTriangle *, BezierTuple &, double &u, double &v)
 Determine if a Bezier Triangle contains a point.
int locate_point_in_linear_mesh (const Point2D &, BezierTriangle *, bool allow_cross_bdry, BezierTuple &)
 Locate a given point in the linear mesh.

Public Types

typedef Vertex_Hash_T Bezier_Vertex_Hash_T
 Typedefs for hash sets Type for a hash of BezierVertexs.
typedef Edge_Hash_T Bezier_Edge_Hash_T
 Type for a hash of BezierEdges.
typedef Face_Hash_T Bezier_Face_Hash_T
 Type for a hash of BezierFaces.

Public Member Functions

 BezierMesh (PersistantStore &, DataStore *)
 Defualt Constructor.
void set_bdry_mesh (BoundaryMesh *)
 ~BezierMesh ()
 Destructor.
void set_linear_flips (bool val)
 Set method for linear_flips variable.
bool check_consistency () const
 Debugging: Check the consistency of the mesh.
int data_length () const
 Get the length of the data. Just forwards the call off to the data store.
Mesh operator debuggers
Debuggers for smooth_edge() and flip()

bool debug_flip (BezierEdge *e)
 Debug the flipping code.
bool debug_smooth (BezierEdge *e)
 Debug the smooth_edge() function.
void draw_smooth_error (const char *name, BezierEdge *e, Point2D poly[], const Point2D &prim, const Point2D &secd, BezierTriangle *ts[])
 Draw unflippable or unsmoothable egdes.
void draw_insert_error (const char *name, BezierTriangle *bt)
void get_smooth_polygon (Point2D poly[], BezierVertex *vs[], BezierEdge *es[])
 Given the vertexs and edges around an edge to smooth, get the smoothing polygon.
void get_flip_polygon (Point2D poly[], BezierVertex *vs[], BezierEdge *es[])
 Given the vertexs and edges around an edge to flip, get the smoothing polygon.
Creation of new cells
These functions are used to add new cells to a mesh. The BezierMesh takes care of allocating and managing memory and all the functions return a pointer to the newly created cell. Do not try and use other functions to add Bezier cells, as there are several special pointers and flags that must be set by these functions.

Note:
When removing cells making calls to delete_vertex(), delete_edge(), and delete_face() directly is fine.


BezierVertexadd_bezier_vertex (const Point2D &p)
 Adds a new BezierVertex Creates a new BezierVertex with point _p and empty data, then returns a handle to it.
BezierVertexadd_bezier_vertex (const Point2D &p, const LinearData &d)
 Adds a new BezierVertex with data Creates a new BezierVertex with point _p and data _d, then returns a handle to it.
BezierVertexadd_bezier_vertex (ControlPoint cp)
 Adds a new BezierVertex on the boundary Given a new ControlPoint from some boundary cell, create a BezierVertex with empty data.
BezierVertexadd_bezier_vertex (ControlPoint cp, const LinearData &d)
 Adds a new BezierVertex on the boundary with data Given a new ControlPoint from some boundary cell, create a BezierVertex with data _d.
BezierEdgeadd_bezier_edge (const Point2D &p, BezierVertex *v0, BezierVertex *v1)
 Adds a new BezierEdge Given two BezierVertexs and a center point, create a new BezierEdge with empty data on the center point.
BezierEdgeadd_bezier_edge (const Point2D &p, const LinearData &d, BezierVertex *v0, BezierVertex *v1)
 Adds a new BezierEdge with data Given two BezierVertexs and a center point, create a new BezierEdge with data _d on the center point.
BezierEdgeadd_straight_bezier_edge (BezierVertex *, BezierVertex *)
BezierEdgeadd_straight_bezier_edge (const LinearData &, BezierVertex *, BezierVertex *)
BezierEdgeadd_bezier_edge (ControlPoint cp, BezierVertex *v0, BezierVertex *v1)
 Adds a new BezierEdge on the boundary Given a control point from the boundary and two BezierVertexs, create a new BezierEdge with empty data for the center point.
BezierEdgeadd_bezier_edge (ControlPoint cp, const LinearData &d, BezierVertex *v0, BezierVertex *v1)
 Adds a new BezierEdge on the boundary with data Given a control point from the boundary and two BezierVertexs, create a new BezierEdge with data _d for the center point.
BezierTriangleadd_bezier_triangle (BoundaryFace *face, BezierEdge *e0, BezierEdge *e1, BezierEdge *e2, bool inverse_handed=false)
 Adds a new BezierTriangle Given three BezierEdges and a BoundaryFace, create a new BezierTriangle and return a handle to it.
Deletion of Cells
These functions override the corresponding versions in CellComplex, in order to ensure that the appropriate ControlPoints and DataPoints are freed from the DataStore when the associated Cells are deleted

This is necessary as the CellComplex being a purely topological data structure, has no knowledge of the geometric and functional data

virtual void delete_vertex (BezierVertex *vert)
 Deletes a BezierVertex from the mesh.
virtual void delete_edge (BezierEdge *edge)
 Removes a BezierEdge from the mesh.
virtual void delete_face (BezierTriangle *face)
 Removes a BezierFace from the mesh.
Deletion of Cells
void replace_control_point (BezierVertex *, const ControlPoint &newp)
 Replace a control point.
void replace_control_point (BezierEdge *, const ControlPoint &newp)
Mesh operators
These are the basic operations which can be performed on the mesh they include
  • Edge flips
  • Edge smooths
  • Vertex Insertion
  • Vertex Removal


BezierVertexclean_insert_point (Point2D p, BezierTriangle *start_tri=NULL, bool over_bdry=true, bool force=true)
 Insert a point in the mesh and make the resulting mesh delaunay.
BezierVertexclean_insert_point (BezierTriangle *t, double alpha, double beta, bool force=false)
 Insert an a point in the middle of a triangle, and make the resulting mesh delaunay.
BezierVertexclean_insert_edge_midpoint (BezierEdge *e, double u, bool force=true)
 Insert an a point in the middle of an edge, and make the resulting mesh delaunay.
BezierVertexclean_insert_circumcenter (BezierTriangle *t)
 Insert a circumcenter and leave the mesh Delaunay.
BezierTuple remove_vertex (BezierVertex *v)
 Remove a vertex from the mesh.
bool smooth_edge (BezierEdge *e)
 Reposition the center point of the edge to make it smoother.
bool flip (BezierEdge *e, BezierTuple &tup)
 Flip a given edge if possible.
Point Location


int blind_locate_point (Point2D pt, BezierTuple &, double &u, double &v)
 Automatically choose a good starting point from which to do a locate_point().
int locate_point (Point2D pt, BezierTriangle *start_tri, bool over_bdry, BezierTuple &, double &u, double &v)
 Locates the element containing the given point in the mesh.
Mesh Queries
Queries about the state of the mesh and its properties

bool should_flip (BezierEdge *e)
 Given an edge, will flipping it make its triangles Delaunay.
bool can_flip (BezierEdge *e)
 Determine if a given edge can be flipped.
bool can_flip (BezierEdge *e, bool &is_typeA, bool &is_typeB)
 Determine if a given edge can be flipped.
bool can_smooth (BezierEdge *e)
 Check if a given edge can be smothed.
bool should_refine_func_angle (BezierEdge *e, double angle_const, double min_area_const)
 Determine if this edge should be refined due to a large function angle.
double function_angle (BezierEdge *e, double u, int func_idx)
 Determine the angle a function makes at a given parameter along an edge.
int find_inverted_triangles (std::vector< BezierTriangle * > &inverted)
int classify_inverted_triangles (std::vector< BezierTriangle * > &normal, std::vector< BezierTriangle * > &inverted, std::vector< BezierTriangle * > &unknown)
Mesh Algorithms
High level algorithms that can be run on the mesh

int smooth_mesh (double jacobian_bound, int passes=1)
 Smooth the BezierEdges in the mesh.
int make_delaunay ()
int make_delaunay (double angle_const, double min_area_const)
 Make the mesh delaunay using edge flips.
int make_delaunay (std::deque< BezierEdge * > flip_list)
int make_delaunay (std::deque< BezierEdge * > flip_list, double angle_const, double min_area_const)
int protect_boundarys ()
 Ensure that no BoundaryEdges are encroached, by splitting encroached edges.
int remove_small_angles ()
 Remove any triangles that have a small angle not caused by a boundary.
int remove_large_triangles (double size_const)
 Remove any triangles that are larger than a given constant size.
int function_angle_refine (double angle_const, double size_const)
 Refine in areas with large function angles.
int coarsen_const_size (double size_const, double lip_const, double nn_const, double dp_epsilon)
 Run the Miller/Talmor/Tang coarsening algorithm using a constant sizing function.
int coarsen_func_angle (double size_const, double lip_const, double nn_const, double dp_epsilon, double angle_const, double min_area_const)
 Coarsen with a constant szing function, and respect function_angle refines.
int coarsen_func_angle_debug (double size_const, double lip_const, double nn_const, double dp_epsilon, double angle_const, double min_area_const)

Public Attributes

double func_angle_x_cuttoff

Private Types

Coarsening Types
Typedefs for the coarsening procress

typedef hashers::hash_map<
BezierEdge *, double > 
EdgeLengthMapT
 A map from BezierEdges to thier linear length.
typedef hashers::hash_map<
BezierVertex *, double > 
BallRadiusMapT
 A map from BezierVertex to the ball size at that point.
typedef hashers::hash_set<
BezierVertex * > 
VertexSetT
 A set of verticies.
typedef FHeap< BezierVertexCoarsenQueueT
 A priority queue of vertexs priortized by thier radius.
typedef std::list< BezierVertex * > CoarsenKillListT
 A list of vertexs to remove.

Private Member Functions

 BezierMesh (const BezierMesh &o)
const BezierMeshoperator= (const BezierMesh &o)
Orientation operations
These operators are used to detemine the respective orientations between an edge and a triangle

int orient_edge_triangle (const BezierEdge *e, const BezierTriangle *t) const
 Finds relative orientation of a BezierEdge and BezierTriangle.
void tri_cps_off_edge (BezierEdge *e, BezierTriangle *t, ControlPoint &cp3, ControlPoint &cp4, ControlPoint &cp5)
 Get the 3 ControlPoints of the triangle which are not on the edge in an oriented way.
void tri_param_to_edge_param (const BezierEdge *e, const BezierTriangle *t, double &u, double alpha, double beta) const
 Convert edge's parametrization to triangle's parametrization.
void edge_param_to_tri_param (const BezierEdge *e, const BezierTriangle *t, double u, double &alpha, double &beta) const
 Convert edge's parametrization to triangle's parametrization.
Reinterpolation
Helper functions for the reinterpolation process

void reinterpolate (BezierEdge *e, BezierTriangle **newt, GhostTriangle **oldt)
 When two triangles have been replaced by two new triangles, set the edge data to minimize error.
bool interpolant_error (BezierTriangle *t, GhostTriangle **oldt, double alpha, double beta, LinearData &interp_err)
 Calculate the amount of error at a given point in the functions caused by replacing triangles.
double phi_evaluate (bool *tri_orientation, double alpha, double beta)
 An orientation helper for BezierMesh::reinterpolate().
Vertex removal helpers
Functions to aid in the vertex removal process

int devillers (BezierVertex *v, std::list< BezierVertex * > &link, int stop_degree)
void get_link (BezierTuple start_tup, std::list< BezierVertex * > &link)
int check_bdry_vertex_removal_degeneracies (std::list< BezierVertex * > &link, BezierVertex *v)
double ear_priority (BezierVertex *v, std::list< BezierVertex * >::iterator ear, const std::list< BezierVertex * > &link)
void flip_out_cavity (std::list< BezierEdge * > &cavity, std::list< BezierEdge * > &new_cavity, BezierVertex *vert)
Mesh operator helpers
Helper functions for smooth_edge() and flip()

BezierVertexinsert_point (BezierTriangle *t, double alpha, double beta)
 Insert a vertex inside triangle, splitting triangle into three.
BezierVertexinsert_edge_midpoint (BezierEdge *e, double u)
 Insert a vertex in the middle of an edge.
void get_edge_neighbor_cells (BezierEdge *e, BezierVertex *vs[], BezierEdge *es[], BezierTriangle *ts[])
 Given an edge, enumerates and saves all surrounding cells.
void split_return_adjacent (BezierEdge *e, std::vector< BezierEdge * > &new_edges)
void split_edge_near_unflippable (BezierEdge *e, std::vector< BezierEdge * > &new_edges)
Debugging helpers
Helpers for other debugging functions

bool consistency_check_helper (const BezierTriangle *t, const BezierEdge *e, const int p[3]) const
 A helper for the check_consistency() function.
bool print_check_inverted (const char *message, int expected=0)
 A quick way to put in checks against inverted elements.
Coarsening helpers
Helpers for the coarsening process

void coarsen_calculate_edge_lengths (EdgeLengthMapT &edge_length)
 Coarsen: Calculate the linear edge length of all BezierEdges.
void coarsen_keep_boundary (double dp_epsilon, VertexSetT &keep)
 Coarsen: Keep vertexs necessary for the boundary.
void coarsen_keep_large_function_angles (double angle_const, double min_area_const, VertexSetT &keep)
 Coarsen: Keep vertxes adjacent to large function angles.
void coarsen_approximate_sizing_func (double size_const, double nn_const, CoarsenQueueT &queue, VertexSetT &keep, EdgeLengthMapT &edge_length)
 Coarsen: Compute an intial sizing function, respecting keep nodes.
void coarsen_make_lipshitz (double lip_const, CoarsenQueueT &queue, EdgeLengthMapT &edge_length, BallRadiusMapT &radius)
 Coarsen: Make the sizing function lischitz.
void coarsen_find_verts_to_remove (VertexSetT &keep, EdgeLengthMapT &edge_length, BallRadiusMapT &radius, CoarsenKillListT &tokill)
 Coarsen: Find the vertexs to remove, given a sizing function.
int coarsen_remove_verts (CoarsenKillListT &tokill)
 Coarsen: Remove selected vertexs Given a list of vertxes, remove them.
void coarsen_draw_debug (VertexSetT &keep, BallRadiusMapT &radius, CoarsenKillListT &tokill)
 Coarsen: visual debugging.

Static Private Member Functions

Smoothing functions
Helper functions that abstract the smoothing interface

static bool robust_smooth (Point2D poly[], const Point2D &primary, const Point2D &secondary, Point2D &new_pt)
 Try to smooth point in a robust manner.
static bool smooth_point (double x_ary[], double y_ary[], const Point2D &p, Point2D &new_pt)
 Solves for best position for center point of an edge.

Private Attributes

BoundaryMeshboundarymesh
 The associated BoundaryMesh.
DataStoredatastore
 The associated DataStore.
bool linear_flips
 Control for flips.

Friends

std::ostream & operator<< (std::ostream &stream, const BezierMesh &bm)

Detailed Description

The CellComplex of Bezier Cells.

The BezierMesh class inherits from a CellComplex, that is instantiated with BezierVertex, BezierEdge, BezierTriangle and BezierTuple classes.

Every BezierMesh is associated with one BoundaryMesh and has a pointer to it. Every BezierMesh and BoundaryMesh pair have a DataStore to keep thier Control and Data points, they have a pointer to the DataStore.

The BezierMesh class is in many ways the heart of the Tumble project. The class contains a lagre number of methods for adding and removing cells, manipulating, querring, and debugging the mesh, as well as several high level cleaning functions for use with the mesh.

Definition at line 46 of file beziermesh.h.


Member Typedef Documentation

typedef hashers::hash_map<BezierEdge*, double> BezierMesh::EdgeLengthMapT [private]

A map from BezierEdges to thier linear length.

Definition at line 148 of file beziermesh.h.

typedef hashers::hash_map<BezierVertex*, double> BezierMesh::BallRadiusMapT [private]

A map from BezierVertex to the ball size at that point.

Definition at line 150 of file beziermesh.h.

typedef hashers::hash_set<BezierVertex*> BezierMesh::VertexSetT [private]

A set of verticies.

Definition at line 152 of file beziermesh.h.

typedef FHeap<BezierVertex> BezierMesh::CoarsenQueueT [private]

A priority queue of vertexs priortized by thier radius.

Definition at line 154 of file beziermesh.h.

typedef std::list<BezierVertex*> BezierMesh::CoarsenKillListT [private]

A list of vertexs to remove.

Definition at line 156 of file beziermesh.h.

typedef Vertex_Hash_T BezierMesh::Bezier_Vertex_Hash_T

Typedefs for hash sets Type for a hash of BezierVertexs.

Definition at line 197 of file beziermesh.h.

typedef Edge_Hash_T BezierMesh::Bezier_Edge_Hash_T

Type for a hash of BezierEdges.

Definition at line 199 of file beziermesh.h.

typedef Face_Hash_T BezierMesh::Bezier_Face_Hash_T

Type for a hash of BezierFaces.

Definition at line 201 of file beziermesh.h.


Constructor & Destructor Documentation

BezierMesh::BezierMesh ( const BezierMesh o  )  [private]

BezierMesh::BezierMesh ( PersistantStore ,
DataStore  
)

Defualt Constructor.

Definition at line 102 of file beziermesh.C.

BezierMesh::~BezierMesh (  ) 

Destructor.

Definition at line 114 of file beziermesh.C.


Member Function Documentation

int BezierMesh::orient_edge_triangle ( const BezierEdge e,
const BezierTriangle t 
) const [private]

Finds relative orientation of a BezierEdge and BezierTriangle.

Given a BezierTriangle and one of its BezierEdges, there is a total of six ways that the two can be oriented with respect to each other. These orientations are determined by the control point numberings. This function returns which of the six orientations the given edge/triangle pair are in.

tri-ed-orientation-wide.png

Triangle/Edge Orientations

Parameters:
e The given BezierEdge
t The given BezierTriangle
Returns:
Integer corresponding to the orientation type

Definition at line 395 of file beziermesh.C.

References BezierTriangle::get_control_point(), BezierEdge::get_control_point(), and EdgeCell::has_face().

Referenced by check_consistency(), edge_param_to_tri_param(), tri_cps_off_edge(), and tri_param_to_edge_param().

Here is the call graph for this function:

void BezierMesh::tri_cps_off_edge ( BezierEdge e,
BezierTriangle t,
ControlPoint cp3,
ControlPoint cp4,
ControlPoint cp5 
) [private]

Get the 3 ControlPoints of the triangle which are not on the edge in an oriented way.

Given an edge and a triangle, there are three of the triangles control points which are not also ControlPoints of the edge. This function retrieves these in an oriented way. We pretend that the triangle is actually numbered in a way that syncs up with the edge, that is, we pretend the following is true:

 t->get_control_point(0)==e->get_control_point(0)
 t->get_control_point(1)==e->get_control_point(1)
 t->get_control_point(2)==e->get_control_point(2)

Then we retrieve what, in this hypothetical ordering, would be the triangle's 3,4 and 5 ControlPoints.

Parameters:
e The given BezierEdge
t The given BezierTriangle
[out] cp3 What would be t->get_control_point(3) in our hypothetical numbering of t's ControlPoints
[out] cp4 What would be t->get_control_point(4) in our hypothetical numbering of t's ControlPoints
[out] cp5 What would be t->get_control_point(5) in our hypothetical numbering of t's ControlPoints

Definition at line 435 of file beziermesh.C.

References BezierTriangle::get_control_point(), and orient_edge_triangle().

Referenced by function_angle().

Here is the call graph for this function:

void BezierMesh::tri_param_to_edge_param ( const BezierEdge e,
const BezierTriangle t,
double &  u,
double  alpha,
double  beta 
) const [private]

Convert edge's parametrization to triangle's parametrization.

Given an edge and a triangle and barycentric coordinates in the triangle, find out what the equivalent parameter is for the edge.

Definition at line 503 of file beziermesh.C.

References orient_edge_triangle().

Referenced by locate_point_in_quadratic_triangle().

Here is the call graph for this function:

void BezierMesh::edge_param_to_tri_param ( const BezierEdge e,
const BezierTriangle t,
double  u,
double &  alpha,
double &  beta 
) const [private]

Convert edge's parametrization to triangle's parametrization.

Given an edge and a triangle and a parameter along that edge, find out what the equivalent parameters are in the triangle to coorespond to the same position

Parameters:
e The given BezierEdge
t The given BezierTriangle
u The given parameter along e
[out] alpha The first of the cooresponding triangle parameters
[out] beta The second of the cooresponding triangle parameters

Definition at line 470 of file beziermesh.C.

References orient_edge_triangle().

Referenced by insert_edge_midpoint(), locate_point_in_quadratic_triangle(), and reinterpolate().

Here is the call graph for this function:

bool BezierMesh::robust_smooth ( Point2D  poly[],
const Point2D primary,
const Point2D secondary,
Point2D new_pt 
) [static, private]

Try to smooth point in a robust manner.

Given the bounding hexagon, and two points to try as input to the smooth_point() function, this function will try to smooth on the primary point, upon failure it will attempt to use the secondary point. It returns true and sets the new_pt on success of either point, and returns false on double failure.

Parameters:
poly The coordinates of the hexagon
primary The first point to try as input to smooth_point()
secondary The backup point to try
[out] new_pt The location of the new point on success, the secondary point on failure
Returns:
True if smooth succeeded with either primary or secondary, false on failure of both

Definition at line 550 of file beziermesh.C.

References smooth_point().

Referenced by can_flip(), can_smooth(), debug_smooth(), flip(), and smooth_edge().

Here is the call graph for this function:

bool BezierMesh::smooth_point ( double  x[],
double  y[],
const Point2D p,
Point2D new_pt 
) [static, private]

Solves for best position for center point of an edge.

Success requires that the polygon is not inverted and has a kernel.

We have one of four cases:

Case 1 and 2 will lead to failure. Case 3 and 4 will lead to success.

We need an instance of Case 4 to be able to run the MEAN_RATIO smooth to choose a quality point. We will use an AREA smooth to change an instance of Case 3 into a Case 4.

On failure, false is returned, and new_pt is set to p.

On success, true is returned, and new_pt is the result of the MEAN_RATIO smooth.

Parameters:
x Array of x-coordinates of hexagon
y Array of y-coordinates of hexagon
p The original point
[out] new_pt The location of the new point on success, the original point on failure
Returns:
true if new location found successfully, false otherwise.

Definition at line 589 of file beziermesh.C.

References Point2D::coords, WARNING, Point2D::x(), and Point2D::y().

Referenced by robust_smooth().

Here is the call graph for this function:

void BezierMesh::reinterpolate ( BezierEdge e,
BezierTriangle **  newt,
GhostTriangle **  oldt 
) [private]

When two triangles have been replaced by two new triangles, set the edge data to minimize error.

When calling BezierMesh::smooth_edge() or BezierMesh::flip(), two old triangles sharing an old edge are replaced with two new triangles sharing a new edge. This inherently changes the basis functions in this region and in turn changes the class of functions which are representable. The geometric locations of the triangles are fixed, as well as the data at all points but one.

This leaves the data point in the center of the new edge as the only degree of freedom, in determining the representation of our functions defined on this region. We will set this data in a manner that minimizes the integral of the difference of the old and new functions.

Todo:
Can the orientation be simplifed here, pssible eliminateing BezierMesh::phi_evaluate()
Parameters:
e The edge to set the data on
newt An array of the two new triangles
oldt An array of the two old triangles, now stored as GhostTriangle

Definition at line 3117 of file beziermesh.C.

References BezierEdge::access_dp(), ALPHA, BETA, edge_param_to_tri_param(), interpolant_error(), BezierTriangle::jacobian(), LinearData::length, phi_evaluate(), WEIGHT, and LinearData::zero().

Referenced by flip(), and smooth_edge().

Here is the call graph for this function:

bool BezierMesh::interpolant_error ( BezierTriangle t,
GhostTriangle **  oldt,
double  alpha,
double  beta,
LinearData interp_err 
) [private]

Calculate the amount of error at a given point in the functions caused by replacing triangles.

When reinterpolating, we are interested in looking a point in a new triangle, and determining how the values of the various functions have changed since we replaced the triangles in oldt with the triangle t .

Thus given parameters u and v we locate that point in t and figure out which GhostTriangle in oldt used to contain that point. We look-up the function values in both the old and new triangles and then find the difference

Parameters:
t The BezierTriangle to look in
oldt An array holding the two ghost triangles
alpha The first parameter
beta The second parameter
[out] interp_error The amount of error for each function
Returns:
True if point locations were successful

Definition at line 3217 of file beziermesh.C.

References BezierTriangle::dataeval(), GhostTriangle::dataeval(), and BezierTriangle::eval().

Referenced by reinterpolate().

Here is the call graph for this function:

double BezierMesh::phi_evaluate ( bool *  tri_orientation,
double  alpha,
double  beta 
) [private]

An orientation helper for BezierMesh::reinterpolate().

Definition at line 3192 of file beziermesh.C.

Referenced by reinterpolate().

int BezierMesh::devillers ( BezierVertex v,
std::list< BezierVertex * > &  link,
int  stop_degree 
) [private]

Referenced by remove_vertex().

void BezierMesh::get_link ( BezierTuple  start_tup,
std::list< BezierVertex * > &  link 
) [private]

Referenced by remove_vertex().

int BezierMesh::check_bdry_vertex_removal_degeneracies ( std::list< BezierVertex * > &  link,
BezierVertex v 
) [private]

Referenced by remove_vertex().

double BezierMesh::ear_priority ( BezierVertex v,
std::list< BezierVertex * >::iterator  ear,
const std::list< BezierVertex * > &  link 
) [private]

void BezierMesh::flip_out_cavity ( std::list< BezierEdge * > &  cavity,
std::list< BezierEdge * > &  new_cavity,
BezierVertex vert 
) [private]

Referenced by clean_insert_edge_midpoint(), and clean_insert_point().

BezierVertex * BezierMesh::insert_point ( BezierTriangle t,
double  u,
double  v 
) [private]

Insert a vertex inside triangle, splitting triangle into three.

Given a triangle and parameters specifying a point in the triangle, insert a new BezieVertex, and split the BezierTriangle into three.

This does not ensure the resulting mesh is Delaunay.

Parameters:
t The triangle in which to insert the point
u The first parameter
v The second parameter
Returns:
New BezierVertex added in center of t

Definition at line 1336 of file beziermesh.C.

References add_bezier_edge(), add_bezier_triangle(), add_bezier_vertex(), check_consistency(), BezierTriangle::dataevalIntermediate(), delete_face(), CellTuple< Vertex, Edge, Face >::e, BezierTriangle::evalIntermediate(), BezierTriangle::get_bdry_face_or_null(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_tuple(), BezierTriangle::is_inverted(), print_check_inverted(), smooth_edge(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::Switch(), and CellTuple< Vertex, Edge, Face >::v.

Referenced by clean_insert_point().

Here is the call graph for this function:

BezierVertex * BezierMesh::insert_edge_midpoint ( BezierEdge e,
double  u 
) [private]

Insert a vertex in the middle of an edge.

Given a edge and a parameter along it specifying a point on the edge, insert a new BezierVertex. If the BezierEdge has only one face, then it splits that face in half. If the BezierEdge has two faces, both get split in half.

If the BezierEdge is on the boundary, than this function adds a knot to the spline, and sets the necessary pointers on the generated vertexes and edges.

This does not ensure the resulting mesh is Delaunay.

Parameters:
e The edge to split
u The parameter along the edge
v The second parameter
Returns:
New BezierVertex added in the middle of e

Definition at line 1430 of file beziermesh.C.

References add_bezier_edge(), add_bezier_triangle(), add_bezier_vertex(), QBSpline::add_knot(), BezierTriangle::dataevalIntermediate(), delete_edge(), CellTuple< Vertex, Edge, Face >::e, edge_param_to_tri_param(), BezierEdge::eval(), BezierTriangle::evalIntermediate(), CellTuple< Vertex, Edge, Face >::f, BezierEdge::get_bdry_edge(), BezierTriangle::get_bdry_face_or_null(), BoundaryEdge::get_spline(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_tuple(), BezierVertex::get_u(), BezierEdge::get_vertex(), BezierEdge::is_boundary(), print_check_inverted(), BezierEdge::set_bdry(), BezierVertex::set_bdry(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::Switch(), and CellTuple< Vertex, Edge, Face >::v.

Referenced by clean_insert_edge_midpoint().

Here is the call graph for this function:

void BezierMesh::get_edge_neighbor_cells ( BezierEdge e,
BezierVertex vs[],
BezierEdge es[],
BezierTriangle ts[] 
) [private]

Given an edge, enumerates and saves all surrounding cells.

This is a common helper routine for several mesh operations like flip(), and smooth_edge(). Given a non-boundary edge, we take the two adjacent triangles, then enumerate and return all their edges and vertexes.

In the image below 'tup' is an indication of the initial, oriented tuple obtained by get_tuple(BezierEdge*), and its relation to the enumeration.

beziermesh-get_edge_neighbor_cells.png

Enumeration order for neighbor cells

Parameters:
e A non-boundary edge
[out] vs The 4 relevent vertexes about this edge, enumerated as specified
[out] es The 4 relevent edges about this edge, enumerated as specified
[out] ts The 2 relevent triangles about this edge, enumerated as specified

Definition at line 717 of file beziermesh.C.

References CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_tuple(), BezierEdge::is_boundary(), and CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::Switch().

Referenced by can_flip(), can_smooth(), debug_flip(), debug_smooth(), flip(), and smooth_edge().

Here is the call graph for this function:

void BezierMesh::split_return_adjacent ( BezierEdge e,
std::vector< BezierEdge * > &  new_edges 
) [private]

void BezierMesh::split_edge_near_unflippable ( BezierEdge e,
std::vector< BezierEdge * > &  new_edges 
) [private]

bool BezierMesh::debug_flip ( BezierEdge e  ) 

Debug the flipping code.

Given an edge check if it is flippable. If it is not flippable, and DEBUG_FLIP is set, then print messages. If DRAW_FLIP is set, then draw the bad flip.

Parameters:
e The edge to check
Returns:
true if the edge is flippable, false otheriwise.

Definition at line 876 of file beziermesh.C.

References boundarymesh, can_flip(), draw_smooth_error(), BezierVertex::get_cp(), BezierEdge::get_cp(), get_edge_neighbor_cells(), get_flip_polygon(), and MeshBinaryOutput::write().

Referenced by flip().

Here is the call graph for this function:

bool BezierMesh::debug_smooth ( BezierEdge e  ) 

Debug the smooth_edge() function.

If DEBUG_SMOOTH is set and the edge is not smoothable, then print some error messages. If DRAW_SMOOTH is also set, then draw the unsmoothable edge.

Parameters:
e The edge to smooth
Returns:
true if the edge can be smoothed, false otherwise

Definition at line 959 of file beziermesh.C.

References draw_smooth_error(), BezierVertex::get_cp(), BezierEdge::get_cp(), get_edge_neighbor_cells(), get_smooth_polygon(), robust_smooth(), and WARNING.

Referenced by smooth_edge().

Here is the call graph for this function:

void BezierMesh::draw_smooth_error ( const char *  name,
BezierEdge e,
Point2D  poly[],
const Point2D primary,
const Point2D secondary,
BezierTriangle ts[] 
)

Draw unflippable or unsmoothable egdes.

Given an unflippable or unsmoothable edge, draw the error, and print the error to a file.

Parameters:
name The name of the ouptu file
e The edge in question
poly The smoothing polyogn
primary The primary smoothing point
secondary The secondary smoothing point
ts The triangles of the edge.

Definition at line 1007 of file beziermesh.C.

References BLUE, Visualization::draw(), Visualization::draw_smooth_debug(), Visualization::finish_draw(), GREEN, Visualization::start_draw(), Visualization::write_ppm(), and Visualization::zoomout().

Referenced by debug_flip(), and debug_smooth().

Here is the call graph for this function:

void BezierMesh::draw_insert_error ( const char *  name,
BezierTriangle bt 
)

Definition at line 1033 of file beziermesh.C.

References BLUE, Visualization::draw_control_net(), Visualization::draw_point(), Visualization::draw_tuple(), Visualization::finish_draw(), Visualization::get_bbox(), BezierTriangle::get_cp(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_tuple(), GREEN, MAGENTA, RED, Visualization::start_draw(), WHITE, Visualization::write_ppm(), and Visualization::zoomin().

Referenced by print_check_inverted().

Here is the call graph for this function:

void BezierMesh::get_smooth_polygon ( Point2D  poly[],
BezierVertex vs[],
BezierEdge es[] 
)

Given the vertexs and edges around an edge to smooth, get the smoothing polygon.

This retrievs the smoothing polygon for an edge smooth.

This function must be given the vs and es from get_edge_neighbor_cells(). This is so that the enumeration of the verticies and edges matches with that used in other parts of the flip() and smooth_edge() functions.

Parameters:
[out] poly The new polygon [size 6]
vs The vertex enumeration from get_edge_neighbor_cells()
es The edge enumeration from get_edge_neighbor_cells()

Definition at line 1094 of file beziermesh.C.

References BezierEdge::get_cp(), and BezierVertex::get_cp().

Referenced by can_smooth(), debug_smooth(), and smooth_edge().

Here is the call graph for this function:

void BezierMesh::get_flip_polygon ( Point2D  poly[],
BezierVertex vs[],
BezierEdge es[] 
)

Given the vertexs and edges around an edge to flip, get the smoothing polygon.

This retrievs the smoothing polygon for an edge flip. This is different from get_smooth_polygon(), because here, the edge to smooth is the new edge, not yet inserted.

This function must be given the vs and es from get_edge_neighbor_cells(). This is so that the enumeration of the verticies and edges matches with that used in other parts of the flip() and smooth_edge() functions.

Parameters:
[out] poly The new polygon [size 6]
vs The vertex enumeration from get_edge_neighbor_cells()
es The edge enumeration from get_edge_neighbor_cells()

Definition at line 1071 of file beziermesh.C.

References BezierEdge::get_cp(), and BezierVertex::get_cp().

Referenced by can_flip(), debug_flip(), and flip().

Here is the call graph for this function:

bool BezierMesh::consistency_check_helper ( const BezierTriangle t,
const BezierEdge e,
const int  p[3] 
) const [private]

A helper for the check_consistency() function.

p must have size 3

Definition at line 4303 of file beziermesh.C.

References BezierTriangle::get_control_point(), BezierEdge::get_control_point(), BezierVertex::get_control_point(), BezierTriangle::get_data_point(), BezierEdge::get_data_point(), BezierVertex::get_data_point(), and BezierEdge::get_vertex().

Referenced by check_consistency().

Here is the call graph for this function:

bool BezierMesh::print_check_inverted ( const char *  message,
int  expected = 0 
) [private]

A quick way to put in checks against inverted elements.

Parameters:
message Something to print if we find inverted elements.
expected The number of expected inverted elements (default 0).
Returns:
Whether everything was dandy: you can assert(print_check_...)

Definition at line 4374 of file beziermesh.C.

References boundarymesh, check_consistency(), draw_insert_error(), find_inverted_triangles(), BezierTriangle::is_inverted(), and MeshBinaryOutput::write().

Referenced by flip(), insert_edge_midpoint(), and insert_point().

Here is the call graph for this function:

BezierTriangle * BezierMesh::find_start_triangle ( const Point2D pt  )  [private]

Given a point to locat, find a good starting triangle to use in BezierMesh::locate_point().

Finds the closest triangle to pt out of the first $ O(n^{\frac{1}{3}}) $ random triangles.

This function has 2n-1 pointer copies to create random permutation and n^(1/3) dist calculations this is slow so hopefully only use this for debugging or in other exceptional circumstances

Parameters:
pt The point to locate
Returns:
A good starting triangle

Definition at line 2561 of file beziermesh.C.

References BezierTriangle::get_cp(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_num_faces(), and sampler.

Referenced by blind_locate_point().

Here is the call graph for this function:

int BezierMesh::locate_point_in_quadratic_triangle ( const Point2D pt,
BezierTriangle t,
BezierTuple cellfound,
double &  u,
double &  v 
) [private]

Determine if a Bezier Triangle contains a point.

Return the containment dimension as per locate_point_in_linear_mesh, as if the triangle were the entire mesh. If it was 1, we also return the u value along that edge. If it was 2, we return both u and v values for the triangle.

Parameters:
pt The point to locate
t The triangle to look in
[out] cellfound The cell we found (vertex, edge, triangle)

Definition at line 2697 of file beziermesh.C.

References CellTuple< Vertex, Edge, Face >::e, edge_param_to_tri_param(), CellTuple< Vertex, Edge, Face >::f, BezierTriangle::get_control_point(), BezierTriangle::get_edge(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_tuple(), Tumble::is_zero(), BezierTriangle::newton_find(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::Switch(), tri_param_to_edge_param(), and CellTuple< Vertex, Edge, Face >::v.

Referenced by locate_point().

Here is the call graph for this function:

int BezierMesh::locate_point_in_linear_mesh ( const Point2D pt,
BezierTriangle start,
bool  over_bdry,
BezierTuple cellfound 
) [private]

Locate a given point in the linear mesh.

Returns the containment dimension of the point: 0 if the point is exactly at a vertex of the mesh 1 if the point is exactly on an edge of the linear mesh (it may not be on the corresponding bezier edge) 2 if the point is anywhere in the strict interior of the triangle. The cell that contains it is in cellfound. If the point is outside the mesh, or across a boundary we weren't allowed to cross, return -1 and the last edge we tried to cross.

Parameters:
pt The point to locate
start The triangle to start the search from
over_bdry Walk across boundaries?
[out] cellfound A tuple for the cell we found.
Returns:
the containment dimension. located in a triangle

Definition at line 2842 of file beziermesh.C.

References CellTuple< Vertex, Edge, Face >::e, CellTuple< Vertex, Edge, Face >::f, BezierVertex::get_cp(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_num_faces(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_tuple(), BezierEdge::is_boundary(), Tumble::is_zero(), Point2D::line_side_test(), Point2D::machine_equal(), EdgeCell::num_faces(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::Switch(), CellTuple< Vertex, Edge, Face >::v, Point2D::x(), and Point2D::y().

Referenced by locate_point().

Here is the call graph for this function:

void BezierMesh::coarsen_calculate_edge_lengths ( EdgeLengthMapT edge_length  )  [private]

Coarsen: Calculate the linear edge length of all BezierEdges.

Computes the linear length of each edge and stores it in a map. This data is used by several components in the coarsening process.

Parameters:
[out] edge_length A map frim BezierEdges to thier linear lenght

Definition at line 3711 of file beziermesh.C.

References BezierVertex::get_cp(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_edges_begin(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_edges_end(), and BezierEdge::get_vertex().

Referenced by coarsen_const_size(), coarsen_func_angle(), and coarsen_func_angle_debug().

Here is the call graph for this function:

void BezierMesh::coarsen_keep_boundary ( double  dp_epsilon,
VertexSetT keep 
) [private]

Coarsen: Keep vertexs necessary for the boundary.

This function keeps all D0 vertxes (those on a BoundaryVertex), and uses the Douglas Peucker algorithm with the supplied tolerence to decide which D1 (those on a BoundaryEdge) must be keept. Marking these vertxes as keepers gurentess as an invariant that they will not be removed by the coarsener.

Parameters:
dp_epsilon The tolerence for the Douglas Peucker Algorithm
[out] keep A set of BezierVertexs to keep

Definition at line 3734 of file beziermesh.C.

References boundarymesh, CellComplex< Vertex, Edge, Face, Tuple >::get_edges_begin(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_end(), CellComplex< Vertex, Edge, Face, Tuple >::get_vertexs_begin(), and CellComplex< Vertex, Edge, Face, Tuple >::get_vertexs_end().

Referenced by coarsen_const_size(), coarsen_func_angle(), and coarsen_func_angle_debug().

Here is the call graph for this function:

void BezierMesh::coarsen_keep_large_function_angles ( double  angle_const,
double  min_area_const,
VertexSetT keep 
) [private]

Coarsen: Keep vertxes adjacent to large function angles.

This function finds all edges which meet the criteria Marking these vertxes as keepers gurentess as an invariant that they will not be removed by the coarsener.

Parameters:
angle_const The threshold for function angles
min_area_const Don't refine any edges with triangles smaller than this size
[out] keep The set of BezierVertexs to keep

Definition at line 3766 of file beziermesh.C.

References CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_edges_begin(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_edges_end(), BezierEdge::get_vertex(), and should_refine_func_angle().

Referenced by coarsen_func_angle(), and coarsen_func_angle_debug().

Here is the call graph for this function:

void BezierMesh::coarsen_approximate_sizing_func ( double  size_const,
double  nn_const,
CoarsenQueueT queue,
VertexSetT keep,
EdgeLengthMapT edge_length 
) [private]

Coarsen: Compute an intial sizing function, respecting keep nodes.

Starting with a constant sizing function, this method modifies it to respect the keep nodes. If a node is to be kept, then its radius is made to be half the distance to its nearest neighbor, also those neighbors have their radii reduced so as not to overlap with the balls at the keep nodes. This ensures that any maximal ball packing will include the keep points, as their balls do not overlap with any other balls.

Parameters:
size_const The sizing constant
nn_const The nearest neighbor constant
[out] queue A priority queue of vertxs with thier radii
keep The vertexs marked as keepers
edge_length A map of BezierEdges to thier linear lengths

Definition at line 3815 of file beziermesh.C.

References FHeap< Data >::decrease(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_vertexs_begin(), and CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_vertexs_end().

Referenced by coarsen_const_size(), coarsen_func_angle(), and coarsen_func_angle_debug().

Here is the call graph for this function:

void BezierMesh::coarsen_make_lipshitz ( double  lip_const,
CoarsenQueueT queue,
EdgeLengthMapT edge_length,
BallRadiusMapT radius 
) [private]

Coarsen: Make the sizing function lischitz.

Given an initial sizing function stored in a priority queue, make the function n-lipschitz. This is essentially Dijkstra's algorithm, with a priority queue of vertexs. Thus this function is $ O(|V| * \ln{|V|} $ since $ |\mbox{queue}|=|V| $ and $ \mbox{rem_min} = O(\ln{|\mbox{queue}|}) $.

Parameters:
size_const The sizing constant
nn_const The nearest neighbor constant
queue A priority queue of vertxs with thier radii
keep The vertexs marked as keepers
edge_length A map of BezierEdges to thier linear lengths
[out] radius The final function value at each vertex

Definition at line 3876 of file beziermesh.C.

References VertexCell::begin_edges(), FHeap< Data >::decrease(), FHeap< Data >::empty(), VertexCell::end_edges(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_opposite_vertex(), and FHeap< Data >::rem_min().

Referenced by coarsen_const_size(), coarsen_func_angle(), and coarsen_func_angle_debug().

Here is the call graph for this function:

void BezierMesh::coarsen_find_verts_to_remove ( VertexSetT keep,
EdgeLengthMapT edge_length,
BallRadiusMapT radius,
CoarsenKillListT tokill 
) [private]

Coarsen: Find the vertexs to remove, given a sizing function.

The sizign function is given as values at each vertex which are interperated as the radii of balls on the vertexs. We then look for a maximal non-overaling set of balls. By design of the radii, this will include the keep nodes, thus we build from the initial set of keep nodes, adding as many balls as possible.

Parameters:
[out] keep The set of vertexes to keep
edge_length A map of BezierEdges to thier linear lengths
radius The sizing function values at each vertex
[out] tokill The list of vertexes to remove

Definition at line 3907 of file beziermesh.C.

References CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_opposite_vertex(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_vertexs_begin(), and CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_vertexs_end().

Referenced by coarsen_const_size(), coarsen_func_angle(), and coarsen_func_angle_debug().

Here is the call graph for this function:

int BezierMesh::coarsen_remove_verts ( CoarsenKillListT tokill  )  [private]

Coarsen: Remove selected vertexs Given a list of vertxes, remove them.

Parameters:
tokill A list of vertexes to kill
Returns:
number of vertxes removed

Definition at line 3942 of file beziermesh.C.

References remove_vertex().

Referenced by coarsen_const_size(), coarsen_func_angle(), and coarsen_func_angle_debug().

Here is the call graph for this function:

void BezierMesh::coarsen_draw_debug ( VertexSetT keep,
BallRadiusMapT radius,
CoarsenKillListT tokill 
) [private]

Coarsen: visual debugging.

Definition at line 3958 of file beziermesh.C.

References BLUE, Visualization::draw(), Visualization::draw_circle(), Visualization::draw_point(), Visualization::finish_draw(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_vertexs_begin(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_vertexs_end(), GRAY4, GREEN, RED, and Visualization::start_draw().

Referenced by coarsen_const_size(), coarsen_func_angle(), and coarsen_func_angle_debug().

Here is the call graph for this function:

const BezierMesh& BezierMesh::operator= ( const BezierMesh o  )  [private]

void BezierMesh::set_bdry_mesh ( BoundaryMesh  ) 

Definition at line 109 of file beziermesh.C.

References boundarymesh.

Referenced by Simulation::initialize_structures().

void BezierMesh::set_linear_flips ( bool  val  )  [inline]

Set method for linear_flips variable.

Definition at line 213 of file beziermesh.h.

References linear_flips.

Referenced by ConformalMesher::mesh(), and MeshConstructor::remove_small_angles().

BezierVertex * BezierMesh::add_bezier_vertex ( const Point2D _p  ) 

Adds a new BezierVertex Creates a new BezierVertex with point _p and empty data, then returns a handle to it.

Parameters:
_p The new point for the vertex
Returns:
The new BezierVertex

Definition at line 122 of file beziermesh.C.

Referenced by add_bezier_vertex(), ConformalMesher::create_bbox(), insert_edge_midpoint(), insert_point(), MeshBinaryInput::read(), and MeshInput::read().

BezierVertex * BezierMesh::add_bezier_vertex ( const Point2D _p,
const LinearData _d 
)

Adds a new BezierVertex with data Creates a new BezierVertex with point _p and data _d, then returns a handle to it.

Parameters:
_p The new point for the vertex
_d The new data at the vertex
Returns:
The new BezierVertex

Definition at line 134 of file beziermesh.C.

References add_bezier_vertex(), DataStore::add_cp(), and datastore.

Here is the call graph for this function:

BezierVertex * BezierMesh::add_bezier_vertex ( ControlPoint  cp  ) 

Adds a new BezierVertex on the boundary Given a new ControlPoint from some boundary cell, create a BezierVertex with empty data.

Parameters:
cp The ControlPoint for the vertex
Returns:
The new BezierVertex

Definition at line 145 of file beziermesh.C.

References add_bezier_vertex().

Here is the call graph for this function:

BezierVertex * BezierMesh::add_bezier_vertex ( ControlPoint  cp,
const LinearData _d 
)

Adds a new BezierVertex on the boundary with data Given a new ControlPoint from some boundary cell, create a BezierVertex with data _d.

Parameters:
cp The ControlPoint for the vertex
_d The new data
Returns:
The new BezierVertex

Definition at line 158 of file beziermesh.C.

References DataStore::add_dp(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::add_vertex(), datastore, and CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_store().

Here is the call graph for this function:

BezierEdge * BezierMesh::add_bezier_edge ( const Point2D _p,
BezierVertex v0,
BezierVertex v1 
)

Adds a new BezierEdge Given two BezierVertexs and a center point, create a new BezierEdge with empty data on the center point.

Parameters:
_p The center point for the edge
v0 The first BezierVertex of the edge
v1 The second BezierVertex of the edge
Returns:
The new BezierEdge

Definition at line 173 of file beziermesh.C.

Referenced by add_bezier_edge(), add_straight_bezier_edge(), flip(), insert_edge_midpoint(), insert_point(), MeshBinaryInput::read(), MeshInput::read(), and remove_vertex().

BezierEdge * BezierMesh::add_bezier_edge ( const Point2D _p,
const LinearData _d,
BezierVertex v0,
BezierVertex v1 
)

Adds a new BezierEdge with data Given two BezierVertexs and a center point, create a new BezierEdge with data _d on the center point.

Parameters:
_p The center point for the edge
_d The new data for the center point
v0 The first BezierVertex of the edge
v1 The second BezierVertex of the edge
Returns:
The new BezierEdge

Definition at line 187 of file beziermesh.C.

References add_bezier_edge(), DataStore::add_cp(), and datastore.

Here is the call graph for this function:

BezierEdge * BezierMesh::add_straight_bezier_edge ( BezierVertex ,
BezierVertex  
)

Definition at line 230 of file beziermesh.C.

References BezierVertex::get_dp().

Referenced by ConformalMesher::create_bbox(), and remove_vertex().

Here is the call graph for this function:

BezierEdge * BezierMesh::add_straight_bezier_edge ( const LinearData ,
BezierVertex ,
BezierVertex  
)

Definition at line 236 of file beziermesh.C.

References add_bezier_edge(), and BezierVertex::get_cp().

Here is the call graph for this function:

BezierEdge * BezierMesh::add_bezier_edge ( ControlPoint  cp,
BezierVertex v0,
BezierVertex v1 
)

Adds a new BezierEdge on the boundary Given a control point from the boundary and two BezierVertexs, create a new BezierEdge with empty data for the center point.

Parameters:
cp The ControlPoint to use as the center point for the edge
v0 The first BezierVertex of the edge
v1 The second BezierVertex of the edge
Returns:
The new BezierEdge

Definition at line 201 of file beziermesh.C.

References add_bezier_edge().

Here is the call graph for this function:

BezierEdge * BezierMesh::add_bezier_edge ( ControlPoint  cp,
const LinearData _d,
BezierVertex v0,
BezierVertex v1 
)

Adds a new BezierEdge on the boundary with data Given a control point from the boundary and two BezierVertexs, create a new BezierEdge with data _d for the center point.

Parameters:
cp The ControlPoint to use as the center point for the edge
_d The new data for the center point
v0 The first BezierVertex of the edge
v1 The second BezierVertex of the edge
Returns:
The new BezierEdge

Definition at line 216 of file beziermesh.C.

References DataStore::add_dp(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::add_edge(), datastore, DataStore::get_data(), BezierEdge::get_data_point(), and CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_store().

Here is the call graph for this function:

BezierTriangle * BezierMesh::add_bezier_triangle ( BoundaryFace face,
BezierEdge e0,
BezierEdge e1,
BezierEdge e2,
bool  inverse_handed = false 
)

Adds a new BezierTriangle Given three BezierEdges and a BoundaryFace, create a new BezierTriangle and return a handle to it.

Parameters:
face The BoundaryFace containing the triangle
e0 The first BezierEdge
e1 The second BezierEdge
e2 The third BezierEdge
inverse_hand 
Returns:
The new BezierTriangle The canonical tuple of the new triangle will be, <NewTri, e0, e0->get_canon_vertex> Normal handedness is CCW The boolean inverse_handed should be set TRUE IF this is CLOCKWISE

Definition at line 256 of file beziermesh.C.

References CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::add_face(), datastore, CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_store(), sample_id_map, sampler, and BezierTriangle::set_boundary_face().

Referenced by ConformalMesher::create_bbox(), flip(), insert_edge_midpoint(), insert_point(), MeshBinaryInput::read(), MeshInput::read(), and remove_vertex().

Here is the call graph for this function:

void BezierMesh::delete_vertex ( BezierVertex v  )  [virtual]

Deletes a BezierVertex from the mesh.

This is a wrapper for CellComplex::delete_vertex(). It makes sure to free any data from the DataStore that was allocated for this BezierVertex. It knows to keep around ControlPoints if the vertex was a D0 or D1. It also frees any data from BeizerEdges that will be removed as a result of removing this vertex.

Parameters:
v The BezierVertex to delete

Reimplemented from CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >.

Definition at line 280 of file beziermesh.C.

References datastore, delete_edge(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::delete_vertex(), VertexCell::get_any_edge(), BezierVertex::get_control_point(), BezierVertex::get_data_point(), BezierVertex::is_boundary(), VertexCell::num_edges(), DataStore::rem_cp(), and DataStore::rem_dp().

Referenced by ConformalMesher::excavate_holes(), and remove_vertex().

Here is the call graph for this function:

void BezierMesh::delete_edge ( BezierEdge edge  )  [virtual]

Removes a BezierEdge from the mesh.

This function makes sure to remove any data that was allocated on the DataStore for this edge. It knows not to delete ControlPoints if the edge is a boundary edge.

Parameters:
edge The BezierEdge to delete

Reimplemented from CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >.

Definition at line 305 of file beziermesh.C.

References datastore, CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::delete_edge(), BezierEdge::get_control_point(), BezierEdge::get_data_point(), BezierEdge::is_boundary(), DataStore::rem_cp(), and DataStore::rem_dp().

Referenced by delete_vertex(), ConformalMesher::excavate_holes(), flip(), insert_edge_midpoint(), and remove_vertex().

Here is the call graph for this function:

void BezierMesh::delete_face ( BezierTriangle face  )  [virtual]

Removes a BezierFace from the mesh.

Parameters:
edge The BezierEdge to delete

Reimplemented from CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >.

Definition at line 320 of file beziermesh.C.

References CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::delete_face(), sample_id_map, and sampler.

Referenced by ConformalMesher::excavate_holes(), and insert_point().

Here is the call graph for this function:

void BezierMesh::replace_control_point ( BezierVertex v,
const ControlPoint newp 
)

Replace a control point.

Remove the ControlPoint from the store and all simplices that include this vertex, and replace it with the new ControlPoint. Ask no questions about relative positions: assume the caller knows what they're doing.

Definition at line 338 of file beziermesh.C.

References datastore, CellTuple< Vertex, Edge, Face >::e, CellTuple< Vertex, Edge, Face >::f, BezierVertex::get_control_point(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_tuple(), DataStore::replace_cp(), BezierVertex::replace_cp(), and CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::Switch().

Referenced by ConformalMesher::create_subsplines(), ConformalMesher::insert_d0_vertices(), and ConformalMesher::reticulate_splines().

Here is the call graph for this function:

void BezierMesh::replace_control_point ( BezierEdge ,
const ControlPoint newp 
)

Definition at line 359 of file beziermesh.C.

References datastore, CellTuple< Vertex, Edge, Face >::f, BezierEdge::get_control_point(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_tuple(), EdgeCell::num_faces(), DataStore::replace_cp(), BezierEdge::replace_cp(), and CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::Switch().

Here is the call graph for this function:

BezierVertex * BezierMesh::clean_insert_point ( Point2D  p,
BezierTriangle start_tri = NULL,
bool  over_bdry = true,
bool  force = true 
)

Insert a point in the mesh and make the resulting mesh delaunay.

Given a Point2D, locate it in the mesh and insert it using using BezierMesh::clean_insert_point()

This function requires that the mesh be Delaunay. The new point must not intersect an already-existing vertex.

Parameters:
p The point to be added.
start_tri Where should we start looking (NULL if we don't know/care)
over_bdry If we set a start_tri, are we allowed to walk over boundaries from there?
force Should this insertion yield to boundary encroachment?
Returns:
The new vertex added

Definition at line 1851 of file beziermesh.C.

References blind_locate_point(), clean_insert_edge_midpoint(), CellTuple< Vertex, Edge, Face >::e, CellTuple< Vertex, Edge, Face >::f, locate_point(), and CellTuple< Vertex, Edge, Face >::v.

Referenced by clean_insert_circumcenter(), ConformalMesher::create_subsplines(), and ConformalMesher::insert_d0_vertices().

Here is the call graph for this function:

BezierVertex * BezierMesh::clean_insert_point ( BezierTriangle t,
double  u,
double  v,
bool  force = false 
)

Insert an a point in the middle of a triangle, and make the resulting mesh delaunay.

Given a point in a triangle, add the point, and make the resulting mesh delaunay

If force is false, this method ensures that the new point will not encroach on an edge by doing an insert edge midpoint if the new vertex would have encroached on an edge.

Requires that the mesh was delaunay to begin with.

This is $ 0(1) $ expected flips.

Parameters:
t The triangle to split
u The first parameter
v The second parameter
force Should we yield due to encroachment?
Returns:
The new vertex added

Definition at line 1719 of file beziermesh.C.

References clean_insert_edge_midpoint(), BezierTriangle::eval(), flip_out_cavity(), BezierVertex::get_cp(), insert_point(), BezierEdge::is_boundary(), BezierEdge::is_encroached(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::lower(), and remove_vertex().

Here is the call graph for this function:

BezierVertex * BezierMesh::clean_insert_edge_midpoint ( BezierEdge e,
double  u,
bool  force = true 
)

Insert an a point in the middle of an edge, and make the resulting mesh delaunay.

Given a point along an edge, split the edge, and make the resulting mesh delaunay

Requires that the mesh was delaunay to being with.

This is $ 0(1) $ expected flips.

Parameters:
e The edge to split
u The parameter along the edge
force Is this a forced point, or should it yield to boundary encroachment?
Returns:
The new vertex added

Definition at line 1778 of file beziermesh.C.

References EdgeCell::begin_faces(), EdgeCell::end_faces(), BezierEdge::eval(), flip_out_cavity(), BezierVertex::get_cp(), insert_edge_midpoint(), BezierEdge::is_boundary(), BezierEdge::is_encroached(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::lower(), remove_vertex(), and WARNING.

Referenced by clean_insert_point(), and protect_boundarys().

Here is the call graph for this function:

BezierVertex * BezierMesh::clean_insert_circumcenter ( BezierTriangle t  ) 

Insert a circumcenter and leave the mesh Delaunay.

Given a triangle, cleanly insert it's circumcenter. This is just a convenience wrapper on clean_insert_point, with the knowledge, that we should start looking near this triangle, we shouldn't insert if on the other side of a bdry, and we should yield to boundary encroachment

Parameters:
t The triangle whose circumcenter we would like to insert

Definition at line 1933 of file beziermesh.C.

References BezierTriangle::circumcenter(), and clean_insert_point().

Referenced by function_angle_refine(), remove_large_triangles(), and remove_small_angles().

Here is the call graph for this function:

BezierTuple BezierMesh::remove_vertex ( BezierVertex v  ) 

Remove a vertex from the mesh.

this function requires a delaunay mesh.

Remove the given vertex and leave the resulting mesh delaunay.

D0 Verticies can never be removed. D1 and D2 vertexs are removefd by using Deviller's algotithm. This involves finding the cavity around the vertex. Performing flips in a special order to leave the vertex at the center of a triangle, and then removing the vertex and replacing the three triangles by 1.

The D1 vertex removal is significantly more complicated, although stil using the devillers algorithm. Devillers must be run on both sides of the boundary in question, and depending on the convity of the boundary at that point, either side may stop flipping with either 0 or 1 non-bdry edge incident to the vertex to remove. Then the spline muist have a knot removed, and the cavity must be retiranglulated on either side.

Parameters:
v The vertex to remove
Returns:
A tuple near the removed vertex

Definition at line 2279 of file beziermesh.C.

References add_bezier_edge(), add_bezier_triangle(), add_straight_bezier_edge(), check_bdry_vertex_removal_degeneracies(), QBSpline::closed, BezierVertex::containment_dimension(), delete_edge(), delete_vertex(), devillers(), CellTuple< Vertex, Edge, Face >::e, CellTuple< Vertex, Edge, Face >::f, CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::find_common_edge(), EdgeCell::get_canon_vertex(), BezierEdge::get_dp(), get_link(), QBSpline::get_num_deboor(), BoundaryEdge::get_spline(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_tuple(), BezierVertex::get_u(), EdgeCell::num_faces(), QBSpline::remove_knot(), BezierEdge::set_bdry(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::Switch(), and CellTuple< Vertex, Edge, Face >::v.

Referenced by clean_insert_edge_midpoint(), clean_insert_point(), and coarsen_remove_verts().

Here is the call graph for this function:

bool BezierMesh::smooth_edge ( BezierEdge e  ) 

Reposition the center point of the edge to make it smoother.

This function uses the smoothing function to determine the optimal location for the center point of an edge, given its local environment. It then uses the BezierMesh::reinterpolate() function to set the data in a manner that minimizes overall error.

Note:
This function requires that there are no inverted elements around the edge. If there are it will fail!
Parameters:
e The edge to smooth

Definition at line 1244 of file beziermesh.C.

References EdgeCell::begin_faces(), debug_smooth(), BezierVertex::get_cp(), BezierEdge::get_cp(), get_edge_neighbor_cells(), get_smooth_polygon(), BezierEdge::is_boundary(), EdgeCell::num_faces(), reinterpolate(), robust_smooth(), BezierEdge::set_cp(), and WARNING.

Referenced by insert_point(), and smooth_mesh().

Here is the call graph for this function:

bool BezierMesh::flip ( BezierEdge e,
BezierTuple tup 
)

Flip a given edge if possible.

Given an edge to flip, it may be possible to make the flip. In which case, this function will remove the old edge and triangles, and add a new edge and new triangles. The new edge will have its center control point calculated by the smoother, and reinterpolation will be done to best approximate the function on the old triangles, with the new triangles.

Setting the BezierMesh::linear_flips flag causes all edge flips to add straight edges when doing the flip, as opposed to calling the smoother to get the new edge's center point.

Parameters:
e The edge to flip
[out] tup A tuple on the new edge( if it was added successfuly)
Returns:
true if flip is successful, false otherwise

Definition at line 1121 of file beziermesh.C.

References add_bezier_edge(), add_bezier_triangle(), debug_flip(), delete_edge(), BezierTriangle::get_bdry_face_or_null(), get_edge_neighbor_cells(), get_flip_polygon(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_tuple(), BezierEdge::is_boundary(), linear_flips, EdgeCell::num_faces(), print_check_inverted(), reinterpolate(), robust_smooth(), and WARNING.

Here is the call graph for this function:

int BezierMesh::blind_locate_point ( Point2D  pt,
BezierTuple cellfound,
double &  u,
double &  v 
)

Automatically choose a good starting point from which to do a locate_point().

Todo:
Make this function always locate any point that is geometrically inside a BoundaryFace (requires fixing BezierMesh::locate_point() )
Parameters:
pt The geometric location to locate
[out] cellfound A tuple pointing to the cell we found.
[out] u The first parameter
[out] v The second parameter if the point was located in a triangle
over_bdry Controls wether to walk across boundaries
Returns:
0 on failure, 1 if on a BezierEdge, 2 if in a BezierTriangle.

Definition at line 2544 of file beziermesh.C.

References find_start_triangle(), and locate_point().

Referenced by clean_insert_point(), and Visualization::visual_locate().

Here is the call graph for this function:

int BezierMesh::locate_point ( Point2D  pt,
BezierTriangle start,
bool  over_bdry,
BezierTuple cellfound,
double &  u,
double &  v 
)

Locates the element containing the given point in the mesh.

Given a geometric location, this function will try to determine which triangle on the mesh contains the point. It requires that you provide it a BezierTriangle start from which to start the search.

We return the containment dimension of the point, along with a tuple for it and barycentric coordinates (zero for vertices, one for edges, two for triangles).

If the point lies outside the mesh, this function will return -1 and set the BezierEdge and a parameter along that edge indicating where the search crossed the boundary. TODO: lies: we return u = 0.5

The parameter over_boundary will keep the search from leaving the BounaryFace where start lives.

Note:
This function requires that there are no inverted triangles in the mesh. Otherwise no guarantees! Almost all failures are due to an inverted triangle.
Parameters:
pt The geometric location to locate
start The BezierTriangle from which to start the search
over_bdry Look for the point in BoundaryFaces outside of start's BoundaryFace
[out] cellfound A tuple for the cell we found.
[out] u The first parameter, if the point was on an edge or triangle.
[out] v The second parameter if the point was in a triangle.
Returns:
the containment dimension: 0 for vertices, 1 for edges, 2 for faces; -1 if across a boundary.

Definition at line 2630 of file beziermesh.C.

References CellTuple< Vertex, Edge, Face >::f, locate_point_in_linear_mesh(), and locate_point_in_quadratic_triangle().

Referenced by blind_locate_point(), and clean_insert_point().

Here is the call graph for this function:

bool BezierMesh::should_flip ( BezierEdge e  ) 

Given an edge, will flipping it make its triangles Delaunay.

Determines wether the edge should be flipped to make it's triangles Delaunay. In two dimensions, edge flips alone are sufficient to make any triangulation Delaunay.

Parameters:
e The edge to check
Returns:
True if the edge should be flipped, false otherwise

Definition at line 682 of file beziermesh.C.

References CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_tuple(), Point2D::in_circle_test(), BezierEdge::is_boundary(), EdgeCell::num_faces(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::Switch(), and CellTuple< Vertex, Edge, Face >::v.

Referenced by Visualization::draw_flippable_edges().

Here is the call graph for this function:

bool BezierMesh::can_flip ( BezierEdge e  ) 

Determine if a given edge can be flipped.

Given an edge, there are two reasons that it may not be flippable. The first, TypeA, is where the outside flips cannot be done in the control mesh. The scond, TypeB, is where the smoothing polygon for the new edge will not have a kernel and thus the new edge cannot be added.

Parameters:
e The edge to test for flippability
Returns:
true if flippable, false otherwise

Definition at line 763 of file beziermesh.C.

Referenced by debug_flip(), and Visualization::draw_flippable_edges().

bool BezierMesh::can_flip ( BezierEdge e,
bool &  is_typeA,
bool &  is_typeB 
)

Determine if a given edge can be flipped.

Given an edge, there are two reasons that it may not be flippable. The first, TypeA, is where the outside flips cannot be done in the control mesh. The scond, TypeB, is where the smoothing polygon for the new edge will not have a kernel and thus the new edge cannot be added.

Parameters:
e The edge to test for flippability
[out] is_typeA The edge is a typeA unflippable edge
[out] is_typeB The edge is a typeB unflippable edge
Returns:
true if flippable, false otherwise

Definition at line 781 of file beziermesh.C.

References BezierVertex::get_cp(), BezierEdge::get_cp(), get_edge_neighbor_cells(), get_flip_polygon(), Point2D::is_left_of(), and robust_smooth().

Here is the call graph for this function:

bool BezierMesh::can_smooth ( BezierEdge e  ) 

Check if a given edge can be smothed.

Given an edge, see if can be smoothed. This function checks if the primary and secondary smoothing points are in the kernel.

Parameters:
e The edge to check
Returns:
true if the edge can be smoothed, false otherwise

Definition at line 933 of file beziermesh.C.

References BezierVertex::get_cp(), BezierEdge::get_cp(), get_edge_neighbor_cells(), get_smooth_polygon(), and robust_smooth().

Referenced by Visualization::draw_smoothable_edges().

Here is the call graph for this function:

bool BezierMesh::should_refine_func_angle ( BezierEdge e,
double  angle_const,
double  min_area_const 
)

Determine if this edge should be refined due to a large function angle.

Measures the function angle at this edge and determines if the edge should be refined due to an angle larger than the threshold angle_cosnt. If this edge has triangles smaller than min_area_const than it will not be refined. If this edge is on the boundary or has only one adjacent triangle, then the edge will not be refined.

Parameters:
e The BezierEdge to measure
angle_const The threshold for angles
min_area_const Do not refine esges with triangles smaller than this
Returns:
true if this edge should be refined

Definition at line 4057 of file beziermesh.C.

References EdgeCell::begin_faces(), EdgeCell::end_faces(), func_angle_x_cuttoff, function_angle(), BezierEdge::get_cp(), BezierEdge::is_boundary(), EdgeCell::num_faces(), and Point2D::x().

Referenced by coarsen_keep_large_function_angles(), and function_angle_refine().

Here is the call graph for this function:

double BezierMesh::function_angle ( BezierEdge e,
double  u,
int  func_idx 
)

Determine the angle a function makes at a given parameter along an edge.

Looking at one of the functions defined on the mesh, we determine what angle the function makes at a specific point along an edge.

Parameters:
e The BezierEdge in question
u The parameter along the edge
func_idx The index of the function in the LinearData
Returns:
The angle in radians of the function angle

Definition at line 3248 of file beziermesh.C.

References EdgeCell::begin_faces(), Vec3D::cross(), datastore, BezierEdge::get_cp(), DataStore::get_data(), BezierEdge::get_dp(), EdgeCell::num_faces(), and tri_cps_off_edge().

Referenced by should_refine_func_angle().

Here is the call graph for this function:

int BezierMesh::find_inverted_triangles ( std::vector< BezierTriangle * > &  inverted  ) 

Referenced by ConformalMesher::create_subsplines(), Simulation::move_safe(), and print_check_inverted().

int BezierMesh::classify_inverted_triangles ( std::vector< BezierTriangle * > &  normal,
std::vector< BezierTriangle * > &  inverted,
std::vector< BezierTriangle * > &  unknown 
)

Referenced by Visualization::draw_inverted_classes().

bool BezierMesh::check_consistency (  )  const

Debugging: Check the consistency of the mesh.

Checks: 1- that the cp and dp arrays of vertices, edges and triangles all match 2- that the switch tables have the right number of elements 3- that the sampling array is a copy of the hash of triangles 4- that the mesh is connected via the switch tables

Definition at line 4161 of file beziermesh.C.

References boundarymesh, consistency_check_helper(), CellTuple< Vertex, Edge, Face >::e, CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::edges, CellTuple< Vertex, Edge, Face >::f, BezierTriangle::get_edge(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_faces_begin(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_faces_end(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_num_edges(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_num_faces(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_num_vertices(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_tuple(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::is_member(), orient_edge_triangle(), sampler, CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::Switch(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::switch_size(), CellTuple< Vertex, Edge, Face >::v, and MeshBinaryOutput::write().

Referenced by ConformalMesher::conform(), ConformalMesher::create_bbox(), ConformalMesher::create_subsplines(), ConformalMesher::excavate_holes(), ConformalMesher::insert_d0_vertices(), insert_point(), Simulation::move_(), print_check_inverted(), and ConformalMesher::reticulate_splines().

Here is the call graph for this function:

int BezierMesh::smooth_mesh ( double  jacobian_bound,
int  passes = 1 
)

Smooth the BezierEdges in the mesh.

Some BezierEdges in the mesh may be overly curved. This function will look at the minimum and maximum values that the jacobian determinate takes over a triangle and compare that difference to a provided cutoff jacobian_bound which represents the maximum difference allowed. Any triangle with more variation in the jacobian determinate than jacobian_bound will be considered overly curved, and its edges will be smoothed.

As the expected number of rounds of smoothing to create a mesh conforming to the smoothing criterion is $ O(lg(n)) $, a single pass may not be sufficient, but $ lg(n) $ passes may be too many. Thus the user can specify the number of passes to make using the passes paramater.

Parameters:
jacobian_bound The amount of total difference in the BezierTriangle Jabobian determinate to consider it overly-curved
passes The number of smoothing passes to make over the edges
Returns:
The number of smooths preformed

Definition at line 3314 of file beziermesh.C.

References BezierTriangle::bound_jacobian(), BezierTriangle::get_edge(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_faces_begin(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_faces_end(), BezierEdge::is_boundary(), and smooth_edge().

Referenced by Cleaner::clean().

Here is the call graph for this function:

int BezierMesh::make_delaunay (  ) 

Definition at line 3348 of file beziermesh.C.

Referenced by Cleaner::clean(), make_delaunay(), and MeshConstructor::remove_small_angles().

int BezierMesh::make_delaunay ( double  angle_const,
double  min_area_const 
)

Make the mesh delaunay using edge flips.

In two-dimensions we can make sure that our mesh is Delaunay simply by flipping edges that are between two non-delaunay triangles. This will be constrianed delaunay as bdry edges can't be flipped.

This function will iterate over all the edges, checking for the delaunay property and performing any necessary edge flips with BezierMesh::flip_edge()

Returns:
The number of edges flipped.

Definition at line 3369 of file beziermesh.C.

References CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_edges_begin(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_edges_end(), and make_delaunay().

Here is the call graph for this function:

int BezierMesh::make_delaunay ( std::deque< BezierEdge * >  flip_list  ) 

int BezierMesh::make_delaunay ( std::deque< BezierEdge * >  flip_list,
double  angle_const,
double  min_area_const 
)

int BezierMesh::protect_boundarys (  ) 

Ensure that no BoundaryEdges are encroached, by splitting encroached edges.

This function uses BeizerEdge::is_encroached() to determin if any points are encroaching on a BezierEdge on the boundary.

If a BezierEdge is encroached this function will split it using BezierMesh::clean_insert_edge_midpoint()

Returns:
The number of boundary edges split

Definition at line 3445 of file beziermesh.C.

References clean_insert_edge_midpoint(), CellTuple< Vertex, Edge, Face >::e, CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::empty_trash(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::enqueue_edges(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_edges_begin(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_edges_end(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_tuple(), BezierEdge::is_boundary(), BezierEdge::is_encroached(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::is_member(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::keep_trash(), EdgeCell::num_faces(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::Switch(), and CellTuple< Vertex, Edge, Face >::v.

Referenced by Cleaner::clean().

Here is the call graph for this function:

int BezierMesh::remove_small_angles (  ) 

Remove any triangles that have a small angle not caused by a boundary.

This will iterate over the elements of the mesh until there are no triangles with small angles. If an angle is formed by the intersection of two BezierEdge's on the boundary, then it is not considered small, in order to prevent recursion. Thus function uses the BezierTriangle::small_angle() function to determine if there are small angles in the triangle. We remove triangles by adding their circumcenter, via clean_insert_circumcenter().

Returns:
The number of triangles with small angles removed

Definition at line 3497 of file beziermesh.C.

References clean_insert_circumcenter(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::empty_trash(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::enqueue_faces(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_faces_begin(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_faces_end(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::is_member(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::keep_trash(), and BezierTriangle::small_angle().

Referenced by Cleaner::clean(), and MeshConstructor::remove_small_angles().

Here is the call graph for this function:

int BezierMesh::remove_large_triangles ( double  size_const  ) 

Remove any triangles that are larger than a given constant size.

This will iterate over the elements of the mesh until there are no triangles with a size bigger than the constant provided. We remove triangles by adding their circumcenter, via clean_insert_circumcenter().

Parameters:
size_const The sizing constant
Returns:
The number of large triangles removed

Definition at line 3536 of file beziermesh.C.

References BezierTriangle::area(), clean_insert_circumcenter(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::empty_trash(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::enqueue_faces(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_faces_begin(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_faces_end(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::is_member(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::keep_trash(), and PI.

Referenced by Cleaner::clean().

Here is the call graph for this function:

int BezierMesh::function_angle_refine ( double  angle_const,
double  min_area_const 
)

Refine in areas with large function angles.

Refine triangles that are adjacent to an edge with a function angle greater than the threshold of angle_const. Don't refine triangles with areas smaller then min_area_const.

This is done in such a way as to ensure that only one pass is made. Triangles are identified as needing to be refined first, and then, afterwards are refined so as to prevent a loop of refining.

Parameters:
angle_cosnt The threshold for the function angle
min_area_const Don't refine triangles smaller than this cutoff
Returns:
The number of vertexs added

Definition at line 4012 of file beziermesh.C.

References EdgeCell::begin_faces(), clean_insert_circumcenter(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::empty_trash(), EdgeCell::end_faces(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_edges_begin(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_edges_end(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::is_member(), CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::keep_trash(), and should_refine_func_angle().

Here is the call graph for this function:

int BezierMesh::coarsen_const_size ( double  size_const,
double  lip_const,
double  nn_const,
double  dp_epsilon 
)

Run the Miller/Talmor/Tang coarsening algorithm using a constant sizing function.

This is an implementation of the Miller/Talmor/Tang Optimal Coarsening algorithm.

A sizing function is defined on the mesh, which decribes the relative size of triangles in that area. The coarsening algorithms interperates the value of the function at vertxes as a ball radius. It then finds a maximal ball packing. Any vertex not in the ball packing is removed.

Since we would like to never remove certain vertxs, we mark some vertexs as keep nodes. These vertxes will never be removed. All the D0 are kept, as well as any D1's that douglas_peucker decided to keep, which is all of them when dp_epsilon is 0.

The sizing function is computed initially as a constant function with value size_const. Then, it is modified so as to esure that no balls are overlaping with the keep nodes. This assures that the keep nodes will exist in any maximal set, and thus be saved.

Next, the function is made lipschitz. This is the only part of the algrithm that is not $ O(n) $. To compute the well graded radii we must run a Dijkstra's like lagorithm and use a priority queue. At present we are using a fibonacci heap to implement the priority queue, this could be chaned to a regular heap with little penalty, because of the low connectivity of our graph.

Finally, a maximal non-overlapping set of balls is found. Knowing that the keep nodes are gaurenteed to be in this set, we use them as an intial set of nodes, and find the first maximal set containg them.

Points not in this maximal set are removed.

Parameters:
size_const The value for the initial constant sizing function
lip_const The lipschitz constant
nn_const The nearest neighbor constant
dp_epsilon The tolerance for the Douglas Peucker Algorithm
Returns:
Number of vertexs removed

Definition at line 3607 of file beziermesh.C.

References coarsen_approximate_sizing_func(), coarsen_calculate_edge_lengths(), coarsen_draw_debug(), coarsen_find_verts_to_remove(), coarsen_keep_boundary(), coarsen_make_lipshitz(), coarsen_remove_verts(), and CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_num_vertices().

Referenced by Cleaner::clean().

Here is the call graph for this function:

int BezierMesh::coarsen_func_angle ( double  size_const,
double  lip_const,
double  nn_const,
double  dp_epsilon,
double  angle_const,
double  min_area_const 
)

Coarsen with a constant szing function, and respect function_angle refines.

This is essentailly a modification of the coarsen_const_size() function, that ensures that the work done by the function angle refinment is not undone by the coarsener. To accompish this, we look for edges that have lareg function angles and mark thier vertxs as keepers. We use should_refine_func_angle() to determine if the edge has a large angle and is not too small. We use a proportion of the supplied func_angle_const when checking for large function angles, as we would like to keep edges with moderatly large angles around as they likly represent important physical phenonomena.

Oherwise this function is exactly coarsen_const_size()

Parameters:
size_const The value for the initial constant sizing function
lip_const The lipschitz constant
nn_const The nearest neighbor constant
dp_epsilon The tolerance for the Douglas Peucker Algorithm
angle_const The threshold for large function angles
min_area_const The cutoff for function angle refinment
Returns:
Number of vertexs removed

Definition at line 3656 of file beziermesh.C.

References coarsen_approximate_sizing_func(), coarsen_calculate_edge_lengths(), coarsen_draw_debug(), coarsen_find_verts_to_remove(), coarsen_keep_boundary(), coarsen_keep_large_function_angles(), coarsen_make_lipshitz(), coarsen_remove_verts(), and CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_num_vertices().

Here is the call graph for this function:

int BezierMesh::coarsen_func_angle_debug ( double  size_const,
double  lip_const,
double  nn_const,
double  dp_epsilon,
double  angle_const,
double  min_area_const 
)

Definition at line 3682 of file beziermesh.C.

References coarsen_approximate_sizing_func(), coarsen_calculate_edge_lengths(), coarsen_draw_debug(), coarsen_find_verts_to_remove(), coarsen_keep_boundary(), coarsen_keep_large_function_angles(), coarsen_make_lipshitz(), coarsen_remove_verts(), and CellComplex< BezierVertex, BezierEdge, BezierTriangle, BezierTuple >::get_num_vertices().

Here is the call graph for this function:

int BezierMesh::data_length (  )  const

Get the length of the data. Just forwards the call off to the data store.

Definition at line 4414 of file beziermesh.C.

References DataStore::data_length(), and datastore.

Referenced by Simulation::move_().

Here is the call graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const BezierMesh bm 
) [friend]


Member Data Documentation

std::vector<BezierTriangle*> BezierMesh::sampler [private]

Definition at line 134 of file beziermesh.h.

Referenced by add_bezier_triangle(), check_consistency(), delete_face(), and find_start_triangle().

hashers::hash_map<BezierTriangle*,int> BezierMesh::sample_id_map [private]

Definition at line 135 of file beziermesh.h.

Referenced by add_bezier_triangle(), and delete_face().

BoundaryMesh* BezierMesh::boundarymesh [private]

The associated BoundaryMesh.

Definition at line 181 of file beziermesh.h.

Referenced by check_consistency(), coarsen_keep_boundary(), debug_flip(), operator<<(), print_check_inverted(), and set_bdry_mesh().

DataStore* BezierMesh::datastore [private]

The associated DataStore.

Definition at line 182 of file beziermesh.h.

Referenced by add_bezier_edge(), add_bezier_triangle(), add_bezier_vertex(), data_length(), delete_edge(), delete_vertex(), function_angle(), operator<<(), and replace_control_point().

bool BezierMesh::linear_flips [private]

Control for flips.

When this flag is true then flips will be done in a linear style. instead of letting the smoother choose a new center control point for the new edge, we will simply create a linear edge

Definition at line 190 of file beziermesh.h.

Referenced by flip(), and set_linear_flips().

double BezierMesh::func_angle_x_cuttoff

Definition at line 344 of file beziermesh.h.

Referenced by should_refine_func_angle().


The documentation for this class was generated from the following files:
Generated on Mon May 24 09:53:33 2010 for TUMBLE by  doxygen 1.5.2