source: molecuilder/src/parser.hpp@ 002351

Last change on this file since 002351 was 002351, checked in by Frederik Heber <heber@…>, 17 years ago

Implemented analysis of magnetic susceptibilites.

This is very similar to Sigma(PAS), however not with ForceMatrix class but with EnergyMatrix. This is still not finished and yet not working. However, it does not impact on other functions of joiner or analyzer.

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