![]() |
Bsoft 2.1.4
Bernard's software package
|
Functions to manipulate polyhedral coordinate files. More...
#include "model_poly.h"
#include "model_transform.h"
#include "model_views.h"
#include "model_util.h"
#include "matrix_linear.h"
#include "model_links.h"
#include "model_compare.h"
#include "math_util.h"
#include "random_numbers.h"
#include "symmetry.h"
#include "Vector3.h"
#include "linked_list.h"
#include "utilities.h"
Macros | |
#define | NSMAX 100 |
Functions | |
int | model_poly_faces (Bmodel *model) |
Generates links between the vertices to define the polyhedron faces. More... | |
int | poly_get_connectivity (Bcomponent *comp, int ilink, int nlink, Bpolygon *poly) |
int | model_poly_generate (Bmodel *model) |
Generates polygons based on a vertex network. More... | |
int | model_vertex_types (Bmodel *model) |
Determines the vertex type based on adjacent polygons. More... | |
Bstring | component_6digit_type (Bcomponent *comp) |
int | model_extended_vertex_types (Bmodel *model) |
Determines the vertex type based on adjacent and opposed polygons. More... | |
Bmodel * | model_poly_dual (Bmodel *model, int order) |
Calculates the dual of a polyhedral network. More... | |
int | model_poly_analyze (Bmodel *model) |
Analyzes a model for polygon regularity and planarity. More... | |
int | model_poly_links (Bmodel *model) |
Calculates all the model links. More... | |
int | model_poly_angles (Bmodel *model) |
Calculates all the polygon angles. More... | |
double | model_poly_regularity (Bmodel *model) |
Analyzes a model for polygon regularity. More... | |
double | model_poly_planarity (Bmodel *model) |
Analyzes a model for polygon planarity. More... | |
double | model_poly_energy (Bmodel *model, double angle_ref) |
Calculates the different energy terms for all models. More... | |
int | model_poly_pentagon_adjacency (Bmodel *model) |
Calculates the number of edges shared by pentagons. More... | |
Bstring | model_poly_find_symmetry (Bmodel *model, double threshold) |
Finds the symmetry axes associated with polyhedral elements. More... | |
int | model_poly_hand (Bmodel *model) |
Calculates the polyhedron hand. More... | |
int | model_poly_compare (Bmodel *model, Bmodel *refmodel) |
Compares a model with reference models based on the eigenvalues of the adjacency matrix. More... | |
vector< double > | model_poly_eigenvalues (Bmodel *model, int show) |
Generates the eigenvalues of the adjacency matrix for a model. More... | |
int | comp_count_connected (Bcomponent *comp) |
int | model_number_connected_clusters (Bmodel *model) |
vector< double > | model_poly_sphere_coor (Bmodel *model) |
Generates coordinates for components based on the eigenvectors of the adjacency matrix. More... | |
Variables | |
int | verbose |
Functions to manipulate polyhedral coordinate files.
#define NSMAX 100 |
int comp_count_connected | ( | Bcomponent * | comp | ) |
Bstring component_6digit_type | ( | Bcomponent * | comp | ) |
int model_extended_vertex_types | ( | Bmodel * | model | ) |
Determines the vertex type based on adjacent and opposed polygons.
*model | model structure. |
The link flag of each component is asigned such that the order of the rigth adjacent polygon is in the first digit, that of the left adjacent polygon in the second digit, and that of the opposing polygon in the third digit. New component types are generated.
int model_number_connected_clusters | ( | Bmodel * | model | ) |
int model_poly_analyze | ( | Bmodel * | model | ) |
Analyzes a model for polygon regularity and planarity.
*model | model structure. |
int model_poly_angles | ( | Bmodel * | model | ) |
Calculates all the polygon angles.
*model | model structure. |
The angles for each polygon is calculated and averaged. The overall statistics for every polygon order is shown.
Compares a model with reference models based on the eigenvalues of the adjacency matrix.
*model | model structure. |
*refmodel | reference model(s) to compare. |
The comparison is based on the eigenvectors of the adjacency matrix, which are related to spherical harmonics. There are 3 P(sigma) eigenvectors giving the vertex coordinates. These are usually (but not always) vectors 2, 3, and 4 ordered by eigenvalue. The eigenvalues are characteristic for a polyhedron, although they may not be unique. For every model identified, the model type is set from the reference ID. The reference model selection is incremented to indicate the count. Dover Publications, Inc., Mineola, New York, pages 101 - 104.Reference: Fowler, P.W. and Manolopoulos, D.E. (2006) An Atlas of Fullerenes.
Calculates the dual of a polyhedral network.
*model | model structure. |
order | order of polygons to convert to vertices, < 3 = all. |
The polygons are first defined to calculate the dual network that has vertices at the polygon centers.
vector< double > model_poly_eigenvalues | ( | Bmodel * | model, |
int | show | ||
) |
Generates the eigenvalues of the adjacency matrix for a model.
*model | model structure (modified with the topological coordinates). |
show | flag to show eigenvalues. |
The eigenvectors of the adjacency matrix are related to spherical harmonics. The eigenvalues are characteristic for a polyhedron, although they may not be unique. Only the first model in the list is processed. Dover Publications, Inc., Mineola, New York, pages 101 - 104.Reference: Fowler, P.W. and Manolopoulos, D.E. (2006) An Atlas of Fullerenes.
double model_poly_energy | ( | Bmodel * | model, |
double | angle_ref | ||
) |
Calculates the different energy terms for all models.
*model | model structure. |
angle_ref | reference angle (<=0 to use the polygon angle). |
The angular energy is calculated either with a given reference angle, or with the nominal polygon inner angle as reference. Regularity is defined as the adherence to a constant distance of each vertex from the polygon center. The polygon area is: n * s^2 1 + cos(2*PI/n) A = ------- sqrt(-----------------) 4 1 - cos(2*PI/n) where n is the number of vertices in the polygon. The contribution of each polygon to the polyhedral volume is: V = A * dc / 3 where dc is the distance of the polygon center to the polyhedral center.
int model_poly_faces | ( | Bmodel * | model | ) |
Generates links between the vertices to define the polyhedron faces.
*model | model structure. |
Two vertices are linked only when they are on the surface of the polyhedron, i.e., all other vertices are on one side of the pair of vertices. This is only true if there are no other vertices v with the following property: v•v0 > v0•v0 where v0 is the average of the two vertices considered for linkage. Only the first model is processed.
Finds the symmetry axes associated with polyhedral elements.
*model | model structure. |
threshold | cutoff to flag a symmetry axis. |
Symmetry axes are associated with specific elements: link reflection and 2-fold axis. vertex n-fold axis based on vertex order. polygon n-fold axis based on polygon order. Only the first model in the list is processed.
int model_poly_generate | ( | Bmodel * | model | ) |
Generates polygons based on a vertex network.
*model | model structure. |
The search startegy is to start at a vertex and then search always turning into the same direction. First the outward pointing normal for each vertex is calculated. Then the connectivity is followed always turning in the same direction at each vertex.
int model_poly_hand | ( | Bmodel * | model | ) |
Calculates the polyhedron hand.
*model | model structure. |
The hand of a polyhedron is based on the sign of the rotational strength element associated with the first two eigenvectors of the adjacency matrix. It is assumed that the symmetry has been determined. The hand sign is: 0 no handedness. 1 one enantiomorph. -1 other enantiomorph.
int model_poly_links | ( | Bmodel * | model | ) |
Calculates all the model links.
*model | model structure. |
int model_poly_pentagon_adjacency | ( | Bmodel * | model | ) |
Calculates the number of edges shared by pentagons.
*model | model structure. |
double model_poly_planarity | ( | Bmodel * | model | ) |
Analyzes a model for polygon planarity.
*model | model structure. |
A plane is fit through the polygon vertices and the normal calculated from: n•p = d where n is the normal vector, p is a point in the plane, and d is the offset. The polygon planarity is defined as the root-mean-square-deviation from the fitted plane.
double model_poly_regularity | ( | Bmodel * | model | ) |
Analyzes a model for polygon regularity.
*model | model structure. |
Regularity is defined as the adherence to a constant distance of each vertex from the polygon center. The polygon area is: n * s^2 1 + cos(2*PI/n) A = ------- sqrt(-----------------) 4 1 - cos(2*PI/n) where n is the number of vertices in the polygon. The contribution of each polygon to the polyhedral volume is: V = A * dc / 3 where dc is the distance of the polygon center to the polyhedral center.
vector< double > model_poly_sphere_coor | ( | Bmodel * | model | ) |
Generates coordinates for components based on the eigenvectors of the adjacency matrix.
*model | model structure. |
The eigenvectors of the adjacency matrix are related to spherical harmonics. There are 3 P(sigma) eigenvectors giving the vertex coordinates. These are usually (but not always) vectors 2, 3, and 4 ordered by eigenvalue. The actual 3 P(sigma) eigenvectors are identified as those having exactly a single node, i.e., closely connected vertices cluster together in every dimension. The eigenvalues are characteristic for a polyhedron, although they may not be unique. Dover Publications, Inc., Mineola, New York, pages 101 - 104.Reference: Fowler, P.W. and Manolopoulos, D.E. (2006) An Atlas of Fullerenes.
int model_vertex_types | ( | Bmodel * | model | ) |
Determines the vertex type based on adjacent polygons.
*model | model structure. |
The polygon order is written into flags for vertex links in one direction for each polygon. New component types are generated.
int poly_get_connectivity | ( | Bcomponent * | comp, |
int | ilink, | ||
int | nlink, | ||
Bpolygon * | poly | ||
) |
|
extern |