1 
2 #ifndef __GABEDIT_CRYSTALLO_H__
3 #define __GABEDIT_CRYSTALLO_H__
4 
5 #include "../Common/Global.h"
6 #include "../Utils/Constants.h"
7 
8 typedef struct _CrystalloAtom
9 {
10 	gchar symbol[20];
11 	gdouble C[3];
12 	gchar mmType[20];
13 	gchar pdbType[20];
14 	gchar residueName[10];
15 	gint residueNumber;
16 	gdouble charge;
17 }CrystalloAtom;
18 
19 typedef struct _CrystalloSymOp
20 {
21 	gchar* S[3]; /* M[0]="ax+by+cz+k" string */
22 	gdouble W[3][3];
23 	gdouble w[3]; /* R = W r + w */
24 }CrystalloSymOp;
25 
26 /* a,b,c and positions are in agnstrom */
27 typedef struct _Crystal
28 {
29 	GList* atoms;
30 	GList* operators;
31 	gdouble alpha;
32 	gdouble beta;
33 	gdouble gamma;
34 	gdouble a;
35 	gdouble b;
36 	gdouble c;
37 }Crystal;
38 
39 typedef enum
40 {
41   GABEDIT_CRYSTALLO_REDUCTION_NIGGLI,
42   GABEDIT_CRYSTALLO_REDUCTION_DELAUNAY,
43   GABEDIT_CRYSTALLO_REDUCTION_PRIMITIVE
44 } GabeditCrystalloReductionType;
45 
46 #include "../Crystallography/GabeditKPoints.h"
47 
48 
49 gboolean crystalloRotate(GList* atoms, gdouble T[][3], gboolean invers);
50 void crystalloFreeSymOp(gpointer data);
51 void crystalloFreeAtom(gpointer data);
52 void initCrystal(Crystal* crystal);
53 void freeCrystal(Crystal* crystal);
54 void crystalloInitAtom(CrystalloAtom* a, gchar* symbol);
55 gdouble crystalloGetDistance2(CrystalloAtom* a1, CrystalloAtom* a2);
56 gboolean crystalloSmallDistance(CrystalloAtom* a1, CrystalloAtom* a2);
57 void crystalloPrintAtoms(GList* atoms);
58 void crystalloPrintSymOp(GList* operators);
59 void crystalloBuildWwFromStr(CrystalloSymOp* crystalloSymOp);
60 gboolean crystalloSetAtomsInBox(GList* atoms);
61 gboolean crystalloSetCartnAtomsInBox(GList* atoms);
62 gint crystalloNumberOfTv(GList* atoms);
63 gboolean crystalloAddTvectorsToGeom(Crystal* crystal);
64 void crystalloPrintNumberOfAtoms(GList* atoms);
65 gboolean crystalloRemoveAtomsWithSmallDistance(GList** patoms);
66 gboolean crystalloApplySymOperators(GList** patoms, GList* operators);
67 gboolean crystalloCartnToFractWw(GList* atoms, gdouble W[][3], gdouble w[]);
68 gboolean crystalloCartnToFract(GList* atoms);
69 gboolean crystalloFractToCartn(GList* atoms);
70 gint crystalloCenter(GList* atoms);
71 void crystalloRemoveTv(GList** patoms);
72 gboolean buildSuperCellSimple(GList** patoms, gint nReplicas1, gint nReplicas2, gint nReplicas3);
73 gint crystalloBuildTablesSymbolsXYZ(GList* atoms, gchar** atomSymbols[], gdouble* positions[]);
74 gint crystalloNumberOfAtoms(GList* atoms);
75 gint crystalloGetTv(GList* atoms, gdouble Tv[][3]);
76 void crystalloCreateCellNano(GList** patoms, gdouble radius);
77 void crystalloCutPlane(GList** patoms, gdouble direction[], gdouble layer);
78 void createWulffCluster(GList** patoms, gint nSurfaces, gdouble** surfaces, gdouble* layers);
79 gdouble crystalloGetVolume(GList* atoms);
80 void createSlab(GList** patoms, gdouble surface[], gdouble layers[], gdouble emptySpaceSize, gboolean orientXZ);
81 gboolean crystalloReduceCell(GList** patoms, gdouble symprec, GabeditCrystalloReductionType type);
82 gint crystalloGetSpaceSymmetryGroup(GList* atoms, char groupName[], gdouble symprec);
83 gboolean crystalloStandardizeCell(GList** patoms,  gint to_primitive, gint no_idealize, gdouble symprec);
84 gchar* crystalloGetSymmetryInfo(Crystal* crystal, gdouble symprec);
85 gboolean crystalloBuildSymOperators(Crystal* crystal, int W[][3][3], double w[][3], int nOp);
86 gchar* crystalloGetCIFOperators(GList* operators);
87 gchar* crystalloGetCIF(Crystal* crystal, gdouble symprec, gboolean withSymmetryOperators);
88 gboolean crystalloComputeLengthsAndAngles(Crystal* crystal);
89 gboolean generateExtendedPearsonSymbol(char extendedPearsonSymbol[], Crystal* crystal, gdouble symprec);
90 gchar* crystalloGetVASPAtomsPositions(GList* atoms);
91 gboolean crystalloAllRecObtuse(GList* atoms, gdouble symprec);
92 gboolean crystalloPrimitiveCellHinuma(GList** patoms,  gchar* pearsonSymbol);
93 gboolean crystalloPrimitiveCell(GList** patoms,  gdouble symprec);
94 gboolean crystalloTranslate(GList* atoms, gdouble T[], gboolean cartn);
95 gboolean buildSuperCell(GList** patoms, gint P[][3], gdouble p[]);
96 
97 
98 #endif /* __GABEDIT_CRYSTALLO_H__ */
99