Linearizer Class Reference

Linearizer is a utility class which converts a higher-order FEM solution defined on a curvilinear, irregular mesh to a linear FEM solution defined on a straight-edged, regular mesh. This is done by adaptive refinement of the higher-order mesh and its subsequent regularization. The linearized mesh can then be easily displayed or exported to standard formats. The class correctly handles discontinuities in the solution (e.g., gradients or in Hcurl) by inserting double vertices where necessary. Linearizer also serves as a container for the resulting linearized mesh. More...

#include <linear.h>

Inherited by Orderizer, and Vectorizer.

List of all members.

Public Member Functions

 Linearizer ()
 ~Linearizer ()
void process_solution (MeshFunction *sln, int item=H2D_FN_VAL_0, double eps=H2D_EPS_NORMAL, double max_abs=-1.0, MeshFunction *xdisp=NULL, MeshFunction *ydisp=NULL, double dmult=1.0)
void lock_data () const
void unlock_data () const
double3get_vertices () const
int get_num_vertices () const
int3get_triangles () const
int get_num_triangles () const
int3get_edges () const
int get_num_edges () const
double get_min_value () const
double get_max_value () const
virtual void calc_vertices_aabb (double *min_x, double *max_x, double *min_y, double *max_y) const
 Returns axis aligned bounding box (AABB) of vertices. Assumes lock.
virtual void save_data (const char *filename)
virtual void load_data (const char *filename)
void free ()

Protected Member Functions

int get_vertex (int p1, int p2, double x, double y, double value)
int get_top_vertex (int id, double value)
int peek_vertex (int p1, int p2)
int hash (int p1, int p2)
int add_vertex ()
void add_triangle (int iv0, int iv1, int iv2)
void del_triangle (int index)
void add_edge (int iv1, int iv2, int marker)
void get_gv_a_b (int mask, int &a, int &b)
void process_triangle (int iv0, int iv1, int iv2, int level, scalar *val, double *phx, double *phy, int *indices)
void process_quad (int iv0, int iv1, int iv2, int iv3, int level, scalar *val, double *phx, double *phy, int *indices)
void process_edge (int iv1, int iv2, int marker)
void regularize_triangle (int iv0, int iv1, int iv2, int mid0, int mid1, int mid2)
void find_min_max ()
void print_hash_stats ()

Static Protected Member Functions

static void calc_aabb (double *x, double *y, int stride, int num, double *min_x, double *max_x, double *min_y, double *max_y)
 Calculates AABB from an array of X-axis and Y-axis coordinates. The distance between values in the array is stride bytes.

Protected Attributes

MeshFunctionsln
int item
int ia
int ib
double eps
double max
double cmax
bool auto_max
MeshFunctionxdisp
MeshFunctionydisp
double dmult
double3verts
 vertices: (x, y, value) triplets
int4info
 info[0]=p1, info[1]=p2, info[2]=next vertex in hash
int3tris
 triangles: vertex index triplets
int3edges
 edges: pairs of vertex indices
int * hash_table
 hash table
int nv
int nt
int ne
 numbers of vertices, triangles and edges
int cv
int ct
int ce
 capacities of vertex, triangle and edge arrays
int del_slot
 free slot index after a triangle which was deleted
int mask
 hash table mask = size-1
bool curved
bool disp
double min_val
double max_val
pthread_mutex_t data_mutex

Detailed Description

Linearizer is a utility class which converts a higher-order FEM solution defined on a curvilinear, irregular mesh to a linear FEM solution defined on a straight-edged, regular mesh. This is done by adaptive refinement of the higher-order mesh and its subsequent regularization. The linearized mesh can then be easily displayed or exported to standard formats. The class correctly handles discontinuities in the solution (e.g., gradients or in Hcurl) by inserting double vertices where necessary. Linearizer also serves as a container for the resulting linearized mesh.


Constructor & Destructor Documentation

Linearizer::Linearizer (  ) 
Linearizer::~Linearizer (  ) 

Member Function Documentation

void Linearizer::add_edge ( int  iv1,
int  iv2,
int  marker 
) [inline, protected]
void Linearizer::add_triangle ( int  iv0,
int  iv1,
int  iv2 
) [protected]
int Linearizer::add_vertex (  )  [inline, protected]

Reimplemented in Vectorizer.

void Linearizer::calc_aabb ( double *  x,
double *  y,
int  stride,
int  num,
double *  min_x,
double *  max_x,
double *  min_y,
double *  max_y 
) [static, protected]

Calculates AABB from an array of X-axis and Y-axis coordinates. The distance between values in the array is stride bytes.

void Linearizer::calc_vertices_aabb ( double *  min_x,
double *  max_x,
double *  min_y,
double *  max_y 
) const [virtual]

Returns axis aligned bounding box (AABB) of vertices. Assumes lock.

Reimplemented in Vectorizer.

void Linearizer::del_triangle ( int  index  )  [inline, protected]
void Linearizer::find_min_max (  )  [protected]

Reimplemented in Vectorizer.

void Linearizer::free (  ) 

Reimplemented in Vectorizer.

int3* Linearizer::get_edges (  )  const [inline]
void Linearizer::get_gv_a_b ( int  mask,
int &  a,
int &  b 
) [inline, protected]
double Linearizer::get_max_value (  )  const [inline]

Reimplemented in Vectorizer.

double Linearizer::get_min_value (  )  const [inline]

Reimplemented in Vectorizer.

int Linearizer::get_num_edges (  )  const [inline]
int Linearizer::get_num_triangles (  )  const [inline]
int Linearizer::get_num_vertices (  )  const [inline]

Reimplemented in Vectorizer.

int Linearizer::get_top_vertex ( int  id,
double  value 
) [protected]
int3* Linearizer::get_triangles (  )  const [inline]
int Linearizer::get_vertex ( int  p1,
int  p2,
double  x,
double  y,
double  value 
) [protected]
double3* Linearizer::get_vertices (  )  const [inline]

Reimplemented in Vectorizer.

int Linearizer::hash ( int  p1,
int  p2 
) [inline, protected]
void Linearizer::load_data ( const char *  filename  )  [virtual]

Reimplemented in Orderizer, and Vectorizer.

void Linearizer::lock_data (  )  const [inline]
int Linearizer::peek_vertex ( int  p1,
int  p2 
) [protected]
void Linearizer::print_hash_stats (  )  [protected]
void Linearizer::process_edge ( int  iv1,
int  iv2,
int  marker 
) [protected]
void Linearizer::process_quad ( int  iv0,
int  iv1,
int  iv2,
int  iv3,
int  level,
scalar val,
double *  phx,
double *  phy,
int *  indices 
) [protected]
void Linearizer::process_solution ( MeshFunction sln,
int  item = H2D_FN_VAL_0,
double  eps = H2D_EPS_NORMAL,
double  max_abs = -1.0,
MeshFunction xdisp = NULL,
MeshFunction ydisp = NULL,
double  dmult = 1.0 
)
void Linearizer::process_triangle ( int  iv0,
int  iv1,
int  iv2,
int  level,
scalar val,
double *  phx,
double *  phy,
int *  indices 
) [protected]
void Linearizer::regularize_triangle ( int  iv0,
int  iv1,
int  iv2,
int  mid0,
int  mid1,
int  mid2 
) [protected]
void Linearizer::save_data ( const char *  filename  )  [virtual]

Reimplemented in Orderizer, and Vectorizer.

void Linearizer::unlock_data (  )  const [inline]

Member Data Documentation

bool Linearizer::auto_max [protected]
int Linearizer::ce [protected]

capacities of vertex, triangle and edge arrays

double Linearizer::cmax [protected]
int Linearizer::ct [protected]
bool Linearizer::curved [protected]
int Linearizer::cv [protected]
pthread_mutex_t Linearizer::data_mutex [mutable, protected]
int Linearizer::del_slot [protected]

free slot index after a triangle which was deleted

bool Linearizer::disp [protected]
double Linearizer::dmult [protected]
int3* Linearizer::edges [protected]

edges: pairs of vertex indices

double Linearizer::eps [protected]
int* Linearizer::hash_table [protected]

hash table

int Linearizer::ia [protected]
int Linearizer::ib [protected]
int4* Linearizer::info [protected]

info[0]=p1, info[1]=p2, info[2]=next vertex in hash

int Linearizer::item [protected]
int Linearizer::mask [protected]

hash table mask = size-1

double Linearizer::max [protected]
double Linearizer::max_val [protected]
double Linearizer::min_val [protected]
int Linearizer::ne [protected]

numbers of vertices, triangles and edges

int Linearizer::nt [protected]
int Linearizer::nv [protected]
int3* Linearizer::tris [protected]

triangles: vertex index triplets

double3* Linearizer::verts [protected]

vertices: (x, y, value) triplets

Reimplemented in Vectorizer.


The documentation for this class was generated from the following files:
Generated on Sat Jun 5 15:17:43 2010 for Hermes2D Library: Real Version by  doxygen 1.6.3