1
/*****************************************************************************
2
TRAVIS - Trajectory Analyzer and Visualizer
3
http://www.travis-analyzer.de/
5
Copyright (c) 2009-2013 Martin Brehm
6
2012-2013 Martin Thomas
8
This file written by Martin Brehm and Martin Thomas.
10
This program is free software: you can redistribute it and/or modify
11
it under the terms of the GNU General Public License as published by
12
the Free Software Foundation, either version 3 of the License, or
13
(at your option) any later version.
15
This program is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
GNU General Public License for more details.
20
You should have received a copy of the GNU General Public License
21
along with this program. If not, see <http://www.gnu.org/licenses/>.
22
*****************************************************************************/
24
#include "interface.h"
26
//#include "normalcoordinate.h"
27
#include "normalmode.h"
31
#include "structurefactor.h"
33
void Interface_DefaultConf() {
34
/* g_pDatabase->AddString("/BLA/BLUBB/PLOEPP/STRING1","String 1 Content");
35
g_pDatabase->AddInt("/BLA/BLUBB/PLOEPP/INT1",123456);
36
g_pDatabase->AddFloat("/BLA/BLUBB/PLOEPP/FLOAT1",1.23456);
37
g_pDatabase->AddBool("/BLA/BLUBB/PLOEPP/BOOL1",true);*/
40
bool Interface_BeforeAnalysis() {
42
if(!gatherRegionAnalysis())
50
/* if(g_bNormalCoordinate)
51
if(!gatherNormalCoordinate())
54
if(!gatherStructureFactor())
59
bool Interface_Initialization() {
61
if(!initializeRaman())
66
/* if(g_bNormalCoordinate)
67
if(!initializeNormalCoordinate())
70
if(!initializeStructureFactor())
75
void Interface_ProcessStep(CTimeStep *ts) {
77
processRegionAnalysis(ts);
82
/* if(g_bNormalCoordinate)
83
processNormalCoordinate(ts);*/
85
processStructureFactor(ts);
88
void Interface_AfterAnalysis() {
90
finalizeRegionAnalysis();
95
/* if(g_bNormalCoordinate)
96
finalizeNormalCoordinate();*/
98
finalizeStructureFactor();
101
void Interface_DecomposeModes(int n, CxObArray *ccr_matrix) {
102
normalModeAnalysis(n, ccr_matrix);
105
/************************************************
109
mprintf( [Color,] ... )
121
A list of useful global variables:
127
g_iTrajSteps // -1 means no information
129
g_fBoxX, g_fBoxY, g_fBoxZ - The cell vector in pm
131
g_oaMolecules - Array of all molecule kinds (members of type CMolecule)
133
g_oaSingleMolecules - Array of all molecules (members of type CSingleMolecule)
137
for (z=0;z<g_oaMolecules.GetSize();z++)
139
m = (CMolecule*)g_oaMolecules[z];
142
for (z2=0;z2<m->m_laSingleMolIndex.GetSize();z2++)
144
sm = (CSingleMolecule*)g_oaSingleMolecules[m->m_laSingleMolIndex[z2]];
145
for (z3=0;z3<m->m_baAtomIndex.GetSize();z3++)
147
if ((!g_bSaveVirtAtoms) && (m->m_baAtomIndex[z3] == g_iVirtAtomType))
149
for (z4=0;z4<((CxIntArray*)sm->m_oaAtomOffset[z3])->GetSize();z4++)
150
mfprintf(a," %s %8.5f %8.5f %8.5f\n",((CAtom*)g_oaAtoms[m->m_baAtomIndex[z3]])->m_sName,m_vaCoords[((CxIntArray*)sm->m_oaAtomOffset[z3])->GetAt(z4)][0]/100.0f,m_vaCoords[((CxIntArray*)sm->m_oaAtomOffset[z3])->GetAt(z4)][1]/100.0f,m_vaCoords[((CxIntArray*)sm->m_oaAtomOffset[z3])->GetAt(z4)][2]/100.0f);
1
/*****************************************************************************
2
TRAVIS - Trajectory Analyzer and Visualizer
3
http://www.travis-analyzer.de/
5
Copyright (c) 2009-2014 Martin Brehm
6
2012-2014 Martin Thomas
8
This file written by Martin Brehm and Martin Thomas.
10
This program is free software: you can redistribute it and/or modify
11
it under the terms of the GNU General Public License as published by
12
the Free Software Foundation, either version 3 of the License, or
13
(at your option) any later version.
15
This program is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
GNU General Public License for more details.
20
You should have received a copy of the GNU General Public License
21
along with this program. If not, see <http://www.gnu.org/licenses/>.
22
*****************************************************************************/
24
#include "interface.h"
26
//#include "normalcoordinate.h"
27
#include "normalmode.h"
31
#include "structurefactor.h"
33
void Interface_DefaultConf() {
34
/* g_pDatabase->AddString("/BLA/BLUBB/PLOEPP/STRING1","String 1 Content");
35
g_pDatabase->AddInt("/BLA/BLUBB/PLOEPP/INT1",123456);
36
g_pDatabase->AddFloat("/BLA/BLUBB/PLOEPP/FLOAT1",1.23456);
37
g_pDatabase->AddBool("/BLA/BLUBB/PLOEPP/BOOL1",true);*/
40
bool Interface_BeforeAnalysis() {
42
if(!gatherRegionAnalysis())
50
/* if(g_bNormalCoordinate)
51
if(!gatherNormalCoordinate())
54
if(!gatherStructureFactor())
59
bool Interface_Initialization() {
61
if(!initializeRaman())
66
/* if(g_bNormalCoordinate)
67
if(!initializeNormalCoordinate())
70
if(!initializeStructureFactor())
75
void Interface_ProcessStep(CTimeStep *ts) {
77
processRegionAnalysis(ts);
82
/* if(g_bNormalCoordinate)
83
processNormalCoordinate(ts);*/
85
processStructureFactor(ts);
88
void Interface_AfterAnalysis() {
90
finalizeRegionAnalysis();
95
/* if(g_bNormalCoordinate)
96
finalizeNormalCoordinate();*/
98
finalizeStructureFactor();
101
void Interface_DecomposeModes(int n, CxObArray *ccr_matrix) {
102
normalModeAnalysis(n, ccr_matrix);
105
/************************************************
109
mprintf( [Color,] ... )
121
A list of useful global variables:
127
g_iTrajSteps // -1 means no information
129
g_fBoxX, g_fBoxY, g_fBoxZ - The cell vector in pm
131
g_oaMolecules - Array of all molecule kinds (members of type CMolecule)
133
g_oaSingleMolecules - Array of all molecules (members of type CSingleMolecule)
137
for (z=0;z<g_oaMolecules.GetSize();z++)
139
m = (CMolecule*)g_oaMolecules[z];
142
for (z2=0;z2<m->m_laSingleMolIndex.GetSize();z2++)
144
sm = (CSingleMolecule*)g_oaSingleMolecules[m->m_laSingleMolIndex[z2]];
145
for (z3=0;z3<m->m_baAtomIndex.GetSize();z3++)
147
if ((!g_bSaveVirtAtoms) && (m->m_baAtomIndex[z3] == g_iVirtAtomType))
149
for (z4=0;z4<((CxIntArray*)sm->m_oaAtomOffset[z3])->GetSize();z4++)
150
mfprintf(a," %s %8.5f %8.5f %8.5f\n",((CAtom*)g_oaAtoms[m->m_baAtomIndex[z3]])->m_sName,m_vaCoords[((CxIntArray*)sm->m_oaAtomOffset[z3])->GetAt(z4)][0]/100.0f,m_vaCoords[((CxIntArray*)sm->m_oaAtomOffset[z3])->GetAt(z4)][1]/100.0f,m_vaCoords[((CxIntArray*)sm->m_oaAtomOffset[z3])->GetAt(z4)][2]/100.0f);
156
156
*************************************************/
b'\\ No newline at end of file'