source: molecuilder/src/parser.hpp@ 0e2190

Last change on this file since 0e2190 was c3a303, checked in by Frederik Heber <heber@…>, 16 years ago

Merge branch 'master' into ConcaveHull

Conflicts:

molecuilder/src/analyzer.cpp
molecuilder/src/bond.cpp
molecuilder/src/boundary.cpp
molecuilder/src/boundary.hpp
molecuilder/src/builder.cpp
molecuilder/src/config.cpp
molecuilder/src/datacreator.cpp
molecuilder/src/datacreator.hpp
molecuilder/src/defs.hpp
molecuilder/src/ellipsoid.cpp
molecuilder/src/joiner.cpp
molecuilder/src/molecules.cpp
molecuilder/src/molecules.hpp
molecuilder/src/parser.cpp
molecuilder/src/parser.hpp

merges:

compilation fixes:

  • Property mode set to 100755
File size: 4.5 KB
RevLine 
[a0bcf1]1/** \file parsing.hpp
2 *
3 * Definitions of various class functions for the parsing of value files.
[e08f45]4 *
[a0bcf1]5 */
6
7
8#ifndef PARSING_HPP_
9#define PARSING_HPP_
10
[77da65]11using namespace std;
12
13// include config.h
14#ifdef HAVE_CONFIG_H
15#include <config.h>
16#endif
17
[a0bcf1]18// ======================================= DEFINES ==========================================
19
20#define EnergySuffix ".energy.all"
[d87482]21#define EnergyFragmentSuffix ".energyfragment.all"
[a0bcf1]22#define ForcesSuffix ".forces.all"
[d87482]23#define ForceFragmentSuffix ".forcefragment.all"
24#define HcorrectionSuffix ".Hcorrection.all"
25#define HcorrectionFragmentSuffix ".Hcorrectionfragment.all"
26#define HessianSuffix ".hessian_xx.all"
27#define HessianFragmentSuffix ".hessianfragment_xx.all"
28#define OrderSuffix ".Order"
[375dcf]29#define ShieldingSuffix ".sigma_all.csv"
30#define ShieldingPASSuffix ".sigma_all_PAS.csv"
31#define ShieldingFragmentSuffix ".sigma_all_fragment.all"
32#define ShieldingPASFragmentSuffix ".sigma_all_PAS_fragment.all"
[002351]33#define ChiSuffix ".chi_all.csv"
34#define ChiPASSuffix ".chi_all_PAS.csv"
35#define ChiFragmentSuffix ".chi_all_fragment.all"
36#define ChiPASFragmentSuffix ".chi_all_PAS_fragment.all"
[a0bcf1]37#define TimeSuffix ".speed"
38
39// ======================================= FUNCTIONS ==========================================
40
[375dcf]41bool FilePresent(const char *filename, bool test);
[a0bcf1]42bool TestParams(int argc, char **argv);
43
[77da65]44
[a0bcf1]45// ======================================= CLASS MatrixContainer =============================
46
47class MatrixContainer {
[a048fa]48 public:
49 double ***Matrix;
50 int **Indices;
[f98e5a]51 char **Header;
[a048fa]52 int MatrixCounter;
53 int *RowCounter;
[b4c71a]54 int *ColumnCounter;
[a0bcf1]55
[a048fa]56 MatrixContainer();
[a0bcf1]57 ~MatrixContainer();
58
[b4c71a]59 bool InitialiseIndices(class MatrixContainer *Matrix = NULL);
[a048fa]60 bool ParseMatrix(const char *name, int skiplines, int skipcolumns, int MatrixNr);
61 virtual bool ParseFragmentMatrix(const char *name, const char *prefix, string suffix, int skiplines, int skipcolumns);
[f98e5a]62 bool AllocateMatrix(char **GivenHeader, int MCounter, int *RCounter, int *CCounter);
[a048fa]63 bool ResetMatrix();
64 double FindMinValue();
65 double FindMaxValue();
66 bool SetLastMatrix(double value, int skipcolumns);
67 bool SetLastMatrix(double **values, int skipcolumns);
68 //bool ParseIndices();
69 //bool SumSubValues();
70 bool SumSubManyBodyTerms(class MatrixContainer &Matrix, class KeySetsContainer &KeySet, int Order);
71 bool WriteTotalFragments(const char *name, const char *prefix);
72 bool WriteLastMatrix(const char *name, const char *prefix, const char *suffix);
[e08f45]73};
[a0bcf1]74
75// ======================================= CLASS EnergyMatrix =============================
76
77class EnergyMatrix : public MatrixContainer {
[a048fa]78 public:
79 bool ParseIndices();
80 bool SumSubEnergy(class EnergyMatrix &Fragments, class EnergyMatrix *CorrectionFragments, class KeySetsContainer &KeySet, int Order, double sign);
81 bool ParseFragmentMatrix(const char *name, const char *prefix, string suffix, int skiplines, int skipcolumns);
[a0bcf1]82};
83
84// ======================================= CLASS ForceMatrix =============================
85
86class ForceMatrix : public MatrixContainer {
[a048fa]87 public:
88 bool ParseIndices(const char *name);
89 bool SumSubForces(class ForceMatrix &Fragments, class KeySetsContainer &KeySet, int Order, double sign);
90 bool ParseFragmentMatrix(const char *name, const char *prefix, string suffix, int skiplines, int skipcolumns);
[a0bcf1]91};
92
[d87482]93// ======================================= CLASS HessianMatrix =============================
94
[f98e5a]95class HessianMatrix : public MatrixContainer {
[d87482]96 public:
[f98e5a]97 HessianMatrix();
98 //~HessianMatrix();
[d87482]99 bool ParseIndices(char *name);
[f98e5a]100 bool SumSubManyBodyTerms(class MatrixContainer &MatrixValues, class KeySetsContainer &KeySet, int Order);
[d87482]101 bool SumSubHessians(class HessianMatrix &Fragments, class KeySetsContainer &KeySet, int Order, double sign);
[c3a303]102 bool ParseFragmentMatrix(const char *name, const char *prefix, string suffix, int skiplines, int skipcolumns);
[f98e5a]103 private:
104 bool IsSymmetric;
[d87482]105};
106
[a0bcf1]107// ======================================= CLASS KeySetsContainer =============================
108
109class KeySetsContainer {
[a048fa]110 public:
111 int **KeySets;
112 int *AtomCounter;
113 int FragmentCounter;
114 int Order;
115 int *FragmentsPerOrder;
116 int **OrderSet;
117
118 KeySetsContainer();
119 ~KeySetsContainer();
120
121 bool ParseKeySets(const char *name, const int *ACounter, const int FCounter);
122 bool ParseManyBodyTerms();
123 bool Contains(const int GreaterSet, const int SmallerSet);
[a0bcf1]124};
125
126// ======================================= END =============================================
127
128#endif /*PARSING_HPP_*/
Note: See TracBrowser for help on using the repository browser.