Ignore:
Timestamp:
Jun 7, 2008, 1:21:53 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
d11f22
Parents:
a89a22
Message:

Working version of PAS transformation (tested on C-S-H cluster) and code scaffold of VolumeOfConvexEnvelope that's untested so far

PAS simply calculates inertia tensor, diagonalizes it via GSL and transforms molecule into eigenvector system such that z axis is eigenvector of biggest eigenvalue.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/molecules.hpp

    ra89a22 r32b6dc  
    1313#include <gsl/gsl_vector.h>
    1414#include <gsl/gsl_matrix.h>
     15#include <gsl/gsl_eigen.h>
    1516#include <gsl/gsl_heapsort.h>
    1617
     
    4344#define KeySetTestPair pair<KeySet::iterator, bool>
    4445#define GraphTestPair pair<Graph::iterator, bool>
     46
     47#define DistanceNrPair pair< double, atom* >
     48#define Boundaries map <double, DistanceNrPair >
     49#define BoundariesPair pair<double, DistanceNrPair >
     50#define BoundariesTestPair pair<Boundaries::iterator, bool>
     51#define LinetoAtomMap map < int, atom * >
     52#define LinetoAtomPair pair < int, atom * >
     53#define LinetoAtomTestPair pair < LinetoAtomMap::iterator, bool>
    4554
    4655struct KeyCompare
     
    265274  void CenterEdge(ofstream *out, vector *max);
    266275  void CenterOrigin(ofstream *out, vector *max);
    267   void CenterGravity(ofstream *out, vector *max); 
     276  void CenterGravity(ofstream *out, vector *max);
    268277  void Translate(const vector *x);
    269278  void Mirror(const vector *x);
    270279  void Align(vector *n);
    271280  void Scale(double **factor);
    272   void DetermineCenterOfGravity(vector &CenterOfGravity);
     281  void DetermineCenter(vector &center);
     282  vector * DetermineCenterOfGravity(ofstream *out);
    273283  void SetBoxDimension(vector *dim);
    274284  double * ReturnFullMatrixforSymmetric(double *cell_size);
    275285  void ScanForPeriodicCorrection(ofstream *out);
    276 
     286        void PrincipalAxisSystem(ofstream *out, bool DoRotate);
     287        double VolumeOfConvexEnvelope(ofstream *out, bool IsAngstroem);
     288       
    277289  bool CheckBounds(const vector *x) const;
    278290  void GetAlignVector(struct lsq_params * par) const;
     
    283295 
    284296  // Graph analysis
    285   MoleculeLeafClass * DepthFirstSearchAnalysis(ofstream *out, bool ReturnStack, int *&MinimumRingSize);
     297  MoleculeLeafClass * DepthFirstSearchAnalysis(ofstream *out, int *&MinimumRingSize);
    286298  void CyclicStructureAnalysis(ofstream *out, class StackClass<bond *> *BackEdgeStack, int *&MinimumRingSize);
    287299  bond * FindNextUnused(atom *vertex);
     
    303315  bool ParseOrderAtSiteFromFile(ofstream *out, char *path);
    304316  bool StoreOrderAtSiteFile(ofstream *out, char *path);
    305   bool ParseKeySetFile(ofstream *out, char *filename, Graph *&FragmentList, bool IsAngstroem);
     317  bool ParseKeySetFile(ofstream *out, char *filename, Graph *&FragmentList);
    306318  bool StoreKeySetFile(ofstream *out, Graph &KeySetList, char *path);
    307319  bool StoreForcesFile(ofstream *out, MoleculeListClass *BondFragments, char *path, int *SortIndex);
Note: See TracChangeset for help on using the changeset viewer.