Voro++

- Main Page
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions | Data Fields | Friends
voro::voronoicell_neighbor Class Reference

Extension of the voronoicell_base class to represent a Voronoi cell with neighbor information. More...

`#include <cell.hh>`

Inheritance diagram for voro::voronoicell_neighbor:

## Public Member Functions
| voronoicell_neighbor ()
| ~voronoicell_neighbor ()
void | operator= (voronoicell &c)
void | operator= (voronoicell_neighbor &c)
bool | nplane (double x, double y, double z, double rsq, int p_id)
bool | nplane (double x, double y, double z, int p_id)
bool | plane (double x, double y, double z, double rsq)
bool | plane (double x, double y, double z)
void | init (double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
void | init_octahedron (double l)
void | init_tetrahedron (double x0, double y0, double z0, double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)
void | check_facets ()
virtual void | neighbors (std::vector< int > &v)
virtual void | print_edges_neighbors (int i)
virtual void | output_neighbors (FILE *fp=stdout)
Public Member Functions inherited from voro::voronoicell_base
| voronoicell_base ()
| ~voronoicell_base ()
void | init_base (double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
void | init_octahedron_base (double l)
void | init_tetrahedron_base (double x0, double y0, double z0, double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)
void | translate (double x, double y, double z)
void | draw_pov (double x, double y, double z, FILE *fp=stdout)
void | draw_pov (double x, double y, double z, const char *filename)
void | draw_pov_mesh (double x, double y, double z, FILE *fp=stdout)
void | draw_pov_mesh (double x, double y, double z, const char *filename)
void | draw_gnuplot (double x, double y, double z, FILE *fp=stdout)
void | draw_gnuplot (double x, double y, double z, const char *filename)
double | volume ()
double | max_radius_squared ()
double | total_edge_distance ()
double | surface_area ()
void | centroid (double &cx, double &cy, double &cz)
int | number_of_faces ()
int | number_of_edges ()
void | vertex_orders (std::vector< int > &v)
void | output_vertex_orders (FILE *fp=stdout)
void | vertices (std::vector< double > &v)
void | output_vertices (FILE *fp=stdout)
void | vertices (double x, double y, double z, std::vector< double > &v)
void | output_vertices (double x, double y, double z, FILE *fp=stdout)
void | face_areas (std::vector< double > &v)
void | output_face_areas (FILE *fp=stdout)
void | face_orders (std::vector< int > &v)
void | output_face_orders (FILE *fp=stdout)
void | face_freq_table (std::vector< int > &v)
void | output_face_freq_table (FILE *fp=stdout)
void | face_vertices (std::vector< int > &v)
void | output_face_vertices (FILE *fp=stdout)
void | face_perimeters (std::vector< double > &v)
void | output_face_perimeters (FILE *fp=stdout)
void | normals (std::vector< double > &v)
void | output_normals (FILE *fp=stdout)
void | output_custom (const char *format, FILE *fp=stdout)
void | output_custom (const char *format, int i, double x, double y, double z, double r, FILE *fp=stdout)
template<class vc_class >
bool | nplane (vc_class &vc, double x, double y, double z, double rsq, int p_id)
bool | plane_intersects (double x, double y, double z, double rsq)
bool | plane_intersects_guess (double x, double y, double z, double rsq)
void | construct_relations ()
void | check_relations ()
void | check_duplicates ()
void | print_edges ()
int | cycle_up (int a, int p)
int | cycle_down (int a, int p)

## Data Fields
int ** | mne
int ** | ne
Data Fields inherited from voro::voronoicell_base
int | current_vertices
int | current_vertex_order
int | current_delete_size
int | current_delete2_size
int | p
int | up
int ** | ed
int * | nu
double * | pts

## Friends
class | voronoicell_base

## Additional Inherited Members
Protected Member Functions inherited from voro::voronoicell_base
void | reset_edges ()
template<class vc_class >
void | check_memory_for_copy (vc_class &vc, voronoicell_base *vb)
void | copy (voronoicell_base *vb)
Protected Attributes inherited from voro::voronoicell_base
int * | mem
int * | mec
int ** | mep

## Detailed Description

This class is an extension of the voronoicell_base class, in cases when the IDs of neighboring particles associated with each face of the Voronoi cell. It contains additional data structures mne and ne for storing this information.

Definition at line 403 of file cell.hh.

## Constructor & Destructor Documentation

voro::voronoicell_neighbor::voronoicell_neighbor | ( |  | ) |

The class constructor allocates memory for storing neighbor information.

Definition at line 2180 of file cell.cc.

voro::voronoicell_neighbor::~voronoicell_neighbor | ( |  | ) |

The class destructor frees the dynamically allocated memory for storing neighbor information.

Definition at line 2191 of file cell.cc.

## Member Function Documentation

void voro::voronoicell_neighbor::check_facets | ( |  | ) |

This routine checks to make sure the neighbor information of each face is consistent.

Definition at line 2159 of file cell.cc.

void voro::voronoicell_neighbor::init | ( | double | xmin,
|  | double | xmax,
|  | double | ymin,
|  | double | ymax,
|  | double | zmin,
|  | double | zmax
| ) |  |

This initializes the class to be a rectangular box. It calls the base class initialization routine to set up the edge and vertex information, and then sets up the neighbor information, with initial faces being assigned ID numbers from -1 to -6.

Parameters

  [in] | (xmin,xmax) | the minimum and maximum x coordinates.
  [in] | (ymin,ymax) | the minimum and maximum y coordinates.
  [in] | (zmin,zmax) | the minimum and maximum z coordinates.

Definition at line 2105 of file cell.cc.

void voro::voronoicell_neighbor::init_octahedron | ( | double | l | ) |

This initializes the class to be an octahedron. It calls the base class initialization routine to set up the edge and vertex information, and then sets up the neighbor information, with the initial faces being assigned ID numbers from -1 to -8.

Parameters

  [in] | l | The distance from the octahedron center to a vertex. Six vertices are initialized at (-l,0,0), (l,0,0), (0,-l,0), (0,l,0), (0,0,-l), and (0,0,l).

Definition at line 2127 of file cell.cc.

void voro::voronoicell_neighbor::init_tetrahedron | ( | double | x0,
|  | double | y0,
|  | double | z0,
|  | double | x1,
|  | double | y1,
|  | double | z1,
|  | double | x2,
|  | double | y2,
|  | double | z2,
|  | double | x3,
|  | double | y3,
|  | double | z3
| ) |  |

This initializes the class to be a tetrahedron. It calls the base class initialization routine to set up the edge and vertex information, and then sets up the neighbor information, with the initial faces being assigned ID numbers from -1 to -4.

Parameters

  (x0,y0,z0) | a position vector for the first vertex.
  (x1,y1,z1) | a position vector for the second vertex.
  (x2,y2,z2) | a position vector for the third vertex.
  (x3,y3,z3) | a position vector for the fourth vertex.

Definition at line 2147 of file cell.cc.

void voro::voronoicell_neighbor::neighbors | ( | std::vector< int > & | v | ) |
| virtual

Computes a vector list of neighbors.

Reimplemented from voro::voronoicell_base.

Definition at line 2198 of file cell.cc.

bool voro::voronoicell_neighbor::nplane | ( | double | x,
|  | double | y,
|  | double | z,
|  | double | rsq,
|  | int | p_id
| ) |  |
| inline

Cuts the Voronoi cell by a particle whose center is at a separation of (x,y,z) from the cell center. The value of rsq should be initially set to .

Parameters

  [in] | (x,y,z) | the normal vector to the plane.
  [in] | rsq | the distance along this vector of the plane.
  [in] | p_id | the plane ID (for neighbor tracking only).

Returns
  False if the plane cut deleted the cell entirely, true otherwise.

Definition at line 430 of file cell.hh.

bool voro::voronoicell_neighbor::nplane | ( | double | x,
|  | double | y,
|  | double | z,
|  | int | p_id
| ) |  |
| inline

This routine calculates the modulus squared of the vector before passing it to the main nplane() routine with full arguments.

Parameters

  [in] | (x,y,z) | the vector to cut the cell by.
  [in] | p_id | the plane ID (for neighbor tracking only).

Returns
  False if the plane cut deleted the cell entirely, true otherwise.

Definition at line 440 of file cell.hh.

void voro::voronoicell_neighbor::operator= | ( | voronoicell & | c | ) |

Copies the information from another voronoicell class into this class, extending memory allocation if necessary.

Parameters

  [in] | c | the class to copy.

Definition at line 80 of file cell.cc.

void voro::voronoicell_neighbor::operator= | ( | voronoicell_neighbor & | c | ) |

Copies the information from another voronoicell_neighbor class into this class, extending memory allocation if necessary.

Parameters

  [in] | c | the class to copy.

Definition at line 93 of file cell.cc.

virtual void voro::voronoicell_neighbor::output_neighbors | ( | FILE * | fp = `stdout` | ) |
| inline virtual

This is a virtual function that is overridden by a routine to print a list of IDs of neighboring particles corresponding to each face. By default, when no neighbor information is available, the routine does nothing.

Parameters

  [in] | fp | the file handle to write to.

Reimplemented from voro::voronoicell_base.

Definition at line 472 of file cell.hh.

bool voro::voronoicell_neighbor::plane | ( | double | x,
|  | double | y,
|  | double | z,
|  | double | rsq
| ) |  |
| inline

This version of the plane routine just makes up the plane ID to be zero. It will only be referenced if neighbor tracking is enabled.

Parameters

  [in] | (x,y,z) | the vector to cut the cell by.
  [in] | rsq | the modulus squared of the vector.

Returns
  False if the plane cut deleted the cell entirely, true otherwise.

Definition at line 451 of file cell.hh.

bool voro::voronoicell_neighbor::plane | ( | double | x,
|  | double | y,
|  | double | z
| ) |  |
| inline

Cuts a Voronoi cell using the influence of a particle at (x,y,z), first calculating the modulus squared of this vector before passing it to the main nplane() routine. Zero is supplied as the plane ID, which will be ignored unless neighbor tracking is enabled.

Parameters

  [in] | (x,y,z) | the vector to cut the cell by.

Returns
  False if the plane cut deleted the cell entirely, true otherwise.

Definition at line 462 of file cell.hh.

void voro::voronoicell_neighbor::print_edges_neighbors | ( | int | i | ) |
| virtual

This prints out the neighbor information for vertex i.

Reimplemented from voro::voronoicell_base.

Definition at line 2237 of file cell.cc.

## Field Documentation

int** voro::voronoicell_neighbor::mne

This two dimensional array holds the neighbor information associated with each vertex. mne[p] is a one dimensional array which holds all of the neighbor information for vertices of order p.

Definition at line 410 of file cell.hh.

int** voro::voronoicell_neighbor::ne

This is a two dimensional array that holds the neighbor information associated with each vertex. ne[i] points to a one-dimensional array in mne[nu[i]]. ne[i][j] holds the neighbor information associated with the jth edge of vertex i. It is set to the ID number of the plane that made the face that is clockwise from the jth edge.

Definition at line 417 of file cell.hh.

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

- cell.hh
- cell.cc