source: src/parser.hpp@ 674220

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 674220 was 674220, 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.