[8eb17a] | 1 | #ifndef BOUNDARY_HPP_
|
---|
| 2 | #define BOUNDARY_HPP_
|
---|
| 3 |
|
---|
| 4 | class BoundaryPointSet;
|
---|
| 5 | class BoundaryLineSet;
|
---|
| 6 | class BoundaryTriangleSet;
|
---|
| 7 |
|
---|
| 8 | // include config.h
|
---|
| 9 | #ifdef HAVE_CONFIG_H
|
---|
| 10 | #include <config.h>
|
---|
| 11 | #endif
|
---|
| 12 |
|
---|
| 13 | // STL headers
|
---|
| 14 | #include <map>
|
---|
| 15 | #include <set>
|
---|
| 16 | #include <deque>
|
---|
| 17 |
|
---|
| 18 | #include <gsl/gsl_poly.h>
|
---|
[6ac7ee] | 19 | #include <gsl/gsl_matrix.h>
|
---|
| 20 | #include <gsl/gsl_linalg.h>
|
---|
| 21 | #include <gsl/gsl_multimin.h>
|
---|
| 22 | #include <gsl/gsl_permutation.h>
|
---|
[8eb17a] | 23 |
|
---|
[6ac7ee] | 24 | #include "linkedcell.hpp"
|
---|
[8eb17a] | 25 | #include "molecules.hpp"
|
---|
| 26 |
|
---|
| 27 | template <typename T> void SetEndpointsOrdered(T endpoints[2], T endpoint1, T endpoint2)
|
---|
| 28 | {
|
---|
| 29 | if (endpoint1->Nr < endpoint2->Nr) {
|
---|
| 30 | endpoints[0] = endpoint1;
|
---|
| 31 | endpoints[1] = endpoint2;
|
---|
| 32 | } else {
|
---|
| 33 | endpoints[0] = endpoint2;
|
---|
| 34 | endpoints[1] = endpoint1;
|
---|
| 35 | }
|
---|
| 36 | };
|
---|
| 37 |
|
---|
| 38 | class BoundaryPointSet {
|
---|
| 39 | public:
|
---|
| 40 | BoundaryPointSet();
|
---|
| 41 | BoundaryPointSet(atom *Walker);
|
---|
| 42 | ~BoundaryPointSet();
|
---|
[a8bcea6] | 43 |
|
---|
[8eb17a] | 44 | void AddLine(class BoundaryLineSet *line);
|
---|
[a8bcea6] | 45 |
|
---|
[8eb17a] | 46 | LineMap lines;
|
---|
| 47 | int LinesCount;
|
---|
| 48 | atom *node;
|
---|
| 49 | int Nr;
|
---|
| 50 | };
|
---|
| 51 |
|
---|
| 52 | class BoundaryLineSet {
|
---|
| 53 | public:
|
---|
| 54 | BoundaryLineSet();
|
---|
| 55 | BoundaryLineSet(class BoundaryPointSet *Point[2], int number);
|
---|
| 56 | ~BoundaryLineSet();
|
---|
| 57 |
|
---|
| 58 | void AddTriangle(class BoundaryTriangleSet *triangle);
|
---|
| 59 |
|
---|
| 60 | class BoundaryPointSet *endpoints[2];
|
---|
| 61 | TriangleMap triangles;
|
---|
| 62 | int TrianglesCount;
|
---|
| 63 | int Nr;
|
---|
| 64 | };
|
---|
| 65 |
|
---|
| 66 | class BoundaryTriangleSet {
|
---|
| 67 | public:
|
---|
| 68 | BoundaryTriangleSet();
|
---|
| 69 | BoundaryTriangleSet(class BoundaryLineSet *line[3], int number);
|
---|
| 70 | ~BoundaryTriangleSet();
|
---|
[a8bcea6] | 71 |
|
---|
[e9b8bb] | 72 | void GetNormalVector(Vector &NormalVector);
|
---|
[a8bcea6] | 73 |
|
---|
[8eb17a] | 74 | class BoundaryPointSet *endpoints[3];
|
---|
| 75 | class BoundaryLineSet *lines[3];
|
---|
[a8bcea6] | 76 | Vector NormalVector;
|
---|
[8eb17a] | 77 | int Nr;
|
---|
| 78 | };
|
---|
| 79 |
|
---|
| 80 | class Tesselation {
|
---|
| 81 | public:
|
---|
[a8bcea6] | 82 |
|
---|
[8eb17a] | 83 | Tesselation();
|
---|
| 84 | ~Tesselation();
|
---|
[a8bcea6] | 85 |
|
---|
[8eb17a] | 86 | void TesselateOnBoundary(ofstream *out, config *configuration, molecule *mol);
|
---|
| 87 | void GuessStartingTriangle(ofstream *out);
|
---|
| 88 | void AddPoint(atom * Walker);
|
---|
[caf5d6] | 89 | void AddTrianglePoint(atom* Candidate, int n);
|
---|
[e4ea46] | 90 | void AddTriangleLine(class BoundaryPointSet *a, class BoundaryPointSet *b, int n);
|
---|
[caf5d6] | 91 | void AddTriangleToLines();
|
---|
[437922] | 92 | void Find_starting_triangle(ofstream *out, molecule* mol, const double RADIUS, LinkedCell *LC);
|
---|
| 93 | bool Find_next_suitable_triangle(ofstream *out, molecule* mol, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, int N, const char *filename, LinkedCell *LC);
|
---|
[cc2ee5] | 94 | bool CheckPresenceOfTriangle(ofstream *out, atom *a, atom *b, atom *c);
|
---|
| 95 | void Find_next_suitable_point_via_Angle_of_Sphere(atom* a, atom* b, atom* c, atom* Candidate, atom* Parent, int RecursionLevel, Vector *Chord, Vector *direction1, Vector *OldNormal, Vector ReferencePoint, atom*& Opt_Candidate, double *Storage, const double RADIUS, molecule* mol);
|
---|
[a8bcea6] | 96 |
|
---|
[8eb17a] | 97 | PointMap PointsOnBoundary;
|
---|
| 98 | LineMap LinesOnBoundary;
|
---|
| 99 | TriangleMap TrianglesOnBoundary;
|
---|
[e4ea46] | 100 | class BoundaryPointSet *TPS[3]; //this is a Storage for pointers to triangle points, this and BPS[2] needed due to AddLine restrictions
|
---|
[8eb17a] | 101 | class BoundaryPointSet *BPS[2];
|
---|
| 102 | class BoundaryLineSet *BLS[3];
|
---|
| 103 | class BoundaryTriangleSet *BTS;
|
---|
| 104 | int PointsOnBoundaryCount;
|
---|
| 105 | int LinesOnBoundaryCount;
|
---|
| 106 | int TrianglesOnBoundaryCount;
|
---|
[e4ea46] | 107 | int TriangleFilesWritten;
|
---|
[8eb17a] | 108 | };
|
---|
| 109 |
|
---|
| 110 |
|
---|
| 111 | ostream & operator << (ostream &ost, BoundaryPointSet &a);
|
---|
| 112 | ostream & operator << (ostream &ost, BoundaryLineSet &a);
|
---|
| 113 | ostream & operator << (ostream &ost, BoundaryTriangleSet &a);
|
---|
| 114 |
|
---|
| 115 |
|
---|
[6ac7ee] | 116 | double VolumeOfConvexEnvelope(ofstream *out, const char *filename, config *configuration, Boundaries *BoundaryPoints, molecule *mol);
|
---|
[318bfd] | 117 | double * GetDiametersOfCluster(ofstream *out, Boundaries *BoundaryPtr, molecule *mol, bool IsAngstroem);
|
---|
[edb650] | 118 | void PrepareClustersinWater(ofstream *out, config *configuration, molecule *mol, double ClusterVolume, double celldensity);
|
---|
[6ac7ee] | 119 | void Find_non_convex_border(ofstream *out, molecule* mol, class Tesselation *T, class LinkedCell *LCList, const char *tempbasename, const double RADIUS);
|
---|
| 120 | void Find_next_suitable_point(class BoundaryTriangleSet *BaseTriangle, class BoundaryLineSet *BaseLine, atom*& OptCandidate, Vector *OptCandidateCenter, double *ShortestAngle, const double RADIUS, LinkedCell *LC);
|
---|
[8eb17a] | 121 |
|
---|
| 122 | #endif /*BOUNDARY_HPP_*/
|
---|