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.
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
*****************************************************************************/
26
#include "maintools.h"
43
CVirtualAtom::CVirtualAtom()
45
m_faWeight.SetName("CVirtualAtom::m_faWeight");
49
CVirtualAtom::~CVirtualAtom()
54
CMolecule::CMolecule()
60
m_bChargesAssigned = false;
62
m_baAtomIndex.SetName("CMolecule::m_baAtomIndex");
63
m_waAtomCount.SetName("CMolecule::m_waAtomCount");
64
m_laSingleMolIndex.SetName("CMolecule::m_laSingleMolIndex");
65
m_laVirtualAtoms.SetName("CMolecule::m_laVirtualAtoms");
66
m_oaNewNumbers.SetName("CMolecule::m_oaNewNumbers");
67
m_oaRingAtomTypes.SetName("CMolecule::m_oaRingAtomTypes");
68
m_oaRingAtoms.SetName("CMolecule::m_oaRingAtoms");
69
m_oaCharges.SetName("CMolecule::m_oaCharges");
73
CMolecule::~CMolecule()
85
m_oaBonds.SetName("CMolAtom::m_oaBonds");
94
CSingleMolecule::CSingleMolecule()
98
m_oaBondGroups.SetName("CSingleMolecule::m_oaBondGroups");
99
m_oaBonds.SetName("CSingleMolecule::m_oaBonds");
100
m_oaAngleGroups.SetName("CSingleMolecule::m_oaAngleGroups");
101
m_oaAngles.SetName("CSingleMolecule::m_oaAngles");
102
m_oaRings.SetName("CSingleMolecule::m_oaRings");
103
m_laBonds.SetName("CSingleMolecule::m_laBonds");
104
m_laWannier.SetName("CSingleMolecule::m_laWannier");
105
m_oaAtomOffset.SetName("CSingleMolecule::m_oaAtomOffset");
106
m_oaMolAtoms.SetName("CSingleMolecule::m_oaMolAtoms");
107
m_baAtomIndex.SetName("CSingleMolecule::m_baAtomIndex");
111
CSingleMolecule::~CSingleMolecule()
119
m_oaVectors.SetName("CADF::m_oaVectors");
120
m_faACF.SetName("CADF::m_faACF");
121
m_faMinMaxAngle.SetName("CADF::m_faMinMaxAngle");
133
m_oaVectors.SetName("CDDF::m_oaVectors");
134
m_faLastData.SetName("CDDF::m_faLastData");
135
m_laRotation.SetName("CDDF::m_laRotation");
136
m_faACF.SetName("CDDF::m_faACF");
147
m_oaCache.SetName("CMSD::m_oaCache");
161
m_oaVectors.SetName("CVHDF::m_oaVectors");
172
if (m_sShortName != NULL)
174
delete[] m_sShortName;
190
m_faMinMaxDist.SetName("CRDF::m_faMinMaxDist");
191
m_oaVectors.SetName("CRDF::m_oaVectors");
192
m_faACF.SetName("CRDF::m_faACF");
199
m_oaVectors.SetName("CPlDF::m_oaVectors");
200
m_faACF.SetName("CPlDF::m_faACF");
207
m_oaVectors.SetName("CLiDF::m_oaVectors");
208
m_faACF.SetName("CLiDF::m_faACF");
219
if (m_sShortName != NULL)
221
delete[] m_sShortName;
234
if (m_faData != NULL)
255
if (m_sShortName != NULL)
257
delete[] m_sShortName;
260
if (m_pDensDF != NULL)
270
m_faACF.SetName("CVDF::m_faACF");
281
m_faACF.SetName("CDipDF::m_faACF");
307
m_bAxisDivide = false;
316
CConditionSubGroup::CConditionSubGroup()
320
m_oaConditions.SetName("CConditionSubGroup::m_oaConditions");
324
CConditionSubGroup::~CConditionSubGroup()
329
CConditionGroup::CConditionGroup()
335
m_iPassCounter = NULL;
336
m_bAlwaysTrue = NULL;
337
m_oaConditionSubGroups.SetName("CConditionGroup::m_oaConditionSubGroups");
341
CConditionGroup::~CConditionGroup()
346
bool ContainsDigit(const char *s)
348
if (strcspn(s,"0123456789") != strlen(s))
354
void ReplaceDigits(char *s)
369
case '1': *q = 'a'; break;
370
case '2': *q = 'b'; break;
371
case '3': *q = 'c'; break;
372
case '4': *q = 'd'; break;
373
case '5': *q = 'e'; break;
374
case '6': *q = 'f'; break;
375
case '7': *q = 'g'; break;
376
case '8': *q = 'h'; break;
377
case '9': *q = 'i'; break;
378
case '0': *q = 'z'; break;
385
case '1': b = true; *q = '_'; q++; *q = 'a'; break;
386
case '2': b = true; *q = '_'; q++; *q = 'b'; break;
387
case '3': b = true; *q = '_'; q++; *q = 'c'; break;
388
case '4': b = true; *q = '_'; q++; *q = 'd'; break;
389
case '5': b = true; *q = '_'; q++; *q = 'e'; break;
390
case '6': b = true; *q = '_'; q++; *q = 'f'; break;
391
case '7': b = true; *q = '_'; q++; *q = 'g'; break;
392
case '8': b = true; *q = '_'; q++; *q = 'h'; break;
393
case '9': b = true; *q = '_'; q++; *q = 'i'; break;
394
case '0': b = true; *q = '_'; q++; *q = 'z'; break;
406
void xAddAtom(const char *s)
413
if (g_oaAtoms.GetSize() >= 254)
415
eprintf("More than 254 different atom types not supported.\n");
422
// printf("AddAtom: \"%s\".\n",s);
423
for (z=0;z<g_oaAtoms.GetSize();z++)
425
if (mystricmp(buf,((CAtom*)g_oaAtoms[z])->m_sName)==0)
427
((CAtom*)g_oaAtoms[z])->m_iCount++;
432
if (ContainsDigit(s))
433
eprintf("Digits in element labels not allowed. Renaming %s to %s.\n",s,buf);
435
try { a = new CAtom(); } catch(...) { a = NULL; }
436
if (a == NULL) NewException((double)sizeof(CAtom),__FILE__,__LINE__,__PRETTY_FUNCTION__);
438
a->m_iIndex = g_oaAtoms.GetSize();
439
strcpy(a->m_sName,buf);
440
if (islower(a->m_sName[0]))
441
a->m_sName[0] = toupper(a->m_sName[0]);
442
if (strlen(a->m_sName) > 1)
443
if (isupper(a->m_sName[1]))
444
a->m_sName[1] = tolower(a->m_sName[1]);
448
a->m_pElement = FindElement(buf,false);
449
if (a->m_pElement == NULL)
451
try { a->m_pElement = new CElement(); } catch(...) { a->m_pElement = NULL; }
452
if (a->m_pElement == NULL) NewException((double)sizeof(CElement),__FILE__,__LINE__,__PRETTY_FUNCTION__);
454
try { a->m_pElement->m_sLabel = new char[strlen(a->m_sName)+1]; } catch(...) { a->m_pElement->m_sLabel = NULL; }
455
if (a->m_pElement->m_sLabel == NULL) NewException((double)(strlen(a->m_sName)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
457
strcpy(a->m_pElement->m_sLabel,a->m_sName);
459
/* a->m_fMass = AtomMass(s);
460
a->m_fRadius = AtomRadius(s);
461
a->m_iOrd = AtomOrd(s);*/
462
// a->m_fVDWRadius = AtomVDWRadius(s);
468
// a->m_fVDWRadius = 0.0f;
471
// g_pAtoms[g_iElementCount].Offset = offset;
472
// printf("Fuege Atom %s an Stelle %d neu hinzu. Der Offset ist %d.\n",s,g_iAtomCount,offset);
473
// g_iElementCount++;
478
void CSingleMolecule::Dump()
482
mprintf("### Single Molecule Dump ###\n");
483
mprintf("%d Elemente.\n",m_baAtomIndex.GetSize());
484
for (z=0;z<m_baAtomIndex.GetSize();z++)
486
mprintf(" * Element %d: %s. %d Vertreter *\n Atome ",z+1,((CAtom*)g_oaAtoms[m_baAtomIndex[z]])->m_sName,((CxIntArray*)m_oaAtomOffset[z])->GetSize());
487
for (z2=0;z2<((CxIntArray*)m_oaAtomOffset[z])->GetSize();z2++)
489
mprintf("%d",((CxIntArray*)m_oaAtomOffset[z])->GetAt(z2));
490
if (z2 < ((CxIntArray*)m_oaAtomOffset[z])->GetSize()-1)
499
void CMolecule::Dump()
503
mprintf("### Molecule Type Dump ###\n");
504
mprintf("%d Elemente.\n",m_baAtomIndex.GetSize());
505
for (z=0;z<m_baAtomIndex.GetSize();z++)
506
mprintf(" * Element %d: %s. %d Vertreter *\n",z+1,((CAtom*)g_oaAtoms[m_baAtomIndex[z]])->m_sName,m_waAtomCount[z]);
511
void CADF::BuildName()
520
sprintf(tmp,"deriv%d_",m_iDeriv);
521
for (z2=0;z2<m_oaVectors.GetSize()/6;z2++)
526
if (m_iVecType[z] == 0) // Position
530
/* if (m_bSameFoot && (z == 1))
531
ag = (CAtomGroup*)m_oaVectors[z2*6];
532
else */ag = (CAtomGroup*)m_oaVectors[z2*6+z*3];
533
strcat(tmp,ag->m_sName);
534
if (m_iRefOrSec[z][0])
536
else strcat(tmp,"r_");
537
strcat(tmp,((CAtomGroup*)m_oaVectors[z2*6+z*3+1])->m_sName);
538
if (m_iRefOrSec[z][1])
540
else strcat(tmp,"r_");
541
strcat(tmp,((CAtomGroup*)m_oaVectors[z2*6+z*3+2])->m_sName);
542
if (m_iRefOrSec[z][2])
544
else strcat(tmp,"r");
547
/* if (m_bSameFoot && (z == 1))
548
ag = (CAtomGroup*)m_oaVectors[z2*6];
549
else */ag = (CAtomGroup*)m_oaVectors[z2*6+z*3];
550
strcat(tmp,ag->m_sName);
551
if (m_iRefOrSec[z][0])
553
else strcat(tmp,"r_");
554
strcat(tmp,((CAtomGroup*)m_oaVectors[z2*6+z*3+1])->m_sName);
555
if (m_iRefOrSec[z][1])
557
else strcat(tmp,"r");
559
} else if (m_iVecType[z] == 1) // Dipol
562
strcat(tmp,(m_iRefOrSec[z][0]!=0)?((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName:((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
563
} else if (m_iVecType[z] == 2) // Geschwindigkeit
566
strcat(tmp,((CAtomGroup*)m_oaVectors[z*3])->m_sName);
567
} else if (m_iVecType[z] == 3) // Kraft
570
strcat(tmp,((CAtomGroup*)m_oaVectors[z*3])->m_sName);
574
else strcat(tmp,"]");
576
if (z2<(m_oaVectors.GetSize()/6)-1)
580
try { m_sShortName = new char[strlen(tmp)+1]; } catch(...) { m_sShortName = NULL; }
581
if (m_sShortName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
583
strcpy(m_sShortName,tmp);
584
if (m_iShowMol != -1)
585
sprintf(tmp,"%s_%s%d_%s_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
586
else sprintf(tmp,"%s_%s%d_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1);
587
strcat(tmp,m_sShortName);
589
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
590
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
597
void CPlDF::BuildName()
608
ag = (CAtomGroup*)m_oaVectors[0];
609
strcat(tmp,ag->m_sName);
612
else strcat(tmp,"r_");
613
strcat(tmp,((CAtomGroup*)m_oaVectors[1])->m_sName);
616
else strcat(tmp,"r");
619
ag = (CAtomGroup*)m_oaVectors[0];
620
strcat(tmp,ag->m_sName);
623
else strcat(tmp,"r_");
624
strcat(tmp,((CAtomGroup*)m_oaVectors[1])->m_sName);
627
else strcat(tmp,"r_");
628
strcat(tmp,((CAtomGroup*)m_oaVectors[2])->m_sName);
631
else strcat(tmp,"r");
634
strcat(tmp,((CAtomGroup*)m_oaVectors[3])->m_sName);
637
else strcat(tmp,"r");
639
try { m_sShortName = new char[strlen(tmp)+1]; } catch(...) { m_sShortName = NULL; }
640
if (m_sShortName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
642
strcpy(m_sShortName,tmp);
643
if (m_iShowMol != -1)
644
sprintf(tmp,"%s_%s%d_%s_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
645
else sprintf(tmp,"%s_%s%d_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1);
646
strcat(tmp,m_sShortName);
648
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
649
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
656
void CLiDF::BuildName()
667
ag = (CAtomGroup*)m_oaVectors[0];
668
strcat(tmp,ag->m_sName);
671
else strcat(tmp,"r_");
672
strcat(tmp,((CAtomGroup*)m_oaVectors[1])->m_sName);
675
else strcat(tmp,"r_");
676
strcat(tmp,((CAtomGroup*)m_oaVectors[2])->m_sName);
679
else strcat(tmp,"r");
682
ag = (CAtomGroup*)m_oaVectors[0];
683
strcat(tmp,ag->m_sName);
686
else strcat(tmp,"r_");
687
strcat(tmp,((CAtomGroup*)m_oaVectors[1])->m_sName);
690
else strcat(tmp,"r");
693
strcat(tmp,((CAtomGroup*)m_oaVectors[3])->m_sName);
696
else strcat(tmp,"r");
698
try { m_sShortName = new char[strlen(tmp)+1]; } catch(...) { m_sShortName = NULL; }
699
if (m_sShortName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
701
strcpy(m_sShortName,tmp);
702
if (m_iShowMol != -1)
703
sprintf(tmp,"%s_%s%d_%s_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
704
else sprintf(tmp,"%s_%s%d_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1);
705
strcat(tmp,m_sShortName);
707
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
708
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
715
void CDDF::BuildName()
724
sprintf(tmp,"deriv%d_",m_iDeriv);
730
ag = (CAtomGroup*)m_oaVectors[z*3];
731
strcat(tmp,ag->m_sName);
732
if (m_iRefOrSec[z][0])
734
else strcat(tmp,"r_");
735
strcat(tmp,((CAtomGroup*)m_oaVectors[z*3+1])->m_sName);
736
if (m_iRefOrSec[z][1])
738
else strcat(tmp,"r_");
739
strcat(tmp,((CAtomGroup*)m_oaVectors[z*3+2])->m_sName);
740
if (m_iRefOrSec[z][2])
742
else strcat(tmp,"r");
745
ag = (CAtomGroup*)m_oaVectors[z*3];
746
strcat(tmp,ag->m_sName);
747
if (m_iRefOrSec[z][0])
749
else strcat(tmp,"r_");
750
strcat(tmp,((CAtomGroup*)m_oaVectors[z*3+1])->m_sName);
751
if (m_iRefOrSec[z][1])
753
else strcat(tmp,"r");
757
else strcat(tmp,"]");
760
try { m_sShortName = new char[strlen(tmp)+1]; } catch(...) { m_sShortName = NULL; }
761
if (m_sShortName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
763
strcpy(m_sShortName,tmp);
764
if (m_iShowMol != -1)
765
sprintf(tmp,"%s_%s%d_%s_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
766
else sprintf(tmp,"%s_%s%d_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1);
767
strcat(tmp,m_sShortName);
769
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
770
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
777
void CDipDF::BuildName()
784
sprintf(tmp,"deriv%d_",m_iDeriv);
786
sprintf(tmp,"%s",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
787
else sprintf(tmp,"%s",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
789
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
790
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
794
try { m_sShortName = new char[strlen(tmp)+1]; } catch(...) { m_sShortName = NULL; }
795
if (m_sShortName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
797
strcpy(m_sShortName,tmp);
802
void CADF::BuildAtomList(CSingleMolecule *ref, CSingleMolecule *obs, CxIntArray *vec)
805
int z, z1t, z1a, z2t, z2a, z3t, z3a, z4t, z4a, z5t, z5a, z6t, z6a;
806
CAtomGroup *g1, *g2, *g3, *g4, *g5, *g6;
807
CxIntArray *a1, *a2, *a3, *a4, *a5, *a6;
809
vec->RemoveAll_KeepSize();
810
for (z=0;z<m_oaVectors.GetSize()/6;z++)
814
g1 = (CAtomGroup*)m_oaVectors[z*6];
815
g2 = (CAtomGroup*)m_oaVectors[z*6+1];
816
g3 = (CAtomGroup*)m_oaVectors[z*6+2];
817
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
819
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
820
for (z1a=0;z1a<a1->GetSize();z1a++)
822
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
824
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
825
for (z2a=0;z2a<a2->GetSize();z2a++)
827
for (z3t=0;z3t<g3->m_baAtomType.GetSize();z3t++)
829
a3 = (CxIntArray*)g3->m_oaAtoms[z3t];
830
for (z3a=0;z3a<a3->GetSize();z3a++)
836
else */g4 = (CAtomGroup*)m_oaVectors[z*6+3];
837
g5 = (CAtomGroup*)m_oaVectors[z*6+4];
838
g6 = (CAtomGroup*)m_oaVectors[z*6+5];
839
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
841
/* if (m_bSameFoot && (z4t != z1t))
843
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
844
for (z4a=0;z4a<a4->GetSize();z4a++)
846
/* if (m_bSameFoot && (z4a != z1a))
848
for (z5t=0;z5t<g5->m_baAtomType.GetSize();z5t++)
850
a5 = (CxIntArray*)g5->m_oaAtoms[z5t];
851
for (z5a=0;z5a<a5->GetSize();z5a++)
853
for (z6t=0;z6t<g6->m_baAtomType.GetSize();z6t++)
855
a6 = (CxIntArray*)g6->m_oaAtoms[z6t];
856
for (z6a=0;z6a<a6->GetSize();z6a++)
858
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
859
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
860
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
861
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
862
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
863
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
864
if ((!m_iRefOrSec[0][2]) || (obs == NULL))
865
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
866
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
867
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
868
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
869
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
870
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
871
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
872
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
873
if ((!m_iRefOrSec[1][2]) || (obs == NULL))
874
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
875
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
886
else */g4 = (CAtomGroup*)m_oaVectors[z*6+3];
887
g5 = (CAtomGroup*)m_oaVectors[z*6+4];
888
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
890
/* if (m_bSameFoot && (z4t != z1t))
892
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
893
for (z4a=0;z4a<a4->GetSize();z4a++)
895
/* if (m_bSameFoot && (z4a != z1a))
897
for (z5t=0;z5t<g5->m_baAtomType.GetSize();z5t++)
899
a5 = (CxIntArray*)g5->m_oaAtoms[z5t];
900
for (z5a=0;z5a<a5->GetSize();z5a++)
902
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
903
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
904
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
905
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
906
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
907
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
908
if ((!m_iRefOrSec[0][2]) || (obs == NULL))
909
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
910
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
911
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
912
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
913
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
914
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
915
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
916
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
922
} // END IF NOT ORTHO[1]
931
g1 = (CAtomGroup*)m_oaVectors[z*6];
932
g2 = (CAtomGroup*)m_oaVectors[z*6+1];
933
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
935
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
936
for (z1a=0;z1a<a1->GetSize();z1a++)
938
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
940
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
941
for (z2a=0;z2a<a2->GetSize();z2a++)
947
else */g4 = (CAtomGroup*)m_oaVectors[z*6+3];
948
g5 = (CAtomGroup*)m_oaVectors[z*6+4];
949
g6 = (CAtomGroup*)m_oaVectors[z*6+5];
950
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
952
/* if (m_bSameFoot && (z4t != z1t))
954
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
955
for (z4a=0;z4a<a4->GetSize();z4a++)
957
/* if (m_bSameFoot && (z4a != z1a))
959
for (z5t=0;z5t<g5->m_baAtomType.GetSize();z5t++)
961
a5 = (CxIntArray*)g5->m_oaAtoms[z5t];
962
for (z5a=0;z5a<a5->GetSize();z5a++)
964
for (z6t=0;z6t<g6->m_baAtomType.GetSize();z6t++)
966
a6 = (CxIntArray*)g6->m_oaAtoms[z6t];
967
for (z6a=0;z6a<a6->GetSize();z6a++)
969
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
970
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
971
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
972
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
973
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
974
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
976
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
977
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
978
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
979
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
980
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
981
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
982
if ((!m_iRefOrSec[1][2]) || (obs == NULL))
983
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
984
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
995
else */g4 = (CAtomGroup*)m_oaVectors[z*6+3];
996
g5 = (CAtomGroup*)m_oaVectors[z*6+4];
997
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
999
/* if (m_bSameFoot && (z4t != z1t))
1001
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1002
for (z4a=0;z4a<a4->GetSize();z4a++)
1004
/* if (m_bSameFoot && (z4a != z1a))
1006
for (z5t=0;z5t<g5->m_baAtomType.GetSize();z5t++)
1008
a5 = (CxIntArray*)g5->m_oaAtoms[z5t];
1009
for (z5a=0;z5a<a5->GetSize();z5a++)
1011
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1012
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1013
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1014
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1015
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1016
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1018
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1019
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1020
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1021
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1022
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1023
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1029
} // END IF NOT ORTHO[1]
1040
/* Mega abartig !!!! */
1041
void CDDF::BuildAtomList(CSingleMolecule *ref, CSingleMolecule *obs, CxIntArray *vec)
1044
int z, z1t, z1a, z2t, z2a, z3t, z3a, z4t, z4a, z5t, z5a, z6t, z6a, z7t, z7a, z8t, z8a, z9t, z9a;
1045
CAtomGroup *g1, *g2, *g3, *g4, *g5, *g6, *g7, *g8, *g9;
1046
CxIntArray *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8, *a9;
1048
vec->RemoveAll_KeepSize();
1049
for (z=0;z<m_oaVectors.GetSize()/9;z++)
1053
g1 = (CAtomGroup*)m_oaVectors[z*9];
1054
g2 = (CAtomGroup*)m_oaVectors[z*9+1];
1055
g3 = (CAtomGroup*)m_oaVectors[z*9+2];
1056
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
1058
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
1059
for (z1a=0;z1a<a1->GetSize();z1a++)
1061
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
1063
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
1064
for (z2a=0;z2a<a2->GetSize();z2a++)
1066
for (z3t=0;z3t<g3->m_baAtomType.GetSize();z3t++)
1068
a3 = (CxIntArray*)g3->m_oaAtoms[z3t];
1069
for (z3a=0;z3a<a3->GetSize();z3a++)
1073
g4 = (CAtomGroup*)m_oaVectors[z*9+3];
1074
g5 = (CAtomGroup*)m_oaVectors[z*9+4];
1075
g6 = (CAtomGroup*)m_oaVectors[z*9+5];
1076
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1078
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1079
for (z4a=0;z4a<a4->GetSize();z4a++)
1081
for (z5t=0;z5t<g5->m_baAtomType.GetSize();z5t++)
1083
a5 = (CxIntArray*)g5->m_oaAtoms[z5t];
1084
for (z5a=0;z5a<a5->GetSize();z5a++)
1086
for (z6t=0;z6t<g6->m_baAtomType.GetSize();z6t++)
1088
a6 = (CxIntArray*)g6->m_oaAtoms[z6t];
1089
for (z6a=0;z6a<a6->GetSize();z6a++)
1093
g7 = (CAtomGroup*)m_oaVectors[z*9+6];
1094
g8 = (CAtomGroup*)m_oaVectors[z*9+7];
1095
g9 = (CAtomGroup*)m_oaVectors[z*9+8];
1096
for (z7t=0;z7t<g7->m_baAtomType.GetSize();z7t++)
1098
a7 = (CxIntArray*)g7->m_oaAtoms[z7t];
1099
for (z7a=0;z7a<a7->GetSize();z7a++)
1101
for (z8t=0;z8t<g8->m_baAtomType.GetSize();z8t++)
1103
a8 = (CxIntArray*)g8->m_oaAtoms[z8t];
1104
for (z8a=0;z8a<a8->GetSize();z8a++)
1106
for (z9t=0;z9t<g9->m_baAtomType.GetSize();z9t++)
1108
a9 = (CxIntArray*)g9->m_oaAtoms[z9t];
1109
for (z9a=0;z9a<a9->GetSize();z9a++)
1111
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1112
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1113
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1114
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1115
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1116
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1117
if ((!m_iRefOrSec[0][2]) || (obs == NULL))
1118
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1119
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1120
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1121
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1122
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1123
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1124
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1125
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1126
if ((!m_iRefOrSec[1][2]) || (obs == NULL))
1127
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
1128
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
1129
if ((!m_iRefOrSec[2][0]) || (obs == NULL))
1130
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1131
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1132
if ((!m_iRefOrSec[2][1]) || (obs == NULL))
1133
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1134
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1135
if ((!m_iRefOrSec[2][2]) || (obs == NULL))
1136
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g9->m_baAtomType[z9t]])->GetAt(a9->GetAt(z9a)));
1137
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g9->m_baAtomType[z9t]])->GetAt(a9->GetAt(z9a)));
1144
} else // IF NOT ORTHO[2]
1146
g7 = (CAtomGroup*)m_oaVectors[z*9+6];
1147
g8 = (CAtomGroup*)m_oaVectors[z*9+7];
1148
for (z7t=0;z7t<g7->m_baAtomType.GetSize();z7t++)
1150
a7 = (CxIntArray*)g7->m_oaAtoms[z7t];
1151
for (z7a=0;z7a<a7->GetSize();z7a++)
1153
for (z8t=0;z8t<g8->m_baAtomType.GetSize();z8t++)
1155
a8 = (CxIntArray*)g8->m_oaAtoms[z8t];
1156
for (z8a=0;z8a<a8->GetSize();z8a++)
1158
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1159
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1160
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1161
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1162
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1163
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1164
if ((!m_iRefOrSec[0][2]) || (obs == NULL))
1165
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1166
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1167
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1168
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1169
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1170
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1171
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1172
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1173
if ((!m_iRefOrSec[1][2]) || (obs == NULL))
1174
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
1175
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
1176
if ((!m_iRefOrSec[2][0]) || (obs == NULL))
1177
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1178
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1179
if ((!m_iRefOrSec[2][1]) || (obs == NULL))
1180
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1181
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1187
} // END IF NOT ORTHO[2]
1194
} else // IF NOT ORTHO[1]
1196
g4 = (CAtomGroup*)m_oaVectors[z*9+3];
1197
g5 = (CAtomGroup*)m_oaVectors[z*9+4];
1198
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1200
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1201
for (z4a=0;z4a<a4->GetSize();z4a++)
1203
for (z5t=0;z5t<g5->m_baAtomType.GetSize();z5t++)
1205
a5 = (CxIntArray*)g5->m_oaAtoms[z5t];
1206
for (z5a=0;z5a<a5->GetSize();z5a++)
1210
g7 = (CAtomGroup*)m_oaVectors[z*9+6];
1211
g8 = (CAtomGroup*)m_oaVectors[z*9+7];
1212
g9 = (CAtomGroup*)m_oaVectors[z*9+8];
1213
for (z7t=0;z7t<g7->m_baAtomType.GetSize();z7t++)
1215
a7 = (CxIntArray*)g7->m_oaAtoms[z7t];
1216
for (z7a=0;z7a<a7->GetSize();z7a++)
1218
for (z8t=0;z8t<g8->m_baAtomType.GetSize();z8t++)
1220
a8 = (CxIntArray*)g8->m_oaAtoms[z8t];
1221
for (z8a=0;z8a<a8->GetSize();z8a++)
1223
for (z9t=0;z9t<g9->m_baAtomType.GetSize();z9t++)
1225
a9 = (CxIntArray*)g9->m_oaAtoms[z9t];
1226
for (z9a=0;z9a<a9->GetSize();z9a++)
1228
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1229
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1230
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1231
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1232
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1233
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1234
if ((!m_iRefOrSec[0][2]) || (obs == NULL))
1235
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1236
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1237
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1238
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1239
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1240
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1241
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1242
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1244
if ((!m_iRefOrSec[2][0]) || (obs == NULL))
1245
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1246
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1247
if ((!m_iRefOrSec[2][1]) || (obs == NULL))
1248
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1249
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1250
if ((!m_iRefOrSec[2][2]) || (obs == NULL))
1251
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g9->m_baAtomType[z9t]])->GetAt(a9->GetAt(z9a)));
1252
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g9->m_baAtomType[z9t]])->GetAt(a9->GetAt(z9a)));
1259
} else // IF NOT ORTHO[2]
1261
g7 = (CAtomGroup*)m_oaVectors[z*9+6];
1262
g8 = (CAtomGroup*)m_oaVectors[z*9+7];
1263
for (z7t=0;z7t<g7->m_baAtomType.GetSize();z7t++)
1265
a7 = (CxIntArray*)g7->m_oaAtoms[z7t];
1266
for (z7a=0;z7a<a7->GetSize();z7a++)
1268
for (z8t=0;z8t<g8->m_baAtomType.GetSize();z8t++)
1270
a8 = (CxIntArray*)g8->m_oaAtoms[z8t];
1271
for (z8a=0;z8a<a8->GetSize();z8a++)
1273
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1274
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1275
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1276
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1277
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1278
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1279
if ((!m_iRefOrSec[0][2]) || (obs == NULL))
1280
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1281
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1282
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1283
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1284
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1285
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1286
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1287
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1289
if ((!m_iRefOrSec[2][0]) || (obs == NULL))
1290
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1291
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1292
if ((!m_iRefOrSec[2][1]) || (obs == NULL))
1293
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1294
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1300
} // END IF NOT ORTHO[2]
1305
} // END IF NOT ORTHO[1]
1312
} else // IF NOT ORTHO[0]
1314
g1 = (CAtomGroup*)m_oaVectors[z*9];
1315
g2 = (CAtomGroup*)m_oaVectors[z*9+1];
1316
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
1318
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
1319
for (z1a=0;z1a<a1->GetSize();z1a++)
1321
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
1323
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
1324
for (z2a=0;z2a<a2->GetSize();z2a++)
1328
g4 = (CAtomGroup*)m_oaVectors[z*9+3];
1329
g5 = (CAtomGroup*)m_oaVectors[z*9+4];
1330
g6 = (CAtomGroup*)m_oaVectors[z*9+5];
1331
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1333
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1334
for (z4a=0;z4a<a4->GetSize();z4a++)
1336
for (z5t=0;z5t<g5->m_baAtomType.GetSize();z5t++)
1338
a5 = (CxIntArray*)g5->m_oaAtoms[z5t];
1339
for (z5a=0;z5a<a5->GetSize();z5a++)
1341
for (z6t=0;z6t<g6->m_baAtomType.GetSize();z6t++)
1343
a6 = (CxIntArray*)g6->m_oaAtoms[z6t];
1344
for (z6a=0;z6a<a6->GetSize();z6a++)
1348
g7 = (CAtomGroup*)m_oaVectors[z*9+6];
1349
g8 = (CAtomGroup*)m_oaVectors[z*9+7];
1350
g9 = (CAtomGroup*)m_oaVectors[z*9+8];
1351
for (z7t=0;z7t<g7->m_baAtomType.GetSize();z7t++)
1353
a7 = (CxIntArray*)g7->m_oaAtoms[z7t];
1354
for (z7a=0;z7a<a7->GetSize();z7a++)
1356
for (z8t=0;z8t<g8->m_baAtomType.GetSize();z8t++)
1358
a8 = (CxIntArray*)g8->m_oaAtoms[z8t];
1359
for (z8a=0;z8a<a8->GetSize();z8a++)
1361
for (z9t=0;z9t<g9->m_baAtomType.GetSize();z9t++)
1363
a9 = (CxIntArray*)g9->m_oaAtoms[z9t];
1364
for (z9a=0;z9a<a9->GetSize();z9a++)
1366
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1367
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1368
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1369
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1370
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1371
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1373
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1374
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1375
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1376
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1377
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1378
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1379
if ((!m_iRefOrSec[1][2]) || (obs == NULL))
1380
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
1381
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
1382
if ((!m_iRefOrSec[2][0]) || (obs == NULL))
1383
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1384
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1385
if ((!m_iRefOrSec[2][1]) || (obs == NULL))
1386
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1387
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1388
if ((!m_iRefOrSec[2][2]) || (obs == NULL))
1389
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g9->m_baAtomType[z9t]])->GetAt(a9->GetAt(z9a)));
1390
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g9->m_baAtomType[z9t]])->GetAt(a9->GetAt(z9a)));
1397
} else // IF NOT ORTHO[2]
1399
g7 = (CAtomGroup*)m_oaVectors[z*9+6];
1400
g8 = (CAtomGroup*)m_oaVectors[z*9+7];
1401
for (z7t=0;z7t<g7->m_baAtomType.GetSize();z7t++)
1403
a7 = (CxIntArray*)g7->m_oaAtoms[z7t];
1404
for (z7a=0;z7a<a7->GetSize();z7a++)
1406
for (z8t=0;z8t<g8->m_baAtomType.GetSize();z8t++)
1408
a8 = (CxIntArray*)g8->m_oaAtoms[z8t];
1409
for (z8a=0;z8a<a8->GetSize();z8a++)
1411
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1412
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1413
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1414
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1415
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1416
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1418
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1419
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1420
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1421
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1422
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1423
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1424
if ((!m_iRefOrSec[1][2]) || (obs == NULL))
1425
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
1426
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
1427
if ((!m_iRefOrSec[2][0]) || (obs == NULL))
1428
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1429
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1430
if ((!m_iRefOrSec[2][1]) || (obs == NULL))
1431
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1432
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1438
} // END IF NOT ORTHO[2]
1445
} else // IF NOT ORTHO[1]
1447
g4 = (CAtomGroup*)m_oaVectors[z*9+3];
1448
g5 = (CAtomGroup*)m_oaVectors[z*9+4];
1449
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1451
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1452
for (z4a=0;z4a<a4->GetSize();z4a++)
1454
for (z5t=0;z5t<g5->m_baAtomType.GetSize();z5t++)
1456
a5 = (CxIntArray*)g5->m_oaAtoms[z5t];
1457
for (z5a=0;z5a<a5->GetSize();z5a++)
1461
g7 = (CAtomGroup*)m_oaVectors[z*9+6];
1462
g8 = (CAtomGroup*)m_oaVectors[z*9+7];
1463
g9 = (CAtomGroup*)m_oaVectors[z*9+8];
1464
for (z7t=0;z7t<g7->m_baAtomType.GetSize();z7t++)
1466
a7 = (CxIntArray*)g7->m_oaAtoms[z7t];
1467
for (z7a=0;z7a<a7->GetSize();z7a++)
1469
for (z8t=0;z8t<g8->m_baAtomType.GetSize();z8t++)
1471
a8 = (CxIntArray*)g8->m_oaAtoms[z8t];
1472
for (z8a=0;z8a<a8->GetSize();z8a++)
1474
for (z9t=0;z9t<g9->m_baAtomType.GetSize();z9t++)
1476
a9 = (CxIntArray*)g9->m_oaAtoms[z9t];
1477
for (z9a=0;z9a<a9->GetSize();z9a++)
1479
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1480
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1481
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1482
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1483
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1484
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1486
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1487
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1488
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1489
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1490
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1491
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1493
if ((!m_iRefOrSec[2][0]) || (obs == NULL))
1494
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1495
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1496
if ((!m_iRefOrSec[2][1]) || (obs == NULL))
1497
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1498
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1499
if ((!m_iRefOrSec[2][2]) || (obs == NULL))
1500
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g9->m_baAtomType[z9t]])->GetAt(a9->GetAt(z9a)));
1501
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g9->m_baAtomType[z9t]])->GetAt(a9->GetAt(z9a)));
1508
} else // IF NOT ORTHO[2]
1510
g7 = (CAtomGroup*)m_oaVectors[z*9+6];
1511
g8 = (CAtomGroup*)m_oaVectors[z*9+7];
1512
for (z7t=0;z7t<g7->m_baAtomType.GetSize();z7t++)
1514
a7 = (CxIntArray*)g7->m_oaAtoms[z7t];
1515
for (z7a=0;z7a<a7->GetSize();z7a++)
1517
for (z8t=0;z8t<g8->m_baAtomType.GetSize();z8t++)
1519
a8 = (CxIntArray*)g8->m_oaAtoms[z8t];
1520
for (z8a=0;z8a<a8->GetSize();z8a++)
1522
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1523
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1524
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1525
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1526
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1527
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1529
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1530
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1531
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1532
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1533
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1534
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1536
if ((!m_iRefOrSec[2][0]) || (obs == NULL))
1537
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1538
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1539
if ((!m_iRefOrSec[2][1]) || (obs == NULL))
1540
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1541
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1547
} // END IF NOT ORTHO[2]
1552
} // END IF NOT ORTHO[1]
1557
} // END IF NOT ORTHO[0]
1558
} // END FOR ALL SETS
1563
void CPlDF::BuildAtomList(CSingleMolecule *ref, CSingleMolecule *obs, CxIntArray *vec)
1566
int z, z1t, z1a, z2t, z2a, z3t, z3a, z4t, z4a;
1567
CAtomGroup *g1, *g2, *g3, *g4;
1568
CxIntArray *a1, *a2, *a3, *a4;
1570
vec->RemoveAll_KeepSize();
1571
for (z=0;z<m_oaVectors.GetSize()/4;z++)
1575
g1 = (CAtomGroup*)m_oaVectors[z*4];
1576
g2 = (CAtomGroup*)m_oaVectors[z*4+1];
1577
g4 = (CAtomGroup*)m_oaVectors[z*4+3];
1579
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
1581
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
1582
for (z1a=0;z1a<a1->GetSize();z1a++)
1584
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
1586
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
1587
for (z2a=0;z2a<a2->GetSize();z2a++)
1589
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1591
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1592
for (z4a=0;z4a<a4->GetSize();z4a++)
1594
if ((!m_iRefOrSec[0]) || (obs == NULL))
1595
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1596
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1597
if ((!m_iRefOrSec[1]) || (obs == NULL))
1598
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1599
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1601
if ((!m_iRefOrSec[3]) || (obs == NULL))
1602
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1603
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1610
} else // IF NOT NORMAL
1612
g1 = (CAtomGroup*)m_oaVectors[z*4];
1613
g2 = (CAtomGroup*)m_oaVectors[z*4+1];
1614
g3 = (CAtomGroup*)m_oaVectors[z*4+2];
1615
g4 = (CAtomGroup*)m_oaVectors[z*4+3];
1617
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
1619
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
1620
for (z1a=0;z1a<a1->GetSize();z1a++)
1622
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
1624
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
1625
for (z2a=0;z2a<a2->GetSize();z2a++)
1627
for (z3t=0;z3t<g3->m_baAtomType.GetSize();z3t++)
1629
a3 = (CxIntArray*)g3->m_oaAtoms[z3t];
1630
for (z3a=0;z3a<a3->GetSize();z3a++)
1632
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1634
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1635
for (z4a=0;z4a<a4->GetSize();z4a++)
1637
if ((!m_iRefOrSec[0]) || (obs == NULL))
1638
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1639
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1640
if ((!m_iRefOrSec[1]) || (obs == NULL))
1641
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1642
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1643
if ((!m_iRefOrSec[2]) || (obs == NULL))
1644
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1645
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1646
if ((!m_iRefOrSec[3]) || (obs == NULL))
1647
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1648
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1658
} // END FOR ALL SETS
1663
void CLiDF::BuildAtomList(CSingleMolecule *ref, CSingleMolecule *obs, CxIntArray *vec)
1666
int z, z1t, z1a, z2t, z2a, z3t, z3a, z4t, z4a;
1667
CAtomGroup *g1, *g2, *g3, *g4;
1668
CxIntArray *a1, *a2, *a3, *a4;
1670
vec->RemoveAll_KeepSize();
1671
for (z=0;z<m_oaVectors.GetSize()/4;z++)
1675
g1 = (CAtomGroup*)m_oaVectors[z*4];
1676
g2 = (CAtomGroup*)m_oaVectors[z*4+1];
1677
g3 = (CAtomGroup*)m_oaVectors[z*4+2];
1678
g4 = (CAtomGroup*)m_oaVectors[z*4+3];
1680
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
1682
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
1683
for (z1a=0;z1a<a1->GetSize();z1a++)
1685
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
1687
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
1688
for (z2a=0;z2a<a2->GetSize();z2a++)
1690
for (z3t=0;z3t<g3->m_baAtomType.GetSize();z3t++)
1692
a3 = (CxIntArray*)g3->m_oaAtoms[z3t];
1693
for (z3a=0;z3a<a3->GetSize();z3a++)
1695
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1697
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1698
for (z4a=0;z4a<a4->GetSize();z4a++)
1700
if ((!m_iRefOrSec[0]) || (obs == NULL))
1701
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1702
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1703
if ((!m_iRefOrSec[1]) || (obs == NULL))
1704
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1705
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1706
if ((!m_iRefOrSec[2]) || (obs == NULL))
1707
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1708
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1709
if ((!m_iRefOrSec[3]) || (obs == NULL))
1710
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1711
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1720
} else // If not Normal
1722
g1 = (CAtomGroup*)m_oaVectors[z*4];
1723
g2 = (CAtomGroup*)m_oaVectors[z*4+1];
1724
g4 = (CAtomGroup*)m_oaVectors[z*4+3];
1726
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
1728
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
1729
for (z1a=0;z1a<a1->GetSize();z1a++)
1731
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
1733
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
1734
for (z2a=0;z2a<a2->GetSize();z2a++)
1736
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1738
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1739
for (z4a=0;z4a<a4->GetSize();z4a++)
1741
if ((!m_iRefOrSec[0]) || (obs == NULL))
1742
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1743
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1744
if ((!m_iRefOrSec[1]) || (obs == NULL))
1745
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1746
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1748
if ((!m_iRefOrSec[3]) || (obs == NULL))
1749
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1750
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1758
} // END FOR ALL SETS
1763
void CRDF::BuildName()
1771
sprintf(tmp,"deriv%d_",m_iDeriv);
1772
for (z=0;z<m_oaVectors.GetSize()/2;z++)
1776
strcat(tmp,((CAtomGroup*)m_oaVectors[z*2])->m_sName);
1779
else strcat(tmp,"r_");
1780
strcat(tmp,((CAtomGroup*)m_oaVectors[z*2+1])->m_sName);
1783
else strcat(tmp,"r");
1785
if (z < (m_oaVectors.GetSize()/2)-1)
1787
else strcat(tmp,"]");
1790
try { m_sShortName = new char[strlen(tmp)+1]; } catch(...) { m_sShortName = NULL; }
1791
if (m_sShortName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1793
strcpy(m_sShortName,tmp);
1794
if (m_iShowMol != -1)
1795
sprintf(tmp,"%s_%s%d_%s_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
1796
else sprintf(tmp,"%s_%s%d_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1);
1797
strcat(tmp,m_sShortName);
1799
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
1800
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1802
strcpy(m_sName,tmp);
1808
void CDensDF::BuildName()
1814
sprintf(tmp,"%s_%s%d_%s",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,((CAtom*)g_oaAtoms[m_iCenterAtomRealType])->m_sName,m_iCenterAtom+1,(m_bDensityMass?"mass":"particle"));
1816
for (z=0;z<g_oaMolecules.GetSize();z++)
1818
if (!m_pDensityMolSelect[z])
1821
strcat(tmp,((CMolecule*)g_oaMolecules[z])->m_sName);
1822
if (!m_pDensityMolAG[z]->m_bAllAtoms)
1825
strcat(tmp,m_pDensityMolAG[z]->m_sName);
1829
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
1830
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1832
strcpy(m_sName,tmp);
1837
void CVHDF::BuildName()
1844
for (z=0;z<m_oaVectors.GetSize()/2;z++)
1848
strcat(tmp,((CAtomGroup*)m_oaVectors[z*2])->m_sName);
1851
else strcat(tmp,"r_");
1852
strcat(tmp,((CAtomGroup*)m_oaVectors[z*2+1])->m_sName);
1855
else strcat(tmp,"r");
1857
if (z < (m_oaVectors.GetSize()/2)-1)
1859
else strcat(tmp,"]");
1862
try { m_sShortName = new char[strlen(tmp)+1]; } catch(...) { m_sShortName = NULL; }
1863
if (m_sShortName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1865
strcpy(m_sShortName,tmp);
1866
if (m_iShowMol != -1)
1867
sprintf(tmp,"%s_%s%d_%s_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
1868
else sprintf(tmp,"%s_%s%d_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1);
1869
strcat(tmp,m_sShortName);
1871
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
1872
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1874
strcpy(m_sName,tmp);
1886
try { m_pRDF = new CDF(); } catch(...) { m_pRDF = NULL; }
1887
if (m_pRDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1891
m_iCombinations = 0;
1892
mprintf(WHITE,"\n>>> Radial Distribution Function >>>\n\n");
1902
if (m_iShowMol != -1)
1903
m_iRefOrSec[0] = AskRangeInteger(" Take reference atom(s) from RM %s (0) or from OM %s (1)? [0] ",0,1,0,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
1904
else m_iRefOrSec[0] = 0; // Kein OM: Nimm alles aus RM
1905
if (m_iShowMol != -1)
1906
m_iRefOrSec[1] = AskRangeInteger(" Take observed atom(s) from RM %s (0) or from OM %s (1)? [1] ",0,1,1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
1907
else m_iRefOrSec[1] = 0; // Kein OM: Nimm alles aus RM
1912
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
1913
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1916
// 1 reales + 2 virtuelle = 3 gesamt
1917
if (((CMolecule*)g_oaMolecules[(m_iRefOrSec[0])?m_iShowMol:g_iFixMol])->m_iAtomGes == 3)
1919
mprintf(" %s is only one atom, there is no choice.\n",((CMolecule*)g_oaMolecules[(m_iRefOrSec[0])?m_iShowMol:g_iFixMol])->m_sName);
1921
ag->m_pMolecule = (CMolecule*)g_oaMolecules[(m_iRefOrSec[0])?m_iShowMol:g_iFixMol];
1922
ag->AddAtom(0,0,false);
1929
mprintf(" Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
1930
inpprintf("! Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
1933
mprintf(" Which atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
1934
inpprintf("! Which atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
1937
if (strlen(buf) == 0)
1939
if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec[0])?m_iShowMol:g_iFixMol],"#2"))
1941
eprintf("Weird error.\n");
1944
} else if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec[0])?m_iShowMol:g_iFixMol],buf))
1947
m_oaVectors.Add(ag);
1948
m_iRefAtomGes += ag->m_iAtomGes;
1949
ti = ag->m_iAtomGes;
1951
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
1952
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1955
if (((CMolecule*)g_oaMolecules[(m_iRefOrSec[1])?m_iShowMol:g_iFixMol])->m_iAtomGes == 3)
1957
mprintf(" %s is only one atom, there is no choice.\n",((CMolecule*)g_oaMolecules[(m_iRefOrSec[1])?m_iShowMol:g_iFixMol])->m_sName);
1959
ag->m_pMolecule = (CMolecule*)g_oaMolecules[(m_iRefOrSec[1])?m_iShowMol:g_iFixMol];
1960
ag->AddAtom(0,0,false);
1967
mprintf(" Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
1968
inpprintf("! Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
1971
mprintf(" Which atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
1972
inpprintf("! Which atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
1976
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
1977
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1979
if (strlen(buf) == 0)
1981
if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec[1])?m_iShowMol:g_iFixMol],"#2"))
1983
eprintf("Weird error.\n");
1986
} else if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec[1])?m_iShowMol:g_iFixMol],buf))
1989
m_oaVectors.Add(ag);
1990
m_iShowAtomGes += ag->m_iAtomGes;
1991
m_iCombinations += ti * ag->m_iAtomGes;
1994
if (AskYesNo(" Add another set of atoms to this (!) RDF (y/n)? [no] ",false))
1997
mprintf(" This yields in %d combinations.\n\n",m_iCombinations);
2004
m_fMinDist = AskFloat(" Enter the minimal radius of this RDF in pm: [0] ",0.0f);
2005
m_fMaxDist = AskFloat(" Enter the maximal radius of this RDF in pm: [%d.0] ",(float)HalfBox(),HalfBox());
2009
m_fMinDist = AskFloat(" Enter the minimal value of this d1-RDF in pm/ps: [0] ",0.0f);
2010
else m_fMinDist = AskFloat(" Enter the minimal value of this d1-RDF in pm/ps: [-10.0] ",-10.0f);
2011
m_fMaxDist = AskFloat(" Enter the maximal value of this d1-RDF in pm/ps: [10.0] ",10.0f);
2015
m_fMinDist = AskFloat(" Enter the minimal value of this d2-RDF in pm/ps^2: [0] ",0.0f);
2016
else m_fMinDist = AskFloat(" Enter the minimal value of this d2-RDF in pm/ps^2: [-10.0] ",-10.0f);
2017
m_fMaxDist = AskFloat(" Enter the maximal value of this d2-RDF in pm/ps^2: [10.0] ",10.0f);
2020
m_bAdaptive = false/*AskYesNo(" Enter binning resolution (n) or use adaptive binnig (y)? [no] ",false)*/;
2022
m_iResolution = AskUnsignedInteger(" Enter the resolution (bin count) for this RDF: [300] ",/*(int)((m_fMaxDist-m_fMinDist)/10.0f),(int)((m_fMaxDist-m_fMinDist)/10.0f)*/300);
2023
else m_iResolution = 65536;
2026
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
2027
else m_iHistogramRes = 0;
2031
if (m_iShowMol != -1)
2032
m_bRadialCorrect = AskYesNo(" Correct radial distribution for this RDF (y/n)? [yes] ",true);
2033
else m_bRadialCorrect = AskYesNo(" Correct radial distribution for this RDF (y/n)? [no] ",false);
2034
} else m_bRadialCorrect = false;
2036
if (g_bAdvanced2 && m_bRadialCorrect)
2037
m_bProbDens = AskYesNo(" Compute occurence in nm^(-3) (y) or rel. to uniform density (n)? [no] ",false);
2038
else m_bProbDens = false;
2040
if (g_bBetaFeatures)
2041
m_bCalcSD = AskYesNo(" Calculate standard deviation for this RDF (y/n)? [no] ",false);
2042
else m_bCalcSD = false;
2046
m_iSDBlocks = AskUnsignedInteger(" How many different block lenghts to use? [100] ",100);
2047
m_iSDBlockMin = AskUnsignedInteger(" Enter minimal block length in time steps: [1] ",1);
2048
if (g_iTrajSteps != -1)
2049
m_iSDBlockMax = AskUnsignedInteger(" Enter maximal block length in time steps: [%d] ",g_iTrajSteps/10,g_iTrajSteps/10);
2050
else m_iSDBlockMax = AskUnsignedInteger(" Enter maximal block length in time steps: [1000] ",1000);
2051
m_bSDVerbose = AskYesNo(" Write out correlation length extrapolation fit data for each bin (y/n)? [no] ",false);
2052
m_fSDTimesSigma = AskFloat(" Use which factor of sigma for confidence range? [3.0] ",3.0);
2053
mprintf("\n %.2f sigma leads to a confidence level of %.5f%c.\n",m_fSDTimesSigma,2.0*NormalDistIntegral(m_fSDTimesSigma)-1.0,'%');
2057
mprintf(WHITE,"\n<<< End of Radial Distribution Function <<<\n\n");
2062
void CDensDF::Parse()
2069
try { m_pDensDF = new CDF(); } catch(...) { m_pDensDF = NULL; }
2070
if (m_pDensDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2072
mprintf(WHITE,"\n>>> Density Distribution Function >>>\n\n");
2074
m_bDensityMass = AskYesNo(" Observe mass density (y) or particle density (n)? [yes] ",true);
2076
mprintf("\n Choose a reference atom around which the density will be analyzed.\n\n");
2078
// 1 reales + 2 virtuelle = 3 gesamt
2079
if (((CMolecule*)g_oaMolecules[m_iShowMol])->m_iAtomGesNoVirt == 1)
2081
mprintf(" %s is only one atom, there is no choice.\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2082
if (!ParseAtom("#2",m_iShowMol,m_iCenterAtomType,m_iCenterAtomRealType,m_iCenterAtom))
2084
eprintf("Weird error.\n");
2090
mprintf(" Which atom to take from OM %s (e.g. C1)? [#2] ",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2091
inpprintf("! Which atom to take from OM %s (e.g. C1)? [#2]\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2093
if (strlen(buf) == 0)
2095
if (!ParseAtom("#2",m_iShowMol,m_iCenterAtomType,m_iCenterAtomRealType,m_iCenterAtom))
2097
eprintf("Weird error.\n");
2100
} else if (!ParseAtom(buf,m_iShowMol,m_iCenterAtomType,m_iCenterAtomRealType,m_iCenterAtom))
2104
try { m_pDensityMolSelect = new bool[g_oaMolecules.GetSize()]; } catch(...) { m_pDensityMolSelect = NULL; }
2105
if (m_pDensityMolSelect == NULL) NewException((double)g_oaMolecules.GetSize()*sizeof(bool),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2107
try { m_pDensityMolAG = new CAtomGroup*[g_oaMolecules.GetSize()]; } catch(...) { m_pDensityMolAG = NULL; }
2108
if (m_pDensityMolAG == NULL) NewException((double)g_oaMolecules.GetSize()*sizeof(CAtomGroup*),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2110
mprintf("\n Please choose the atoms to observe:\n\n");
2112
for (z=0;z<g_oaMolecules.GetSize();z++)
2114
m = (CMolecule*)g_oaMolecules[z];
2115
m_pDensityMolSelect[z] = AskYesNo(" Consider contributions from %s (y/n)? [%s] ",!m->m_bPseudo,((CMolecule*)g_oaMolecules[z])->m_sName,m->m_bPseudo?"no":"yes");
2116
if (m_pDensityMolSelect[z])
2118
try { m_pDensityMolAG[z] = new CAtomGroup(); } catch(...) { m_pDensityMolAG[z] = NULL; }
2119
if (m_pDensityMolAG[z] == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2121
AskString(" Which atoms from %s to observe (e.g. C1-3,C6,N)? [all] ",buf,"",m->m_sName);
2122
if (strlen(buf) == 0)
2124
m_pDensityMolAG[z]->AddAllAtoms(m,false);
2125
} else if (!m_pDensityMolAG[z]->ParseAtoms(m,buf))
2132
m_fMinDist = AskFloat(" Enter the minimal radius of this Density DF in pm: [0] ",0.0f);
2133
m_fMaxDist = AskFloat(" Enter the maximal radius of this Density DF in pm: [%d.0] ",(float)HalfBox(),HalfBox());
2135
m_iResolution = AskUnsignedInteger(" Enter the resolution (bin count) for this Density DF: [300] ",300);
2138
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
2139
else m_iHistogramRes = 0;
2142
mprintf(WHITE,"\n<<< End of Density Distribution Function <<<\n\n");
2147
void CRDF::ParseCondition(int rm, CNbSearch *n, bool nbana)
2154
try { m_pRDF = new CDF(); } catch(...) { m_pRDF = NULL; }
2155
if (m_pRDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2159
m_iCombinations = 0;
2162
mprintf(WHITE,"\n>>> Distance Condition >>>\n");
2167
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2168
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2171
if (((CMolecule*)g_oaMolecules[rm])->m_iAtomGes == 3)
2173
mprintf(" %s is only one atom, there is no choice.\n",((CMolecule*)g_oaMolecules[rm])->m_sName);
2175
ag->m_pMolecule = (CMolecule*)g_oaMolecules[rm];
2176
ag->AddAtom(0,0,false);
2181
mprintf(" Which atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[rm])->m_sName);
2182
inpprintf("! Which atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[rm])->m_sName);
2184
if (strlen(buf) == 0)
2186
if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[rm],"#2"))
2188
eprintf("Weird error.\n");
2191
} else if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[rm],buf))
2194
m_oaVectors.Add(ag);
2195
m_iRefAtomGes += ag->m_iAtomGes;
2196
ti = ag->m_iAtomGes;
2198
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2199
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2202
if (((CMolecule*)g_oaMolecules[m_iShowMol])->m_iAtomGes == 3)
2204
mprintf(" %s is only one atom, there is no choice.\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2206
ag->m_pMolecule = (CMolecule*)g_oaMolecules[m_iShowMol];
2207
ag->AddAtom(0,0,false);
2212
mprintf(" Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2213
inpprintf("! Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2216
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2217
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2219
if (strlen(buf) == 0)
2221
if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[m_iShowMol],"#2"))
2223
eprintf("Weird error.\n");
2226
} else if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[m_iShowMol],buf))
2229
m_oaVectors.Add(ag);
2230
m_iShowAtomGes += ag->m_iAtomGes;
2231
m_iCombinations += ti * ag->m_iAtomGes;
2233
if (AskYesNo(" Enter another set of atoms for this condition (y/n)? [no] ",false))
2238
if (AskUnsignedInteger("\n Enter min./max. distance (0) or min./max. nearest neighbor count (1)? [0] ",0)==0)
2240
g_bEnvDisableSortNb = true;
2243
m_faMinMaxDist.Add(AskFloat(" Enter the minimal distance in pm: [0] ",0.0f));
2244
m_faMinMaxDist.Add(AskFloat(" Enter the maximal distance in pm: [400] ",400.0f));
2245
} while (AskYesNo(" Enter another distance interval (y/n)? [no] ",false));
2246
n->m_iNbCountMin = -1;
2247
n->m_iNbCountMax = -1;
2250
n->m_iNbCountMin = AskRangeInteger(" Use next neighbors from the n-th on? [1] ",0,((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize(),1)-1;
2251
n->m_iNbCountMax = AskRangeInteger(" Use next neighbors up to the n-th? [%d] ",n->m_iNbCountMin+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize(),n->m_iNbCountMin+1,n->m_iNbCountMin+1)-1;
2252
// m_faMinMaxDist.Add(0);
2253
// m_faMinMaxDist.Add(9E20f);
2257
m_faMinMaxDist.Add(0);
2258
m_faMinMaxDist.Add(1.0e30f);
2259
n->m_iNbCountMin = -2;
2260
n->m_iNbCountMax = -2;
2262
mprintf(WHITE,"\n<<< End of Distance Condition <<<\n\n");
2267
void CRDF::ParseConditionGrid(int rm, CNbSearch *n, int gridmode)
2274
try { m_pRDF = new CDF(); } catch(...) { m_pRDF = NULL; }
2275
if (m_pRDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2279
m_iCombinations = 0;
2282
mprintf(WHITE,"\n>>> Distance Condition >>>\n");
2287
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2288
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2291
if (((CMolecule*)g_oaMolecules[rm])->m_iAtomGes == 3)
2293
mprintf(" %s is only one atom, there is no choice.\n",((CMolecule*)g_oaMolecules[rm])->m_sName);
2295
ag->m_pMolecule = (CMolecule*)g_oaMolecules[rm];
2296
ag->AddAtom(0,0,false);
2301
mprintf(" Which atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[rm])->m_sName);
2302
inpprintf("! Which atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[rm])->m_sName);
2304
if (strlen(buf) == 0)
2306
if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[rm],"#2"))
2308
eprintf("Weird error.\n");
2311
} else if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[rm],buf))
2314
m_oaVectors.Add(ag);
2315
m_iRefAtomGes += ag->m_iAtomGes;
2316
ti = ag->m_iAtomGes;
2318
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2319
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2322
if (((CMolecule*)g_oaMolecules[m_iShowMol])->m_iAtomGes == 3)
2324
mprintf(" %s is only one atom, there is no choice.\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2326
ag->m_pMolecule = (CMolecule*)g_oaMolecules[m_iShowMol];
2327
ag->AddAtom(0,0,false);
2332
mprintf(" Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2333
inpprintf("! Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2336
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2337
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2339
if (strlen(buf) == 0)
2341
if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[m_iShowMol],"#2"))
2343
eprintf("Weird error.\n");
2346
} else if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[m_iShowMol],buf))
2349
m_oaVectors.Add(ag);
2350
m_iShowAtomGes += ag->m_iAtomGes;
2351
m_iCombinations += ti * ag->m_iAtomGes;
2353
if (AskYesNo(" Enter another set of atoms (y/n)? [no] ",false))
2358
if (AskUnsignedInteger("\n Enter min./max. distance (0) or min./max. nearest neighbor count (1)? [0] ",0)==0)
2360
m_faMinMaxDist.Add(AskFloat(" Enter the minimal distance in pm: [0] ",0.0f));
2361
m_faMinMaxDist.Add(AskFloat(" Enter the maximal distance in pm: [400] ",400.0f));
2362
n->m_iNbCountMin = -1;
2363
n->m_iNbCountMax = -1;
2366
n->m_iNbCountMin = AskRangeInteger(" Use next neighbors from the n-th on? [1] ",0,((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize(),1)-1;
2367
n->m_iNbCountMax = AskRangeInteger(" Use next neighbors up to the n-th? [%d] ",n->m_iNbCountMin+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize(),n->m_iNbCountMin+1,n->m_iNbCountMin+1)-1;
2368
// m_faMinMaxDist.Add(0);
2369
// m_faMinMaxDist.Add(9E20f);
2371
} else if ((gridmode == 4) || (gridmode == 5))
2373
n->m_iNbCountMin = 0;
2374
n->m_iNbCountMax = 0;
2375
// m_faMinMaxDist.Add(0);
2376
// m_faMinMaxDist.Add(9E20f);
2377
} else if (gridmode == 2)
2379
m_faMinMaxDist.Add(AskFloat(" Enter the minimal distance in pm: [0] ",0.0f));
2380
m_faMinMaxDist.Add(AskFloat(" Enter the maximal distance in pm: [400] ",400.0f));
2381
n->m_iNbCountMin = -1;
2382
n->m_iNbCountMax = -1;
2385
m_faMinMaxDist.Add(0.0f);
2386
m_faMinMaxDist.Add(400.0f);
2387
n->m_iNbCountMin = -1;
2388
n->m_iNbCountMax = -1;
2390
mprintf(WHITE,"\n<<< End of Distance Condition <<<\n\n");
2395
void CRDF::ParseCondition_OnlyValues(CNbSearch *n)
2400
mprintf(" Distance condition between ");
2401
for (z=0;z<m_oaVectors.GetSize()/2;z++)
2403
mprintf("%s and %s",((CAtomGroup*)m_oaVectors[z*2])->m_sName,((CAtomGroup*)m_oaVectors[z*2+1])->m_sName);
2404
if (z < (m_oaVectors.GetSize()/2)-1)
2408
if (n->m_iNbCountMin == -1)
2410
for (z=0;z<m_faMinMaxDist.GetSize()/2;z++)
2412
mprintf(" Interval %d:\n",z+1,m_faMinMaxDist.GetSize()/2);
2413
m_faMinMaxDist[z*2] = AskFloat(" Enter the minimal distance in pm: [0] ",0.0f);
2414
m_faMinMaxDist[z*2+1] = AskFloat(" Enter the maximal distance in pm: [400] ",400.0f);
2418
n->m_iNbCountMin = AskRangeInteger(" Use next neighbors from the n-th on? [1] ",0,((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize(),1)-1;
2419
n->m_iNbCountMax = AskRangeInteger(" Use next neighbors up to the n-th? [%d] ",n->m_iNbCountMin+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize(),n->m_iNbCountMin+1,n->m_iNbCountMin+1)-1;
2433
try { m_pVHDF = new C2DF(); } catch(...) { m_pVHDF = NULL; }
2434
if (m_pVHDF == NULL) NewException((double)sizeof(C2DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2438
m_iCombinations = 0;
2439
mprintf(WHITE,"\n>>> Van Hove Correlation Function >>>\n\n");
2440
if (m_iShowMol != -1)
2442
m_iRefOrSec[0] = AskRangeInteger(" Take (fixed) reference atom(s) from RM %s (0) or from OM %s (1)? [0] ",0,1,0,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2443
m_iRefOrSec[1] = AskRangeInteger(" Take (moving) observed atom(s) from RM %s (0) or from OM %s (1)? [1] ",0,1,1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2444
} else // Kein OM: Nimm alles aus RM
2452
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2453
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2458
mprintf(" Which (fixed) reference atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2459
inpprintf("! Which (fixed) reference atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2462
mprintf(" Which (fixed) reference atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
2463
inpprintf("! Which (fixed) reference atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
2466
if (strlen(buf) == 0)
2468
if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec[0])?m_iShowMol:g_iFixMol],"#2"))
2470
} else if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec[0])?m_iShowMol:g_iFixMol],buf))
2472
m_oaVectors.Add(ag);
2473
m_iRefAtomGes += ag->m_iAtomGes;
2474
ti = ag->m_iAtomGes;
2476
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2477
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2482
mprintf(" Which (moving) observed atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2483
inpprintf("! Which (moving) observed atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2486
mprintf(" Which (moving) observed atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
2487
inpprintf("! Which (moving) observed atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
2491
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2492
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2494
if (strlen(buf) == 0)
2496
if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec[1])?m_iShowMol:g_iFixMol],"#2"))
2498
} else if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec[1])?m_iShowMol:g_iFixMol],buf))
2500
m_oaVectors.Add(ag);
2501
m_iShowAtomGes += ag->m_iAtomGes;
2502
m_iCombinations += ti * ag->m_iAtomGes;
2505
if (AskYesNo(" Enter another set of atoms (y/n)? [no] ",false))
2508
m_fMinDist = 0; //AskFloat(" Enter the minimal radius of this VHCF in pm: [0] ",0.0f);
2509
m_fMaxDist = AskFloat(" Enter the radius of this VHCF in pm: [%d.0] ",(float)HalfBox(),HalfBox());
2510
m_iResolution = AskUnsignedInteger(" Enter the radial resolution of this VHCF: [100] ",100);
2511
m_bRadialCorrect = AskYesNo(" Correct radial distribution for this VHCF (y/n)? [%s] ",!m_bSelf,m_bSelf?"no":"yes");
2514
if (g_iTrajSteps != -1)
2515
m_iDepth = AskUnsignedInteger(" Enter the temporal resolution (time depth) of this VHCF (in time steps): [%d] ",int(g_iTrajSteps*0.75),int(g_iTrajSteps*0.75));
2516
else m_iDepth = AskUnsignedInteger(" Enter the temporal resolution (time depth) of this VHCF (in time steps): [5000] ",5000);
2518
mprintf("\n This will occupy %s of RAM.\n",FormatBytes((double)m_iDepth*g_iGesVirtAtomCount*3.0*sizeof(float)));
2519
if (m_iDepth*g_iGesVirtAtomCount*3.0*sizeof(float)/1024.0f/1024.0f >= 1000.0f)
2520
if (!AskYesNo(" Make sure that enough free RAM is available. Continue (y/n)? [yes] ",true))
2525
m_iStride = AskUnsignedInteger(" Take each n-th time step for the temporal axis? [%d] ",max(1,m_iDepth/100),max(1,m_iDepth/100));
2527
mprintf("\n This results in a plot resolution of %d on the temporal axis.\n",m_iDepth/m_iStride);
2529
if (m_iDepth/m_iStride > 200)
2532
if (!AskYesNo(" The resolution seems quite high, the plot will take much time to render. Contiune (y/n)? [yes] ",true))
2539
m_bSwapAxes = AskYesNo(" Put distance on X axis and time on Y axis (y) or swap axes (n)? [yes] ",true);
2540
m_iGraceBunchTime = AskUnsignedInteger(" How many time graphs do you want do draw in the distance grace stack (0=disable)? [10] ",10);
2541
m_iGraceBunchDist = AskUnsignedInteger(" How many distance graphs do you want do draw in the time grace stack (0=disable)? [10] ",10);
2545
m_iGraceBunchTime = 0;
2546
m_iGraceBunchDist = 0;
2550
mprintf(WHITE,"\n<<< End of Van Hove Correlation Function <<<\n\n");
2563
try { m_pADF = new CDF(); } catch(...) { m_pADF = NULL; }
2564
if (m_pADF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2566
mprintf(WHITE,"\n>>> Angular Distribution Function >>>\n\n");
2569
m_iVecType[z] = AskRangeInteger(" Should the %d. vector depict position (1), dipole (2), velocity (3) or force (4)? [1] ",1,4,1,z+1) - 1;
2570
if (m_iVecType[z] == 1)
2577
m_iCombinations = 0;
2581
mprintf("\n %d. set of vectors\n\n",z2+1);
2584
if (m_iVecType[z] == 0) // Position
2587
if ((z == 1) && (m_iVecType[0] == 0) && (m_iVecType[1] == 0))
2588
m_bSameFoot = AskYesNo(" Should the base points of the 1st and 2nd vectors always be equal (y/n)? [no] ",false);
2589
else m_bSameFoot = false;*/
2592
m_bOrtho[z] = (AskRangeInteger("\n Should the %d. vector connect 2 points (0) or stand perpendicular to 3 points (1)? [0] ",0,1,0,z+1) != 0);
2597
/* if (m_bSameFoot && (z == 1))
2599
m_iRefOrSec[1][0] = m_iRefOrSec[0][0];
2600
m_oaVectors.Add(NULL);
2605
if (m_iShowMol != -1)
2606
m_iRefOrSec[z][0] = AskRangeInteger(" Take atom(s) at the base point from RM %s (0) or from OM %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
2607
else m_iRefOrSec[z][0] = 0;
2609
mprintf(" Please enter the atom(s) at the base point (e.g. C7): ");
2610
inpprintf("! Please enter the atom(s) at the base point (e.g. C7):\n");
2613
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2614
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2616
if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2618
eprintf("Wrong input.\n");
2619
inpprintf("! Wrong input.\n");
2623
m_oaVectors.Add(ag);
2624
ti *= ag->m_iAtomGes;
2628
if (m_iShowMol != -1)
2629
m_iRefOrSec[z][1] = AskRangeInteger(" Take 2nd atom(s) of normal plane from RM %s (0) or from OM %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
2630
else m_iRefOrSec[z][1] = 0;
2632
mprintf(" Please enter the 2nd atom(s) of the normal plane (e.g. C7): ");
2633
inpprintf("! Please enter the 2nd atom(s) of the normal plane (e.g. C7):\n");
2636
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2637
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2639
if (!ag->ParseAtoms((!m_iRefOrSec[z][1])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2641
eprintf("Wrong input.\n");
2642
inpprintf("! Wrong input.\n");
2646
m_oaVectors.Add(ag);
2647
ti *= ag->m_iAtomGes;
2650
if (m_iShowMol != -1)
2651
m_iRefOrSec[z][2] = AskRangeInteger(" Take 3rd atom(s) of normal plane from RM %s (0) or from OM %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
2652
else m_iRefOrSec[z][2] = 0;
2654
mprintf(" Please enter the 3rd atom(s) of the normal plane (e.g. C7): ");
2655
inpprintf("! Please enter the 3rd atom(s) of the normal plane (e.g. C7):\n");
2658
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2659
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2661
if (!ag->ParseAtoms((!m_iRefOrSec[z][2])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2663
eprintf("Wrong input.\n");
2664
inpprintf("! Wrong input.\n");
2668
m_oaVectors.Add(ag);
2669
ti *= ag->m_iAtomGes;
2672
/* if (m_bSameFoot && (z == 1))
2674
m_iRefOrSec[1][0] = m_iRefOrSec[0][0];
2675
m_oaVectors.Add(NULL);
2680
if (m_iShowMol != -1)
2681
m_iRefOrSec[z][0] = AskRangeInteger(" Take atom(s) at the base point from RM %s (0) or from OM %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
2682
else m_iRefOrSec[z][0] = 0;
2684
mprintf(" Please enter the atom(s) at the base point (e.g. C7): ");
2685
inpprintf("! Please enter the atom(s) at the base point (e.g. C7):\n");
2688
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2689
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2691
if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2693
eprintf("Wrong input.\n");
2694
inpprintf("! Wrong input.\n");
2698
m_oaVectors.Add(ag);
2699
ti *= ag->m_iAtomGes;
2700
} // END IF NOT SAMEFOOT
2703
if (m_iShowMol != -1)
2704
m_iRefOrSec[z][1] = AskRangeInteger(" Take atom(s) at the tip point from RM %s (0) or from OM %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
2705
else m_iRefOrSec[z][1] = 0;
2707
mprintf(" Please enter the atom(s) at the tip point (e.g. C7): ");
2708
inpprintf("! Please enter the atom(s) at the tip point (e.g. C7):\n");
2711
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2712
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2714
if (!ag->ParseAtoms((!m_iRefOrSec[z][1])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2716
eprintf("Wrong input.\n");
2717
inpprintf("! Wrong input.\n");
2721
m_oaVectors.Add(ag);
2722
ti *= ag->m_iAtomGes;
2723
m_oaVectors.Add(NULL);
2724
} // END IF NOT ORTHO
2725
} else if (m_iVecType[z] == 1) // Dipol
2727
if (m_iShowMol != -1)
2728
m_iRefOrSec[z][0] = AskRangeInteger(" Take dipole vector from RM %s (0) or from OM %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
2729
else m_iRefOrSec[z][0] = 0;
2730
} else if (m_iVecType[z] == 2) // Geschwindigkeit
2732
_ax6: if (m_iShowMol != -1)
2733
m_iRefOrSec[z][0] = AskRangeInteger(" Take velocity vector from RM %s (0) or from OM %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
2734
else m_iRefOrSec[z][0] = 0;
2735
mprintf(" Velocity vector of which atoms to use (e.g. C7)? [#2] ");
2736
inpprintf("! Velocity vector of which atoms to use (e.g. C7)? [#2]\n");
2739
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2740
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2744
if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],"#2"))
2746
eprintf("Weird error.\n");
2747
inpprintf("! Weird error.\n");
2750
} else if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2752
eprintf("Wrong input.\n");
2753
inpprintf("! Wrong input.\n");
2757
m_oaVectors.Add(ag);
2758
ti *= ag->m_iAtomGes;
2759
} else if (m_iVecType[z] == 3) // Kraft
2761
_ax7: if (m_iShowMol != -1)
2762
m_iRefOrSec[z][0] = AskRangeInteger(" Take force vektor from RM %s (0) or from OM %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
2763
else m_iRefOrSec[z][0] = 0;
2764
mprintf(" Force vector of which atoms to use (e.g. C7)? [#2] ");
2765
inpprintf("! Force vector of which atoms to use (e.g. C7)? [#2]\n");
2768
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2769
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2773
if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],"#2"))
2775
eprintf("Weird Error.\n");
2776
inpprintf("! Weird Error.\n");
2779
} else if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2781
eprintf("Wrong input.\n");
2782
inpprintf("! Wrong input.\n");
2786
m_oaVectors.Add(ag);
2787
ti *= ag->m_iAtomGes;
2791
m_iCombinations += ti;
2792
} while (g_bAdvanced2?AskYesNo("\n Add another set of vectors to this (!) ADF (y/n)? [no] ",false):false);
2799
m_fMinAngle = AskFloat("\n Enter minimal angle between the vectors: [0 deg] ",0.0f);
2800
m_fMaxAngle = AskFloat(" Enter maximal angle between the vectors: [180 deg] ",180.0f);
2804
m_fMinAngle = AskFloat(" Enter the minimal value of this d1-ADF in deg/ps: [0] ",0.0f);
2805
else m_fMinAngle = AskFloat(" Enter the minimal value of this d1-ADF in deg/ps: [-10.0] ",-10.0f);
2806
m_fMaxAngle = AskFloat(" Enter the maximal value of this d1-ADF in deg/ps: [10.0] ",10.0f);
2810
m_fMinAngle = AskFloat(" Enter the minimal value of this d2-ADF in deg/ps^2: [0] ",0.0f);
2811
else m_fMinAngle = AskFloat(" Enter the minimal value of this d2-ADF in deg/ps^2: [-10.0] ",-10.0f);
2812
m_fMaxAngle = AskFloat(" Enter the maximal value of this d2-ADF in deg/ps^2: [10.0] ",10.0f);
2816
/* if (m_fMaxAngle <= 90.0f)
2817
m_bFoldAngle = AskYesNo(" Should angles > 90 deg be \"mirrored\" (180 deg = 0 deg) (y/n)? [yes] ",true);
2818
else*/ m_bFoldAngle = false;
2819
m_bCosine = (AskRangeInteger(" Plot ADF against angle (0) or against cosine (1)? [0] ",0,1,0)!=0);
2822
m_fMinAngle = (float)cos(m_fMinAngle/180.0*Pi);
2823
m_fMaxAngle = (float)cos(m_fMaxAngle/180.0*Pi);
2824
if (m_fMinAngle > m_fMaxAngle)
2827
m_fMinAngle = m_fMaxAngle;
2830
mprintf(" The data range is %.2f to %.2f.\n",m_fMinAngle,m_fMaxAngle);
2833
m_bMirror = AskYesNo(" Force this ADF to be mirror-symmetric to the 90 deg line (y/n)? [no] ",false);
2834
else m_bMirror = false;
2835
m_iResolution = AskUnsignedInteger(" Please enter the resolution (bin count) for this ADF: [100] ",100);
2838
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
2839
m_iHistogramRes = 0;
2841
if (m_iShowMol != -1)
2842
m_bStat = AskYesNo(" Apply cone correction (y/n)? [%c] ",!m_bCosine,(!m_bCosine)?'y':'n');
2844
/* mprintf("\n Save temporal development of this ADF (0=nein, 1=ja)? [0] ");
2846
m_bSaveAngle = (atoi(buf)!=0);*/
2848
mprintf(WHITE,"\n<<< End of Angular Distribution Function <<<\n\n");
2861
try { m_pDDF = new CDF(); } catch(...) { m_pDDF = NULL; }
2862
if (m_pDDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2864
mprintf(WHITE,"\n>>> Dihedral Distribution Function >>>\n\n");
2865
m_bClassical = AskYesNo(" Use \"simple\" (y) (4 atoms) or \"generalized\" (n) (3 vectors) Dihedrals? [yes] ",true);
2867
m_iCombinations = 1;
2870
m_bOrtho[0] = false;
2871
m_bOrtho[1] = false;
2872
m_bOrtho[2] = false;
2873
z0 = m_oaVectors.GetSize();
2876
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2877
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2879
m_oaVectors.Add(ag);
2881
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2882
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2884
m_oaVectors.Add(ag);
2885
m_oaVectors.Add(NULL);
2889
_bx: if (m_iShowMol != -1)
2890
i = AskRangeInteger(" Take the %d. atom from RM %s (0) or from OM %s (1)? [0] ",0,1,0,z+1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2895
m_iRefOrSec[0][1] = i;
2898
m_iRefOrSec[0][0] = i;
2899
m_iRefOrSec[2][0] = i;
2902
m_iRefOrSec[2][1] = i;
2903
m_iRefOrSec[1][0] = i;
2906
m_iRefOrSec[1][1] = i;
2909
mprintf(" Enter the %d. atom(s) (e.g. C7): ",z+1);
2910
inpprintf("! Enter the %d. atom(s) (e.g. C7):\n",z+1);
2915
if (!((CAtomGroup*)m_oaVectors[z0+0*3+1])->ParseAtoms((!m_iRefOrSec[0][1])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2917
eprintf("Wrong input.\n");
2918
inpprintf("! Wrong input.\n");
2921
m_iCombinations *= ((CAtomGroup*)m_oaVectors[z0+0*3+1])->m_iAtomGes;
2924
if (!((CAtomGroup*)m_oaVectors[z0+0*3+0])->ParseAtoms((!m_iRefOrSec[0][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2926
eprintf("Wrong input.\n");
2927
inpprintf("! Wrong input.\n");
2930
if (!((CAtomGroup*)m_oaVectors[z0+2*3+0])->ParseAtoms((!m_iRefOrSec[2][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2932
eprintf("Wrong input.\n");
2933
inpprintf("! Wrong input.\n");
2936
m_iCombinations *= ((CAtomGroup*)m_oaVectors[z0+0*3+0])->m_iAtomGes;
2937
m_iCombinations *= ((CAtomGroup*)m_oaVectors[z0+0*3+0])->m_iAtomGes;
2940
if (!((CAtomGroup*)m_oaVectors[z0+2*3+1])->ParseAtoms((!m_iRefOrSec[2][1])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2942
eprintf("Wrong input.\n");
2943
inpprintf("! Wrong input.\n");
2946
if (!((CAtomGroup*)m_oaVectors[z0+1*3+0])->ParseAtoms((!m_iRefOrSec[1][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2948
eprintf("Wrong input.\n");
2949
inpprintf("! Wrong input.\n");
2952
m_iCombinations *= ((CAtomGroup*)m_oaVectors[z0+2*3+1])->m_iAtomGes;
2953
m_iCombinations *= ((CAtomGroup*)m_oaVectors[z0+2*3+1])->m_iAtomGes;
2956
if (!((CAtomGroup*)m_oaVectors[z0+1*3+1])->ParseAtoms((!m_iRefOrSec[1][1])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2958
eprintf("Wrong input.\n");
2959
inpprintf("! Wrong input.\n");
2962
m_iCombinations *= ((CAtomGroup*)m_oaVectors[z0+1*3+1])->m_iAtomGes;
2966
} else // NONCLASSIC
2968
mprintf("\nYou now have to define 3 vectors:\n");
2969
mprintf("The 1st and 2nd vector are projected onto the normal plane of the 3rd vector.\n");
2970
mprintf("The angle between the two projected vectors in the plane is evaluated.\n");
2973
mprintf(WHITE,"\n * Vector %d\n",z+1);
2974
m_bOrtho[z] = (AskRangeInteger(" Shall the %d. vector connect 2 points (0) or be orthogonal to a plane (1)? [0] ",0,1,0,z+1) != 0);
2977
for (z2=0;z2<3;z2++)
2979
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2980
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2982
_by: if (m_iShowMol != -1)
2983
m_iRefOrSec[z][z2] = AskRangeInteger(" Take the %d. atom(s) of the plane from RM %s (0) or from OM %s (1)? [0] ",0,1,0,z2+1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2984
else m_iRefOrSec[z][z2] = 0;
2985
mprintf(" Please enter the %d. atom(s) (e.g. C7): ",z2+1);
2986
inpprintf("! Please enter the %d. atom(s) (e.g. C7):\n",z2+1);
2988
if (!ag->ParseAtoms((!m_iRefOrSec[z][z2])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2990
eprintf("Wrong input.\n");
2991
inpprintf("! Wrong input.\n");
2994
m_iCombinations *= ag->m_iAtomGes;
2995
m_oaVectors.Add(ag);
2999
for (z2=0;z2<2;z2++)
3001
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
3002
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3004
_bz: if (m_iShowMol != -1)
3005
m_iRefOrSec[z][z2] = AskRangeInteger(" Take the %d. atom(s) of the vector from RM %s (0) or from OM %s (1)? [0] ",0,1,0,z2+1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3006
else m_iRefOrSec[z][z2] = 0;
3007
mprintf(" Please enter the %d. atom(s) (e.g. C7): ",z2+1);
3008
inpprintf("! Please enter the %d. atom(s) (e.g. C7):\n",z2+1);
3010
if (!ag->ParseAtoms((!m_iRefOrSec[z][z2])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3012
eprintf("Wrong input.\n");
3013
inpprintf("! Wrong input.\n");
3016
m_iCombinations *= ag->m_iAtomGes;
3017
m_oaVectors.Add(ag);
3019
m_oaVectors.Add(NULL);
3022
} // END IF NONCLASSIC
3025
mprintf(" The \"classical\" dihedral angle is defined for a range of 0 ... 180 deg.\n\n");
3026
m_bAbs = !AskYesNo(" Do you want to extend the range to -180 ... +180 deg (y/n)? [no] ",false);*/
3029
mprintf(" Per default, the dihedral angle is defined in a range of -180 ... 180 deg.\n\n");
3030
m_bPositive = AskYesNo(" Use range of 0 ... 360 deg instead (e.g. -90 deg becomes 270 deg, ...) (y/n)? [no] ",false);
3041
m_fMinAngle = AskFloat("\n Enter minimal dihedral angle to observe: [0 deg] ",0);
3042
m_fMaxAngle = AskFloat(" Enter maximal dihedral angle to observe: [360 deg] ",360.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.
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
*****************************************************************************/
26
#include "maintools.h"
45
CVirtualAtom::CVirtualAtom()
47
m_faWeight.SetName("CVirtualAtom::m_faWeight");
51
CVirtualAtom::~CVirtualAtom()
56
CMolecule::CMolecule()
62
m_bChargesAssigned = false;
64
m_baAtomIndex.SetName("CMolecule::m_baAtomIndex");
65
m_waAtomCount.SetName("CMolecule::m_waAtomCount");
66
m_laSingleMolIndex.SetName("CMolecule::m_laSingleMolIndex");
67
m_laVirtualAtoms.SetName("CMolecule::m_laVirtualAtoms");
68
m_oaNewNumbers.SetName("CMolecule::m_oaNewNumbers");
69
m_oaRingAtomTypes.SetName("CMolecule::m_oaRingAtomTypes");
70
m_oaRingAtoms.SetName("CMolecule::m_oaRingAtoms");
71
m_oaCharges.SetName("CMolecule::m_oaCharges");
75
CMolecule::~CMolecule()
87
m_oaBonds.SetName("CMolAtom::m_oaBonds");
96
CSingleMolecule::CSingleMolecule()
100
m_oaBondGroups.SetName("CSingleMolecule::m_oaBondGroups");
101
m_oaBonds.SetName("CSingleMolecule::m_oaBonds");
102
m_oaAngleGroups.SetName("CSingleMolecule::m_oaAngleGroups");
103
m_oaAngles.SetName("CSingleMolecule::m_oaAngles");
104
m_oaRings.SetName("CSingleMolecule::m_oaRings");
105
m_laBonds.SetName("CSingleMolecule::m_laBonds");
106
m_laWannier.SetName("CSingleMolecule::m_laWannier");
107
m_oaAtomOffset.SetName("CSingleMolecule::m_oaAtomOffset");
108
m_oaMolAtoms.SetName("CSingleMolecule::m_oaMolAtoms");
109
m_baAtomIndex.SetName("CSingleMolecule::m_baAtomIndex");
113
CSingleMolecule::~CSingleMolecule()
121
m_oaVectors.SetName("CADF::m_oaVectors");
122
m_faACF.SetName("CADF::m_faACF");
123
m_faMinMaxAngle.SetName("CADF::m_faMinMaxAngle");
135
m_oaVectors.SetName("CDDF::m_oaVectors");
136
m_faLastData.SetName("CDDF::m_faLastData");
137
m_laRotation.SetName("CDDF::m_laRotation");
138
m_faACF.SetName("CDDF::m_faACF");
149
m_oaCache.SetName("CMSD::m_oaCache");
163
m_oaVectors.SetName("CVHDF::m_oaVectors");
174
if (m_sShortName != NULL)
176
delete[] m_sShortName;
192
m_faMinMaxDist.SetName("CRDF::m_faMinMaxDist");
193
m_oaVectors.SetName("CRDF::m_oaVectors");
194
m_faACF.SetName("CRDF::m_faACF");
201
m_oaVectors.SetName("CPlDF::m_oaVectors");
202
m_faACF.SetName("CPlDF::m_faACF");
209
m_oaVectors.SetName("CLiDF::m_oaVectors");
210
m_faACF.SetName("CLiDF::m_faACF");
221
if (m_sShortName != NULL)
223
delete[] m_sShortName;
236
if (m_faData != NULL)
257
if (m_sShortName != NULL)
259
delete[] m_sShortName;
262
if (m_pDensDF != NULL)
272
m_faACF.SetName("CVDF::m_faACF");
283
m_faACF.SetName("CDipDF::m_faACF");
309
m_bAxisDivide = false;
318
CConditionSubGroup::CConditionSubGroup()
322
m_oaConditions.SetName("CConditionSubGroup::m_oaConditions");
326
CConditionSubGroup::~CConditionSubGroup()
331
CConditionGroup::CConditionGroup()
337
m_iPassCounter = NULL;
338
m_bAlwaysTrue = NULL;
339
m_oaConditionSubGroups.SetName("CConditionGroup::m_oaConditionSubGroups");
343
CConditionGroup::~CConditionGroup()
348
bool ContainsDigit(const char *s)
350
if (strcspn(s,"0123456789") != strlen(s))
356
void ReplaceDigits(char *s)
371
case '1': *q = 'a'; break;
372
case '2': *q = 'b'; break;
373
case '3': *q = 'c'; break;
374
case '4': *q = 'd'; break;
375
case '5': *q = 'e'; break;
376
case '6': *q = 'f'; break;
377
case '7': *q = 'g'; break;
378
case '8': *q = 'h'; break;
379
case '9': *q = 'i'; break;
380
case '0': *q = 'z'; break;
387
case '1': b = true; *q = '_'; q++; *q = 'a'; break;
388
case '2': b = true; *q = '_'; q++; *q = 'b'; break;
389
case '3': b = true; *q = '_'; q++; *q = 'c'; break;
390
case '4': b = true; *q = '_'; q++; *q = 'd'; break;
391
case '5': b = true; *q = '_'; q++; *q = 'e'; break;
392
case '6': b = true; *q = '_'; q++; *q = 'f'; break;
393
case '7': b = true; *q = '_'; q++; *q = 'g'; break;
394
case '8': b = true; *q = '_'; q++; *q = 'h'; break;
395
case '9': b = true; *q = '_'; q++; *q = 'i'; break;
396
case '0': b = true; *q = '_'; q++; *q = 'z'; break;
408
void xAddAtom(const char *s)
415
if (g_oaAtoms.GetSize() >= 254)
417
eprintf("More than 254 different atom types not supported.\n");
424
// printf("AddAtom: \"%s\".\n",s);
425
for (z=0;z<g_oaAtoms.GetSize();z++)
427
if (mystricmp(buf,((CAtom*)g_oaAtoms[z])->m_sName)==0)
429
((CAtom*)g_oaAtoms[z])->m_iCount++;
434
if (ContainsDigit(s))
435
eprintf("Digits in element labels not allowed. Renaming %s to %s.\n",s,buf);
437
try { a = new CAtom(); } catch(...) { a = NULL; }
438
if (a == NULL) NewException((double)sizeof(CAtom),__FILE__,__LINE__,__PRETTY_FUNCTION__);
440
a->m_iIndex = g_oaAtoms.GetSize();
441
strcpy(a->m_sName,buf);
442
if (islower(a->m_sName[0]))
443
a->m_sName[0] = toupper(a->m_sName[0]);
444
if (strlen(a->m_sName) > 1)
445
if (isupper(a->m_sName[1]))
446
a->m_sName[1] = tolower(a->m_sName[1]);
450
a->m_pElement = FindElement(buf,false);
451
if (a->m_pElement == NULL)
453
try { a->m_pElement = new CElement(); } catch(...) { a->m_pElement = NULL; }
454
if (a->m_pElement == NULL) NewException((double)sizeof(CElement),__FILE__,__LINE__,__PRETTY_FUNCTION__);
456
try { a->m_pElement->m_sLabel = new char[strlen(a->m_sName)+1]; } catch(...) { a->m_pElement->m_sLabel = NULL; }
457
if (a->m_pElement->m_sLabel == NULL) NewException((double)(strlen(a->m_sName)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
459
strcpy(a->m_pElement->m_sLabel,a->m_sName);
461
/* a->m_fMass = AtomMass(s);
462
a->m_fRadius = AtomRadius(s);
463
a->m_iOrd = AtomOrd(s);*/
464
// a->m_fVDWRadius = AtomVDWRadius(s);
470
// a->m_fVDWRadius = 0.0f;
473
// g_pAtoms[g_iElementCount].Offset = offset;
474
// printf("Fuege Atom %s an Stelle %d neu hinzu. Der Offset ist %d.\n",s,g_iAtomCount,offset);
475
// g_iElementCount++;
480
void CSingleMolecule::Dump()
484
mprintf("### Single Molecule Dump ###\n");
485
mprintf("%d Elemente.\n",m_baAtomIndex.GetSize());
486
for (z=0;z<m_baAtomIndex.GetSize();z++)
488
mprintf(" * Element %d: %s. %d Vertreter *\n Atome ",z+1,((CAtom*)g_oaAtoms[m_baAtomIndex[z]])->m_sName,((CxIntArray*)m_oaAtomOffset[z])->GetSize());
489
for (z2=0;z2<((CxIntArray*)m_oaAtomOffset[z])->GetSize();z2++)
491
mprintf("%d",((CxIntArray*)m_oaAtomOffset[z])->GetAt(z2));
492
if (z2 < ((CxIntArray*)m_oaAtomOffset[z])->GetSize()-1)
501
void CMolecule::Dump()
505
mprintf("### Molecule Type Dump ###\n");
506
mprintf("%d Elemente.\n",m_baAtomIndex.GetSize());
507
for (z=0;z<m_baAtomIndex.GetSize();z++)
508
mprintf(" * Element %d: %s. %d Vertreter *\n",z+1,((CAtom*)g_oaAtoms[m_baAtomIndex[z]])->m_sName,m_waAtomCount[z]);
513
void CADF::BuildName()
522
sprintf(tmp,"deriv%d_",m_iDeriv);
523
for (z2=0;z2<m_oaVectors.GetSize()/6;z2++)
528
if (m_iVecType[z] == 0) // Position
532
/* if (m_bSameFoot && (z == 1))
533
ag = (CAtomGroup*)m_oaVectors[z2*6];
534
else */ag = (CAtomGroup*)m_oaVectors[z2*6+z*3];
535
strcat(tmp,ag->m_sName);
536
if (m_iRefOrSec[z][0])
538
else strcat(tmp,"r_");
539
strcat(tmp,((CAtomGroup*)m_oaVectors[z2*6+z*3+1])->m_sName);
540
if (m_iRefOrSec[z][1])
542
else strcat(tmp,"r_");
543
strcat(tmp,((CAtomGroup*)m_oaVectors[z2*6+z*3+2])->m_sName);
544
if (m_iRefOrSec[z][2])
546
else strcat(tmp,"r");
549
/* if (m_bSameFoot && (z == 1))
550
ag = (CAtomGroup*)m_oaVectors[z2*6];
551
else */ag = (CAtomGroup*)m_oaVectors[z2*6+z*3];
552
strcat(tmp,ag->m_sName);
553
if (m_iRefOrSec[z][0])
555
else strcat(tmp,"r_");
556
strcat(tmp,((CAtomGroup*)m_oaVectors[z2*6+z*3+1])->m_sName);
557
if (m_iRefOrSec[z][1])
559
else strcat(tmp,"r");
561
} else if (m_iVecType[z] == 1) // Dipol
564
strcat(tmp,(m_iRefOrSec[z][0]!=0)?((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName:((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
565
} else if (m_iVecType[z] == 2) // Geschwindigkeit
568
strcat(tmp,((CAtomGroup*)m_oaVectors[z*3])->m_sName);
569
} else if (m_iVecType[z] == 3) // Kraft
572
strcat(tmp,((CAtomGroup*)m_oaVectors[z*3])->m_sName);
576
else strcat(tmp,"]");
578
if (z2<(m_oaVectors.GetSize()/6)-1)
582
try { m_sShortName = new char[strlen(tmp)+1]; } catch(...) { m_sShortName = NULL; }
583
if (m_sShortName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
585
strcpy(m_sShortName,tmp);
586
if (m_iShowMol != -1)
587
sprintf(tmp,"%s_%s%d_%s_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
588
else sprintf(tmp,"%s_%s%d_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1);
589
strcat(tmp,m_sShortName);
591
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
592
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
599
void CPlDF::BuildName()
610
ag = (CAtomGroup*)m_oaVectors[0];
611
strcat(tmp,ag->m_sName);
614
else strcat(tmp,"r_");
615
strcat(tmp,((CAtomGroup*)m_oaVectors[1])->m_sName);
618
else strcat(tmp,"r");
621
ag = (CAtomGroup*)m_oaVectors[0];
622
strcat(tmp,ag->m_sName);
625
else strcat(tmp,"r_");
626
strcat(tmp,((CAtomGroup*)m_oaVectors[1])->m_sName);
629
else strcat(tmp,"r_");
630
strcat(tmp,((CAtomGroup*)m_oaVectors[2])->m_sName);
633
else strcat(tmp,"r");
636
strcat(tmp,((CAtomGroup*)m_oaVectors[3])->m_sName);
639
else strcat(tmp,"r");
641
try { m_sShortName = new char[strlen(tmp)+1]; } catch(...) { m_sShortName = NULL; }
642
if (m_sShortName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
644
strcpy(m_sShortName,tmp);
645
if (m_iShowMol != -1)
646
sprintf(tmp,"%s_%s%d_%s_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
647
else sprintf(tmp,"%s_%s%d_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1);
648
strcat(tmp,m_sShortName);
650
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
651
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
658
void CLiDF::BuildName()
669
ag = (CAtomGroup*)m_oaVectors[0];
670
strcat(tmp,ag->m_sName);
673
else strcat(tmp,"r_");
674
strcat(tmp,((CAtomGroup*)m_oaVectors[1])->m_sName);
677
else strcat(tmp,"r_");
678
strcat(tmp,((CAtomGroup*)m_oaVectors[2])->m_sName);
681
else strcat(tmp,"r");
684
ag = (CAtomGroup*)m_oaVectors[0];
685
strcat(tmp,ag->m_sName);
688
else strcat(tmp,"r_");
689
strcat(tmp,((CAtomGroup*)m_oaVectors[1])->m_sName);
692
else strcat(tmp,"r");
695
strcat(tmp,((CAtomGroup*)m_oaVectors[3])->m_sName);
698
else strcat(tmp,"r");
700
try { m_sShortName = new char[strlen(tmp)+1]; } catch(...) { m_sShortName = NULL; }
701
if (m_sShortName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
703
strcpy(m_sShortName,tmp);
704
if (m_iShowMol != -1)
705
sprintf(tmp,"%s_%s%d_%s_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
706
else sprintf(tmp,"%s_%s%d_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1);
707
strcat(tmp,m_sShortName);
709
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
710
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
717
void CDDF::BuildName()
726
sprintf(tmp,"deriv%d_",m_iDeriv);
732
ag = (CAtomGroup*)m_oaVectors[z*3];
733
strcat(tmp,ag->m_sName);
734
if (m_iRefOrSec[z][0])
736
else strcat(tmp,"r_");
737
strcat(tmp,((CAtomGroup*)m_oaVectors[z*3+1])->m_sName);
738
if (m_iRefOrSec[z][1])
740
else strcat(tmp,"r_");
741
strcat(tmp,((CAtomGroup*)m_oaVectors[z*3+2])->m_sName);
742
if (m_iRefOrSec[z][2])
744
else strcat(tmp,"r");
747
ag = (CAtomGroup*)m_oaVectors[z*3];
748
strcat(tmp,ag->m_sName);
749
if (m_iRefOrSec[z][0])
751
else strcat(tmp,"r_");
752
strcat(tmp,((CAtomGroup*)m_oaVectors[z*3+1])->m_sName);
753
if (m_iRefOrSec[z][1])
755
else strcat(tmp,"r");
759
else strcat(tmp,"]");
762
try { m_sShortName = new char[strlen(tmp)+1]; } catch(...) { m_sShortName = NULL; }
763
if (m_sShortName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
765
strcpy(m_sShortName,tmp);
766
if (m_iShowMol != -1)
767
sprintf(tmp,"%s_%s%d_%s_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
768
else sprintf(tmp,"%s_%s%d_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1);
769
strcat(tmp,m_sShortName);
771
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
772
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
779
void CDipDF::BuildName()
786
sprintf(tmp,"deriv%d_",m_iDeriv);
788
sprintf(tmp,"%s",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
789
else sprintf(tmp,"%s",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
791
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
792
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
796
try { m_sShortName = new char[strlen(tmp)+1]; } catch(...) { m_sShortName = NULL; }
797
if (m_sShortName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
799
strcpy(m_sShortName,tmp);
804
void CADF::BuildAtomList(CSingleMolecule *ref, CSingleMolecule *obs, CxIntArray *vec)
807
int z, z1t, z1a, z2t, z2a, z3t, z3a, z4t, z4a, z5t, z5a, z6t, z6a;
808
CAtomGroup *g1, *g2, *g3, *g4, *g5, *g6;
809
CxIntArray *a1, *a2, *a3, *a4, *a5, *a6;
811
vec->RemoveAll_KeepSize();
812
for (z=0;z<m_oaVectors.GetSize()/6;z++)
816
g1 = (CAtomGroup*)m_oaVectors[z*6];
817
g2 = (CAtomGroup*)m_oaVectors[z*6+1];
818
g3 = (CAtomGroup*)m_oaVectors[z*6+2];
819
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
821
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
822
for (z1a=0;z1a<a1->GetSize();z1a++)
824
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
826
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
827
for (z2a=0;z2a<a2->GetSize();z2a++)
829
for (z3t=0;z3t<g3->m_baAtomType.GetSize();z3t++)
831
a3 = (CxIntArray*)g3->m_oaAtoms[z3t];
832
for (z3a=0;z3a<a3->GetSize();z3a++)
838
else */g4 = (CAtomGroup*)m_oaVectors[z*6+3];
839
g5 = (CAtomGroup*)m_oaVectors[z*6+4];
840
g6 = (CAtomGroup*)m_oaVectors[z*6+5];
841
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
843
/* if (m_bSameFoot && (z4t != z1t))
845
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
846
for (z4a=0;z4a<a4->GetSize();z4a++)
848
/* if (m_bSameFoot && (z4a != z1a))
850
for (z5t=0;z5t<g5->m_baAtomType.GetSize();z5t++)
852
a5 = (CxIntArray*)g5->m_oaAtoms[z5t];
853
for (z5a=0;z5a<a5->GetSize();z5a++)
855
for (z6t=0;z6t<g6->m_baAtomType.GetSize();z6t++)
857
a6 = (CxIntArray*)g6->m_oaAtoms[z6t];
858
for (z6a=0;z6a<a6->GetSize();z6a++)
860
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
861
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
862
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
863
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
864
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
865
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
866
if ((!m_iRefOrSec[0][2]) || (obs == NULL))
867
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
868
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
869
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
870
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
871
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
872
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
873
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
874
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
875
if ((!m_iRefOrSec[1][2]) || (obs == NULL))
876
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
877
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
888
else */g4 = (CAtomGroup*)m_oaVectors[z*6+3];
889
g5 = (CAtomGroup*)m_oaVectors[z*6+4];
890
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
892
/* if (m_bSameFoot && (z4t != z1t))
894
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
895
for (z4a=0;z4a<a4->GetSize();z4a++)
897
/* if (m_bSameFoot && (z4a != z1a))
899
for (z5t=0;z5t<g5->m_baAtomType.GetSize();z5t++)
901
a5 = (CxIntArray*)g5->m_oaAtoms[z5t];
902
for (z5a=0;z5a<a5->GetSize();z5a++)
904
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
905
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
906
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
907
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
908
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
909
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
910
if ((!m_iRefOrSec[0][2]) || (obs == NULL))
911
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
912
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
913
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
914
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
915
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
916
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
917
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
918
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
924
} // END IF NOT ORTHO[1]
933
g1 = (CAtomGroup*)m_oaVectors[z*6];
934
g2 = (CAtomGroup*)m_oaVectors[z*6+1];
935
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
937
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
938
for (z1a=0;z1a<a1->GetSize();z1a++)
940
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
942
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
943
for (z2a=0;z2a<a2->GetSize();z2a++)
949
else */g4 = (CAtomGroup*)m_oaVectors[z*6+3];
950
g5 = (CAtomGroup*)m_oaVectors[z*6+4];
951
g6 = (CAtomGroup*)m_oaVectors[z*6+5];
952
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
954
/* if (m_bSameFoot && (z4t != z1t))
956
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
957
for (z4a=0;z4a<a4->GetSize();z4a++)
959
/* if (m_bSameFoot && (z4a != z1a))
961
for (z5t=0;z5t<g5->m_baAtomType.GetSize();z5t++)
963
a5 = (CxIntArray*)g5->m_oaAtoms[z5t];
964
for (z5a=0;z5a<a5->GetSize();z5a++)
966
for (z6t=0;z6t<g6->m_baAtomType.GetSize();z6t++)
968
a6 = (CxIntArray*)g6->m_oaAtoms[z6t];
969
for (z6a=0;z6a<a6->GetSize();z6a++)
971
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
972
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
973
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
974
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
975
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
976
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
978
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
979
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
980
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
981
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
982
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
983
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
984
if ((!m_iRefOrSec[1][2]) || (obs == NULL))
985
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
986
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
997
else */g4 = (CAtomGroup*)m_oaVectors[z*6+3];
998
g5 = (CAtomGroup*)m_oaVectors[z*6+4];
999
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1001
/* if (m_bSameFoot && (z4t != z1t))
1003
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1004
for (z4a=0;z4a<a4->GetSize();z4a++)
1006
/* if (m_bSameFoot && (z4a != z1a))
1008
for (z5t=0;z5t<g5->m_baAtomType.GetSize();z5t++)
1010
a5 = (CxIntArray*)g5->m_oaAtoms[z5t];
1011
for (z5a=0;z5a<a5->GetSize();z5a++)
1013
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1014
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1015
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1016
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1017
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1018
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1020
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1021
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1022
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1023
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1024
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1025
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1031
} // END IF NOT ORTHO[1]
1042
/* Mega abartig !!!! */
1043
void CDDF::BuildAtomList(CSingleMolecule *ref, CSingleMolecule *obs, CxIntArray *vec)
1046
int z, z1t, z1a, z2t, z2a, z3t, z3a, z4t, z4a, z5t, z5a, z6t, z6a, z7t, z7a, z8t, z8a, z9t, z9a;
1047
CAtomGroup *g1, *g2, *g3, *g4, *g5, *g6, *g7, *g8, *g9;
1048
CxIntArray *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8, *a9;
1050
vec->RemoveAll_KeepSize();
1051
for (z=0;z<m_oaVectors.GetSize()/9;z++)
1055
g1 = (CAtomGroup*)m_oaVectors[z*9];
1056
g2 = (CAtomGroup*)m_oaVectors[z*9+1];
1057
g3 = (CAtomGroup*)m_oaVectors[z*9+2];
1058
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
1060
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
1061
for (z1a=0;z1a<a1->GetSize();z1a++)
1063
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
1065
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
1066
for (z2a=0;z2a<a2->GetSize();z2a++)
1068
for (z3t=0;z3t<g3->m_baAtomType.GetSize();z3t++)
1070
a3 = (CxIntArray*)g3->m_oaAtoms[z3t];
1071
for (z3a=0;z3a<a3->GetSize();z3a++)
1075
g4 = (CAtomGroup*)m_oaVectors[z*9+3];
1076
g5 = (CAtomGroup*)m_oaVectors[z*9+4];
1077
g6 = (CAtomGroup*)m_oaVectors[z*9+5];
1078
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1080
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1081
for (z4a=0;z4a<a4->GetSize();z4a++)
1083
for (z5t=0;z5t<g5->m_baAtomType.GetSize();z5t++)
1085
a5 = (CxIntArray*)g5->m_oaAtoms[z5t];
1086
for (z5a=0;z5a<a5->GetSize();z5a++)
1088
for (z6t=0;z6t<g6->m_baAtomType.GetSize();z6t++)
1090
a6 = (CxIntArray*)g6->m_oaAtoms[z6t];
1091
for (z6a=0;z6a<a6->GetSize();z6a++)
1095
g7 = (CAtomGroup*)m_oaVectors[z*9+6];
1096
g8 = (CAtomGroup*)m_oaVectors[z*9+7];
1097
g9 = (CAtomGroup*)m_oaVectors[z*9+8];
1098
for (z7t=0;z7t<g7->m_baAtomType.GetSize();z7t++)
1100
a7 = (CxIntArray*)g7->m_oaAtoms[z7t];
1101
for (z7a=0;z7a<a7->GetSize();z7a++)
1103
for (z8t=0;z8t<g8->m_baAtomType.GetSize();z8t++)
1105
a8 = (CxIntArray*)g8->m_oaAtoms[z8t];
1106
for (z8a=0;z8a<a8->GetSize();z8a++)
1108
for (z9t=0;z9t<g9->m_baAtomType.GetSize();z9t++)
1110
a9 = (CxIntArray*)g9->m_oaAtoms[z9t];
1111
for (z9a=0;z9a<a9->GetSize();z9a++)
1113
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1114
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1115
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1116
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1117
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1118
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1119
if ((!m_iRefOrSec[0][2]) || (obs == NULL))
1120
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1121
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1122
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1123
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1124
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1125
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1126
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1127
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1128
if ((!m_iRefOrSec[1][2]) || (obs == NULL))
1129
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
1130
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
1131
if ((!m_iRefOrSec[2][0]) || (obs == NULL))
1132
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1133
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1134
if ((!m_iRefOrSec[2][1]) || (obs == NULL))
1135
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1136
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1137
if ((!m_iRefOrSec[2][2]) || (obs == NULL))
1138
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g9->m_baAtomType[z9t]])->GetAt(a9->GetAt(z9a)));
1139
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g9->m_baAtomType[z9t]])->GetAt(a9->GetAt(z9a)));
1146
} else // IF NOT ORTHO[2]
1148
g7 = (CAtomGroup*)m_oaVectors[z*9+6];
1149
g8 = (CAtomGroup*)m_oaVectors[z*9+7];
1150
for (z7t=0;z7t<g7->m_baAtomType.GetSize();z7t++)
1152
a7 = (CxIntArray*)g7->m_oaAtoms[z7t];
1153
for (z7a=0;z7a<a7->GetSize();z7a++)
1155
for (z8t=0;z8t<g8->m_baAtomType.GetSize();z8t++)
1157
a8 = (CxIntArray*)g8->m_oaAtoms[z8t];
1158
for (z8a=0;z8a<a8->GetSize();z8a++)
1160
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1161
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1162
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1163
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1164
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1165
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1166
if ((!m_iRefOrSec[0][2]) || (obs == NULL))
1167
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1168
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1169
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1170
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1171
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1172
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1173
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1174
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1175
if ((!m_iRefOrSec[1][2]) || (obs == NULL))
1176
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
1177
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
1178
if ((!m_iRefOrSec[2][0]) || (obs == NULL))
1179
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1180
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1181
if ((!m_iRefOrSec[2][1]) || (obs == NULL))
1182
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1183
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1189
} // END IF NOT ORTHO[2]
1196
} else // IF NOT ORTHO[1]
1198
g4 = (CAtomGroup*)m_oaVectors[z*9+3];
1199
g5 = (CAtomGroup*)m_oaVectors[z*9+4];
1200
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1202
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1203
for (z4a=0;z4a<a4->GetSize();z4a++)
1205
for (z5t=0;z5t<g5->m_baAtomType.GetSize();z5t++)
1207
a5 = (CxIntArray*)g5->m_oaAtoms[z5t];
1208
for (z5a=0;z5a<a5->GetSize();z5a++)
1212
g7 = (CAtomGroup*)m_oaVectors[z*9+6];
1213
g8 = (CAtomGroup*)m_oaVectors[z*9+7];
1214
g9 = (CAtomGroup*)m_oaVectors[z*9+8];
1215
for (z7t=0;z7t<g7->m_baAtomType.GetSize();z7t++)
1217
a7 = (CxIntArray*)g7->m_oaAtoms[z7t];
1218
for (z7a=0;z7a<a7->GetSize();z7a++)
1220
for (z8t=0;z8t<g8->m_baAtomType.GetSize();z8t++)
1222
a8 = (CxIntArray*)g8->m_oaAtoms[z8t];
1223
for (z8a=0;z8a<a8->GetSize();z8a++)
1225
for (z9t=0;z9t<g9->m_baAtomType.GetSize();z9t++)
1227
a9 = (CxIntArray*)g9->m_oaAtoms[z9t];
1228
for (z9a=0;z9a<a9->GetSize();z9a++)
1230
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1231
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1232
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1233
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1234
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1235
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1236
if ((!m_iRefOrSec[0][2]) || (obs == NULL))
1237
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1238
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1239
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1240
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1241
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1242
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1243
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1244
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1246
if ((!m_iRefOrSec[2][0]) || (obs == NULL))
1247
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1248
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1249
if ((!m_iRefOrSec[2][1]) || (obs == NULL))
1250
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1251
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1252
if ((!m_iRefOrSec[2][2]) || (obs == NULL))
1253
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g9->m_baAtomType[z9t]])->GetAt(a9->GetAt(z9a)));
1254
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g9->m_baAtomType[z9t]])->GetAt(a9->GetAt(z9a)));
1261
} else // IF NOT ORTHO[2]
1263
g7 = (CAtomGroup*)m_oaVectors[z*9+6];
1264
g8 = (CAtomGroup*)m_oaVectors[z*9+7];
1265
for (z7t=0;z7t<g7->m_baAtomType.GetSize();z7t++)
1267
a7 = (CxIntArray*)g7->m_oaAtoms[z7t];
1268
for (z7a=0;z7a<a7->GetSize();z7a++)
1270
for (z8t=0;z8t<g8->m_baAtomType.GetSize();z8t++)
1272
a8 = (CxIntArray*)g8->m_oaAtoms[z8t];
1273
for (z8a=0;z8a<a8->GetSize();z8a++)
1275
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1276
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1277
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1278
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1279
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1280
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1281
if ((!m_iRefOrSec[0][2]) || (obs == NULL))
1282
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1283
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1284
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1285
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1286
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1287
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1288
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1289
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1291
if ((!m_iRefOrSec[2][0]) || (obs == NULL))
1292
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1293
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1294
if ((!m_iRefOrSec[2][1]) || (obs == NULL))
1295
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1296
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1302
} // END IF NOT ORTHO[2]
1307
} // END IF NOT ORTHO[1]
1314
} else // IF NOT ORTHO[0]
1316
g1 = (CAtomGroup*)m_oaVectors[z*9];
1317
g2 = (CAtomGroup*)m_oaVectors[z*9+1];
1318
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
1320
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
1321
for (z1a=0;z1a<a1->GetSize();z1a++)
1323
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
1325
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
1326
for (z2a=0;z2a<a2->GetSize();z2a++)
1330
g4 = (CAtomGroup*)m_oaVectors[z*9+3];
1331
g5 = (CAtomGroup*)m_oaVectors[z*9+4];
1332
g6 = (CAtomGroup*)m_oaVectors[z*9+5];
1333
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1335
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1336
for (z4a=0;z4a<a4->GetSize();z4a++)
1338
for (z5t=0;z5t<g5->m_baAtomType.GetSize();z5t++)
1340
a5 = (CxIntArray*)g5->m_oaAtoms[z5t];
1341
for (z5a=0;z5a<a5->GetSize();z5a++)
1343
for (z6t=0;z6t<g6->m_baAtomType.GetSize();z6t++)
1345
a6 = (CxIntArray*)g6->m_oaAtoms[z6t];
1346
for (z6a=0;z6a<a6->GetSize();z6a++)
1350
g7 = (CAtomGroup*)m_oaVectors[z*9+6];
1351
g8 = (CAtomGroup*)m_oaVectors[z*9+7];
1352
g9 = (CAtomGroup*)m_oaVectors[z*9+8];
1353
for (z7t=0;z7t<g7->m_baAtomType.GetSize();z7t++)
1355
a7 = (CxIntArray*)g7->m_oaAtoms[z7t];
1356
for (z7a=0;z7a<a7->GetSize();z7a++)
1358
for (z8t=0;z8t<g8->m_baAtomType.GetSize();z8t++)
1360
a8 = (CxIntArray*)g8->m_oaAtoms[z8t];
1361
for (z8a=0;z8a<a8->GetSize();z8a++)
1363
for (z9t=0;z9t<g9->m_baAtomType.GetSize();z9t++)
1365
a9 = (CxIntArray*)g9->m_oaAtoms[z9t];
1366
for (z9a=0;z9a<a9->GetSize();z9a++)
1368
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1369
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1370
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1371
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1372
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1373
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1375
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1376
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1377
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1378
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1379
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1380
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1381
if ((!m_iRefOrSec[1][2]) || (obs == NULL))
1382
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
1383
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
1384
if ((!m_iRefOrSec[2][0]) || (obs == NULL))
1385
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1386
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1387
if ((!m_iRefOrSec[2][1]) || (obs == NULL))
1388
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1389
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1390
if ((!m_iRefOrSec[2][2]) || (obs == NULL))
1391
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g9->m_baAtomType[z9t]])->GetAt(a9->GetAt(z9a)));
1392
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g9->m_baAtomType[z9t]])->GetAt(a9->GetAt(z9a)));
1399
} else // IF NOT ORTHO[2]
1401
g7 = (CAtomGroup*)m_oaVectors[z*9+6];
1402
g8 = (CAtomGroup*)m_oaVectors[z*9+7];
1403
for (z7t=0;z7t<g7->m_baAtomType.GetSize();z7t++)
1405
a7 = (CxIntArray*)g7->m_oaAtoms[z7t];
1406
for (z7a=0;z7a<a7->GetSize();z7a++)
1408
for (z8t=0;z8t<g8->m_baAtomType.GetSize();z8t++)
1410
a8 = (CxIntArray*)g8->m_oaAtoms[z8t];
1411
for (z8a=0;z8a<a8->GetSize();z8a++)
1413
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1414
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1415
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1416
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1417
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1418
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1420
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1421
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1422
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1423
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1424
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1425
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1426
if ((!m_iRefOrSec[1][2]) || (obs == NULL))
1427
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
1428
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g6->m_baAtomType[z6t]])->GetAt(a6->GetAt(z6a)));
1429
if ((!m_iRefOrSec[2][0]) || (obs == NULL))
1430
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1431
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1432
if ((!m_iRefOrSec[2][1]) || (obs == NULL))
1433
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1434
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1440
} // END IF NOT ORTHO[2]
1447
} else // IF NOT ORTHO[1]
1449
g4 = (CAtomGroup*)m_oaVectors[z*9+3];
1450
g5 = (CAtomGroup*)m_oaVectors[z*9+4];
1451
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1453
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1454
for (z4a=0;z4a<a4->GetSize();z4a++)
1456
for (z5t=0;z5t<g5->m_baAtomType.GetSize();z5t++)
1458
a5 = (CxIntArray*)g5->m_oaAtoms[z5t];
1459
for (z5a=0;z5a<a5->GetSize();z5a++)
1463
g7 = (CAtomGroup*)m_oaVectors[z*9+6];
1464
g8 = (CAtomGroup*)m_oaVectors[z*9+7];
1465
g9 = (CAtomGroup*)m_oaVectors[z*9+8];
1466
for (z7t=0;z7t<g7->m_baAtomType.GetSize();z7t++)
1468
a7 = (CxIntArray*)g7->m_oaAtoms[z7t];
1469
for (z7a=0;z7a<a7->GetSize();z7a++)
1471
for (z8t=0;z8t<g8->m_baAtomType.GetSize();z8t++)
1473
a8 = (CxIntArray*)g8->m_oaAtoms[z8t];
1474
for (z8a=0;z8a<a8->GetSize();z8a++)
1476
for (z9t=0;z9t<g9->m_baAtomType.GetSize();z9t++)
1478
a9 = (CxIntArray*)g9->m_oaAtoms[z9t];
1479
for (z9a=0;z9a<a9->GetSize();z9a++)
1481
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1482
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1483
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1484
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1485
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1486
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1488
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1489
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1490
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1491
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1492
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1493
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1495
if ((!m_iRefOrSec[2][0]) || (obs == NULL))
1496
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1497
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1498
if ((!m_iRefOrSec[2][1]) || (obs == NULL))
1499
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1500
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1501
if ((!m_iRefOrSec[2][2]) || (obs == NULL))
1502
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g9->m_baAtomType[z9t]])->GetAt(a9->GetAt(z9a)));
1503
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g9->m_baAtomType[z9t]])->GetAt(a9->GetAt(z9a)));
1510
} else // IF NOT ORTHO[2]
1512
g7 = (CAtomGroup*)m_oaVectors[z*9+6];
1513
g8 = (CAtomGroup*)m_oaVectors[z*9+7];
1514
for (z7t=0;z7t<g7->m_baAtomType.GetSize();z7t++)
1516
a7 = (CxIntArray*)g7->m_oaAtoms[z7t];
1517
for (z7a=0;z7a<a7->GetSize();z7a++)
1519
for (z8t=0;z8t<g8->m_baAtomType.GetSize();z8t++)
1521
a8 = (CxIntArray*)g8->m_oaAtoms[z8t];
1522
for (z8a=0;z8a<a8->GetSize();z8a++)
1524
if ((!m_iRefOrSec[0][0]) || (obs == NULL))
1525
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1526
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1527
if ((!m_iRefOrSec[0][1]) || (obs == NULL))
1528
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1529
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1531
if ((!m_iRefOrSec[1][0]) || (obs == NULL))
1532
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1533
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1534
if ((!m_iRefOrSec[1][1]) || (obs == NULL))
1535
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1536
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g5->m_baAtomType[z5t]])->GetAt(a5->GetAt(z5a)));
1538
if ((!m_iRefOrSec[2][0]) || (obs == NULL))
1539
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1540
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g7->m_baAtomType[z7t]])->GetAt(a7->GetAt(z7a)));
1541
if ((!m_iRefOrSec[2][1]) || (obs == NULL))
1542
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1543
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g8->m_baAtomType[z8t]])->GetAt(a8->GetAt(z8a)));
1549
} // END IF NOT ORTHO[2]
1554
} // END IF NOT ORTHO[1]
1559
} // END IF NOT ORTHO[0]
1560
} // END FOR ALL SETS
1565
void CPlDF::BuildAtomList(CSingleMolecule *ref, CSingleMolecule *obs, CxIntArray *vec)
1568
int z, z1t, z1a, z2t, z2a, z3t, z3a, z4t, z4a;
1569
CAtomGroup *g1, *g2, *g3, *g4;
1570
CxIntArray *a1, *a2, *a3, *a4;
1572
vec->RemoveAll_KeepSize();
1573
for (z=0;z<m_oaVectors.GetSize()/4;z++)
1577
g1 = (CAtomGroup*)m_oaVectors[z*4];
1578
g2 = (CAtomGroup*)m_oaVectors[z*4+1];
1579
g4 = (CAtomGroup*)m_oaVectors[z*4+3];
1581
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
1583
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
1584
for (z1a=0;z1a<a1->GetSize();z1a++)
1586
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
1588
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
1589
for (z2a=0;z2a<a2->GetSize();z2a++)
1591
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1593
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1594
for (z4a=0;z4a<a4->GetSize();z4a++)
1596
if ((!m_iRefOrSec[0]) || (obs == NULL))
1597
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1598
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1599
if ((!m_iRefOrSec[1]) || (obs == NULL))
1600
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1601
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1603
if ((!m_iRefOrSec[3]) || (obs == NULL))
1604
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1605
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1612
} else // IF NOT NORMAL
1614
g1 = (CAtomGroup*)m_oaVectors[z*4];
1615
g2 = (CAtomGroup*)m_oaVectors[z*4+1];
1616
g3 = (CAtomGroup*)m_oaVectors[z*4+2];
1617
g4 = (CAtomGroup*)m_oaVectors[z*4+3];
1619
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
1621
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
1622
for (z1a=0;z1a<a1->GetSize();z1a++)
1624
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
1626
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
1627
for (z2a=0;z2a<a2->GetSize();z2a++)
1629
for (z3t=0;z3t<g3->m_baAtomType.GetSize();z3t++)
1631
a3 = (CxIntArray*)g3->m_oaAtoms[z3t];
1632
for (z3a=0;z3a<a3->GetSize();z3a++)
1634
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1636
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1637
for (z4a=0;z4a<a4->GetSize();z4a++)
1639
if ((!m_iRefOrSec[0]) || (obs == NULL))
1640
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1641
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1642
if ((!m_iRefOrSec[1]) || (obs == NULL))
1643
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1644
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1645
if ((!m_iRefOrSec[2]) || (obs == NULL))
1646
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1647
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1648
if ((!m_iRefOrSec[3]) || (obs == NULL))
1649
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1650
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1660
} // END FOR ALL SETS
1665
void CLiDF::BuildAtomList(CSingleMolecule *ref, CSingleMolecule *obs, CxIntArray *vec)
1668
int z, z1t, z1a, z2t, z2a, z3t, z3a, z4t, z4a;
1669
CAtomGroup *g1, *g2, *g3, *g4;
1670
CxIntArray *a1, *a2, *a3, *a4;
1672
vec->RemoveAll_KeepSize();
1673
for (z=0;z<m_oaVectors.GetSize()/4;z++)
1677
g1 = (CAtomGroup*)m_oaVectors[z*4];
1678
g2 = (CAtomGroup*)m_oaVectors[z*4+1];
1679
g3 = (CAtomGroup*)m_oaVectors[z*4+2];
1680
g4 = (CAtomGroup*)m_oaVectors[z*4+3];
1682
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
1684
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
1685
for (z1a=0;z1a<a1->GetSize();z1a++)
1687
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
1689
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
1690
for (z2a=0;z2a<a2->GetSize();z2a++)
1692
for (z3t=0;z3t<g3->m_baAtomType.GetSize();z3t++)
1694
a3 = (CxIntArray*)g3->m_oaAtoms[z3t];
1695
for (z3a=0;z3a<a3->GetSize();z3a++)
1697
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1699
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1700
for (z4a=0;z4a<a4->GetSize();z4a++)
1702
if ((!m_iRefOrSec[0]) || (obs == NULL))
1703
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1704
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1705
if ((!m_iRefOrSec[1]) || (obs == NULL))
1706
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1707
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1708
if ((!m_iRefOrSec[2]) || (obs == NULL))
1709
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1710
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g3->m_baAtomType[z3t]])->GetAt(a3->GetAt(z3a)));
1711
if ((!m_iRefOrSec[3]) || (obs == NULL))
1712
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1713
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1722
} else // If not Normal
1724
g1 = (CAtomGroup*)m_oaVectors[z*4];
1725
g2 = (CAtomGroup*)m_oaVectors[z*4+1];
1726
g4 = (CAtomGroup*)m_oaVectors[z*4+3];
1728
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
1730
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
1731
for (z1a=0;z1a<a1->GetSize();z1a++)
1733
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
1735
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
1736
for (z2a=0;z2a<a2->GetSize();z2a++)
1738
for (z4t=0;z4t<g4->m_baAtomType.GetSize();z4t++)
1740
a4 = (CxIntArray*)g4->m_oaAtoms[z4t];
1741
for (z4a=0;z4a<a4->GetSize();z4a++)
1743
if ((!m_iRefOrSec[0]) || (obs == NULL))
1744
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1745
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
1746
if ((!m_iRefOrSec[1]) || (obs == NULL))
1747
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1748
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
1750
if ((!m_iRefOrSec[3]) || (obs == NULL))
1751
vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1752
else vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g4->m_baAtomType[z4t]])->GetAt(a4->GetAt(z4a)));
1760
} // END FOR ALL SETS
1765
void CRDF::BuildName()
1773
sprintf(tmp,"deriv%d_",m_iDeriv);
1774
for (z=0;z<m_oaVectors.GetSize()/2;z++)
1778
strcat(tmp,((CAtomGroup*)m_oaVectors[z*2])->m_sName);
1781
else strcat(tmp,"r_");
1782
strcat(tmp,((CAtomGroup*)m_oaVectors[z*2+1])->m_sName);
1785
else strcat(tmp,"r");
1787
if (z < (m_oaVectors.GetSize()/2)-1)
1789
else strcat(tmp,"]");
1792
try { m_sShortName = new char[strlen(tmp)+1]; } catch(...) { m_sShortName = NULL; }
1793
if (m_sShortName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1795
strcpy(m_sShortName,tmp);
1796
if (m_iShowMol != -1)
1797
sprintf(tmp,"%s_%s%d_%s_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
1798
else sprintf(tmp,"%s_%s%d_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1);
1799
strcat(tmp,m_sShortName);
1801
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
1802
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1804
strcpy(m_sName,tmp);
1810
void CDensDF::BuildName()
1816
sprintf(tmp,"%s_%s%d_%s",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,((CAtom*)g_oaAtoms[m_iCenterAtomRealType])->m_sName,m_iCenterAtom+1,(m_bDensityMass?"mass":"particle"));
1818
for (z=0;z<g_oaMolecules.GetSize();z++)
1820
if (!m_pDensityMolSelect[z])
1823
strcat(tmp,((CMolecule*)g_oaMolecules[z])->m_sName);
1824
if (!m_pDensityMolAG[z]->m_bAllAtoms)
1827
strcat(tmp,m_pDensityMolAG[z]->m_sName);
1831
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
1832
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1834
strcpy(m_sName,tmp);
1839
void CVHDF::BuildName()
1846
for (z=0;z<m_oaVectors.GetSize()/2;z++)
1850
strcat(tmp,((CAtomGroup*)m_oaVectors[z*2])->m_sName);
1853
else strcat(tmp,"r_");
1854
strcat(tmp,((CAtomGroup*)m_oaVectors[z*2+1])->m_sName);
1857
else strcat(tmp,"r");
1859
if (z < (m_oaVectors.GetSize()/2)-1)
1861
else strcat(tmp,"]");
1864
try { m_sShortName = new char[strlen(tmp)+1]; } catch(...) { m_sShortName = NULL; }
1865
if (m_sShortName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1867
strcpy(m_sShortName,tmp);
1868
if (m_iShowMol != -1)
1869
sprintf(tmp,"%s_%s%d_%s_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
1870
else sprintf(tmp,"%s_%s%d_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1);
1871
strcat(tmp,m_sShortName);
1873
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
1874
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1876
strcpy(m_sName,tmp);
1888
try { m_pRDF = new CDF(); } catch(...) { m_pRDF = NULL; }
1889
if (m_pRDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1893
m_iCombinations = 0;
1894
mprintf(WHITE,"\n>>> Radial Distribution Function >>>\n\n");
1904
if (m_iShowMol != -1)
1905
m_iRefOrSec[0] = AskRangeInteger(" Take reference atom(s) from RM %s (0) or from OM %s (1)? [0] ",0,1,0,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
1906
else m_iRefOrSec[0] = 0; // Kein OM: Nimm alles aus RM
1907
if (m_iShowMol != -1)
1908
m_iRefOrSec[1] = AskRangeInteger(" Take observed atom(s) from RM %s (0) or from OM %s (1)? [1] ",0,1,1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
1909
else m_iRefOrSec[1] = 0; // Kein OM: Nimm alles aus RM
1914
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
1915
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1918
// 1 reales + 2 virtuelle = 3 gesamt
1919
if (((CMolecule*)g_oaMolecules[(m_iRefOrSec[0])?m_iShowMol:g_iFixMol])->m_iAtomGes == 3)
1921
mprintf(" %s is only one atom, there is no choice.\n",((CMolecule*)g_oaMolecules[(m_iRefOrSec[0])?m_iShowMol:g_iFixMol])->m_sName);
1923
ag->m_pMolecule = (CMolecule*)g_oaMolecules[(m_iRefOrSec[0])?m_iShowMol:g_iFixMol];
1924
ag->AddAtom(0,0,false);
1931
mprintf(" Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
1932
inpprintf("! Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
1935
mprintf(" Which atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
1936
inpprintf("! Which atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
1939
if (strlen(buf) == 0)
1941
if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec[0])?m_iShowMol:g_iFixMol],"#2"))
1943
eprintf("Weird error.\n");
1946
} else if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec[0])?m_iShowMol:g_iFixMol],buf))
1949
m_oaVectors.Add(ag);
1950
m_iRefAtomGes += ag->m_iAtomGes;
1951
ti = ag->m_iAtomGes;
1953
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
1954
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1957
if (((CMolecule*)g_oaMolecules[(m_iRefOrSec[1])?m_iShowMol:g_iFixMol])->m_iAtomGes == 3)
1959
mprintf(" %s is only one atom, there is no choice.\n",((CMolecule*)g_oaMolecules[(m_iRefOrSec[1])?m_iShowMol:g_iFixMol])->m_sName);
1961
ag->m_pMolecule = (CMolecule*)g_oaMolecules[(m_iRefOrSec[1])?m_iShowMol:g_iFixMol];
1962
ag->AddAtom(0,0,false);
1969
mprintf(" Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
1970
inpprintf("! Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
1973
mprintf(" Which atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
1974
inpprintf("! Which atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
1978
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
1979
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
1981
if (strlen(buf) == 0)
1983
if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec[1])?m_iShowMol:g_iFixMol],"#2"))
1985
eprintf("Weird error.\n");
1988
} else if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec[1])?m_iShowMol:g_iFixMol],buf))
1991
m_oaVectors.Add(ag);
1992
m_iShowAtomGes += ag->m_iAtomGes;
1993
m_iCombinations += ti * ag->m_iAtomGes;
1996
if (AskYesNo(" Add another set of atoms to this (!) RDF (y/n)? [no] ",false))
1999
mprintf(" This yields in %d combinations.\n\n",m_iCombinations);
2006
m_fMinDist = AskFloat(" Enter the minimal radius of this RDF in pm: [0] ",0.0f);
2007
m_fMaxDist = AskFloat(" Enter the maximal radius of this RDF in pm: [%d.0] ",(float)HalfBox(),HalfBox());
2011
m_fMinDist = AskFloat(" Enter the minimal value of this d1-RDF in pm/ps: [0] ",0.0f);
2012
else m_fMinDist = AskFloat(" Enter the minimal value of this d1-RDF in pm/ps: [-10.0] ",-10.0f);
2013
m_fMaxDist = AskFloat(" Enter the maximal value of this d1-RDF in pm/ps: [10.0] ",10.0f);
2017
m_fMinDist = AskFloat(" Enter the minimal value of this d2-RDF in pm/ps^2: [0] ",0.0f);
2018
else m_fMinDist = AskFloat(" Enter the minimal value of this d2-RDF in pm/ps^2: [-10.0] ",-10.0f);
2019
m_fMaxDist = AskFloat(" Enter the maximal value of this d2-RDF in pm/ps^2: [10.0] ",10.0f);
2022
m_bAdaptive = false/*AskYesNo(" Enter binning resolution (n) or use adaptive binnig (y)? [no] ",false)*/;
2024
m_iResolution = AskUnsignedInteger(" Enter the resolution (bin count) for this RDF: [300] ",/*(int)((m_fMaxDist-m_fMinDist)/10.0f),(int)((m_fMaxDist-m_fMinDist)/10.0f)*/300);
2025
else m_iResolution = 65536;
2028
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
2029
else m_iHistogramRes = 0;
2033
if (m_iShowMol != -1)
2034
m_bRadialCorrect = AskYesNo(" Correct radial distribution for this RDF (y/n)? [yes] ",true);
2035
else m_bRadialCorrect = AskYesNo(" Correct radial distribution for this RDF (y/n)? [no] ",false);
2036
} else m_bRadialCorrect = false;
2038
if (g_bAdvanced2 && m_bRadialCorrect)
2039
m_bProbDens = AskYesNo(" Compute occurence in nm^(-3) (y) or rel. to uniform density (n)? [no] ",false);
2040
else m_bProbDens = false;
2042
if (g_bBetaFeatures)
2044
m_bLongMode = AskYesNo(" Use correction trick for longer RDFs (y/n)? [no] ",false);
2045
m_bCalcSD = AskYesNo(" Calculate standard deviation for this RDF (y/n)? [no] ",false);
2049
m_bLongMode = false;
2054
m_iSDBlocks = AskUnsignedInteger(" How many different block lenghts to use? [100] ",100);
2055
m_iSDBlockMin = AskUnsignedInteger(" Enter minimal block length in time steps: [1] ",1);
2056
if (g_iTrajSteps != -1)
2057
m_iSDBlockMax = AskUnsignedInteger(" Enter maximal block length in time steps: [%d] ",g_iTrajSteps/10,g_iTrajSteps/10);
2058
else m_iSDBlockMax = AskUnsignedInteger(" Enter maximal block length in time steps: [1000] ",1000);
2059
m_bSDVerbose = AskYesNo(" Write out correlation length extrapolation fit data for each bin (y/n)? [no] ",false);
2060
m_fSDTimesSigma = AskFloat(" Use which factor of sigma for confidence range? [3.0] ",3.0);
2061
mprintf("\n %.2f sigma leads to a confidence level of %.5f%c.\n",m_fSDTimesSigma,2.0*NormalDistIntegral(m_fSDTimesSigma)-1.0,'%');
2065
mprintf(WHITE,"\n<<< End of Radial Distribution Function <<<\n\n");
2070
void CDensDF::Parse()
2077
try { m_pDensDF = new CDF(); } catch(...) { m_pDensDF = NULL; }
2078
if (m_pDensDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2080
mprintf(WHITE,"\n>>> Density Distribution Function >>>\n\n");
2082
m_bDensityMass = AskYesNo(" Observe mass density (y) or particle density (n)? [yes] ",true);
2084
mprintf("\n Choose a reference atom around which the density will be analyzed.\n\n");
2086
// 1 reales + 2 virtuelle = 3 gesamt
2087
if (((CMolecule*)g_oaMolecules[m_iShowMol])->m_iAtomGesNoVirt == 1)
2089
mprintf(" %s is only one atom, there is no choice.\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2090
if (!ParseAtom("#2",m_iShowMol,m_iCenterAtomType,m_iCenterAtomRealType,m_iCenterAtom))
2092
eprintf("Weird error.\n");
2098
mprintf(" Which atom to take from OM %s (e.g. C1)? [#2] ",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2099
inpprintf("! Which atom to take from OM %s (e.g. C1)? [#2]\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2101
if (strlen(buf) == 0)
2103
if (!ParseAtom("#2",m_iShowMol,m_iCenterAtomType,m_iCenterAtomRealType,m_iCenterAtom))
2105
eprintf("Weird error.\n");
2108
} else if (!ParseAtom(buf,m_iShowMol,m_iCenterAtomType,m_iCenterAtomRealType,m_iCenterAtom))
2112
try { m_pDensityMolSelect = new bool[g_oaMolecules.GetSize()]; } catch(...) { m_pDensityMolSelect = NULL; }
2113
if (m_pDensityMolSelect == NULL) NewException((double)g_oaMolecules.GetSize()*sizeof(bool),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2115
try { m_pDensityMolAG = new CAtomGroup*[g_oaMolecules.GetSize()]; } catch(...) { m_pDensityMolAG = NULL; }
2116
if (m_pDensityMolAG == NULL) NewException((double)g_oaMolecules.GetSize()*sizeof(CAtomGroup*),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2118
mprintf("\n Please choose the atoms to observe:\n\n");
2120
for (z=0;z<g_oaMolecules.GetSize();z++)
2122
m = (CMolecule*)g_oaMolecules[z];
2123
m_pDensityMolSelect[z] = AskYesNo(" Consider contributions from %s (y/n)? [%s] ",!m->m_bPseudo,((CMolecule*)g_oaMolecules[z])->m_sName,m->m_bPseudo?"no":"yes");
2124
if (m_pDensityMolSelect[z])
2126
try { m_pDensityMolAG[z] = new CAtomGroup(); } catch(...) { m_pDensityMolAG[z] = NULL; }
2127
if (m_pDensityMolAG[z] == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2129
AskString(" Which atoms from %s to observe (e.g. C1-3,C6,N)? [all] ",buf,"",m->m_sName);
2130
if (strlen(buf) == 0)
2132
m_pDensityMolAG[z]->AddAllAtoms(m,false);
2133
} else if (!m_pDensityMolAG[z]->ParseAtoms(m,buf))
2140
m_fMinDist = AskFloat(" Enter the minimal radius of this Density DF in pm: [0] ",0.0f);
2141
m_fMaxDist = AskFloat(" Enter the maximal radius of this Density DF in pm: [%d.0] ",(float)HalfBox(),HalfBox());
2143
m_iResolution = AskUnsignedInteger(" Enter the resolution (bin count) for this Density DF: [300] ",300);
2146
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
2147
else m_iHistogramRes = 0;
2150
mprintf(WHITE,"\n<<< End of Density Distribution Function <<<\n\n");
2155
void CRDF::ParseCondition(int rm, CNbSearch *n, bool nbana)
2162
try { m_pRDF = new CDF(); } catch(...) { m_pRDF = NULL; }
2163
if (m_pRDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2167
m_iCombinations = 0;
2170
mprintf(WHITE,"\n>>> Distance Condition >>>\n");
2175
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2176
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2179
if (((CMolecule*)g_oaMolecules[rm])->m_iAtomGes == 3)
2181
mprintf(" %s is only one atom, there is no choice.\n",((CMolecule*)g_oaMolecules[rm])->m_sName);
2183
ag->m_pMolecule = (CMolecule*)g_oaMolecules[rm];
2184
ag->AddAtom(0,0,false);
2189
mprintf(" Which atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[rm])->m_sName);
2190
inpprintf("! Which atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[rm])->m_sName);
2192
if (strlen(buf) == 0)
2194
if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[rm],"#2"))
2196
eprintf("Weird error.\n");
2199
} else if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[rm],buf))
2202
m_oaVectors.Add(ag);
2203
m_iRefAtomGes += ag->m_iAtomGes;
2204
ti = ag->m_iAtomGes;
2206
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2207
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2210
if (((CMolecule*)g_oaMolecules[m_iShowMol])->m_iAtomGes == 3)
2212
mprintf(" %s is only one atom, there is no choice.\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2214
ag->m_pMolecule = (CMolecule*)g_oaMolecules[m_iShowMol];
2215
ag->AddAtom(0,0,false);
2220
mprintf(" Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2221
inpprintf("! Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2224
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2225
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2227
if (strlen(buf) == 0)
2229
if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[m_iShowMol],"#2"))
2231
eprintf("Weird error.\n");
2234
} else if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[m_iShowMol],buf))
2237
m_oaVectors.Add(ag);
2238
m_iShowAtomGes += ag->m_iAtomGes;
2239
m_iCombinations += ti * ag->m_iAtomGes;
2241
if (AskYesNo(" Enter another set of atoms for this condition (y/n)? [no] ",false))
2246
if (AskUnsignedInteger("\n Enter min./max. distance (0) or min./max. nearest neighbor count (1)? [0] ",0)==0)
2248
g_bEnvDisableSortNb = true;
2251
m_faMinMaxDist.Add(AskFloat(" Enter the minimal distance in pm: [0] ",0.0f));
2252
m_faMinMaxDist.Add(AskFloat(" Enter the maximal distance in pm: [400] ",400.0f));
2253
} while (AskYesNo(" Enter another distance interval (y/n)? [no] ",false));
2254
n->m_iNbCountMin = -1;
2255
n->m_iNbCountMax = -1;
2258
n->m_iNbCountMin = AskRangeInteger(" Use next neighbors from the n-th on? [1] ",0,((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize(),1)-1;
2259
n->m_iNbCountMax = AskRangeInteger(" Use next neighbors up to the n-th? [%d] ",n->m_iNbCountMin+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize(),n->m_iNbCountMin+1,n->m_iNbCountMin+1)-1;
2260
// m_faMinMaxDist.Add(0);
2261
// m_faMinMaxDist.Add(9E20f);
2265
m_faMinMaxDist.Add(0);
2266
m_faMinMaxDist.Add(1.0e30f);
2267
n->m_iNbCountMin = -2;
2268
n->m_iNbCountMax = -2;
2270
mprintf(WHITE,"\n<<< End of Distance Condition <<<\n\n");
2275
void CRDF::ParseConditionGrid(int rm, CNbSearch *n, int gridmode)
2282
try { m_pRDF = new CDF(); } catch(...) { m_pRDF = NULL; }
2283
if (m_pRDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2287
m_iCombinations = 0;
2290
mprintf(WHITE,"\n>>> Distance Condition >>>\n");
2295
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2296
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2299
if (((CMolecule*)g_oaMolecules[rm])->m_iAtomGes == 3)
2301
mprintf(" %s is only one atom, there is no choice.\n",((CMolecule*)g_oaMolecules[rm])->m_sName);
2303
ag->m_pMolecule = (CMolecule*)g_oaMolecules[rm];
2304
ag->AddAtom(0,0,false);
2309
mprintf(" Which atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[rm])->m_sName);
2310
inpprintf("! Which atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[rm])->m_sName);
2312
if (strlen(buf) == 0)
2314
if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[rm],"#2"))
2316
eprintf("Weird error.\n");
2319
} else if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[rm],buf))
2322
m_oaVectors.Add(ag);
2323
m_iRefAtomGes += ag->m_iAtomGes;
2324
ti = ag->m_iAtomGes;
2326
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2327
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2330
if (((CMolecule*)g_oaMolecules[m_iShowMol])->m_iAtomGes == 3)
2332
mprintf(" %s is only one atom, there is no choice.\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2334
ag->m_pMolecule = (CMolecule*)g_oaMolecules[m_iShowMol];
2335
ag->AddAtom(0,0,false);
2340
mprintf(" Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2341
inpprintf("! Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2344
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2345
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2347
if (strlen(buf) == 0)
2349
if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[m_iShowMol],"#2"))
2351
eprintf("Weird error.\n");
2354
} else if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[m_iShowMol],buf))
2357
m_oaVectors.Add(ag);
2358
m_iShowAtomGes += ag->m_iAtomGes;
2359
m_iCombinations += ti * ag->m_iAtomGes;
2361
if (AskYesNo(" Enter another set of atoms (y/n)? [no] ",false))
2366
if (AskUnsignedInteger("\n Enter min./max. distance (0) or min./max. nearest neighbor count (1)? [0] ",0)==0)
2368
m_faMinMaxDist.Add(AskFloat(" Enter the minimal distance in pm: [0] ",0.0f));
2369
m_faMinMaxDist.Add(AskFloat(" Enter the maximal distance in pm: [400] ",400.0f));
2370
n->m_iNbCountMin = -1;
2371
n->m_iNbCountMax = -1;
2374
n->m_iNbCountMin = AskRangeInteger(" Use next neighbors from the n-th on? [1] ",0,((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize(),1)-1;
2375
n->m_iNbCountMax = AskRangeInteger(" Use next neighbors up to the n-th? [%d] ",n->m_iNbCountMin+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize(),n->m_iNbCountMin+1,n->m_iNbCountMin+1)-1;
2376
// m_faMinMaxDist.Add(0);
2377
// m_faMinMaxDist.Add(9E20f);
2379
} else if ((gridmode == 4) || (gridmode == 5))
2381
n->m_iNbCountMin = 0;
2382
n->m_iNbCountMax = 0;
2383
// m_faMinMaxDist.Add(0);
2384
// m_faMinMaxDist.Add(9E20f);
2385
} else if (gridmode == 2)
2387
m_faMinMaxDist.Add(AskFloat(" Enter the minimal distance in pm: [0] ",0.0f));
2388
m_faMinMaxDist.Add(AskFloat(" Enter the maximal distance in pm: [400] ",400.0f));
2389
n->m_iNbCountMin = -1;
2390
n->m_iNbCountMax = -1;
2393
m_faMinMaxDist.Add(0.0f);
2394
m_faMinMaxDist.Add(400.0f);
2395
n->m_iNbCountMin = -1;
2396
n->m_iNbCountMax = -1;
2398
mprintf(WHITE,"\n<<< End of Distance Condition <<<\n\n");
2403
void CRDF::ParseCondition_OnlyValues(CNbSearch *n)
2408
mprintf(" Distance condition between ");
2409
for (z=0;z<m_oaVectors.GetSize()/2;z++)
2411
mprintf("%s and %s",((CAtomGroup*)m_oaVectors[z*2])->m_sName,((CAtomGroup*)m_oaVectors[z*2+1])->m_sName);
2412
if (z < (m_oaVectors.GetSize()/2)-1)
2416
if (n->m_iNbCountMin == -1)
2418
for (z=0;z<m_faMinMaxDist.GetSize()/2;z++)
2420
mprintf(" Interval %d:\n",z+1,m_faMinMaxDist.GetSize()/2);
2421
m_faMinMaxDist[z*2] = AskFloat(" Enter the minimal distance in pm: [0] ",0.0f);
2422
m_faMinMaxDist[z*2+1] = AskFloat(" Enter the maximal distance in pm: [400] ",400.0f);
2426
n->m_iNbCountMin = AskRangeInteger(" Use next neighbors from the n-th on? [1] ",0,((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize(),1)-1;
2427
n->m_iNbCountMax = AskRangeInteger(" Use next neighbors up to the n-th? [%d] ",n->m_iNbCountMin+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize(),n->m_iNbCountMin+1,n->m_iNbCountMin+1)-1;
2441
try { m_pVHDF = new C2DF(); } catch(...) { m_pVHDF = NULL; }
2442
if (m_pVHDF == NULL) NewException((double)sizeof(C2DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2446
m_iCombinations = 0;
2447
mprintf(WHITE,"\n>>> Van Hove Correlation Function >>>\n\n");
2448
if (m_iShowMol != -1)
2450
m_iRefOrSec[0] = AskRangeInteger(" Take (fixed) reference atom(s) from RM %s (0) or from OM %s (1)? [0] ",0,1,0,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2451
m_iRefOrSec[1] = AskRangeInteger(" Take (moving) observed atom(s) from RM %s (0) or from OM %s (1)? [1] ",0,1,1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2452
} else // Kein OM: Nimm alles aus RM
2460
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2461
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2466
mprintf(" Which (fixed) reference atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2467
inpprintf("! Which (fixed) reference atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2470
mprintf(" Which (fixed) reference atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
2471
inpprintf("! Which (fixed) reference atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
2474
if (strlen(buf) == 0)
2476
if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec[0])?m_iShowMol:g_iFixMol],"#2"))
2478
} else if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec[0])?m_iShowMol:g_iFixMol],buf))
2480
m_oaVectors.Add(ag);
2481
m_iRefAtomGes += ag->m_iAtomGes;
2482
ti = ag->m_iAtomGes;
2484
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2485
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2490
mprintf(" Which (moving) observed atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2491
inpprintf("! Which (moving) observed atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2494
mprintf(" Which (moving) observed atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
2495
inpprintf("! Which (moving) observed atom(s) to take from RM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
2499
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2500
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2502
if (strlen(buf) == 0)
2504
if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec[1])?m_iShowMol:g_iFixMol],"#2"))
2506
} else if (!ag->ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec[1])?m_iShowMol:g_iFixMol],buf))
2508
m_oaVectors.Add(ag);
2509
m_iShowAtomGes += ag->m_iAtomGes;
2510
m_iCombinations += ti * ag->m_iAtomGes;
2513
if (AskYesNo(" Enter another set of atoms (y/n)? [no] ",false))
2516
m_fMinDist = 0; //AskFloat(" Enter the minimal radius of this VHCF in pm: [0] ",0.0f);
2517
m_fMaxDist = AskFloat(" Enter the radius of this VHCF in pm: [%d.0] ",(float)HalfBox(),HalfBox());
2518
m_iResolution = AskUnsignedInteger(" Enter the radial resolution of this VHCF: [100] ",100);
2519
m_bRadialCorrect = AskYesNo(" Correct radial distribution for this VHCF (y/n)? [%s] ",!m_bSelf,m_bSelf?"no":"yes");
2522
if (g_iTrajSteps != -1)
2523
m_iDepth = AskUnsignedInteger(" Enter the temporal resolution (time depth) of this VHCF (in time steps): [%d] ",int(g_iTrajSteps*0.75),int(g_iTrajSteps*0.75));
2524
else m_iDepth = AskUnsignedInteger(" Enter the temporal resolution (time depth) of this VHCF (in time steps): [5000] ",5000);
2526
mprintf("\n This will occupy %s of RAM.\n",FormatBytes((double)m_iDepth*g_iGesVirtAtomCount*3.0*sizeof(float)));
2527
if (m_iDepth*g_iGesVirtAtomCount*3.0*sizeof(float)/1024.0f/1024.0f >= 1000.0f)
2528
if (!AskYesNo(" Make sure that enough free RAM is available. Continue (y/n)? [yes] ",true))
2533
m_iStride = AskUnsignedInteger(" Take each n-th time step for the temporal axis? [%d] ",max(1,m_iDepth/100),max(1,m_iDepth/100));
2535
mprintf("\n This results in a plot resolution of %d on the temporal axis.\n",m_iDepth/m_iStride);
2537
if (m_iDepth/m_iStride > 200)
2540
if (!AskYesNo(" The resolution seems quite high, the plot will take much time to render. Contiune (y/n)? [yes] ",true))
2547
m_bSwapAxes = AskYesNo(" Put distance on X axis and time on Y axis (y) or swap axes (n)? [yes] ",true);
2548
m_iGraceBunchTime = AskUnsignedInteger(" How many time graphs do you want do draw in the distance grace stack (0=disable)? [10] ",10);
2549
m_iGraceBunchDist = AskUnsignedInteger(" How many distance graphs do you want do draw in the time grace stack (0=disable)? [10] ",10);
2553
m_iGraceBunchTime = 0;
2554
m_iGraceBunchDist = 0;
2558
mprintf(WHITE,"\n<<< End of Van Hove Correlation Function <<<\n\n");
2571
try { m_pADF = new CDF(); } catch(...) { m_pADF = NULL; }
2572
if (m_pADF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2574
mprintf(WHITE,"\n>>> Angular Distribution Function >>>\n\n");
2577
m_iVecType[z] = AskRangeInteger(" Should the %d. vector depict position (1), dipole (2), velocity (3) or force (4)? [1] ",1,4,1,z+1) - 1;
2578
if (m_iVecType[z] == 1)
2585
m_iCombinations = 0;
2589
mprintf("\n %d. set of vectors\n\n",z2+1);
2592
if (m_iVecType[z] == 0) // Position
2595
if ((z == 1) && (m_iVecType[0] == 0) && (m_iVecType[1] == 0))
2596
m_bSameFoot = AskYesNo(" Should the base points of the 1st and 2nd vectors always be equal (y/n)? [no] ",false);
2597
else m_bSameFoot = false;*/
2600
m_bOrtho[z] = (AskRangeInteger("\n Should the %d. vector connect 2 points (0) or stand perpendicular to 3 points (1)? [0] ",0,1,0,z+1) != 0);
2605
/* if (m_bSameFoot && (z == 1))
2607
m_iRefOrSec[1][0] = m_iRefOrSec[0][0];
2608
m_oaVectors.Add(NULL);
2613
if (m_iShowMol != -1)
2614
m_iRefOrSec[z][0] = AskRangeInteger(" Take atom(s) at the base point from RM %s (0) or from OM %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
2615
else m_iRefOrSec[z][0] = 0;
2617
mprintf(" Please enter the atom(s) at the base point (e.g. C7): ");
2618
inpprintf("! Please enter the atom(s) at the base point (e.g. C7):\n");
2621
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2622
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2624
if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2626
eprintf("Wrong input.\n");
2627
inpprintf("! Wrong input.\n");
2631
m_oaVectors.Add(ag);
2632
ti *= ag->m_iAtomGes;
2636
if (m_iShowMol != -1)
2637
m_iRefOrSec[z][1] = AskRangeInteger(" Take 2nd atom(s) of normal plane from RM %s (0) or from OM %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
2638
else m_iRefOrSec[z][1] = 0;
2640
mprintf(" Please enter the 2nd atom(s) of the normal plane (e.g. C7): ");
2641
inpprintf("! Please enter the 2nd atom(s) of the normal plane (e.g. C7):\n");
2644
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2645
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2647
if (!ag->ParseAtoms((!m_iRefOrSec[z][1])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2649
eprintf("Wrong input.\n");
2650
inpprintf("! Wrong input.\n");
2654
m_oaVectors.Add(ag);
2655
ti *= ag->m_iAtomGes;
2658
if (m_iShowMol != -1)
2659
m_iRefOrSec[z][2] = AskRangeInteger(" Take 3rd atom(s) of normal plane from RM %s (0) or from OM %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
2660
else m_iRefOrSec[z][2] = 0;
2662
mprintf(" Please enter the 3rd atom(s) of the normal plane (e.g. C7): ");
2663
inpprintf("! Please enter the 3rd atom(s) of the normal plane (e.g. C7):\n");
2666
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2667
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2669
if (!ag->ParseAtoms((!m_iRefOrSec[z][2])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2671
eprintf("Wrong input.\n");
2672
inpprintf("! Wrong input.\n");
2676
m_oaVectors.Add(ag);
2677
ti *= ag->m_iAtomGes;
2680
/* if (m_bSameFoot && (z == 1))
2682
m_iRefOrSec[1][0] = m_iRefOrSec[0][0];
2683
m_oaVectors.Add(NULL);
2688
if (m_iShowMol != -1)
2689
m_iRefOrSec[z][0] = AskRangeInteger(" Take atom(s) at the base point from RM %s (0) or from OM %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
2690
else m_iRefOrSec[z][0] = 0;
2692
mprintf(" Please enter the atom(s) at the base point (e.g. C7): ");
2693
inpprintf("! Please enter the atom(s) at the base point (e.g. C7):\n");
2696
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2697
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2699
if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2701
eprintf("Wrong input.\n");
2702
inpprintf("! Wrong input.\n");
2706
m_oaVectors.Add(ag);
2707
ti *= ag->m_iAtomGes;
2708
} // END IF NOT SAMEFOOT
2711
if (m_iShowMol != -1)
2712
m_iRefOrSec[z][1] = AskRangeInteger(" Take atom(s) at the tip point from RM %s (0) or from OM %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
2713
else m_iRefOrSec[z][1] = 0;
2715
mprintf(" Please enter the atom(s) at the tip point (e.g. C7): ");
2716
inpprintf("! Please enter the atom(s) at the tip point (e.g. C7):\n");
2719
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2720
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2722
if (!ag->ParseAtoms((!m_iRefOrSec[z][1])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2724
eprintf("Wrong input.\n");
2725
inpprintf("! Wrong input.\n");
2729
m_oaVectors.Add(ag);
2730
ti *= ag->m_iAtomGes;
2731
m_oaVectors.Add(NULL);
2732
} // END IF NOT ORTHO
2733
} else if (m_iVecType[z] == 1) // Dipol
2735
if (m_iShowMol != -1)
2736
m_iRefOrSec[z][0] = AskRangeInteger(" Take dipole vector from RM %s (0) or from OM %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
2737
else m_iRefOrSec[z][0] = 0;
2738
} else if (m_iVecType[z] == 2) // Geschwindigkeit
2740
_ax6: if (m_iShowMol != -1)
2741
m_iRefOrSec[z][0] = AskRangeInteger(" Take velocity vector from RM %s (0) or from OM %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
2742
else m_iRefOrSec[z][0] = 0;
2743
mprintf(" Velocity vector of which atoms to use (e.g. C7)? [#2] ");
2744
inpprintf("! Velocity vector of which atoms to use (e.g. C7)? [#2]\n");
2747
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2748
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2752
if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],"#2"))
2754
eprintf("Weird error.\n");
2755
inpprintf("! Weird error.\n");
2758
} else if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2760
eprintf("Wrong input.\n");
2761
inpprintf("! Wrong input.\n");
2765
m_oaVectors.Add(ag);
2766
ti *= ag->m_iAtomGes;
2767
} else if (m_iVecType[z] == 3) // Kraft
2769
_ax7: if (m_iShowMol != -1)
2770
m_iRefOrSec[z][0] = AskRangeInteger(" Take force vektor from RM %s (0) or from OM %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
2771
else m_iRefOrSec[z][0] = 0;
2772
mprintf(" Force vector of which atoms to use (e.g. C7)? [#2] ");
2773
inpprintf("! Force vector of which atoms to use (e.g. C7)? [#2]\n");
2776
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2777
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2781
if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],"#2"))
2783
eprintf("Weird Error.\n");
2784
inpprintf("! Weird Error.\n");
2787
} else if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2789
eprintf("Wrong input.\n");
2790
inpprintf("! Wrong input.\n");
2794
m_oaVectors.Add(ag);
2795
ti *= ag->m_iAtomGes;
2799
m_iCombinations += ti;
2800
} while (g_bAdvanced2?AskYesNo("\n Add another set of vectors to this (!) ADF (y/n)? [no] ",false):false);
2809
m_fMinAngle = AskFloat(" Enter minimal angle between the vectors: [0 deg] ",0.0f);
2810
if (m_fMinAngle < 0)
2812
eprintf(" Angles < 0 degree are not defined.\n");
2815
m_fMaxAngle = AskFloat(" Enter maximal angle between the vectors: [180 deg] ",180.0f);
2819
m_fMinAngle = AskFloat(" Enter the minimal value of this d1-ADF in deg/ps: [0] ",0.0f);
2820
else m_fMinAngle = AskFloat(" Enter the minimal value of this d1-ADF in deg/ps: [-10.0] ",-10.0f);
2821
m_fMaxAngle = AskFloat(" Enter the maximal value of this d1-ADF in deg/ps: [10.0] ",10.0f);
2825
m_fMinAngle = AskFloat(" Enter the minimal value of this d2-ADF in deg/ps^2: [0] ",0.0f);
2826
else m_fMinAngle = AskFloat(" Enter the minimal value of this d2-ADF in deg/ps^2: [-10.0] ",-10.0f);
2827
m_fMaxAngle = AskFloat(" Enter the maximal value of this d2-ADF in deg/ps^2: [10.0] ",10.0f);
2831
/* if (m_fMaxAngle <= 90.0f)
2832
m_bFoldAngle = AskYesNo(" Should angles > 90 deg be \"mirrored\" (180 deg = 0 deg) (y/n)? [yes] ",true);
2833
else*/ m_bFoldAngle = false;
2834
m_bCosine = (AskRangeInteger(" Plot ADF against angle (0) or against cosine (1)? [0] ",0,1,0)!=0);
2837
m_fMinAngle = (float)cos(m_fMinAngle/180.0*Pi);
2838
m_fMaxAngle = (float)cos(m_fMaxAngle/180.0*Pi);
2839
if (m_fMinAngle > m_fMaxAngle)
2842
m_fMinAngle = m_fMaxAngle;
2845
mprintf(" The data range is %.2f to %.2f.\n",m_fMinAngle,m_fMaxAngle);
2848
m_bMirror = AskYesNo(" Force this ADF to be mirror-symmetric to the 90 deg line (y/n)? [no] ",false);
2849
else m_bMirror = false;
2850
m_iResolution = AskUnsignedInteger(" Please enter the resolution (bin count) for this ADF: [100] ",100);
2853
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
2854
else m_iHistogramRes = 0;
2856
if (m_iShowMol != -1)
2857
m_bStat = AskYesNo(" Apply cone correction (y/n)? [%c] ",!m_bCosine,(!m_bCosine)?'y':'n');
2859
/* mprintf("\n Save temporal development of this ADF (0=nein, 1=ja)? [0] ");
2861
m_bSaveAngle = (atoi(buf)!=0);*/
2863
mprintf(WHITE,"\n<<< End of Angular Distribution Function <<<\n\n");
2876
try { m_pDDF = new CDF(); } catch(...) { m_pDDF = NULL; }
2877
if (m_pDDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2879
mprintf(WHITE,"\n>>> Dihedral Distribution Function >>>\n\n");
2880
m_bClassical = AskYesNo(" Use \"simple\" (y) (4 atoms) or \"generalized\" (n) (3 vectors) Dihedrals? [yes] ",true);
2882
m_iCombinations = 1;
2885
m_bOrtho[0] = false;
2886
m_bOrtho[1] = false;
2887
m_bOrtho[2] = false;
2888
z0 = m_oaVectors.GetSize();
2891
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2892
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2894
m_oaVectors.Add(ag);
2896
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2897
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2899
m_oaVectors.Add(ag);
2900
m_oaVectors.Add(NULL);
2904
_bx: if (m_iShowMol != -1)
2905
i = AskRangeInteger(" Take the %d. atom from RM %s (0) or from OM %s (1)? [0] ",0,1,0,z+1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2910
m_iRefOrSec[0][1] = i;
2913
m_iRefOrSec[0][0] = i;
2914
m_iRefOrSec[2][0] = i;
2917
m_iRefOrSec[2][1] = i;
2918
m_iRefOrSec[1][0] = i;
2921
m_iRefOrSec[1][1] = i;
2924
mprintf(" Enter the %d. atom(s) (e.g. C7): ",z+1);
2925
inpprintf("! Enter the %d. atom(s) (e.g. C7):\n",z+1);
2930
if (!((CAtomGroup*)m_oaVectors[z0+0*3+1])->ParseAtoms((!m_iRefOrSec[0][1])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2932
eprintf("Wrong input.\n");
2933
inpprintf("! Wrong input.\n");
2936
m_iCombinations *= ((CAtomGroup*)m_oaVectors[z0+0*3+1])->m_iAtomGes;
2939
if (!((CAtomGroup*)m_oaVectors[z0+0*3+0])->ParseAtoms((!m_iRefOrSec[0][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2941
eprintf("Wrong input.\n");
2942
inpprintf("! Wrong input.\n");
2945
if (!((CAtomGroup*)m_oaVectors[z0+2*3+0])->ParseAtoms((!m_iRefOrSec[2][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2947
eprintf("Wrong input.\n");
2948
inpprintf("! Wrong input.\n");
2951
m_iCombinations *= ((CAtomGroup*)m_oaVectors[z0+0*3+0])->m_iAtomGes;
2952
m_iCombinations *= ((CAtomGroup*)m_oaVectors[z0+0*3+0])->m_iAtomGes;
2955
if (!((CAtomGroup*)m_oaVectors[z0+2*3+1])->ParseAtoms((!m_iRefOrSec[2][1])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2957
eprintf("Wrong input.\n");
2958
inpprintf("! Wrong input.\n");
2961
if (!((CAtomGroup*)m_oaVectors[z0+1*3+0])->ParseAtoms((!m_iRefOrSec[1][0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2963
eprintf("Wrong input.\n");
2964
inpprintf("! Wrong input.\n");
2967
m_iCombinations *= ((CAtomGroup*)m_oaVectors[z0+2*3+1])->m_iAtomGes;
2968
m_iCombinations *= ((CAtomGroup*)m_oaVectors[z0+2*3+1])->m_iAtomGes;
2971
if (!((CAtomGroup*)m_oaVectors[z0+1*3+1])->ParseAtoms((!m_iRefOrSec[1][1])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
2973
eprintf("Wrong input.\n");
2974
inpprintf("! Wrong input.\n");
2977
m_iCombinations *= ((CAtomGroup*)m_oaVectors[z0+1*3+1])->m_iAtomGes;
2981
} else // NONCLASSIC
2983
mprintf("\nYou now have to define 3 vectors:\n");
2984
mprintf("The 1st and 2nd vector are projected onto the normal plane of the 3rd vector.\n");
2985
mprintf("The angle between the two projected vectors in the plane is evaluated.\n");
2988
mprintf(WHITE,"\n * Vector %d\n",z+1);
2989
m_bOrtho[z] = (AskRangeInteger(" Shall the %d. vector connect 2 points (0) or be orthogonal to a plane (1)? [0] ",0,1,0,z+1) != 0);
2992
for (z2=0;z2<3;z2++)
2994
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
2995
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
2997
_by: if (m_iShowMol != -1)
2998
m_iRefOrSec[z][z2] = AskRangeInteger(" Take the %d. atom(s) of the plane from RM %s (0) or from OM %s (1)? [0] ",0,1,0,z2+1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
2999
else m_iRefOrSec[z][z2] = 0;
3000
mprintf(" Please enter the %d. atom(s) (e.g. C7): ",z2+1);
3001
inpprintf("! Please enter the %d. atom(s) (e.g. C7):\n",z2+1);
3003
if (!ag->ParseAtoms((!m_iRefOrSec[z][z2])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3005
eprintf("Wrong input.\n");
3006
inpprintf("! Wrong input.\n");
3009
m_iCombinations *= ag->m_iAtomGes;
3010
m_oaVectors.Add(ag);
3014
for (z2=0;z2<2;z2++)
3016
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
3017
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3019
_bz: if (m_iShowMol != -1)
3020
m_iRefOrSec[z][z2] = AskRangeInteger(" Take the %d. atom(s) of the vector from RM %s (0) or from OM %s (1)? [0] ",0,1,0,z2+1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3021
else m_iRefOrSec[z][z2] = 0;
3022
mprintf(" Please enter the %d. atom(s) (e.g. C7): ",z2+1);
3023
inpprintf("! Please enter the %d. atom(s) (e.g. C7):\n",z2+1);
3025
if (!ag->ParseAtoms((!m_iRefOrSec[z][z2])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3027
eprintf("Wrong input.\n");
3028
inpprintf("! Wrong input.\n");
3031
m_iCombinations *= ag->m_iAtomGes;
3032
m_oaVectors.Add(ag);
3034
m_oaVectors.Add(NULL);
3037
} // END IF NONCLASSIC
3040
mprintf(" The \"classical\" dihedral angle is defined for a range of 0 ... 180 deg.\n\n");
3041
m_bAbs = !AskYesNo(" Do you want to extend the range to -180 ... +180 deg (y/n)? [no] ",false);*/
3044
mprintf(" Per default, the dihedral angle is defined in a range of -180 ... 180 deg.\n\n");
3045
m_bPositive = AskYesNo(" Use range of 0 ... 360 deg instead (e.g. -90 deg becomes 270 deg, ...) (y/n)? [no] ",false);
3056
m_fMinAngle = AskFloat("\n Enter minimal dihedral angle to observe: [0 deg] ",0);
3057
m_fMaxAngle = AskFloat(" Enter maximal dihedral angle to observe: [360 deg] ",360.0f);
3060
m_fMinAngle = AskFloat("\n Enter minimal dihedral angle to observe: [-180 deg] ",-180.0f);
3061
m_fMaxAngle = AskFloat(" Enter maximal dihedral angle to observe: [180 deg] ",180.0f);
3066
m_fMinAngle = AskFloat(" Enter the minimal value of this d1-DDF in deg/ps: [0] ",0.0f);
3067
else m_fMinAngle = AskFloat(" Enter the minimal value of this d1-DDF in deg/ps: [-10.0] ",-10.0f);
3068
m_fMaxAngle = AskFloat(" Enter the maximal value of this d1-DDF in deg/ps: [10.0] ",10.0f);
3072
m_fMinAngle = AskFloat(" Enter the minimal value of this d2-DDF in deg/ps^2: [0] ",0.0f);
3073
else m_fMinAngle = AskFloat(" Enter the minimal value of this d2-DDF in deg/ps^2: [-10.0] ",-10.0f);
3074
m_fMaxAngle = AskFloat(" Enter the maximal value of this d2-DDF in deg/ps^2: [10.0] ",10.0f);
3080
m_bCosine = (AskRangeInteger(" Plot DDF against angle (0) or against cosine (1)? [0] ",0,1,0) != 0);
3083
if ((m_fMinAngle <= 0) && (m_fMaxAngle >= 0))
3085
if (fabsf(m_fMinAngle) > fabsf(m_fMaxAngle))
3086
m_fMinAngle = cosf(fabsf(m_fMinAngle));
3087
else m_fMinAngle = cosf(fabsf(m_fMaxAngle));
3045
m_fMinAngle = AskFloat("\n Enter minimal dihedral angle to observe: [-180 deg] ",-180.0f);
3046
m_fMaxAngle = AskFloat(" Enter maximal dihedral angle to observe: [180 deg] ",180.0f);
3051
m_fMinAngle = AskFloat(" Enter the minimal value of this d1-DDF in deg/ps: [0] ",0.0f);
3052
else m_fMinAngle = AskFloat(" Enter the minimal value of this d1-DDF in deg/ps: [-10.0] ",-10.0f);
3053
m_fMaxAngle = AskFloat(" Enter the maximal value of this d1-DDF in deg/ps: [10.0] ",10.0f);
3057
m_fMinAngle = AskFloat(" Enter the minimal value of this d2-DDF in deg/ps^2: [0] ",0.0f);
3058
else m_fMinAngle = AskFloat(" Enter the minimal value of this d2-DDF in deg/ps^2: [-10.0] ",-10.0f);
3059
m_fMaxAngle = AskFloat(" Enter the maximal value of this d2-DDF in deg/ps^2: [10.0] ",10.0f);
3065
m_bCosine = (AskRangeInteger(" Plot DDF against angle (0) or against cosine (1)? [0] ",0,1,0) != 0);
3068
m_fMinAngle = (float)cos(m_fMinAngle/180.0*Pi);
3069
m_fMaxAngle = (float)cos(m_fMaxAngle/180.0*Pi);
3070
if (m_fMinAngle > m_fMaxAngle)
3073
m_fMinAngle = m_fMaxAngle;
3078
mprintf("\n The data range is %.2f to %.2f.\n\n",m_fMinAngle,m_fMaxAngle);
3081
/* m_bAbs = AskYesNo(" Use absolute angle values (y) or signed values (n)? [yes] ",true);
3084
m_fMinAngle = -m_fMaxAngle;
3085
mprintf("\n The data range is %.2f to %.2f.\n\n",m_fMinAngle,m_fMaxAngle);
3086
m_bSymm = AskYesNo(" Force this DDF to be symmetrical to the 0 degree line (y/n)? [no] ",false);
3087
} else m_bSymm = false;*/
3090
// m_fMinAngle = -m_fMaxAngle;
3091
mprintf("\n The data range is %.2f to %.2f.\n\n",m_fMinAngle,m_fMaxAngle);
3093
m_bSymm = AskYesNo(" Add also bin entries for inverse angles (force symmetry) (y/n)? [no] ",false);
3094
else m_bSymm = false;
3095
// } else m_bSymm = false;
3103
m_iResolution = AskUnsignedInteger(" Please enter binning resolution for this DDF: [100] ",100);
3106
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
3107
else m_iHistogramRes = 0;
3109
/* mprintf("\n Save temporal Development of Dihedrals (0=no, 1=yes)? [0] ");
3111
m_bSaveAngle = atoi(buf)!=0;*/
3113
mprintf(WHITE,"\n<<< End of Dihedral Distribution Function <<<\n\n");
3125
try { m_pPlDF = new CDF(); } catch(...) { m_pPlDF = NULL; }
3126
if (m_pPlDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3128
mprintf(WHITE,"\n>>> Plane Distance Distribution Function >>>\n\n");
3130
m_bNormal = !AskYesNo(" Define plane via 3 atoms (y) or as normal plane of a vector (n) (y/n)? [yes] ",true);
3132
m_iCombinations = 1;
3135
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
3136
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3138
if (m_iShowMol != -1)
3139
m_iRefOrSec[0] = AskRangeInteger(" Take the base atom of the vector/plane from RM %s (0) or from OM %s (1)? [0] ",0,1,0,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3140
else m_iRefOrSec[0] = 0;
3141
mprintf(" Please enter the base atom (e.g. C7): ");
3142
inpprintf("! Please enter the base atom (e.g. C7):\n");
3144
if (!ag->ParseAtoms((!m_iRefOrSec[0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3146
eprintf("Wrong input.\n");
3147
inpprintf("! Wrong input.\n");
3150
m_iCombinations *= ag->m_iAtomGes;
3151
m_oaVectors.Add(ag);
3153
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
3154
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3156
if (m_iShowMol != -1)
3157
m_iRefOrSec[1] = AskRangeInteger(" Take the atom at the tip of the vector from RM %s (0) or from OM %s (1)? [0] ",0,1,0,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3158
else m_iRefOrSec[1] = 0;
3159
mprintf(" Please enter the tip atom (e.g. C7): ");
3160
inpprintf("! Please enter the tip atom (e.g. C7):\n");
3162
if (!ag->ParseAtoms((!m_iRefOrSec[1])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3164
eprintf("Wrong input.\n");
3165
inpprintf("! Wrong input.\n");
3168
m_iCombinations *= ag->m_iAtomGes;
3169
m_oaVectors.Add(ag);
3170
m_oaVectors.Add(NULL); // Dummy placeholder
3175
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
3176
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3178
if (m_iShowMol != -1)
3179
m_iRefOrSec[z] = AskRangeInteger(" Take the %d. atom(s) of the plane from RM %s (0) or from OM %s (1)? [0] ",0,1,0,z+1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3180
else m_iRefOrSec[z] = 0;
3181
mprintf(" Please enter the %d. atom (e.g. C7): ",z+1);
3182
inpprintf("! Please enter the %d. atom (e.g. C7):\n",z+1);
3184
if (!ag->ParseAtoms((!m_iRefOrSec[z])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3186
eprintf("Wrong input.\n");
3187
inpprintf("! Wrong input.\n");
3190
m_iCombinations *= ag->m_iAtomGes;
3191
m_oaVectors.Add(ag);
3194
mprintf(" Plane defined.\n\n");
3196
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
3197
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3199
if (m_iShowMol != -1)
3200
m_iRefOrSec[3] = AskRangeInteger(" Take the atom(s) to observe from RM %s (0) or from OM %s (1)? [0] ",0,1,0,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3201
else m_iRefOrSec[3] = 0;
3202
mprintf(" Please enter the atom(s) to observe (e.g. C7): ");
3203
inpprintf("! Please enter the atom(s) to observe (e.g. C7):\n");
3205
if (!ag->ParseAtoms((!m_iRefOrSec[3])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3207
eprintf("Wrong input.\n");
3208
inpprintf("! Wrong input.\n");
3211
m_iCombinations *= ag->m_iAtomGes;
3212
m_oaVectors.Add(ag);
3214
m_fMinDist = AskFloat(" Enter the minimal distance to observe (in pm): [-%d.0] ",(float)-HalfBox(),HalfBox());
3215
m_fMaxDist = AskFloat(" Enter the maximal distance to observe (in pm): [%d.0] ",(float)HalfBox(),HalfBox());
3217
m_iResolution = AskUnsignedInteger(" Please enter binning resolution for this PlDF: [100] ",100);
3220
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
3221
else m_iHistogramRes = 0;
3224
mprintf(WHITE,"\n<<< End of Plane Distance Distribution Function <<<\n\n");
3236
try { m_pLiDF = new CDF(); } catch(...) { m_pLiDF = NULL; }
3237
if (m_pLiDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3239
mprintf(WHITE,"\n>>> Line Distance Distribution Function >>>\n\n");
3241
m_bNormal = !AskYesNo(" Define line via 2 atoms (y) or as normal vector of a plane (n) (y/n)? [yes] ",true);
3243
m_iCombinations = 1;
3246
mprintf("\n The line will pass through the 1st point of the plane.\n\n");
3249
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
3250
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3252
if (m_iShowMol != -1)
3253
m_iRefOrSec[z] = AskRangeInteger(" Take the %d. atom(s) of the plane from RM %s (0) or from OM %s (1)? [0] ",0,1,0,z+1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3254
else m_iRefOrSec[z] = 0;
3255
mprintf(" Please enter the %d. atom (e.g. C7): ",z+1);
3256
inpprintf("! Please enter the %d. atom (e.g. C7):\n",z+1);
3258
if (!ag->ParseAtoms((!m_iRefOrSec[z])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3260
eprintf("Wrong input.\n");
3261
inpprintf("! Wrong input.\n");
3264
m_iCombinations *= ag->m_iAtomGes;
3265
m_oaVectors.Add(ag);
3271
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
3272
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3274
if (m_iShowMol != -1)
3275
m_iRefOrSec[z] = AskRangeInteger(" Take the %d. atom(s) of the line from RM %s (0) or from OM %s (1)? [0] ",0,1,0,z+1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3276
else m_iRefOrSec[z] = 0;
3277
mprintf(" Please enter the %d. atom (e.g. C7): ",z+1);
3278
inpprintf("! Please enter the %d. atom (e.g. C7):\n",z+1);
3280
if (!ag->ParseAtoms((!m_iRefOrSec[z])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3282
eprintf("Wrong input.\n");
3283
inpprintf("! Wrong input.\n");
3286
m_iCombinations *= ag->m_iAtomGes;
3287
m_oaVectors.Add(ag);
3289
m_oaVectors.Add(NULL);
3292
mprintf(" Line defined.\n\n");
3294
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
3295
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3297
if (m_iShowMol != -1)
3298
m_iRefOrSec[3] = AskRangeInteger(" Take the atom(s) to observe from RM %s (0) or from OM %s (1)? [0] ",0,1,0,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3299
else m_iRefOrSec[3] = 0;
3300
mprintf(" Please enter the atom(s) to observe (e.g. C7): ");
3301
inpprintf("! Please enter the atom(s) to observe (e.g. C7):\n");
3303
if (!ag->ParseAtoms((!m_iRefOrSec[3])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3305
eprintf("Wrong input.\n");
3306
inpprintf("! Wrong input.\n");
3309
m_iCombinations *= ag->m_iAtomGes;
3310
m_oaVectors.Add(ag);
3312
m_fMinDist = AskFloat(" Enter the minimal distance to observe (in pm): [0] ",0.0f);
3313
m_fMaxDist = AskFloat(" Enter the maximal distance to observe (in pm): [%d.0] ",(float)HalfBox(),HalfBox());
3315
m_iResolution = AskUnsignedInteger(" Please enter binning resolution for this LiDF: [100] ",100);
3318
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
3319
else m_iHistogramRes = 0;
3321
if (m_iShowMol != -1)
3322
m_bRadialCorrect = AskYesNo(" Correct radial distribution for this LiDF (y/n)? [yes] ",true);
3323
else m_bRadialCorrect = AskYesNo(" Correct radial distribution for this LiDF (y/n)? [no] ",false);
3326
mprintf(WHITE,"\n<<< End of Line Distance Distribution Function <<<\n\n");
3331
void CDipDF::Parse()
3335
double td, td2, td3;
3337
CSingleMolecule *sm;
3342
try { m_pDipoleDF = new CDF(); } catch(...) { m_pDipoleDF = NULL; }
3343
if (m_pDipoleDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3345
mprintf(WHITE,"\n>>> Dipole Distribution Function >>>\n\n");
3346
if (m_iShowMol != -1)
3347
m_iRefOrSec = AskRangeInteger(" Observe dipole moment from RM %s (0) or from OM %s (1)? [0] ",0,1,0,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3348
else m_iRefOrSec = 0;
3352
if (m_iRefOrSec != 0)
3353
m = (CMolecule*)g_oaMolecules[m_iShowMol];
3354
else m = (CMolecule*)g_oaMolecules[g_iFixMol];
3359
for (z=0;z<m->m_laSingleMolIndex.GetSize();z++)
3361
sm = (CSingleMolecule*)g_oaSingleMolecules[m->m_laSingleMolIndex[z]];
3362
tf = sm->m_vDipole.GetLength();
3369
td3 /= (double)m->m_laSingleMolIndex.GetSize();
3371
mprintf("\n Dipole moment of %s (1st step): Min. %.3f, Max. %.3f, Avg. %.3f Debye.\n\n",m->m_sName,td2,td,td3);
3376
m_fDipoleMin = AskFloat(" Enter the lower bound for dipole values (in Debye): [0] ",0.0f);
3377
m_fDipoleMax = AskFloat(" Enter the upper bound for dipole values (in Debye): [%d] ",float(int(td*2.0)),int(td*2.0));
3381
m_fDipoleMin = AskFloat(" Enter the minimal value of this d1-DDF in Debye/ps: [0] ",0.0f);
3382
else m_fDipoleMin = AskFloat(" Enter the minimal value of this d1-DDF in Debye/ps: [-10.0] ",-10.0f);
3383
m_fDipoleMax = AskFloat(" Enter the maximal value of this d1-DDF in Debye/ps: [10.0] ",10.0f);
3387
m_fDipoleMin = AskFloat(" Enter the minimal value of this d2-DDF in Debye/ps^2: [0] ",0.0f);
3388
else m_fDipoleMin = AskFloat(" Enter the minimal value of this d2-DDF in Debye/ps^2: [-10.0] ",-10.0f);
3389
m_fDipoleMax = AskFloat(" Enter the maximal value of this d2-DDF in Debye/ps^2: [10.0] ",10.0f);
3393
m_iResolution = AskUnsignedInteger(" Enter binning resolution for the Dipole DF: [%d] ",int((m_fDipoleMax-m_fDipoleMin)*10.0),int((m_fDipoleMax-m_fDipoleMin)*10.0));
3396
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
3397
else m_iHistogramRes = 0;
3400
mprintf(WHITE,"\n<<< End of Dipole Distribution Function <<<\n\n");
3405
void CSDF::Parse(bool voro)
3413
try { m_pSDF = new C3DF(); } catch(...) { m_pSDF = NULL; }
3414
if (m_pSDF == NULL) NewException((double)sizeof(C3DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3416
mprintf(WHITE,"\n>>> Spatial Distribution Function >>>\n\n");
3422
mprintf(" Observing atoms in reference molecule %s.\n",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
3426
mprintf(" Observing atoms in observed molecule %s.\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3429
/* if (m_iShowMol != -1)
3430
m_iRefOrSec = AskRangeInteger(" Observe atoms in RM %s (0) or in OM %s (1)? [1] ",0,1,1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3431
else m_iRefOrSec = 0;*/
3432
mprintf(" Which atoms to observe (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ");
3433
inpprintf("! Which atoms to observe (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n");
3435
if (strlen(buf) == 0)
3437
if (!m_oAtoms.ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec==0)?g_iFixMol:m_iShowMol],"#2"))
3439
eprintf("Strange error ^^\n");
3440
inpprintf("! Strange error ^\n");
3445
if (!m_oAtoms.ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec==0)?g_iFixMol:m_iShowMol],buf))
3447
eprintf("Wrong input.\n");
3448
inpprintf("! Wrong input.\n");
3453
m_iShowAtomGes += m_oAtoms.m_iAtomGes;
3454
m_fParticleDensity = m_oAtoms.m_iAtomGes * ((CMolecule*)g_oaMolecules[(m_iRefOrSec==0)?g_iFixMol:m_iShowMol])->m_laSingleMolIndex.GetSize() / g_fBoxX / g_fBoxY / g_fBoxZ * 1E9f;
3457
m_fRadius = AskFloat(" Please enter radius of this SDF in pm: [%d.0] ",(float)HalfBox(),HalfBox());
3459
ti = g_pDatabase->GetInt("/PLOT3D/DEFAULTS/BIN_RES");
3460
m_iResolution = AskUnsignedInteger(" Please enter binning resolution of this SDF per dimension: [%d] ",ti,ti);
3462
if (m_iResolution > 300)
3464
eprintf("\nWarning: ");
3465
mprintf("This large resolution will consume much RAM (%s)\n",FormatBytes(pow((double)m_iResolution,3)*sizeof(double)));
3466
mprintf(" and result in very large SDF output files.\n\n");
3467
if (!AskYesNo(" Use this resolution (y/n)? [no] ",false))
3473
m_bVdWSpheres = false; //AskYesNo(" Process atoms as VdW spheres rather than points (y/n)? [no] ",false);
3474
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
3475
m_bClipPlane = AskYesNo(" Use a clipping plane for this SDF (y/n)? [no] ",false);
3478
_cut: mprintf(" Should the clipping plane stand perpendicular to the X, Y or Z axis (x/y/z)? [x] ");
3479
inpprintf("! Should the clipping plane stand perpendicular to the X, Y or Z axis (x/y/z)? [x]\n");
3481
switch(tolower(buf[0]))
3485
m_iClipDirection = 0;
3488
m_iClipDirection = 1;
3491
m_iClipDirection = 2;
3494
eprintf(" Wrong input! Please enter 'x', 'y' or 'z'.\n");
3495
inpprintf("! Wrong input! Please enter 'x', 'y' or 'z'.\n");
3498
m_fClipValue = AskFloat(" Please enter distance of clipping plane from origin (in pm): [0] ",0.0f);
3500
m_bInvert = AskYesNo(" Should this SDF be inverted (y/n)? [no] ",false);
3501
m_bSDFMirrorXY = AskYesNo(" Force this SDF to be symmetrical to the XY plane (y/n)? [no] ",false);
3502
m_bSDFMirrorBisect = AskYesNo(" Force this SDF to be symmetrical to the angle bisector (y/n)? [no] ",false);
3503
m_bCutPlane = AskYesNo(" Add a particle density cut plane to this SDF (y/n)? [no] ",false);
3506
m_iCutPlaneResolution = AskUnsignedInteger(" Enter the binning resolution for the cut plane per dimension: [100] ",100);
3507
m_bCutPlaneShowAtoms = AskYesNo(" Show reference atoms in Pseudo SDF plot (y/n)? [yes] ",true);
3511
m_bVdWSpheres = false;
3091
m_fMinAngle = cosf(m_fMinAngle/180.0f*Pi);
3092
m_fMaxAngle = cosf(m_fMaxAngle/180.0f*Pi);
3094
if (m_fMinAngle > m_fMaxAngle)
3097
m_fMinAngle = m_fMaxAngle;
3102
mprintf("\n The data range is %.2f to %.2f.\n\n",m_fMinAngle,m_fMaxAngle);
3105
/* m_bAbs = AskYesNo(" Use absolute angle values (y) or signed values (n)? [yes] ",true);
3108
m_fMinAngle = -m_fMaxAngle;
3109
mprintf("\n The data range is %.2f to %.2f.\n\n",m_fMinAngle,m_fMaxAngle);
3110
m_bSymm = AskYesNo(" Force this DDF to be symmetrical to the 0 degree line (y/n)? [no] ",false);
3111
} else m_bSymm = false;*/
3114
// m_fMinAngle = -m_fMaxAngle;
3115
mprintf("\n The data range is %.2f to %.2f.\n\n",m_fMinAngle,m_fMaxAngle);
3117
m_bSymm = AskYesNo(" Add also bin entries for inverse angles (force symmetry) (y/n)? [no] ",false);
3118
else m_bSymm = false;
3119
// } else m_bSymm = false;
3127
m_iResolution = AskUnsignedInteger(" Please enter binning resolution for this DDF: [100] ",100);
3130
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
3131
else m_iHistogramRes = 0;
3133
/* mprintf("\n Save temporal Development of Dihedrals (0=no, 1=yes)? [0] ");
3135
m_bSaveAngle = atoi(buf)!=0;*/
3137
mprintf(WHITE,"\n<<< End of Dihedral Distribution Function <<<\n\n");
3149
try { m_pPlDF = new CDF(); } catch(...) { m_pPlDF = NULL; }
3150
if (m_pPlDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3152
mprintf(WHITE,"\n>>> Plane Distance Distribution Function >>>\n\n");
3154
m_bNormal = !AskYesNo(" Define plane via 3 atoms (y) or as normal plane of a vector (n) (y/n)? [yes] ",true);
3156
m_iCombinations = 1;
3159
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
3160
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3162
if (m_iShowMol != -1)
3163
m_iRefOrSec[0] = AskRangeInteger(" Take the base atom of the vector/plane from RM %s (0) or from OM %s (1)? [0] ",0,1,0,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3164
else m_iRefOrSec[0] = 0;
3165
mprintf(" Please enter the base atom (e.g. C7): ");
3166
inpprintf("! Please enter the base atom (e.g. C7):\n");
3168
if (!ag->ParseAtoms((!m_iRefOrSec[0])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3170
eprintf("Wrong input.\n");
3171
inpprintf("! Wrong input.\n");
3174
m_iCombinations *= ag->m_iAtomGes;
3175
m_oaVectors.Add(ag);
3177
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
3178
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3180
if (m_iShowMol != -1)
3181
m_iRefOrSec[1] = AskRangeInteger(" Take the atom at the tip of the vector from RM %s (0) or from OM %s (1)? [0] ",0,1,0,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3182
else m_iRefOrSec[1] = 0;
3183
mprintf(" Please enter the tip atom (e.g. C7): ");
3184
inpprintf("! Please enter the tip atom (e.g. C7):\n");
3186
if (!ag->ParseAtoms((!m_iRefOrSec[1])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3188
eprintf("Wrong input.\n");
3189
inpprintf("! Wrong input.\n");
3192
m_iCombinations *= ag->m_iAtomGes;
3193
m_oaVectors.Add(ag);
3194
m_oaVectors.Add(NULL); // Dummy placeholder
3199
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
3200
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3202
if (m_iShowMol != -1)
3203
m_iRefOrSec[z] = AskRangeInteger(" Take the %d. atom(s) of the plane from RM %s (0) or from OM %s (1)? [0] ",0,1,0,z+1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3204
else m_iRefOrSec[z] = 0;
3205
mprintf(" Please enter the %d. atom (e.g. C7): ",z+1);
3206
inpprintf("! Please enter the %d. atom (e.g. C7):\n",z+1);
3208
if (!ag->ParseAtoms((!m_iRefOrSec[z])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3210
eprintf("Wrong input.\n");
3211
inpprintf("! Wrong input.\n");
3214
m_iCombinations *= ag->m_iAtomGes;
3215
m_oaVectors.Add(ag);
3218
mprintf(" Plane defined.\n\n");
3220
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
3221
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3223
if (m_iShowMol != -1)
3224
m_iRefOrSec[3] = AskRangeInteger(" Take the atom(s) to observe from RM %s (0) or from OM %s (1)? [0] ",0,1,0,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3225
else m_iRefOrSec[3] = 0;
3226
mprintf(" Please enter the atom(s) to observe (e.g. C7): ");
3227
inpprintf("! Please enter the atom(s) to observe (e.g. C7):\n");
3229
if (!ag->ParseAtoms((!m_iRefOrSec[3])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3231
eprintf("Wrong input.\n");
3232
inpprintf("! Wrong input.\n");
3235
m_iCombinations *= ag->m_iAtomGes;
3236
m_oaVectors.Add(ag);
3238
m_fMinDist = AskFloat(" Enter the minimal distance to observe (in pm): [-%d.0] ",(float)-HalfBox(),HalfBox());
3239
m_fMaxDist = AskFloat(" Enter the maximal distance to observe (in pm): [%d.0] ",(float)HalfBox(),HalfBox());
3241
m_iResolution = AskUnsignedInteger(" Please enter binning resolution for this PlDF: [100] ",100);
3244
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
3245
else m_iHistogramRes = 0;
3248
mprintf(WHITE,"\n<<< End of Plane Distance Distribution Function <<<\n\n");
3260
try { m_pLiDF = new CDF(); } catch(...) { m_pLiDF = NULL; }
3261
if (m_pLiDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3263
mprintf(WHITE,"\n>>> Line Distance Distribution Function >>>\n\n");
3265
m_bNormal = !AskYesNo(" Define line via 2 atoms (y) or as normal vector of a plane (n) (y/n)? [yes] ",true);
3267
m_iCombinations = 1;
3270
mprintf("\n The line will pass through the 1st point of the plane.\n\n");
3273
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
3274
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3276
if (m_iShowMol != -1)
3277
m_iRefOrSec[z] = AskRangeInteger(" Take the %d. atom(s) of the plane from RM %s (0) or from OM %s (1)? [0] ",0,1,0,z+1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3278
else m_iRefOrSec[z] = 0;
3279
mprintf(" Please enter the %d. atom (e.g. C7): ",z+1);
3280
inpprintf("! Please enter the %d. atom (e.g. C7):\n",z+1);
3282
if (!ag->ParseAtoms((!m_iRefOrSec[z])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3284
eprintf("Wrong input.\n");
3285
inpprintf("! Wrong input.\n");
3288
m_iCombinations *= ag->m_iAtomGes;
3289
m_oaVectors.Add(ag);
3295
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
3296
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3298
if (m_iShowMol != -1)
3299
m_iRefOrSec[z] = AskRangeInteger(" Take the %d. atom(s) of the line from RM %s (0) or from OM %s (1)? [0] ",0,1,0,z+1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3300
else m_iRefOrSec[z] = 0;
3301
mprintf(" Please enter the %d. atom (e.g. C7): ",z+1);
3302
inpprintf("! Please enter the %d. atom (e.g. C7):\n",z+1);
3304
if (!ag->ParseAtoms((!m_iRefOrSec[z])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3306
eprintf("Wrong input.\n");
3307
inpprintf("! Wrong input.\n");
3310
m_iCombinations *= ag->m_iAtomGes;
3311
m_oaVectors.Add(ag);
3313
m_oaVectors.Add(NULL);
3316
mprintf(" Line defined.\n\n");
3318
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
3319
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3321
if (m_iShowMol != -1)
3322
m_iRefOrSec[3] = AskRangeInteger(" Take the atom(s) to observe from RM %s (0) or from OM %s (1)? [0] ",0,1,0,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3323
else m_iRefOrSec[3] = 0;
3324
mprintf(" Please enter the atom(s) to observe (e.g. C7): ");
3325
inpprintf("! Please enter the atom(s) to observe (e.g. C7):\n");
3327
if (!ag->ParseAtoms((!m_iRefOrSec[3])?(CMolecule*)g_oaMolecules[g_iFixMol]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
3329
eprintf("Wrong input.\n");
3330
inpprintf("! Wrong input.\n");
3333
m_iCombinations *= ag->m_iAtomGes;
3334
m_oaVectors.Add(ag);
3336
m_fMinDist = AskFloat(" Enter the minimal distance to observe (in pm): [0] ",0.0f);
3337
m_fMaxDist = AskFloat(" Enter the maximal distance to observe (in pm): [%d.0] ",(float)HalfBox(),HalfBox());
3339
m_iResolution = AskUnsignedInteger(" Please enter binning resolution for this LiDF: [100] ",100);
3342
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
3343
else m_iHistogramRes = 0;
3345
if (m_iShowMol != -1)
3346
m_bRadialCorrect = AskYesNo(" Correct radial distribution for this LiDF (y/n)? [yes] ",true);
3347
else m_bRadialCorrect = AskYesNo(" Correct radial distribution for this LiDF (y/n)? [no] ",false);
3350
mprintf(WHITE,"\n<<< End of Line Distance Distribution Function <<<\n\n");
3355
void CDipDF::Parse()
3359
double td, td2, td3;
3361
CSingleMolecule *sm;
3366
try { m_pDipoleDF = new CDF(); } catch(...) { m_pDipoleDF = NULL; }
3367
if (m_pDipoleDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3369
mprintf(WHITE,"\n>>> Dipole Distribution Function >>>\n\n");
3370
if (m_iShowMol != -1)
3371
m_iRefOrSec = AskRangeInteger(" Observe dipole moment from RM %s (0) or from OM %s (1)? [0] ",0,1,0,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3372
else m_iRefOrSec = 0;
3376
if (m_iRefOrSec != 0)
3377
m = (CMolecule*)g_oaMolecules[m_iShowMol];
3378
else m = (CMolecule*)g_oaMolecules[g_iFixMol];
3383
for (z=0;z<m->m_laSingleMolIndex.GetSize();z++)
3385
sm = (CSingleMolecule*)g_oaSingleMolecules[m->m_laSingleMolIndex[z]];
3386
tf = sm->m_vDipole.GetLength();
3393
td3 /= (double)m->m_laSingleMolIndex.GetSize();
3395
mprintf("\n Dipole moment of %s (1st step): Min. %.3f, Max. %.3f, Avg. %.3f Debye.\n\n",m->m_sName,td2,td,td3);
3400
m_fDipoleMin = AskFloat(" Enter the lower bound for dipole values (in Debye): [0] ",0.0f);
3401
m_fDipoleMax = AskFloat(" Enter the upper bound for dipole values (in Debye): [%d] ",float(int(td*2.0)),int(td*2.0));
3405
m_fDipoleMin = AskFloat(" Enter the minimal value of this d1-DDF in Debye/ps: [0] ",0.0f);
3406
else m_fDipoleMin = AskFloat(" Enter the minimal value of this d1-DDF in Debye/ps: [-10.0] ",-10.0f);
3407
m_fDipoleMax = AskFloat(" Enter the maximal value of this d1-DDF in Debye/ps: [10.0] ",10.0f);
3411
m_fDipoleMin = AskFloat(" Enter the minimal value of this d2-DDF in Debye/ps^2: [0] ",0.0f);
3412
else m_fDipoleMin = AskFloat(" Enter the minimal value of this d2-DDF in Debye/ps^2: [-10.0] ",-10.0f);
3413
m_fDipoleMax = AskFloat(" Enter the maximal value of this d2-DDF in Debye/ps^2: [10.0] ",10.0f);
3417
m_iResolution = AskUnsignedInteger(" Enter binning resolution for the Dipole DF: [%d] ",int((m_fDipoleMax-m_fDipoleMin)*10.0),int((m_fDipoleMax-m_fDipoleMin)*10.0));
3420
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
3421
else m_iHistogramRes = 0;
3424
mprintf(WHITE,"\n<<< End of Dipole Distribution Function <<<\n\n");
3429
void CSDF::Parse(bool voro)
3437
try { m_pSDF = new C3DF(); } catch(...) { m_pSDF = NULL; }
3438
if (m_pSDF == NULL) NewException((double)sizeof(C3DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3440
mprintf(WHITE,"\n>>> Spatial Distribution Function >>>\n\n");
3446
mprintf(" Observing atoms in reference molecule %s.\n",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
3450
mprintf(" Observing atoms in observed molecule %s.\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3453
/* if (m_iShowMol != -1)
3454
m_iRefOrSec = AskRangeInteger(" Observe atoms in RM %s (0) or in OM %s (1)? [1] ",0,1,1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3455
else m_iRefOrSec = 0;*/
3456
mprintf(" Which atoms to observe (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ");
3457
inpprintf("! Which atoms to observe (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n");
3459
if (strlen(buf) == 0)
3461
if (!m_oAtoms.ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec==0)?g_iFixMol:m_iShowMol],"#2"))
3463
eprintf("Strange error ^^\n");
3464
inpprintf("! Strange error ^\n");
3469
if (!m_oAtoms.ParseAtoms((CMolecule*)g_oaMolecules[(m_iRefOrSec==0)?g_iFixMol:m_iShowMol],buf))
3471
eprintf("Wrong input.\n");
3472
inpprintf("! Wrong input.\n");
3477
m_iShowAtomGes += m_oAtoms.m_iAtomGes;
3478
m_fParticleDensity = m_oAtoms.m_iAtomGes * ((CMolecule*)g_oaMolecules[(m_iRefOrSec==0)?g_iFixMol:m_iShowMol])->m_laSingleMolIndex.GetSize() / g_fBoxX / g_fBoxY / g_fBoxZ * 1E9f;
3481
m_fRadius = AskFloat(" Please enter radius of this SDF in pm: [%d.0] ",(float)HalfBox(),HalfBox());
3483
ti = g_pDatabase->GetInt("/PLOT3D/DEFAULTS/BIN_RES");
3484
m_iResolution = AskUnsignedInteger(" Please enter binning resolution of this SDF per dimension: [%d] ",ti,ti);
3486
if (m_iResolution > 300)
3488
eprintf("\nWarning: ");
3489
mprintf("This large resolution will consume much RAM (%s)\n",FormatBytes(pow((double)m_iResolution,3)*sizeof(double)));
3490
mprintf(" and result in very large SDF output files.\n\n");
3491
if (!AskYesNo(" Use this resolution (y/n)? [no] ",false))
3497
m_bVdWSpheres = false; //AskYesNo(" Process atoms as VdW spheres rather than points (y/n)? [no] ",false);
3498
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
3499
m_bClipPlane = AskYesNo(" Use a clipping plane for this SDF (y/n)? [no] ",false);
3502
_cut: mprintf(" Should the clipping plane stand perpendicular to the X, Y or Z axis (x/y/z)? [x] ");
3503
inpprintf("! Should the clipping plane stand perpendicular to the X, Y or Z axis (x/y/z)? [x]\n");
3505
switch(tolower(buf[0]))
3509
m_iClipDirection = 0;
3512
m_iClipDirection = 1;
3515
m_iClipDirection = 2;
3518
eprintf(" Wrong input! Please enter 'x', 'y' or 'z'.\n");
3519
inpprintf("! Wrong input! Please enter 'x', 'y' or 'z'.\n");
3522
m_fClipValue = AskFloat(" Please enter distance of clipping plane from origin (in pm): [0] ",0.0f);
3524
m_bInvert = AskYesNo(" Should this SDF be inverted (y/n)? [no] ",false);
3525
m_bSDFMirrorXY = AskYesNo(" Force this SDF to be symmetrical to the XY plane (y/n)? [no] ",false);
3526
m_bSDFMirrorBisect = AskYesNo(" Force this SDF to be symmetrical to the angle bisector (y/n)? [no] ",false);
3527
m_bCutPlane = AskYesNo(" Add a particle density cut plane to this SDF (y/n)? [no] ",false);
3530
m_iCutPlaneResolution = AskUnsignedInteger(" Enter the binning resolution for the cut plane per dimension: [100] ",100);
3531
m_bCutPlaneShowAtoms = AskYesNo(" Show reference atoms in Pseudo SDF plot (y/n)? [yes] ",true);
3535
m_bVdWSpheres = false;
3536
m_bClipPlane = false;
3538
m_bSDFMirrorXY = false;
3539
m_bSDFMirrorBisect = false;
3540
m_bCutPlane = false;
3512
3541
m_iHistogramRes = 0;
3513
m_bClipPlane = false;
3515
m_bSDFMirrorXY = false;
3516
m_bSDFMirrorBisect = false;
3517
m_bCutPlane = false;
3523
mprintf(WHITE,"\n<<< End of Spatial Distribution Function <<<\n\n");
3535
try { m_pVDF = new CDF(); } catch(...) { m_pVDF = NULL; }
3536
if (m_pVDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3538
mprintf(WHITE,"\n>>> Velocity Distribution Function >>>\n\n");
3540
if (g_iFixMol == -1)
3542
mprintf(" Observing atoms from OM %s.\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3544
} else if (m_iShowMol == -1)
3546
mprintf(" Observing atoms from RM %s.\n",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
3548
} else m_iRefOrSec = AskRangeInteger(" Observe atoms in RM %s (0) or in OM %s (1)? [1]",0,1,1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3550
mprintf(" Which atoms to observe (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ");
3551
inpprintf("! Which atoms to observe (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n");
3553
if (strlen(buf) == 0)
3555
m_oAtoms.AddAllAtoms((CMolecule*)g_oaMolecules[m_iRefOrSec?m_iShowMol:g_iFixMol],false);
3556
if (!m_oAtoms.ParseAtoms((CMolecule*)g_oaMolecules[m_iRefOrSec?m_iShowMol:g_iFixMol],"#2"))
3558
eprintf("Strange error ^^\n");
3559
inpprintf("! Strange error ^^\n");
3564
if (!m_oAtoms.ParseAtoms((CMolecule*)g_oaMolecules[m_iRefOrSec?m_iShowMol:g_iFixMol],buf))
3566
eprintf("Wrong input.\n");
3567
inpprintf("! Wrong input.\n");
3571
m_iCombinations = m_oAtoms.m_iAtomGes;
3572
m_iShowAtomGes += m_oAtoms.m_iAtomGes;
3573
// m_fParticleDensity = m_oAtoms.m_iAtomGes * ((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize() / g_fBoxX / g_fBoxY / g_fBoxZ;
3580
/* if (AskYesNo(" Scan for velocity range (y) or enter range manually (n)? [no] ",false))
3582
m_bScanRange = true;
3583
g_bScanVelocities = true;
3586
m_bScanRange = false;
3587
m_fMinSpeed = 0; //AskFloat(" Please enter the minimal velocity: [0.0 pm/fs] ",0.0f);
3588
m_fMaxSpeed = AskFloat(" Please enter the maximal velocity: [10000.0 pm/ps] ",10000.0f);
3593
m_fMinSpeed = AskFloat(" Enter the minimal value of this d1-VDF in pm/ps^2: [0] ",0.0f);
3594
else m_fMinSpeed = AskFloat(" Enter the minimal value of this d1-VDF in pm/ps^2: [-10.0] ",-10.0f);
3595
m_fMaxSpeed = AskFloat(" Enter the maximal value of this d1-VDF in pm/ps^2: [10.0] ",10.0f);
3599
m_fMinSpeed = AskFloat(" Enter the minimal value of this d2-VDF in pm/ps^3: [0] ",0.0f);
3600
else m_fMinSpeed = AskFloat(" Enter the minimal value of this d2-VDF in pm/ps^3: [-10.0] ",-10.0f);
3601
m_fMaxSpeed = AskFloat(" Enter the maximal value of this d2-VDF in pm/ps^3: [10.0] ",10.0f);
3547
mprintf(WHITE,"\n<<< End of Spatial Distribution Function <<<\n\n");
3559
try { m_pVDF = new CDF(); } catch(...) { m_pVDF = NULL; }
3560
if (m_pVDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3562
mprintf(WHITE,"\n>>> Velocity Distribution Function >>>\n\n");
3564
if (g_iFixMol == -1)
3566
mprintf(" Observing atoms from OM %s.\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3568
} else if (m_iShowMol == -1)
3570
mprintf(" Observing atoms from RM %s.\n",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
3572
} else m_iRefOrSec = AskRangeInteger(" Observe atoms in RM %s (0) or in OM %s (1)? [1]",0,1,1,((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3574
mprintf(" Which atoms to observe (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ");
3575
inpprintf("! Which atoms to observe (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n");
3577
if (strlen(buf) == 0)
3579
m_oAtoms.AddAllAtoms((CMolecule*)g_oaMolecules[m_iRefOrSec?m_iShowMol:g_iFixMol],false);
3580
if (!m_oAtoms.ParseAtoms((CMolecule*)g_oaMolecules[m_iRefOrSec?m_iShowMol:g_iFixMol],"#2"))
3582
eprintf("Strange error ^^\n");
3583
inpprintf("! Strange error ^^\n");
3588
if (!m_oAtoms.ParseAtoms((CMolecule*)g_oaMolecules[m_iRefOrSec?m_iShowMol:g_iFixMol],buf))
3590
eprintf("Wrong input.\n");
3591
inpprintf("! Wrong input.\n");
3595
m_iCombinations = m_oAtoms.m_iAtomGes;
3596
m_iShowAtomGes += m_oAtoms.m_iAtomGes;
3597
// m_fParticleDensity = m_oAtoms.m_iAtomGes * ((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize() / g_fBoxX / g_fBoxY / g_fBoxZ;
3604
/* if (AskYesNo(" Scan for velocity range (y) or enter range manually (n)? [no] ",false))
3606
m_bScanRange = true;
3607
g_bScanVelocities = true;
3610
m_bScanRange = false;
3611
m_fMinSpeed = 0; //AskFloat(" Please enter the minimal velocity: [0.0 pm/fs] ",0.0f);
3612
m_fMaxSpeed = AskFloat(" Please enter the maximal velocity: [10000.0 pm/ps] ",10000.0f);
3617
m_fMinSpeed = AskFloat(" Enter the minimal value of this d1-VDF in pm/ps^2: [0] ",0.0f);
3618
else m_fMinSpeed = AskFloat(" Enter the minimal value of this d1-VDF in pm/ps^2: [-10.0] ",-10.0f);
3619
m_fMaxSpeed = AskFloat(" Enter the maximal value of this d1-VDF in pm/ps^2: [10.0] ",10.0f);
3623
m_fMinSpeed = AskFloat(" Enter the minimal value of this d2-VDF in pm/ps^3: [0] ",0.0f);
3624
else m_fMinSpeed = AskFloat(" Enter the minimal value of this d2-VDF in pm/ps^3: [-10.0] ",-10.0f);
3625
m_fMaxSpeed = AskFloat(" Enter the maximal value of this d2-VDF in pm/ps^3: [10.0] ",10.0f);
3605
3629
m_iResolution = AskInteger(" Please enter the binning resolution for this VDF: [300] ",300);
3607
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
3608
else m_iHistogramRes = 0;
3609
/* mprintf(" Save temporal Development of Velocity (0=no, 1=yes)? [0] ");
3611
m_bSaveSpeed = atoi(buf)!=0;*/
3613
mprintf(WHITE,"\n<<< End of Velocity Distribution Function <<<\n\n");
3618
void CSDF::BuildName()
3626
sprintf(tmp,"%s_%s%d%s%d%s%d_%s_%s",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CAtom*)g_oaAtoms[g_iFixRealAtomType[1]])->m_sName,g_iFixAtom[1]+1,((CAtom*)g_oaAtoms[g_iFixRealAtomType[2]])->m_sName,g_iFixAtom[2]+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,m_oAtoms.m_sName);
3627
else sprintf(tmp,"%s_%s%d%s%d%s%d_%s",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CAtom*)g_oaAtoms[g_iFixRealAtomType[1]])->m_sName,g_iFixAtom[1]+1,((CAtom*)g_oaAtoms[g_iFixRealAtomType[2]])->m_sName,g_iFixAtom[2]+1,m_oAtoms.m_sName);
3629
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
3630
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3632
strcpy(m_sName,tmp);
3637
void CVDF::BuildName()
3643
sprintf(tmp,"deriv%d_%s",m_iDeriv,m_oAtoms.m_sName);
3644
else sprintf(tmp,"%s",m_oAtoms.m_sName);
3646
try { m_sShortName = new char[strlen(tmp)+1]; } catch(...) { m_sShortName = NULL; }
3647
if (m_sShortName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3649
strcpy(m_sShortName,m_oAtoms.m_sName);
3650
if (g_iFixMol == -1)
3652
sprintf(tmp,"%s_",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3653
} else if (m_iRefOrSec)
3654
sprintf(tmp,"%s_%s%d_%s_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3655
else sprintf(tmp,"%s_%s%d_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1);
3656
strcat(tmp,m_sShortName);
3658
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
3659
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3661
strcpy(m_sName,tmp);
3666
void CSDF::BuildAtomList(CSingleMolecule *ref, CSingleMolecule *obs, CxIntArray *vec)
3672
vec->RemoveAll_KeepSize();
3673
for (z1t=0;z1t<m_oAtoms.m_baAtomType.GetSize();z1t++)
3675
// mprintf("(a) BuildAtomList z1t=%d, WA=%X\n",z1t,m_oAtoms.m_oaAtoms[z1t]);
3676
a1 = (CxIntArray*)m_oAtoms.m_oaAtoms[z1t];
3677
// mprintf("(b) BuildAtomList wa.GetSize()=%d\n",a1->GetSize());
3678
for (z1a=0;z1a<a1->GetSize();z1a++)
3681
// mprintf("(c) BuildAtomList z1t=%d, z1a=%d, Type=%d, WA=%X\n",z1t,z1a,m_oAtoms.m_baAtomType[z1t],obs->m_oaAtomOffset[m_oAtoms.m_baAtomType[z1t]]);
3682
vec->Add(((CxIntArray*)obs->m_oaAtomOffset[m_oAtoms.m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
3683
} else vec->Add(((CxIntArray*)ref->m_oaAtomOffset[m_oAtoms.m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
3689
void CVDF::BuildAtomList(CSingleMolecule *ref, CSingleMolecule *obs, CxIntArray *vec)
3695
vec->RemoveAll_KeepSize();
3696
for (z1t=0;z1t<m_oAtoms.m_baAtomType.GetSize();z1t++)
3698
a1 = (CxIntArray*)m_oAtoms.m_oaAtoms[z1t];
3699
for (z1a=0;z1a<a1->GetSize();z1a++)
3701
vec->Add(((CxIntArray*)obs->m_oaAtomOffset[m_oAtoms.m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
3702
else vec->Add(((CxIntArray*)ref->m_oaAtomOffset[m_oAtoms.m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
3708
void CRDF::BuildAtomList(CSingleMolecule *ref, CSingleMolecule *obs, CxIntArray *vec)
3711
int z, z1t, z1a, z2t, z2a;
3712
CAtomGroup *g1, *g2;
3713
CxIntArray *a1, *a2;
3715
vec->RemoveAll_KeepSize();
3716
for (z=0;z<m_oaVectors.GetSize()/2;z++)
3718
g1 = (CAtomGroup*)m_oaVectors[z*2];
3719
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
3721
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
3722
for (z1a=0;z1a<a1->GetSize();z1a++)
3724
g2 = (CAtomGroup*)m_oaVectors[z*2+1];
3725
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
3727
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
3728
for (z2a=0;z2a<a2->GetSize();z2a++)
3731
vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
3732
else vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
3734
vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
3735
else vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
3736
// mprintf("Vector z=%d, z1t=%d, z1a=%d, z2t=%d, z2a=%d.\n",z,z1t,z1a,z2t,z2a);
3746
void CVHDF::BuildAtomList(CSingleMolecule *ref, CSingleMolecule *obs, CxIntArray *vec)
3749
int z, z1t, z1a, z2t, z2a;
3750
CAtomGroup *g1, *g2;
3751
CxIntArray *a1, *a2;
3753
vec->RemoveAll_KeepSize();
3754
for (z=0;z<m_oaVectors.GetSize()/2;z++)
3756
g1 = (CAtomGroup*)m_oaVectors[z*2];
3757
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
3759
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
3760
for (z1a=0;z1a<a1->GetSize();z1a++)
3762
g2 = (CAtomGroup*)m_oaVectors[z*2+1];
3763
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
3765
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
3766
for (z2a=0;z2a<a2->GetSize();z2a++)
3769
vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
3770
else vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
3772
vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
3773
else vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
3783
/*int FindAtom(char *s)
3787
for (z=0;z<g_oaAtoms.GetSize();z++)
3788
if (mystricmp(s,((CAtom*)g_oaAtoms[z])->m_sName)==0)
3798
int CMolecule::FindAtomInMol(const char *s)
3802
for (z=0;z<m_baAtomIndex.GetSize();z++)
3803
if (mystricmp(s,((CAtom*)g_oaAtoms[m_baAtomIndex[z]])->m_sName)==0)
3813
void CMolecule::BuildName()
3817
char buf[16], buf2[256];
3824
for (z=0;z<g_oaAtoms.GetSize();z++)
3826
for (z2=0;z2<m_baAtomIndex.GetSize();z2++)
3828
if (m_baAtomIndex[z2] != z)
3830
if (m_waAtomCount[z2] > 1)
3831
sprintf(buf,"%s%d",((CAtom*)g_oaAtoms[z])->m_sName,m_waAtomCount[z2]);
3832
else sprintf(buf,"%s",((CAtom*)g_oaAtoms[z])->m_sName);
3837
try { m_sName = new char[strlen(buf2)+1]; } catch(...) { m_sName = NULL; }
3838
if (m_sName == NULL) NewException((double)(strlen(buf2)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3840
strcpy(m_sName,buf2);
3845
bool CConditionGroup::Contains(int mol)
3851
return m_bAlwaysTrue[mol];
3853
if (m_bInvertCondition)
3855
if (m_bAlwaysTrue[mol])
3860
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
3862
if (((CConditionSubGroup*)m_oaConditionSubGroups[z])->Contains(mol))
3872
if (m_bAlwaysTrue[mol])
3877
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
3879
if (((CConditionSubGroup*)m_oaConditionSubGroups[z])->Contains(mol))
3891
void CConditionGroup::MarkPassedAtoms(int om, bool passed)
3897
// mprintf("######## OM %d ##########\n",om+1);
3899
for (z=0;z<g_iGesVirtAtomCount;z++)
3900
g_baAtomPassedCondition[z] = 110; // 110 heisst: Atom kommt nicht in einer Condition vor
3902
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
3903
((CConditionSubGroup*)m_oaConditionSubGroups[z])->MarkPassedAtoms(om);
3905
// for (z=0;z<g_iGesVirtAtomCount;z++)
3906
// mprintf("\nAtom %d: %d.",z+1,g_baAtomPassedCondition[z]);
3909
if (m_bInvertCondition)
3911
for (z=0;z<g_iGesVirtAtomCount;z++)
3913
if (g_baAtomPassedCondition[z] != 100) // Entweder Condition nicht bestanden oder Atom kam gar nicht darin vor
3916
g_baAtomPassedCondition[z] = 1;
3917
// mprintf("%d: Ok\n",z+1);
3918
// mprintf("\n %d --> Wird genommen.",z+1);
3919
} else // Condition bestanden
3921
// mprintf("Atom %s%d nicht bestanden (%d).\n",((CAtom*)g_oaAtoms[g_waAtomRealElement[z]])->m_sName,g_waAtomMolNumber[z]+1,g_baAtomPassedCondition[z]);
3922
// mprintf("\n%d erfuellt --> durchgefallen",z+1);
3923
g_baAtomPassedCondition[z] = 0;
3928
for (z=0;z<g_iGesVirtAtomCount;z++)
3932
if (g_baAtomPassedCondition[z] >= 100) // Entweder Condition bestanden oder Atom kam gar nicht darin vor
3935
g_baAtomPassedCondition[z] = 1;
3936
} else // Condition nicht bestanden
3938
// mprintf("Atom %s%d nicht bestanden (%d).\n",((CAtom*)g_oaAtoms[g_waAtomRealElement[z]])->m_sName,g_waAtomMolNumber[z]+1,g_baAtomPassedCondition[z]);
3939
g_baAtomPassedCondition[z] = 0;
3943
if (g_baAtomPassedCondition[z] == 100) // Condition bestanden
3946
// mprintf("### Atom %s[%d] %s%d bestanden (%d).\n",((CMolecule*)g_oaMolecules[g_waAtomMolIndex[z]])->m_sName,g_laAtomSMLocalIndex[z]+1,((CAtom*)g_oaAtoms[g_waAtomRealElement[z]])->m_sName,g_waAtomMolNumber[z]+1,g_baAtomPassedCondition[z]);
3947
g_baAtomPassedCondition[z] = 0;
3948
} else // Entweder Condition nicht bestanden oder Atom kam gar nicht darin vor
3950
// mprintf("--- Atom %s[%d] %s%d nicht bestanden (%d).\n",((CMolecule*)g_oaMolecules[g_waAtomMolIndex[z]])->m_sName,g_laAtomSMLocalIndex[z]+1,((CAtom*)g_oaAtoms[g_waAtomRealElement[z]])->m_sName,g_waAtomMolNumber[z]+1,g_baAtomPassedCondition[z]);
3951
g_baAtomPassedCondition[z] = 1;
3956
// mprintf("\nMarked %d / %d atoms as enabled.",ti,g_iGesVirtAtomCount);
3962
void CConditionGroup::ScanNeighborhoodAllOM(CTimeStep *t, CSingleMolecule *rm)
3965
int z, z2, t1, t2, i;
3970
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
3971
((CConditionSubGroup*)m_oaConditionSubGroups[z])->ScanNeighborhoodAllOM(t,rm);
3973
if (m_oaConditionSubGroups.GetSize() == 2)
3975
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
3979
for (z2=0;z2<((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_oaConditions.GetSize();z2++)
3980
t1 += ((CNbSearch*)((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_oaConditions[z2])->m_iCombPassCount[z];
3981
for (z2=0;z2<((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_oaConditions.GetSize();z2++)
3982
t2 += ((CNbSearch*)((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_oaConditions[z2])->m_iCombPassCount[z];
3983
m_pTable[t1*(((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)+t2]++;
3989
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
3992
if (m_bInvertCondition)
3994
for (z2=0;z2<m_oaConditionSubGroups.GetSize();z2++)
3995
if (((CConditionSubGroup*)m_oaConditionSubGroups[z2])->Contains(z))
3998
m_iPassCounter[z]++;
3999
m_bAnyPassed = true;
4002
for (z2=0;z2<m_oaConditionSubGroups.GetSize();z2++)
4004
if (((CConditionSubGroup*)m_oaConditionSubGroups[z2])->Contains(z))
4006
// mprintf("passed[%d]++\n",z);
4008
m_iPassCounter[z]++;
4009
m_bAnyPassed = true;
4024
void CConditionGroup::PreScanNeighborhoodAllOM(CTimeStep *t, CSingleMolecule *rm)
4032
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
4033
((CConditionSubGroup*)m_oaConditionSubGroups[z])->PreScanNeighborhoodAllOM(t,rm);
4039
void CConditionGroup::Parse(int rm, int sm)
4042
CConditionSubGroup *sg;
4048
try { m_bAlwaysTrue = new bool[((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_bAlwaysTrue = NULL; }
4049
if (m_bAlwaysTrue == NULL) NewException((double)((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()*sizeof(bool),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4051
try { m_iPassCounter = new long[((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iPassCounter = NULL; }
4052
if (m_iPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4054
try { m_iOMPassCounter = new long[((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iOMPassCounter = NULL; }
4055
if (m_iOMPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4057
for (z=0;z<((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize();z++)
4059
m_bAlwaysTrue[z] = false;
4060
m_iPassCounter[z] = 0;
4061
m_iOMPassCounter[z] = 0;
4064
try { m_iRMPassCounter = new long[((CMolecule*)g_oaMolecules[rm])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iRMPassCounter = NULL; }
4065
if (m_iRMPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[rm])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4067
for (z=0;z<((CMolecule*)g_oaMolecules[rm])->m_laSingleMolIndex.GetSize();z++)
4068
m_iRMPassCounter[z] = 0;
4070
mprintf("Different sets of conditions are connected with OR (at least one of them has to be fulfilled).\n");
4071
mprintf("Different conditions within one set are connected with AND (have to be fulfilled at the same time).\n");
4072
mprintf("If you create 1 or 2 sets of conditions, a table with subcondition count populations will be printed.\n\n");
4074
mprintf(YELLOW,">>> %d. set of conditions >>>\n",m_oaConditionSubGroups.GetSize()+1);
4076
try { sg = new CConditionSubGroup(); } catch(...) { sg = NULL; }
4077
if (sg == NULL) NewException((double)sizeof(CConditionSubGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4079
sg->m_iShowMol = m_iShowMol;
4080
sg->m_iNumber = m_oaConditionSubGroups.GetSize();
4081
m_oaConditionSubGroups.Add(sg);
4083
mprintf(YELLOW,"\n<<< End of %d. set of conditions <<<\n\n",m_oaConditionSubGroups.GetSize());
4084
if (AskYesNo(" Enter an additional set of conditions (y/n)? [no] ",false))
4087
m_bInvertCondition = AskYesNo(" Invert this condition (only add bin entries if failed) (y/n)? [no] ",false);
4089
if (m_oaConditionSubGroups.GetSize() == 2)
4093
try { m_pTable = new double[(((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_iCombinations+1) * (((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)]; } catch(...) { m_pTable = NULL; }
4094
if (m_pTable == NULL) NewException((double)(((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_iCombinations+1) * (((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)*sizeof(double),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4096
for (z=0;z<(((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_iCombinations+1) * (((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1);z++)
4100
/* m_bNeedNbCountMode = false;
4101
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
4103
sg = (CConditionSubGroup*)m_oaConditionSubGroups[z];
4104
for (z2=0;z2<sg->m_oaConditions.GetSize();z2++)
4105
if (((CNbSearch*)sg->m_oaConditions[z2])->m_iNbCountMin != -1)
4106
m_bNeedNbCountMode = true;
4110
try {m_pHistogram = new unsigned long[((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()+1]; } catch(...) { m_pHistogram = NULL; }
4111
if (m_pHistogram == NULL) NewException((double)((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()+1*sizeof(unsigned long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4113
for (z=0;z<((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()+1;z++)
4114
m_pHistogram[z] = 0;
4119
void CConditionGroup::PrintData()
4123
mprintf(GREEN,"\n>>> Condition Data >>>\n\n");
4124
mprintf(" %.0f of %.0f molecules passed the conditions (%.2f percent).\n",m_fPassed,m_fTotal,ZeroDivide(m_fPassed,m_fTotal)*100.0f);
4127
mprintf(YELLOW,"\n No molecules at all passed the condition.\n");
4128
mprintf(" This is probably not what you wanted.\n");
4131
mprintf(YELLOW,"\nList of reference molecules (%s) that passed the conditions:\n\n",((CMolecule*)g_oaMolecules[m_iRefMol])->m_sName);
4132
for (z=0;z<((CMolecule*)g_oaMolecules[m_iRefMol])->m_laSingleMolIndex.GetSize();z++)
4133
if (m_iRMPassCounter[z] > 0)
4134
mprintf(" - %2d: %10.4f percent of the time (%d hits)\n",z+1,((double)m_iRMPassCounter[z])/g_iSteps*100.0,m_iRMPassCounter[z]);
4136
mprintf(YELLOW,"\nList of observed molecules (%s) that passed the conditions:\n\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
4137
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
4138
if (m_iOMPassCounter[z] > 0)
4139
mprintf(" - %2d: %10.4f percent of the time (%d hits)\n",z+1,((double)m_iOMPassCounter[z])/g_iSteps*100.0,m_iOMPassCounter[z]);
4141
mprintf(YELLOW,"\nNeighbor count histogram:\n\n");
4142
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()+1;z++)
4143
if (m_pHistogram[z] != 0)
4144
mprintf(" - %d Neighbors: %8.4f percent of the time (%d hits).\n",z,((double)m_pHistogram[z])/m_iHistoGes*100.0,m_pHistogram[z]);
4145
mprintf(YELLOW,"\nListing for all sets of conditions:\n");
4146
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
4147
((CConditionSubGroup*)m_oaConditionSubGroups[z])->PrintData();
4148
mprintf(GREEN,"\n<<< End of Condition Data <<<\n\n");
4152
void CConditionGroup::PrintData(char *s)
4157
mprintf(GREEN,"\n>>> Condition Data >>>\n\n");
4158
mprintf(" %.0f of %.0f molecules passed the conditions (%.2f percent).\n",m_fPassed,m_fTotal,ZeroDivide(m_fPassed,m_fTotal)*100.0f);
4161
mprintf("\n No molecules at all passed the condition.\n");
4162
mprintf(" This is probably not what you wanted.\n");
4164
mprintf("\nNeighbor count histogram:\n\n");
4165
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()+1;z++)
4166
if (m_pHistogram[z] != 0)
4167
mprintf(" - %d Neighbors: %8.4f percent of the time (%d hits).\n",z,((double)m_pHistogram[z])/m_iHistoGes*100.0,m_pHistogram[z]);
4168
mprintf("\n Saving detailed condition data as \"%s\"...\n",s);
4170
a = OpenFileWrite(s,true);
4172
mfprintf(a,"\n>>> Condition Data >>>\n\n");
4173
mfprintf(a," %.0f of %.0f molecules passed the conditions (%.2f percent).\n",m_fPassed,m_fTotal,ZeroDivide(m_fPassed,m_fTotal)*100.0f);
4176
mfprintf(a,"\n No molecules at all passed the condition.\n");
4177
mfprintf(a," This is probably not what you wanted.\n");
4180
mfprintf(a,"\nList of reference molecules (%s) that passed the conditions:\n\n",((CMolecule*)g_oaMolecules[m_iRefMol])->m_sName);
4181
for (z=0;z<((CMolecule*)g_oaMolecules[m_iRefMol])->m_laSingleMolIndex.GetSize();z++)
4182
if (m_iRMPassCounter[z] > 0)
4183
mfprintf(a," - %2d: %10.4f percent of the time (%lu hits)\n",z+1,((double)m_iRMPassCounter[z])/g_iSteps*100.0,m_iRMPassCounter[z]);
4185
mfprintf(a,"\nList of observed molecules (%s) that passed the conditions:\n\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
4186
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
4187
if (m_iOMPassCounter[z] > 0)
4188
mfprintf(a," - %2d: %10.4f percent of the time (%lu hits)\n",z+1,((double)m_iOMPassCounter[z])/g_iSteps*100.0,m_iOMPassCounter[z]);
4190
mfprintf(a,"\nNeighbor count histogram:\n\n");
4191
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()+1;z++)
4192
if (m_pHistogram[z] != 0)
4193
mfprintf(a," - %d Neighbors: %8.4f percent of the time (%lu hits).\n",z,((double)m_pHistogram[z])/m_iHistoGes*100.0,m_pHistogram[z]);
4194
mfprintf(a,"\nListing for all sets of conditions:\n");
4195
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
4196
((CConditionSubGroup*)m_oaConditionSubGroups[z])->PrintData(a);
4197
mfprintf(a,"\n<<< End of Condition Data <<<\n\n");
4200
mprintf(GREEN,"\n<<< End of Condition Data <<<\n\n");
4204
bool CConditionSubGroup::Contains(int mol)
4209
for (z=0;z<m_oaConditions.GetSize();z++)
4211
if (!((CNbSearch*)m_oaConditions[z])->m_bPassed[mol])
4222
void CConditionSubGroup::MarkPassedAtoms(int om)
4226
for (z=0;z<g_iGesVirtAtomCount;z++)
4227
m_bTempPassed[z] = false;
4229
for (z=0;z<m_oaConditions.GetSize();z++)
4231
for (z2=0;z2<g_iGesVirtAtomCount;z2++)
4232
if (g_baAtomPassedCondition[z2] < 100)
4233
g_baAtomPassedCondition[z2] = 0;
4235
((CNbSearch*)m_oaConditions[z])->MarkPassedAtoms(om);
4237
for (z2=0;z2<g_iGesVirtAtomCount;z2++)
4238
if (g_baAtomPassedCondition[z2] == 1)
4239
m_bTempPassed[z2] = true;
4242
for (z=0;z<g_iGesVirtAtomCount;z++)
4243
if (m_bTempPassed[z])
4244
g_baAtomPassedCondition[z] = 100;
4248
void CConditionSubGroup::ScanNeighborhoodAllOM(CTimeStep *t, CSingleMolecule *rm)
4252
for (z=0;z<m_oaConditions.GetSize();z++)
4253
((CNbSearch*)m_oaConditions[z])->ScanAllOM(rm,t);
4255
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
4258
for (z2=0;z2<m_oaConditions.GetSize();z2++)
4259
if (!((CNbSearch*)m_oaConditions[z2])->m_bPassed[z])
4267
void CConditionSubGroup::PreScanNeighborhoodAllOM(CTimeStep *t, CSingleMolecule *rm)
4271
for (z=0;z<m_oaConditions.GetSize();z++)
4272
((CNbSearch*)m_oaConditions[z])->PreScanAllOM(rm,t);
4276
void CConditionSubGroup::Parse(int rm, int sm)
4281
m_iCombinations = 0;
4284
try { n = new CNbSearch(); } catch(...) { n = NULL; }
4285
if (n == NULL) NewException((double)sizeof(CNbSearch),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4287
n->m_iNumber = m_oaConditions.GetSize();
4288
m_oaConditions.Add(n);
4289
n->Parse(rm,sm,false);
4290
m_iCombinations += n->m_iCombinationsEnabled;
4291
} while (AskYesNo(" Add another condition to this set of conditions (y/n)? [no] ",false));
4293
try { m_bTempPassed = new bool[g_iGesVirtAtomCount]; } catch(...) { m_bTempPassed = NULL; }
4294
if (m_bTempPassed == NULL) NewException((double)g_iGesVirtAtomCount*sizeof(bool),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4300
void CADF::ParseCondition(int rm, bool nocrit)
4307
mprintf(WHITE,"\n>>> Angular Condition >>>\n");
4311
m_iCombinations = 0;
4315
mprintf("\n %d. set of vectors\n\n",z2+1);
4319
m_bSameFoot = AskYesNo(" Should the base points of the 1st and 2nd vectors always be equal (y/n)? [no] ",false);
4320
else m_bSameFoot = false;*/
4321
m_bOrtho[z] = (AskRangeInteger("\n Should the %d. vector connect two points (0) or stand perpendicular on 3 points (1)? [0] ",0,1,0,z+1) != 0);
4325
/* if (m_bSameFoot && (z == 1))
4327
m_iRefOrSec[1][0] = m_iRefOrSec[0][0];
4328
m_oaVectors.Add(NULL);
4331
_ax1: if (m_iShowMol != -1)
4332
m_iRefOrSec[z][0] = AskRangeInteger(" Take atom(s) in base point from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4333
else m_iRefOrSec[z][0] = 0;
4334
mprintf(" Enter atom(s) in the base point (e.g. C7): ");
4335
inpprintf("! Enter atom(s) in the base point (e.g. C7):\n");
4338
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4339
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4341
if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4343
eprintf("Wrong input.\n");
4344
inpprintf("! Wrong input.\n");
4348
m_oaVectors.Add(ag);
4349
ti *= ag->m_iAtomGes;
4351
_ax2: if (m_iShowMol != -1)
4352
m_iRefOrSec[z][1] = AskRangeInteger(" Take 2nd atom(s) of normal plane from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4353
else m_iRefOrSec[z][1] = 0;
4354
mprintf(" Enter 2nd atom(s) of normal plane (e.g. C7): ");
4355
inpprintf("! Enter 2nd atom(s) of normal plane (e.g. C7):\n");
4358
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4359
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4361
if (!ag->ParseAtoms((!m_iRefOrSec[z][1])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4363
eprintf("Wrong input.\n");
4364
inpprintf("! Wrong input.\n");
4368
m_oaVectors.Add(ag);
4369
ti *= ag->m_iAtomGes;
4370
_ax3: if (m_iShowMol != -1)
4371
m_iRefOrSec[z][2] = AskRangeInteger(" Take 3rd atom(s) of normal plane from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4372
else m_iRefOrSec[z][2] = 0;
4373
mprintf(" Enter 3rd atom(s) of normal plane (e.g. C7): ");
4374
inpprintf("! Enter 3rd atom(s) of normal plane (e.g. C7):\n");
4377
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4378
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4380
if (!ag->ParseAtoms((!m_iRefOrSec[z][2])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4382
eprintf("Wrong input.\n");
4383
inpprintf("! Wrong input.\n");
4387
m_oaVectors.Add(ag);
4388
ti *= ag->m_iAtomGes;
4389
} else // IF NOT ORTHO
4391
/* if (m_bSameFoot && (z == 1))
4393
m_iRefOrSec[1][0] = m_iRefOrSec[0][0];
4394
m_oaVectors.Add(NULL);
4397
_ax4: if (m_iShowMol != -1)
4398
m_iRefOrSec[z][0] = AskRangeInteger(" Take atom(s) in base point from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4399
else m_iRefOrSec[z][0] = 0;
4400
mprintf(" Enter atom(s) in the base point (e.g. C7): ");
4401
inpprintf("! Enter atom(s) in the base point (e.g. C7):\n");
4404
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4405
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4407
if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4409
eprintf("Wrong input.\n");
4410
inpprintf("! Wrong input.\n");
4414
m_oaVectors.Add(ag);
4415
ti *= ag->m_iAtomGes;
4416
} // END IF NOT SAMEFOOT
4417
_ax5: if (m_iShowMol != -1)
4418
m_iRefOrSec[z][1] = AskRangeInteger(" Take atom(s) in tip point from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4419
else m_iRefOrSec[z][1] = 0;
4420
mprintf(" Enter atom(s) in the tip point (e.g. C7): ");
4421
inpprintf("! Enter atom(s) in the tip point (e.g. C7):\n");
4424
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4425
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4427
if (!ag->ParseAtoms((!m_iRefOrSec[z][1])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4429
eprintf("Wrong input.\n");
4430
inpprintf("! Wrong input.\n");
4434
m_oaVectors.Add(ag);
4435
ti *= ag->m_iAtomGes;
4436
m_oaVectors.Add(NULL);
4437
} // END IF NOT ORTHO
4439
m_iCombinations += ti;
4441
} while (AskYesNo("\n Enter another set of vectors (y/n)? [no] ",false));
4445
m_faMinMaxAngle.Add(AskFloat(" Enter minimal angle between the vectors in degree: [0.0] ",0.0f));
4446
m_faMinMaxAngle.Add(AskFloat(" Enter maximal angle between the vectors in degree: [180.0] ",180.0f));
4447
} while (AskYesNo(" Enter another angle interval (y/n)? [no] ",false));
4450
m_faMinMaxAngle.Add(0.0f);
4451
m_faMinMaxAngle.Add(180.0f);
4453
mprintf(WHITE,"\n<<< End of Angular Condition <<<\n\n");
4458
void CADF::ParseConditionGrid(int rm, int gridmode)
4465
mprintf(WHITE,"\n>>> Angular Condition >>>\n");
4469
m_iCombinations = 0;
4473
mprintf("\n %d. set of vectors\n\n",z2+1);
4477
m_bSameFoot = AskYesNo(" Should the base points of the 1st and 2nd vectors always be equal (y/n)? [no] ",false);
4478
else m_bSameFoot = false;*/
4479
m_bOrtho[z] = (AskRangeInteger("\n Should the %d. vector connect two points (0) or stand perpendicular on 3 points (1)? [0] ",0,1,0,z+1) != 0);
4483
/* if (m_bSameFoot && (z == 1))
4485
m_iRefOrSec[1][0] = m_iRefOrSec[0][0];
4486
m_oaVectors.Add(NULL);
4489
_ax1: if (m_iShowMol != -1)
4490
m_iRefOrSec[z][0] = AskRangeInteger(" Take atom(s) in base point from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4491
else m_iRefOrSec[z][0] = 0;
4492
mprintf(" Enter atom(s) in the base point (e.g. C7): ");
4493
inpprintf("! Enter atom(s) in the base point (e.g. C7):\n");
4496
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4497
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4499
m_oaVectors.Add(ag);
4500
if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4502
eprintf("Wrong input.\n");
4503
inpprintf("! Wrong input.\n");
4506
ti *= ag->m_iAtomGes;
4508
_ax2: if (m_iShowMol != -1)
4509
m_iRefOrSec[z][1] = AskRangeInteger(" Take 2nd atom(s) of normal plane from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4510
else m_iRefOrSec[z][1] = 0;
4511
mprintf(" Enter 2nd atom(s) of normal plane (e.g. C7): ");
4512
inpprintf("! Enter 2nd atom(s) of normal plane (e.g. C7):\n");
4515
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4516
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4518
m_oaVectors.Add(ag);
4519
if (!ag->ParseAtoms((!m_iRefOrSec[z][1])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4521
eprintf("Wrong input.\n");
4522
inpprintf("! Wrong input.\n");
4525
ti *= ag->m_iAtomGes;
4526
_ax3: if (m_iShowMol != -1)
4527
m_iRefOrSec[z][2] = AskRangeInteger(" Take 3rd atom(s) of normal plane from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4528
else m_iRefOrSec[z][2] = 0;
4529
mprintf(" Enter 3rd atom(s) of normal plane (e.g. C7): ");
4530
inpprintf("! Enter 3rd atom(s) of normal plane (e.g. C7):\n");
4533
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4534
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4536
m_oaVectors.Add(ag);
4537
if (!ag->ParseAtoms((!m_iRefOrSec[z][2])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4539
eprintf("Wrong input.\n");
4540
inpprintf("! Wrong input.\n");
4543
ti *= ag->m_iAtomGes;
4544
} else // IF NOT ORTHO
4546
/* if (m_bSameFoot && (z == 1))
4548
m_iRefOrSec[1][0] = m_iRefOrSec[0][0];
4549
m_oaVectors.Add(NULL);
4552
_ax4: if (m_iShowMol != -1)
4553
m_iRefOrSec[z][0] = AskRangeInteger(" Take atom(s) in base point from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4554
else m_iRefOrSec[z][0] = 0;
4555
mprintf(" Enter atom(s) in the base point (e.g. C7): ");
4556
inpprintf("! Enter atom(s) in the base point (e.g. C7):\n");
4559
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4560
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4562
m_oaVectors.Add(ag);
4563
if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4565
eprintf("Wrong input.\n");
4566
inpprintf("! Wrong input.\n");
4569
ti *= ag->m_iAtomGes;
4570
} // END IF NOT SAMEFOOT
4571
_ax5: if (m_iShowMol != -1)
4572
m_iRefOrSec[z][1] = AskRangeInteger(" Take atom(s) in tip point from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4573
else m_iRefOrSec[z][1] = 0;
4574
mprintf(" Enter atom(s) in the tip point (e.g. C7): ");
4575
inpprintf("! Enter atom(s) in the tip point (e.g. C7):\n");
4578
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4579
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4581
m_oaVectors.Add(ag);
4582
if (!ag->ParseAtoms((!m_iRefOrSec[z][1])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4584
eprintf("Wrong input.\n");
4585
inpprintf("! Wrong input.\n");
4588
ti *= ag->m_iAtomGes;
4589
m_oaVectors.Add(NULL);
4590
} // END IF NOT ORTHO
4592
m_iCombinations += ti;
4594
} while (AskYesNo("\n Enter another set of vectors (y/n)? [no] ",false));
4595
if ((gridmode == 1) || (gridmode == 6))
4597
m_faMinMaxAngle.Add(AskFloat(" Enter minimal angle between the vectors in degree: [0.0] ",0.0f));
4598
m_faMinMaxAngle.Add(AskFloat(" Enter maximal angle between the vectors in degree: [180.0] ",180.0f));
4601
m_faMinMaxAngle.Add(0.0f);
4602
m_faMinMaxAngle.Add(180.0f);
4604
mprintf(WHITE,"\n<<< End of Angular Condition <<<\n\n");
4609
void CADF::ParseCondition_OnlyValues()
4614
mprintf(" Angular condition between vectors:\n");
4615
for (z=0;z<m_oaVectors.GetSize()/6;z++)
4618
if (m_oaVectors[z*6+2] != NULL)
4619
mprintf("normal(%s, %s, %s)",((CAtomGroup*)m_oaVectors[z*6])->m_sName,((CAtomGroup*)m_oaVectors[z*6+1])->m_sName,((CAtomGroup*)m_oaVectors[z*6+2])->m_sName);
4620
else mprintf("(%s --> %s)",((CAtomGroup*)m_oaVectors[z*6])->m_sName,((CAtomGroup*)m_oaVectors[z*6+1])->m_sName);
4622
if (m_oaVectors[z*6+5] != NULL)
4623
mprintf("normal(%s, %s, %s)",((CAtomGroup*)m_oaVectors[z*6+3])->m_sName,((CAtomGroup*)m_oaVectors[z*6+4])->m_sName,((CAtomGroup*)m_oaVectors[z*6+5])->m_sName);
4624
else mprintf("(%s --> %s)",((CAtomGroup*)m_oaVectors[z*6+3])->m_sName,((CAtomGroup*)m_oaVectors[z*6+4])->m_sName);
4627
for (z=0;z<m_faMinMaxAngle.GetSize()/2;z++)
4629
mprintf(" Interval %d:\n",z+1,m_faMinMaxAngle.GetSize()/2);
4630
m_faMinMaxAngle[z*2] = AskFloat(" Enter minimal angle between the vectors in degree: [0.0] ",0.0f);
4631
m_faMinMaxAngle[z*2+1] = AskFloat(" Enter maximal angle between the vectors in degree: [180.0] ",180.0f);
4633
// mprintf(WHITE,"\n<<< End of Angular Condition <<<\n\n");
4638
CObservation::CObservation()
4640
m_pConditions = NULL;
4641
m_pConditionsOM2 = NULL;
3632
m_iHistogramRes = AskUnsignedInteger(" Please enter histogram resolution (0=no histogram): [5000] ",5000);
3633
else m_iHistogramRes = 0;
3635
/* mprintf(" Save temporal Development of Velocity (0=no, 1=yes)? [0] ");
3637
m_bSaveSpeed = atoi(buf)!=0;*/
3639
mprintf(WHITE,"\n<<< End of Velocity Distribution Function <<<\n\n");
3644
void CSDF::BuildName()
3652
sprintf(tmp,"%s_%s%d%s%d%s%d_%s_%s",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CAtom*)g_oaAtoms[g_iFixRealAtomType[1]])->m_sName,g_iFixAtom[1]+1,((CAtom*)g_oaAtoms[g_iFixRealAtomType[2]])->m_sName,g_iFixAtom[2]+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,m_oAtoms.m_sName);
3653
else sprintf(tmp,"%s_%s%d%s%d%s%d_%s",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CAtom*)g_oaAtoms[g_iFixRealAtomType[1]])->m_sName,g_iFixAtom[1]+1,((CAtom*)g_oaAtoms[g_iFixRealAtomType[2]])->m_sName,g_iFixAtom[2]+1,m_oAtoms.m_sName);
3655
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
3656
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3658
strcpy(m_sName,tmp);
3663
void CVDF::BuildName()
3669
sprintf(tmp,"deriv%d_%s",m_iDeriv,m_oAtoms.m_sName);
3670
else sprintf(tmp,"%s",m_oAtoms.m_sName);
3672
try { m_sShortName = new char[strlen(tmp)+1]; } catch(...) { m_sShortName = NULL; }
3673
if (m_sShortName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3675
strcpy(m_sShortName,m_oAtoms.m_sName);
3676
if (g_iFixMol == -1)
3678
sprintf(tmp,"%s_",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3679
} else if (m_iRefOrSec)
3680
sprintf(tmp,"%s_%s%d_%s_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
3681
else sprintf(tmp,"%s_%s%d_",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1);
3682
strcat(tmp,m_sShortName);
3684
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
3685
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3687
strcpy(m_sName,tmp);
3692
void CSDF::BuildAtomList(CSingleMolecule *ref, CSingleMolecule *obs, CxIntArray *vec)
3698
vec->RemoveAll_KeepSize();
3699
for (z1t=0;z1t<m_oAtoms.m_baAtomType.GetSize();z1t++)
3701
// mprintf("(a) BuildAtomList z1t=%d, WA=%X\n",z1t,m_oAtoms.m_oaAtoms[z1t]);
3702
a1 = (CxIntArray*)m_oAtoms.m_oaAtoms[z1t];
3703
// mprintf("(b) BuildAtomList wa.GetSize()=%d\n",a1->GetSize());
3704
for (z1a=0;z1a<a1->GetSize();z1a++)
3707
// mprintf("(c) BuildAtomList z1t=%d, z1a=%d, Type=%d, WA=%X\n",z1t,z1a,m_oAtoms.m_baAtomType[z1t],obs->m_oaAtomOffset[m_oAtoms.m_baAtomType[z1t]]);
3708
vec->Add(((CxIntArray*)obs->m_oaAtomOffset[m_oAtoms.m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
3709
} else vec->Add(((CxIntArray*)ref->m_oaAtomOffset[m_oAtoms.m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
3715
void CVDF::BuildAtomList(CSingleMolecule *ref, CSingleMolecule *obs, CxIntArray *vec)
3721
vec->RemoveAll_KeepSize();
3722
for (z1t=0;z1t<m_oAtoms.m_baAtomType.GetSize();z1t++)
3724
a1 = (CxIntArray*)m_oAtoms.m_oaAtoms[z1t];
3725
for (z1a=0;z1a<a1->GetSize();z1a++)
3727
vec->Add(((CxIntArray*)obs->m_oaAtomOffset[m_oAtoms.m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
3728
else vec->Add(((CxIntArray*)ref->m_oaAtomOffset[m_oAtoms.m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
3734
void CRDF::BuildAtomList(CSingleMolecule *ref, CSingleMolecule *obs, CxIntArray *vec)
3737
int z, z1t, z1a, z2t, z2a;
3738
CAtomGroup *g1, *g2;
3739
CxIntArray *a1, *a2;
3741
vec->RemoveAll_KeepSize();
3742
for (z=0;z<m_oaVectors.GetSize()/2;z++)
3744
g1 = (CAtomGroup*)m_oaVectors[z*2];
3745
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
3747
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
3748
for (z1a=0;z1a<a1->GetSize();z1a++)
3750
g2 = (CAtomGroup*)m_oaVectors[z*2+1];
3751
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
3753
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
3754
for (z2a=0;z2a<a2->GetSize();z2a++)
3757
vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
3758
else vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
3760
vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
3761
else vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
3762
// mprintf("Vector z=%d, z1t=%d, z1a=%d, z2t=%d, z2a=%d.\n",z,z1t,z1a,z2t,z2a);
3772
void CVHDF::BuildAtomList(CSingleMolecule *ref, CSingleMolecule *obs, CxIntArray *vec)
3775
int z, z1t, z1a, z2t, z2a;
3776
CAtomGroup *g1, *g2;
3777
CxIntArray *a1, *a2;
3779
vec->RemoveAll_KeepSize();
3780
for (z=0;z<m_oaVectors.GetSize()/2;z++)
3782
g1 = (CAtomGroup*)m_oaVectors[z*2];
3783
for (z1t=0;z1t<g1->m_baAtomType.GetSize();z1t++)
3785
a1 = (CxIntArray*)g1->m_oaAtoms[z1t];
3786
for (z1a=0;z1a<a1->GetSize();z1a++)
3788
g2 = (CAtomGroup*)m_oaVectors[z*2+1];
3789
for (z2t=0;z2t<g2->m_baAtomType.GetSize();z2t++)
3791
a2 = (CxIntArray*)g2->m_oaAtoms[z2t];
3792
for (z2a=0;z2a<a2->GetSize();z2a++)
3795
vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
3796
else vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g1->m_baAtomType[z1t]])->GetAt(a1->GetAt(z1a)));
3798
vec->Add(((CxIntArray*)obs->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
3799
else vec->Add(((CxIntArray*)ref->m_oaAtomOffset[g2->m_baAtomType[z2t]])->GetAt(a2->GetAt(z2a)));
3809
/*int FindAtom(char *s)
3813
for (z=0;z<g_oaAtoms.GetSize();z++)
3814
if (mystricmp(s,((CAtom*)g_oaAtoms[z])->m_sName)==0)
3824
int CMolecule::FindAtomInMol(const char *s)
3828
for (z=0;z<m_baAtomIndex.GetSize();z++)
3829
if (mystricmp(s,((CAtom*)g_oaAtoms[m_baAtomIndex[z]])->m_sName)==0)
3839
void CMolecule::BuildName()
3843
char buf[16], buf2[256];
3850
for (z=0;z<g_oaAtoms.GetSize();z++)
3852
for (z2=0;z2<m_baAtomIndex.GetSize();z2++)
3854
if (m_baAtomIndex[z2] != z)
3856
if (m_waAtomCount[z2] > 1)
3857
sprintf(buf,"%s%d",((CAtom*)g_oaAtoms[z])->m_sName,m_waAtomCount[z2]);
3858
else sprintf(buf,"%s",((CAtom*)g_oaAtoms[z])->m_sName);
3863
try { m_sName = new char[strlen(buf2)+1]; } catch(...) { m_sName = NULL; }
3864
if (m_sName == NULL) NewException((double)(strlen(buf2)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
3866
strcpy(m_sName,buf2);
3871
bool CConditionGroup::Contains(int mol)
3877
return m_bAlwaysTrue[mol];
3879
if (m_bInvertCondition)
3881
if (m_bAlwaysTrue[mol])
3886
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
3888
if (((CConditionSubGroup*)m_oaConditionSubGroups[z])->Contains(mol))
3898
if (m_bAlwaysTrue[mol])
3903
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
3905
if (((CConditionSubGroup*)m_oaConditionSubGroups[z])->Contains(mol))
3917
void CConditionGroup::MarkPassedAtoms(int om, bool passed)
3923
// mprintf("######## OM %d ##########\n",om+1);
3925
for (z=0;z<g_iGesVirtAtomCount;z++)
3926
g_baAtomPassedCondition[z] = 110; // 110 heisst: Atom kommt nicht in einer Condition vor
3928
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
3929
((CConditionSubGroup*)m_oaConditionSubGroups[z])->MarkPassedAtoms(om);
3931
// for (z=0;z<g_iGesVirtAtomCount;z++)
3932
// mprintf("\nAtom %d: %d.",z+1,g_baAtomPassedCondition[z]);
3935
if (m_bInvertCondition)
3937
for (z=0;z<g_iGesVirtAtomCount;z++)
3939
if (g_baAtomPassedCondition[z] != 100) // Entweder Condition nicht bestanden oder Atom kam gar nicht darin vor
3942
g_baAtomPassedCondition[z] = 1;
3943
// mprintf("%d: Ok\n",z+1);
3944
// mprintf("\n %d --> Wird genommen.",z+1);
3945
} else // Condition bestanden
3947
// mprintf("Atom %s%d nicht bestanden (%d).\n",((CAtom*)g_oaAtoms[g_waAtomRealElement[z]])->m_sName,g_waAtomMolNumber[z]+1,g_baAtomPassedCondition[z]);
3948
// mprintf("\n%d erfuellt --> durchgefallen",z+1);
3949
g_baAtomPassedCondition[z] = 0;
3954
for (z=0;z<g_iGesVirtAtomCount;z++)
3958
if (g_baAtomPassedCondition[z] >= 100) // Entweder Condition bestanden oder Atom kam gar nicht darin vor
3961
g_baAtomPassedCondition[z] = 1;
3962
} else // Condition nicht bestanden
3964
// mprintf("Atom %s%d nicht bestanden (%d).\n",((CAtom*)g_oaAtoms[g_waAtomRealElement[z]])->m_sName,g_waAtomMolNumber[z]+1,g_baAtomPassedCondition[z]);
3965
g_baAtomPassedCondition[z] = 0;
3969
if (g_baAtomPassedCondition[z] == 100) // Condition bestanden
3972
// mprintf("### Atom %s[%d] %s%d bestanden (%d).\n",((CMolecule*)g_oaMolecules[g_waAtomMolIndex[z]])->m_sName,g_laAtomSMLocalIndex[z]+1,((CAtom*)g_oaAtoms[g_waAtomRealElement[z]])->m_sName,g_waAtomMolNumber[z]+1,g_baAtomPassedCondition[z]);
3973
g_baAtomPassedCondition[z] = 0;
3974
} else // Entweder Condition nicht bestanden oder Atom kam gar nicht darin vor
3976
// mprintf("--- Atom %s[%d] %s%d nicht bestanden (%d).\n",((CMolecule*)g_oaMolecules[g_waAtomMolIndex[z]])->m_sName,g_laAtomSMLocalIndex[z]+1,((CAtom*)g_oaAtoms[g_waAtomRealElement[z]])->m_sName,g_waAtomMolNumber[z]+1,g_baAtomPassedCondition[z]);
3977
g_baAtomPassedCondition[z] = 1;
3982
// mprintf("\nMarked %d / %d atoms as enabled.",ti,g_iGesVirtAtomCount);
3988
void CConditionGroup::ScanNeighborhoodAllOM(CTimeStep *t, CSingleMolecule *rm)
3991
int z, z2, t1, t2, i;
3996
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
3997
((CConditionSubGroup*)m_oaConditionSubGroups[z])->ScanNeighborhoodAllOM(t,rm);
3999
if (m_oaConditionSubGroups.GetSize() == 2)
4001
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
4005
for (z2=0;z2<((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_oaConditions.GetSize();z2++)
4006
t1 += ((CNbSearch*)((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_oaConditions[z2])->m_iCombPassCount[z];
4007
for (z2=0;z2<((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_oaConditions.GetSize();z2++)
4008
t2 += ((CNbSearch*)((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_oaConditions[z2])->m_iCombPassCount[z];
4009
m_pTable[t1*(((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)+t2]++;
4015
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
4018
if (m_bInvertCondition)
4020
for (z2=0;z2<m_oaConditionSubGroups.GetSize();z2++)
4021
if (((CConditionSubGroup*)m_oaConditionSubGroups[z2])->Contains(z))
4024
m_iPassCounter[z]++;
4025
m_bAnyPassed = true;
4028
for (z2=0;z2<m_oaConditionSubGroups.GetSize();z2++)
4030
if (((CConditionSubGroup*)m_oaConditionSubGroups[z2])->Contains(z))
4032
// mprintf("passed[%d]++\n",z);
4034
m_iPassCounter[z]++;
4035
m_bAnyPassed = true;
4050
void CConditionGroup::PreScanNeighborhoodAllOM(CTimeStep *t, CSingleMolecule *rm)
4058
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
4059
((CConditionSubGroup*)m_oaConditionSubGroups[z])->PreScanNeighborhoodAllOM(t,rm);
4065
void CConditionGroup::Parse(int rm, int sm)
4068
CConditionSubGroup *sg;
4074
try { m_bAlwaysTrue = new bool[((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_bAlwaysTrue = NULL; }
4075
if (m_bAlwaysTrue == NULL) NewException((double)((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()*sizeof(bool),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4077
try { m_iPassCounter = new long[((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iPassCounter = NULL; }
4078
if (m_iPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4080
try { m_iOMPassCounter = new long[((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iOMPassCounter = NULL; }
4081
if (m_iOMPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4083
for (z=0;z<((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize();z++)
4085
m_bAlwaysTrue[z] = false;
4086
m_iPassCounter[z] = 0;
4087
m_iOMPassCounter[z] = 0;
4090
try { m_iRMPassCounter = new long[((CMolecule*)g_oaMolecules[rm])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iRMPassCounter = NULL; }
4091
if (m_iRMPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[rm])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4093
for (z=0;z<((CMolecule*)g_oaMolecules[rm])->m_laSingleMolIndex.GetSize();z++)
4094
m_iRMPassCounter[z] = 0;
4096
mprintf("Different sets of conditions are connected with OR (at least one of them has to be fulfilled).\n");
4097
mprintf("Different conditions within one set are connected with AND (have to be fulfilled at the same time).\n");
4098
mprintf("If you create 1 or 2 sets of conditions, a table with subcondition count populations will be printed.\n\n");
4100
mprintf(YELLOW,">>> %d. set of conditions >>>\n",m_oaConditionSubGroups.GetSize()+1);
4102
try { sg = new CConditionSubGroup(); } catch(...) { sg = NULL; }
4103
if (sg == NULL) NewException((double)sizeof(CConditionSubGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4105
sg->m_iShowMol = m_iShowMol;
4106
sg->m_iNumber = m_oaConditionSubGroups.GetSize();
4107
m_oaConditionSubGroups.Add(sg);
4109
mprintf(YELLOW,"\n<<< End of %d. set of conditions <<<\n\n",m_oaConditionSubGroups.GetSize());
4110
if (AskYesNo(" Enter an additional set of conditions (y/n)? [no] ",false))
4113
m_bInvertCondition = AskYesNo(" Invert this condition (only add bin entries if failed) (y/n)? [no] ",false);
4115
if (m_oaConditionSubGroups.GetSize() == 2)
4119
try { m_pTable = new double[(((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_iCombinations+1) * (((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)]; } catch(...) { m_pTable = NULL; }
4120
if (m_pTable == NULL) NewException((double)(((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_iCombinations+1) * (((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)*sizeof(double),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4122
for (z=0;z<(((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_iCombinations+1) * (((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1);z++)
4126
/* m_bNeedNbCountMode = false;
4127
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
4129
sg = (CConditionSubGroup*)m_oaConditionSubGroups[z];
4130
for (z2=0;z2<sg->m_oaConditions.GetSize();z2++)
4131
if (((CNbSearch*)sg->m_oaConditions[z2])->m_iNbCountMin != -1)
4132
m_bNeedNbCountMode = true;
4136
try {m_pHistogram = new unsigned long[((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()+1]; } catch(...) { m_pHistogram = NULL; }
4137
if (m_pHistogram == NULL) NewException((double)((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()+1*sizeof(unsigned long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4139
for (z=0;z<((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()+1;z++)
4140
m_pHistogram[z] = 0;
4145
void CConditionGroup::PrintData()
4149
mprintf(GREEN,"\n>>> Condition Data >>>\n\n");
4150
mprintf(" %.0f of %.0f molecules passed the conditions (%.2f percent).\n",m_fPassed,m_fTotal,ZeroDivide(m_fPassed,m_fTotal)*100.0f);
4153
mprintf(YELLOW,"\n No molecules at all passed the condition.\n");
4154
mprintf(" This is probably not what you wanted.\n");
4157
mprintf(YELLOW,"\nList of reference molecules (%s) that passed the conditions:\n\n",((CMolecule*)g_oaMolecules[m_iRefMol])->m_sName);
4158
for (z=0;z<((CMolecule*)g_oaMolecules[m_iRefMol])->m_laSingleMolIndex.GetSize();z++)
4159
if (m_iRMPassCounter[z] > 0)
4160
mprintf(" - %2d: %10.4f percent of the time (%d hits)\n",z+1,((double)m_iRMPassCounter[z])/g_iSteps*100.0,m_iRMPassCounter[z]);
4162
mprintf(YELLOW,"\nList of observed molecules (%s) that passed the conditions:\n\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
4163
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
4164
if (m_iOMPassCounter[z] > 0)
4165
mprintf(" - %2d: %10.4f percent of the time (%d hits)\n",z+1,((double)m_iOMPassCounter[z])/g_iSteps*100.0,m_iOMPassCounter[z]);
4167
mprintf(YELLOW,"\nNeighbor count histogram:\n\n");
4168
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()+1;z++)
4169
if (m_pHistogram[z] != 0)
4170
mprintf(" - %d Neighbors: %8.4f percent of the time (%d hits).\n",z,((double)m_pHistogram[z])/m_iHistoGes*100.0,m_pHistogram[z]);
4171
mprintf(YELLOW,"\nListing for all sets of conditions:\n");
4172
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
4173
((CConditionSubGroup*)m_oaConditionSubGroups[z])->PrintData();
4174
mprintf(GREEN,"\n<<< End of Condition Data <<<\n\n");
4178
void CConditionGroup::PrintData(char *s)
4183
mprintf(GREEN,"\n>>> Condition Data >>>\n\n");
4184
mprintf(" %.0f of %.0f molecules passed the conditions (%.2f percent).\n",m_fPassed,m_fTotal,ZeroDivide(m_fPassed,m_fTotal)*100.0f);
4187
mprintf("\n No molecules at all passed the condition.\n");
4188
mprintf(" This is probably not what you wanted.\n");
4190
mprintf("\nNeighbor count histogram:\n\n");
4191
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()+1;z++)
4192
if (m_pHistogram[z] != 0)
4193
mprintf(" - %d Neighbors: %8.4f percent of the time (%d hits).\n",z,((double)m_pHistogram[z])/m_iHistoGes*100.0,m_pHistogram[z]);
4194
mprintf("\n Saving detailed condition data as \"%s\"...\n",s);
4196
a = OpenFileWrite(s,true);
4198
mfprintf(a,"\n>>> Condition Data >>>\n\n");
4199
mfprintf(a," %.0f of %.0f molecules passed the conditions (%.2f percent).\n",m_fPassed,m_fTotal,ZeroDivide(m_fPassed,m_fTotal)*100.0f);
4202
mfprintf(a,"\n No molecules at all passed the condition.\n");
4203
mfprintf(a," This is probably not what you wanted.\n");
4206
mfprintf(a,"\nList of reference molecules (%s) that passed the conditions:\n\n",((CMolecule*)g_oaMolecules[m_iRefMol])->m_sName);
4207
for (z=0;z<((CMolecule*)g_oaMolecules[m_iRefMol])->m_laSingleMolIndex.GetSize();z++)
4208
if (m_iRMPassCounter[z] > 0)
4209
mfprintf(a," - %2d: %10.4f percent of the time (%lu hits)\n",z+1,((double)m_iRMPassCounter[z])/g_iSteps*100.0,m_iRMPassCounter[z]);
4211
mfprintf(a,"\nList of observed molecules (%s) that passed the conditions:\n\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
4212
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
4213
if (m_iOMPassCounter[z] > 0)
4214
mfprintf(a," - %2d: %10.4f percent of the time (%lu hits)\n",z+1,((double)m_iOMPassCounter[z])/g_iSteps*100.0,m_iOMPassCounter[z]);
4216
mfprintf(a,"\nNeighbor count histogram:\n\n");
4217
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()+1;z++)
4218
if (m_pHistogram[z] != 0)
4219
mfprintf(a," - %d Neighbors: %8.4f percent of the time (%lu hits).\n",z,((double)m_pHistogram[z])/m_iHistoGes*100.0,m_pHistogram[z]);
4220
mfprintf(a,"\nListing for all sets of conditions:\n");
4221
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
4222
((CConditionSubGroup*)m_oaConditionSubGroups[z])->PrintData(a);
4223
mfprintf(a,"\n<<< End of Condition Data <<<\n\n");
4226
mprintf(GREEN,"\n<<< End of Condition Data <<<\n\n");
4230
bool CConditionSubGroup::Contains(int mol)
4235
for (z=0;z<m_oaConditions.GetSize();z++)
4237
if (!((CNbSearch*)m_oaConditions[z])->m_bPassed[mol])
4248
void CConditionSubGroup::MarkPassedAtoms(int om)
4252
for (z=0;z<g_iGesVirtAtomCount;z++)
4253
m_bTempPassed[z] = false;
4255
for (z=0;z<m_oaConditions.GetSize();z++)
4257
for (z2=0;z2<g_iGesVirtAtomCount;z2++)
4258
if (g_baAtomPassedCondition[z2] < 100)
4259
g_baAtomPassedCondition[z2] = 0;
4261
((CNbSearch*)m_oaConditions[z])->MarkPassedAtoms(om);
4263
for (z2=0;z2<g_iGesVirtAtomCount;z2++)
4264
if (g_baAtomPassedCondition[z2] == 1)
4265
m_bTempPassed[z2] = true;
4268
for (z=0;z<g_iGesVirtAtomCount;z++)
4269
if (m_bTempPassed[z])
4270
g_baAtomPassedCondition[z] = 100;
4274
void CConditionSubGroup::ScanNeighborhoodAllOM(CTimeStep *t, CSingleMolecule *rm)
4278
for (z=0;z<m_oaConditions.GetSize();z++)
4279
((CNbSearch*)m_oaConditions[z])->ScanAllOM(rm,t);
4281
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
4284
for (z2=0;z2<m_oaConditions.GetSize();z2++)
4285
if (!((CNbSearch*)m_oaConditions[z2])->m_bPassed[z])
4293
void CConditionSubGroup::PreScanNeighborhoodAllOM(CTimeStep *t, CSingleMolecule *rm)
4297
for (z=0;z<m_oaConditions.GetSize();z++)
4298
((CNbSearch*)m_oaConditions[z])->PreScanAllOM(rm,t);
4302
void CConditionSubGroup::Parse(int rm, int sm)
4307
m_iCombinations = 0;
4310
try { n = new CNbSearch(); } catch(...) { n = NULL; }
4311
if (n == NULL) NewException((double)sizeof(CNbSearch),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4313
n->m_iNumber = m_oaConditions.GetSize();
4314
m_oaConditions.Add(n);
4315
n->Parse(rm,sm,false);
4316
m_iCombinations += n->m_iCombinationsEnabled;
4317
} while (AskYesNo(" Add another condition to this set of conditions (y/n)? [no] ",false));
4319
try { m_bTempPassed = new bool[g_iGesVirtAtomCount]; } catch(...) { m_bTempPassed = NULL; }
4320
if (m_bTempPassed == NULL) NewException((double)g_iGesVirtAtomCount*sizeof(bool),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4326
void CADF::ParseCondition(int rm, bool nocrit)
4333
mprintf(WHITE,"\n>>> Angular Condition >>>\n");
4337
m_iCombinations = 0;
4341
mprintf("\n %d. set of vectors\n\n",z2+1);
4345
m_bSameFoot = AskYesNo(" Should the base points of the 1st and 2nd vectors always be equal (y/n)? [no] ",false);
4346
else m_bSameFoot = false;*/
4347
m_bOrtho[z] = (AskRangeInteger("\n Should the %d. vector connect two points (0) or stand perpendicular on 3 points (1)? [0] ",0,1,0,z+1) != 0);
4351
/* if (m_bSameFoot && (z == 1))
4353
m_iRefOrSec[1][0] = m_iRefOrSec[0][0];
4354
m_oaVectors.Add(NULL);
4357
_ax1: if (m_iShowMol != -1)
4358
m_iRefOrSec[z][0] = AskRangeInteger(" Take atom(s) in base point from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4359
else m_iRefOrSec[z][0] = 0;
4360
mprintf(" Enter atom(s) in the base point (e.g. C7): ");
4361
inpprintf("! Enter atom(s) in the base point (e.g. C7):\n");
4364
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4365
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4367
if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4369
eprintf("Wrong input.\n");
4370
inpprintf("! Wrong input.\n");
4374
m_oaVectors.Add(ag);
4375
ti *= ag->m_iAtomGes;
4377
_ax2: if (m_iShowMol != -1)
4378
m_iRefOrSec[z][1] = AskRangeInteger(" Take 2nd atom(s) of normal plane from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4379
else m_iRefOrSec[z][1] = 0;
4380
mprintf(" Enter 2nd atom(s) of normal plane (e.g. C7): ");
4381
inpprintf("! Enter 2nd atom(s) of normal plane (e.g. C7):\n");
4384
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4385
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4387
if (!ag->ParseAtoms((!m_iRefOrSec[z][1])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4389
eprintf("Wrong input.\n");
4390
inpprintf("! Wrong input.\n");
4394
m_oaVectors.Add(ag);
4395
ti *= ag->m_iAtomGes;
4396
_ax3: if (m_iShowMol != -1)
4397
m_iRefOrSec[z][2] = AskRangeInteger(" Take 3rd atom(s) of normal plane from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4398
else m_iRefOrSec[z][2] = 0;
4399
mprintf(" Enter 3rd atom(s) of normal plane (e.g. C7): ");
4400
inpprintf("! Enter 3rd atom(s) of normal plane (e.g. C7):\n");
4403
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4404
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4406
if (!ag->ParseAtoms((!m_iRefOrSec[z][2])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4408
eprintf("Wrong input.\n");
4409
inpprintf("! Wrong input.\n");
4413
m_oaVectors.Add(ag);
4414
ti *= ag->m_iAtomGes;
4415
} else // IF NOT ORTHO
4417
/* if (m_bSameFoot && (z == 1))
4419
m_iRefOrSec[1][0] = m_iRefOrSec[0][0];
4420
m_oaVectors.Add(NULL);
4423
_ax4: if (m_iShowMol != -1)
4424
m_iRefOrSec[z][0] = AskRangeInteger(" Take atom(s) in base point from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4425
else m_iRefOrSec[z][0] = 0;
4426
mprintf(" Enter atom(s) in the base point (e.g. C7): ");
4427
inpprintf("! Enter atom(s) in the base point (e.g. C7):\n");
4430
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4431
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4433
if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4435
eprintf("Wrong input.\n");
4436
inpprintf("! Wrong input.\n");
4440
m_oaVectors.Add(ag);
4441
ti *= ag->m_iAtomGes;
4442
} // END IF NOT SAMEFOOT
4443
_ax5: if (m_iShowMol != -1)
4444
m_iRefOrSec[z][1] = AskRangeInteger(" Take atom(s) in tip point from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4445
else m_iRefOrSec[z][1] = 0;
4446
mprintf(" Enter atom(s) in the tip point (e.g. C7): ");
4447
inpprintf("! Enter atom(s) in the tip point (e.g. C7):\n");
4450
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4451
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4453
if (!ag->ParseAtoms((!m_iRefOrSec[z][1])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4455
eprintf("Wrong input.\n");
4456
inpprintf("! Wrong input.\n");
4460
m_oaVectors.Add(ag);
4461
ti *= ag->m_iAtomGes;
4462
m_oaVectors.Add(NULL);
4463
} // END IF NOT ORTHO
4465
m_iCombinations += ti;
4467
} while (AskYesNo("\n Enter another set of vectors (y/n)? [no] ",false));
4471
m_faMinMaxAngle.Add(AskFloat(" Enter minimal angle between the vectors in degree: [0.0] ",0.0f));
4472
m_faMinMaxAngle.Add(AskFloat(" Enter maximal angle between the vectors in degree: [180.0] ",180.0f));
4473
} while (AskYesNo(" Enter another angle interval (y/n)? [no] ",false));
4476
m_faMinMaxAngle.Add(0.0f);
4477
m_faMinMaxAngle.Add(180.0f);
4479
mprintf(WHITE,"\n<<< End of Angular Condition <<<\n\n");
4484
void CADF::ParseConditionGrid(int rm, int gridmode)
4491
mprintf(WHITE,"\n>>> Angular Condition >>>\n");
4495
m_iCombinations = 0;
4499
mprintf("\n %d. set of vectors\n\n",z2+1);
4503
m_bSameFoot = AskYesNo(" Should the base points of the 1st and 2nd vectors always be equal (y/n)? [no] ",false);
4504
else m_bSameFoot = false;*/
4505
m_bOrtho[z] = (AskRangeInteger("\n Should the %d. vector connect two points (0) or stand perpendicular on 3 points (1)? [0] ",0,1,0,z+1) != 0);
4509
/* if (m_bSameFoot && (z == 1))
4511
m_iRefOrSec[1][0] = m_iRefOrSec[0][0];
4512
m_oaVectors.Add(NULL);
4515
_ax1: if (m_iShowMol != -1)
4516
m_iRefOrSec[z][0] = AskRangeInteger(" Take atom(s) in base point from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4517
else m_iRefOrSec[z][0] = 0;
4518
mprintf(" Enter atom(s) in the base point (e.g. C7): ");
4519
inpprintf("! Enter atom(s) in the base point (e.g. C7):\n");
4522
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4523
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4525
m_oaVectors.Add(ag);
4526
if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4528
eprintf("Wrong input.\n");
4529
inpprintf("! Wrong input.\n");
4532
ti *= ag->m_iAtomGes;
4534
_ax2: if (m_iShowMol != -1)
4535
m_iRefOrSec[z][1] = AskRangeInteger(" Take 2nd atom(s) of normal plane from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4536
else m_iRefOrSec[z][1] = 0;
4537
mprintf(" Enter 2nd atom(s) of normal plane (e.g. C7): ");
4538
inpprintf("! Enter 2nd atom(s) of normal plane (e.g. C7):\n");
4541
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4542
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4544
m_oaVectors.Add(ag);
4545
if (!ag->ParseAtoms((!m_iRefOrSec[z][1])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4547
eprintf("Wrong input.\n");
4548
inpprintf("! Wrong input.\n");
4551
ti *= ag->m_iAtomGes;
4552
_ax3: if (m_iShowMol != -1)
4553
m_iRefOrSec[z][2] = AskRangeInteger(" Take 3rd atom(s) of normal plane from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4554
else m_iRefOrSec[z][2] = 0;
4555
mprintf(" Enter 3rd atom(s) of normal plane (e.g. C7): ");
4556
inpprintf("! Enter 3rd atom(s) of normal plane (e.g. C7):\n");
4559
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4560
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4562
m_oaVectors.Add(ag);
4563
if (!ag->ParseAtoms((!m_iRefOrSec[z][2])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4565
eprintf("Wrong input.\n");
4566
inpprintf("! Wrong input.\n");
4569
ti *= ag->m_iAtomGes;
4570
} else // IF NOT ORTHO
4572
/* if (m_bSameFoot && (z == 1))
4574
m_iRefOrSec[1][0] = m_iRefOrSec[0][0];
4575
m_oaVectors.Add(NULL);
4578
_ax4: if (m_iShowMol != -1)
4579
m_iRefOrSec[z][0] = AskRangeInteger(" Take atom(s) in base point from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4580
else m_iRefOrSec[z][0] = 0;
4581
mprintf(" Enter atom(s) in the base point (e.g. C7): ");
4582
inpprintf("! Enter atom(s) in the base point (e.g. C7):\n");
4585
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4586
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4588
m_oaVectors.Add(ag);
4589
if (!ag->ParseAtoms((!m_iRefOrSec[z][0])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4591
eprintf("Wrong input.\n");
4592
inpprintf("! Wrong input.\n");
4595
ti *= ag->m_iAtomGes;
4596
} // END IF NOT SAMEFOOT
4597
_ax5: if (m_iShowMol != -1)
4598
m_iRefOrSec[z][1] = AskRangeInteger(" Take atom(s) in tip point from 1st mol. %s (0) or from 2nd mol. %s (1)? [%d] ",0,1,z,((CMolecule*)g_oaMolecules[rm])->m_sName,((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,z);
4599
else m_iRefOrSec[z][1] = 0;
4600
mprintf(" Enter atom(s) in the tip point (e.g. C7): ");
4601
inpprintf("! Enter atom(s) in the tip point (e.g. C7):\n");
4604
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
4605
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4607
m_oaVectors.Add(ag);
4608
if (!ag->ParseAtoms((!m_iRefOrSec[z][1])?(CMolecule*)g_oaMolecules[rm]:(CMolecule*)g_oaMolecules[m_iShowMol],buf))
4610
eprintf("Wrong input.\n");
4611
inpprintf("! Wrong input.\n");
4614
ti *= ag->m_iAtomGes;
4615
m_oaVectors.Add(NULL);
4616
} // END IF NOT ORTHO
4618
m_iCombinations += ti;
4620
} while (AskYesNo("\n Enter another set of vectors (y/n)? [no] ",false));
4621
if ((gridmode == 1) || (gridmode == 6))
4623
m_faMinMaxAngle.Add(AskFloat(" Enter minimal angle between the vectors in degree: [0.0] ",0.0f));
4624
m_faMinMaxAngle.Add(AskFloat(" Enter maximal angle between the vectors in degree: [180.0] ",180.0f));
4627
m_faMinMaxAngle.Add(0.0f);
4628
m_faMinMaxAngle.Add(180.0f);
4630
mprintf(WHITE,"\n<<< End of Angular Condition <<<\n\n");
4635
void CADF::ParseCondition_OnlyValues()
4640
mprintf(" Angular condition between vectors:\n");
4641
for (z=0;z<m_oaVectors.GetSize()/6;z++)
4644
if (m_oaVectors[z*6+2] != NULL)
4645
mprintf("normal(%s, %s, %s)",((CAtomGroup*)m_oaVectors[z*6])->m_sName,((CAtomGroup*)m_oaVectors[z*6+1])->m_sName,((CAtomGroup*)m_oaVectors[z*6+2])->m_sName);
4646
else mprintf("(%s --> %s)",((CAtomGroup*)m_oaVectors[z*6])->m_sName,((CAtomGroup*)m_oaVectors[z*6+1])->m_sName);
4648
if (m_oaVectors[z*6+5] != NULL)
4649
mprintf("normal(%s, %s, %s)",((CAtomGroup*)m_oaVectors[z*6+3])->m_sName,((CAtomGroup*)m_oaVectors[z*6+4])->m_sName,((CAtomGroup*)m_oaVectors[z*6+5])->m_sName);
4650
else mprintf("(%s --> %s)",((CAtomGroup*)m_oaVectors[z*6+3])->m_sName,((CAtomGroup*)m_oaVectors[z*6+4])->m_sName);
4653
for (z=0;z<m_faMinMaxAngle.GetSize()/2;z++)
4655
mprintf(" Interval %d:\n",z+1,m_faMinMaxAngle.GetSize()/2);
4656
m_faMinMaxAngle[z*2] = AskFloat(" Enter minimal angle between the vectors in degree: [0.0] ",0.0f);
4657
m_faMinMaxAngle[z*2+1] = AskFloat(" Enter maximal angle between the vectors in degree: [180.0] ",180.0f);
4659
// mprintf(WHITE,"\n<<< End of Angular Condition <<<\n\n");
4664
CObservation::CObservation()
4666
m_pConditions = NULL;
4667
m_pConditionsOM2 = NULL;
4652
m_bBinOnlyPassedAtoms = false;
4653
m_bBinOnlyNotPassedAtoms = false;
4655
m_waSaveRefList.SetName("CObservation::m_waSaveRefList");
4656
m_waSaveShowList.SetName("CObservation::m_waSaveShowList");
4657
m_waObsRefList.SetName("CObservation::m_waObsRefList");
4658
m_waObsShowList.SetName("CObservation::m_waObsShowList");
4659
m_waObsShow2List.SetName("CObservation::m_waObsShow2List");
4660
m_waDecompTypeRefOffs.SetName("CObservation::m_waDecompTypeRefOffs");
4661
m_waDecompTypeObsOffs.SetName("CObservation::m_waDecompTypeObsOffs");
4662
m_waDecompTypeRefList.SetName("CObservation::m_waDecompTypeRefList");
4663
m_waDecompTypeObsList.SetName("CObservation::m_waDecompTypeObsList");
4664
m_iaRMRegions.SetName("CObservation::m_iaRMRegions");
4665
m_iaOM1Regions.SetName("CObservation::m_iaOM1Regions");
4666
m_iaOM2Regions.SetName("CObservation::m_iaOM2Regions");
4670
CObservation::~CObservation()
4674
if (m_pConditions != NULL)
4676
delete m_pConditions;
4677
m_pConditions = NULL;
4694
if (m_pVACF != NULL)
4699
if (m_pDipACF != NULL)
4707
for (z=0;z<g_iCDFChannels;z++)
4709
if (m_pRDF[z] != NULL)
4720
for (z=0;z<g_iCDFChannels;z++)
4722
if (m_pADF[z] != NULL)
4733
for (z=0;z<g_iCDFChannels;z++)
4735
if (m_pDDF[z] != NULL)
4744
if (m_pDipDF != NULL)
4746
for (z=0;z<g_iCDFChannels;z++)
4748
if (m_pDipDF[z] != NULL)
4759
for (z=0;z<g_iCDFChannels;z++)
4761
if (m_pVDF[z] != NULL)
4773
void CSingleMolecule::BuildAtomCodes()
4775
int z, z2, c1, c2, i;
4779
// Die Anfangswerte der AtomCodes: [Ordnungszahl] * 10.0 + [Zahl der Nicht-Wasserstoff-Bindungen]
4780
for (z=0;z<m_oaMolAtoms.GetSize();z++)
4782
ma = (CMolAtom*)m_oaMolAtoms[z];
4783
ma->m_fAtomCode = 10.0 * ((CAtom*)g_oaAtoms[m_baAtomIndex[ma->m_iType]])->m_pElement->m_fMass;
4786
for (z2=0;z2<ma->m_oaBonds.GetSize();z2++)
4788
// Alle Wasserstoff-Atome ueberspringen
4789
if (((CAtom*)g_oaAtoms[m_baAtomIndex[((CMolAtom*)ma->m_oaBonds[z2])->m_iType]])->m_pElement->m_fMass < 4.5)
4796
mprintf(" Atom %d (%s%d): 10.0 * %.2f + %d = %.2f\n",z+1,((CAtom*)g_oaAtoms[m_baAtomIndex[ma->m_iType]])->m_sName,ma->m_iOffset+1,((CAtom*)g_oaAtoms[m_baAtomIndex[ma->m_iType]])->m_pElement->m_fMass,i,ma->m_fAtomCode);
4801
c1 = CountDifferentAtomCodes();
4804
mprintf(WHITE,"\n Cycle %d: %d different atom codes exist.\n\n",i+1,c1);
4806
for (z=0;z<m_oaMolAtoms.GetSize();z++)
4808
ma = (CMolAtom*)m_oaMolAtoms[z];
4809
ma->m_fTempAtomCode = ma->m_fAtomCode * 5.0;
4811
for (z2=0;z2<ma->m_oaBonds.GetSize();z2++)
4812
ma->m_fTempAtomCode += ((CMolAtom*)ma->m_oaBonds[z2])->m_fAtomCode;
4814
for (z=0;z<m_oaMolAtoms.GetSize();z++)
4816
ma = (CMolAtom*)m_oaMolAtoms[z];
4817
ma->m_fAtomCode = ma->m_fTempAtomCode;
4820
mprintf(" Atom %d (%s%d): %.2f\n",z+1,((CAtom*)g_oaAtoms[m_baAtomIndex[ma->m_iType]])->m_sName,ma->m_iOffset+1,ma->m_fAtomCode);
4822
c2 = CountDifferentAtomCodes();
4824
// mprintf("Iteration %d: %d classes before, %d classes after.\n",i,c1,c2);
4828
mprintf(WHITE,"\nSorting...\n");
4830
m_iAtomClasses = c2;
4831
// mprintf("Finished.\n");
4832
// mprintf("%d Iterations, %d atom classes found.\n",i,c2);
4833
// mprintf("Sorting Atom Codes...");
4835
// Sortieren mittels StackSort
4836
for (z=0;z<m_oaMolAtoms.GetSize();z++)
4840
for (z2=z;z2<m_oaMolAtoms.GetSize();z2++)
4842
if (((CMolAtom*)m_oaMolAtoms[z2])->m_fAtomCode > ac)
4844
ac = ((CMolAtom*)m_oaMolAtoms[z2])->m_fAtomCode;
4850
ma = (CMolAtom*)m_oaMolAtoms[z];
4851
m_oaMolAtoms[z] = m_oaMolAtoms[i];
4852
m_oaMolAtoms[i] = ma;
4853
((CMolAtom*)m_oaMolAtoms[z])->m_iMolAtomNumber = z;
4856
eprintf("CSingleMolecule::BuildAtomCodes(): Weird error.\n");
4863
for (z=0;z<m_oaMolAtoms.GetSize();z++)
4865
ma = (CMolAtom*)m_oaMolAtoms[z];
4866
mprintf(" Atom %d (%s%d): %.2f\n",z+1,((CAtom*)g_oaAtoms[m_baAtomIndex[ma->m_iType]])->m_sName,ma->m_iOffset+1,ma->m_fAtomCode);
4868
mprintf(WHITE,"Finished.\n\n");
4870
// mprintf("Finished.\n");
4874
int CSingleMolecule::CountDifferentAtomCodes()
4879
try { d = new double[m_oaMolAtoms.GetSize()]; } catch(...) { d = NULL; }
4880
if (d == NULL) NewException((double)m_oaMolAtoms.GetSize()*sizeof(double),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4883
for (z=0;z<m_oaMolAtoms.GetSize();z++)
4885
for (z2=0;z2<i;z2++)
4886
if (d[z2] == ((CMolAtom*)m_oaMolAtoms[z])->m_fAtomCode)
4888
d[i] = ((CMolAtom*)m_oaMolAtoms[z])->m_fAtomCode;
4905
try { m_pMSD = new CAF(); } catch(...) { m_pMSD = NULL; }
4906
if (m_pMSD == NULL) NewException((double)sizeof(CAF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4908
mprintf(WHITE,"\n*** Mean Square Displacement\n\n");
4910
try { m_pAtomGroup = new CAtomGroup(); } catch(...) { m_pAtomGroup = NULL; }
4911
if (m_pAtomGroup == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4914
mprintf(" Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
4915
inpprintf("! Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
4917
if (strlen(buf) == 0)
4919
if (!m_pAtomGroup->ParseAtoms((CMolecule*)g_oaMolecules[m_iShowMol],"#2"))
4921
eprintf("Weird error.\n");
4922
inpprintf("! Weird error.\n");
4925
} else if (!m_pAtomGroup->ParseAtoms((CMolecule*)g_oaMolecules[m_iShowMol],buf))
4927
eprintf("Wrong input.\n");
4928
inpprintf("! Wrong input.\n");
4933
if (g_iTrajSteps != -1)
4934
m_iResolution = AskUnsignedInteger(" Enter the resolution (=depth) for this MSD (in time steps): [%d] ",int(g_iTrajSteps*0.75),int(g_iTrajSteps*0.75));
4935
else m_iResolution = AskUnsignedInteger(" Enter the resolution (=depth) for this MSD (in time steps): [10000] ",10000);
4937
m_iShowAtoms = m_pAtomGroup->m_iAtomGes;
4939
/* if (g_iTrajSteps != -1)
4941
if (g_bMSDCacheMode)
4943
tf = g_iTrajSteps*m_pAtomGroup->m_iAtomGes*((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*3.0f*sizeof(float)/1024.0f/1024.0f;
4945
if (!AskYesNo(" This will occupy %.0f MB RAM (once, not for every MSD!). Continue (y/n)? [yes] ",true,tf))
4949
tf = m_iResolution*g_iGesVirtAtomCount*12.0f*sizeof(double)/1024.0f/1024.0f;
4951
if (!AskYesNo(" This will occupy %.0f MB RAM (once, not for every MSD!). Continue (y/n)? [yes] ",true,tf))
4955
/* if (m_iResolution > g_iMaxMSDDepth)
4956
g_iMaxMSDDepth = m_iReolution;*/
4958
ti = m_iResolution / 1000;
4961
m_iStride = AskUnsignedInteger(" Take every n-th step for the time axis of the MSD: [%d] ",ti,ti);
4962
m_iStride2 = AskUnsignedInteger(" Shift correlation window n time steps at once: [%d] ",m_iStride,m_iStride);
4966
m_bSplit = AskYesNo(" Decompose this MSD into contributions from each individual molecule (y/n)? [no] ",false);
4967
if (AskYesNo(" Take into account only certain dimensions for displacement (y/n)? [no] ",false))
4969
m_bTakeX = AskYesNo(" Take into account contributions along X axis (y/n)? [yes] ",true);
4970
m_bTakeY = AskYesNo(" Take into account contributions along X axis (y/n)? [yes] ",true);
4971
m_bTakeZ = AskYesNo(" Take into account contributions along X axis (y/n)? [yes] ",true);
4991
void CMSD::BuildName()
4996
sprintf(tmp,"%s_%s",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,m_pAtomGroup->m_sName);
4998
if ((!m_bTakeX) || (!m_bTakeY) || (!m_bTakeZ))
5009
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
5010
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5012
strcpy(m_sName,tmp);
5017
void CVHDF::CorrectCount()
5021
for (y=0;y<m_iResolution;y++)
5022
for (x=0;x<m_iDepth/m_iStride;x++)
5023
if (m_pCount[x] != 0)
5024
m_pVHDF->m_pBin[y*m_iDepth/m_iStride+x] /= m_pCount[x];
5028
void CConditionSubGroup::PrintData()
5033
mprintf(GREEN,"\n*** Data for %d. set of conditions ***\n\n",m_iNumber+1);
5034
mprintf(" %.0f of %.0f molecules passed this set of conditions (%.4f percent).\n",m_fPassed,m_fTotal,ZeroDivide(m_fPassed,m_fTotal)*100.0f);
5036
for (z=0;z<m_oaConditions.GetSize();z++)
5038
mprintf(" - Condition %d: %.0f of %.0f molecules passed (%.4f percent).\n",z+1,((CNbSearch*)m_oaConditions[z])->m_fMoleculesPassed,((CNbSearch*)m_oaConditions[z])->m_fMoleculesTotal,ZeroDivide(((CNbSearch*)m_oaConditions[z])->m_fMoleculesPassed,((CNbSearch*)m_oaConditions[z])->m_fMoleculesTotal)*100.0);
5039
d *= ZeroDivide(((CNbSearch*)m_oaConditions[z])->m_fMoleculesPassed,((CNbSearch*)m_oaConditions[z])->m_fMoleculesTotal);
5042
if (m_oaConditions.GetSize() > 1)
5044
mprintf(" The product of the condition probabilities is %.4f percent.\n",d*100.0);
5045
mprintf(" If the conditions would be uncorrelated, this would be also the probability for the set.\n");
5046
mprintf(" Therefore, the conditions are %s correlated for %.4f percent.\n\n",(d<ZeroDivide(m_fPassed,m_fTotal))?"positively":"negatively",(d<ZeroDivide(m_fPassed,m_fTotal))?(ZeroDivide(ZeroDivide(m_fPassed,m_fTotal),d)-1.0)*100.0:(ZeroDivide(d,ZeroDivide(m_fPassed,m_fTotal))-1.0)*100.0);
5049
for (z=0;z<m_oaConditions.GetSize();z++)
5050
((CNbSearch*)m_oaConditions[z])->PrintTable();
5054
void CConditionSubGroup::PrintData(FILE *a)
5058
mfprintf(a,"\n*** Data for %d. set of conditions ***\n\n",m_iNumber+1);
5059
mfprintf(a," %.0f of %.0f molecules passed this set of conditions (%.4f percent).\n",m_fPassed,m_fTotal,ZeroDivide(m_fPassed,m_fTotal)*100.0f);
5060
for (z=0;z<m_oaConditions.GetSize();z++)
5061
((CNbSearch*)m_oaConditions[z])->PrintTable(a);
5065
void CConditionSubGroup::PrintSingle(int om)
5069
for (z=0;z<m_oaConditions.GetSize();z++)
5070
((CNbSearch*)m_oaConditions[z])->PrintSingle(om);
5074
void CConditionGroup::PrintSingle(int om)
5078
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
5079
((CConditionSubGroup*)m_oaConditionSubGroups[z])->PrintSingle(om);
5083
void CConditionGroup::PrintTable()
5086
double tf1, tf2, tf3;
5088
mprintf(WHITE,"*** Condition Table ***\n\n");
5089
mprintf(" The rows indicate how many subconditions of condition 1 are fulfilled.\n");
5090
mprintf(" The columns indicate how many subconditions of condition 2 are fulfilled.\n\n");
5093
for (z=0;z<((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1;z++)
5094
mprintf("| %4d ",z);
5097
for (z=0;z<((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1;z++)
5098
mprintf("|---------",z);
5103
for (z=0;z<((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_iCombinations+1;z++)
5106
for (z2=0;z2<((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1;z2++)
5108
if ((z > 0) && (z2 == 0))
5109
tf1 += m_pTable[z*(((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)+z2];
5110
if ((z == 0) && (z2 > 0))
5111
tf2 += m_pTable[z*(((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)+z2];
5112
if ((z > 0) && (z2 > 0))
5113
tf3 += m_pTable[z*(((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)+z2];
5114
mprintf("| %7.3f ",m_pTable[z*(((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)+z2]/m_fTableGes*100.0);
5119
mprintf(" A RM/OM pair fulfills no condition: %7.3f percent of the time.\n",m_pTable[0]/m_fTableGes*100.0);
5120
mprintf(" A RM/OM pair fulfills only condition 1: %7.3f percent of the time.\n",tf1/m_fTableGes*100.0);
5121
mprintf(" A RM/OM pair fulfills only condition 2: %7.3f percent of the time.\n",tf2/m_fTableGes*100.0);
5122
mprintf(" A RM/OM pair fulfills both conditions: %7.3f percent of the time.\n",tf3/m_fTableGes*100.0);
5123
mprintf(" Total: %7.3f percent of the time.\n",100.0);
5125
mprintf(WHITE,"*** Condition Table End ***\n\n");
5129
void CObservation::ListCDFObservations(int z)
5131
int z2, ti, ti2, ti3;
5134
switch(g_iObsChannel[z])
5139
if (m_bSecondShowMol && (z == 1))
5140
m_pRDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol2])->m_laSingleMolIndex[0]],&tempwa);
5141
else m_pRDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex[0]],&tempwa);
5142
} else m_pRDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],&tempwa);
5143
for (z2=0;z2<tempwa.GetSize()/2;z2++)
5146
ti2 = tempwa[z2*2+1];
5147
mprintf(" * %2d.) Distance %s%d (%s) <--> %s%d (%s)\n",z2+1,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName);
5154
if (m_bSecondShowMol && (z == 1))
5155
m_pADF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol2])->m_laSingleMolIndex[0]],&tempwa);
5156
else m_pADF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex[0]],&tempwa);
5157
} else m_pADF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],&tempwa);
5158
for (z2=0;z2<tempwa.GetSize()/6;z2++)
5160
mprintf(" * %2d.) Angle ",z2+1);
5161
if (m_pADF[z]->m_bOrtho[0])
5164
ti2 = tempwa[z2*6+1];
5165
ti3 = tempwa[z2*6+2];
5166
mprintf("[%s%d (%s), %s%d (%s), %s%d (%s)] to ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti3]])->m_sName,g_waAtomMolNumber[ti3]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti3]])->m_sName);
5170
ti2 = tempwa[z2*6+1];
5171
mprintf("[%s%d (%s) --> %s%d (%s)] to ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName);
5173
if (m_pADF[z]->m_bOrtho[1])
5175
ti = tempwa[z2*6+3];
5176
ti2 = tempwa[z2*6+4];
5177
ti3 = tempwa[z2*6+5];
5178
mprintf("[%s%d (%s), %s%d (%s), %s%d (%s)]\n",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti3]])->m_sName,g_waAtomMolNumber[ti3]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti3]])->m_sName);
5181
ti = tempwa[z2*6+3];
5182
ti2 = tempwa[z2*6+4];
5183
mprintf("[%s%d (%s) --> %s%d (%s)]\n",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName);
5191
if (m_bSecondShowMol && (z == 1))
5192
m_pDDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol2])->m_laSingleMolIndex[0]],&tempwa);
5193
else m_pDDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex[0]],&tempwa);
5194
} else m_pDDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],&tempwa);
5195
for (z2=0;z2<tempwa.GetSize()/9;z2++)
5197
mprintf(" * %2d.) Dihedral Angle ",z2+1);
5198
if (m_pDDF[z]->m_bOrtho[0])
5201
ti2 = tempwa[z2*9+1];
5202
ti3 = tempwa[z2*9+2];
5203
mprintf("[%s%d (%s), %s%d (%s), %s%d (%s)] - ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti3]])->m_sName,g_waAtomMolNumber[ti3]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti3]])->m_sName);
5207
ti2 = tempwa[z2*9+1];
5208
mprintf("[%s%d (%s) --> %s%d (%s)] - ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName);
5210
if (m_pDDF[z]->m_bOrtho[1])
5212
ti = tempwa[z2*9+3];
5213
ti2 = tempwa[z2*9+4];
5214
ti3 = tempwa[z2*9+5];
5215
mprintf("[%s%d (%s), %s%d (%s), %s%d (%s)] - ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti3]])->m_sName,g_waAtomMolNumber[ti3]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti3]])->m_sName);
5218
ti = tempwa[z2*9+3];
5219
ti2 = tempwa[z2*9+4];
5220
mprintf("[%s%d (%s) --> %s%d (%s)] - ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName);
5222
if (m_pDDF[z]->m_bOrtho[2])
5224
ti = tempwa[z2*9+6];
5225
ti2 = tempwa[z2*9+7];
5226
ti3 = tempwa[z2*9+8];
5227
mprintf("[%s%d (%s), %s%d (%s), %s%d (%s)]\n",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti3]])->m_sName,g_waAtomMolNumber[ti3]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti3]])->m_sName);
5230
ti = tempwa[z2*9+6];
5231
ti2 = tempwa[z2*9+7];
5232
mprintf("[%s%d (%s) --> %s%d (%s)]\n",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName);
5238
eprintf("(not implemented)\n");
5242
eprintf("(not implemented)\n");
5248
if (m_bSecondShowMol && (z == 1))
5249
m_pPlDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol2])->m_laSingleMolIndex[0]],&tempwa);
5250
else m_pPlDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex[0]],&tempwa);
5251
} else m_pPlDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],&tempwa);
5252
for (z2=0;z2<tempwa.GetSize()/4;z2++)
5254
mprintf(" * %2d.) Distance from Plane ",z2+1);
5255
if (m_pPlDF[z]->m_bNormal)
5258
ti2 = tempwa[z2*4+1];
5259
mprintf("[%s%d (%s) --> %s%d (%s)] - ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName);
5263
ti2 = tempwa[z2*4+1];
5264
ti3 = tempwa[z2*4+2];
5265
mprintf("[%s%d (%s), %s%d (%s), %s%d (%s)] - ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti3]])->m_sName,g_waAtomMolNumber[ti3]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti3]])->m_sName);
5267
ti = tempwa[z2*4+3];
5268
mprintf("%s%d (%s)\n",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName);
5275
if (m_bSecondShowMol && (z == 1))
5276
m_pLiDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol2])->m_laSingleMolIndex[0]],&tempwa);
5277
else m_pLiDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex[0]],&tempwa);
5278
} else m_pLiDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],&tempwa);
5279
for (z2=0;z2<tempwa.GetSize()/4;z2++)
5281
mprintf(" * %2d.) Distance from Plane ",z2+1);
5282
if (m_pLiDF[z]->m_bNormal)
5285
ti2 = tempwa[z2*4+1];
5286
ti3 = tempwa[z2*4+2];
5287
mprintf("[%s%d (%s), %s%d (%s), %s%d (%s)] - ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti3]])->m_sName,g_waAtomMolNumber[ti3]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti3]])->m_sName);
5291
ti2 = tempwa[z2*4+1];
5292
mprintf("[%s%d (%s) --> %s%d (%s)] - ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName);
5294
ti = tempwa[z2*4+3];
5295
mprintf("%s%d (%s)\n",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName);
5302
void CSDF::CreateCutPlane()
5307
try { m_pCutPlane = new C2DF(); } catch(...) { m_pCutPlane = NULL; }
5308
if (m_pCutPlane == NULL) NewException((double)sizeof(C2DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5310
m_pCutPlane->m_fMinVal[0] = -m_fRadius;
5311
m_pCutPlane->m_fMinVal[1] = -m_fRadius;
5312
m_pCutPlane->m_fMaxVal[0] = m_fRadius;
5313
m_pCutPlane->m_fMaxVal[1] = m_fRadius;
5314
m_pCutPlane->m_iRes[0] = m_iCutPlaneResolution;
5315
m_pCutPlane->m_iRes[1] = m_iCutPlaneResolution;
5316
m_pCutPlane->SetLabelX("X [pm]");
5317
m_pCutPlane->SetLabelY("Y [pm]");
5318
m_pCutPlane->Create();
5321
for (y=0;y<m_iCutPlaneResolution;y++)
5323
vec[1] = (float)(((y+0.5)/m_pCutPlane->m_iRes[1])*(m_pCutPlane->m_fMaxVal[1]-m_pCutPlane->m_fMinVal[1])+m_pCutPlane->m_fMinVal[1]);
5324
for (x=0;x<m_iCutPlaneResolution;x++)
5326
vec[0] = (float)(((x+0.5)/m_pCutPlane->m_iRes[0])*(m_pCutPlane->m_fMaxVal[0]-m_pCutPlane->m_fMinVal[0])+m_pCutPlane->m_fMinVal[0]);
5327
m_pCutPlane->AddToBin(x,y,m_pSDF->GetValue(vec));
5330
if (m_bCutPlaneShowAtoms)
5332
m_pCutPlane->AddCircle(0,0,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_pElement->m_fRadius*0.75,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_pElement->m_iColorR/255.0,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_pElement->m_iColorG/255.0,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_pElement->m_iColorB/255.0);
5333
m_pCutPlane->AddCircle(m_fAtom2PosX / m_fPosCounter,0,((CAtom*)g_oaAtoms[g_iFixRealAtomType[1]])->m_pElement->m_fRadius*0.75,((CAtom*)g_oaAtoms[g_iFixRealAtomType[1]])->m_pElement->m_iColorR/255.0,((CAtom*)g_oaAtoms[g_iFixRealAtomType[1]])->m_pElement->m_iColorG/255.0,((CAtom*)g_oaAtoms[g_iFixRealAtomType[1]])->m_pElement->m_iColorB/255.0);
5334
m_pCutPlane->AddCircle(m_fAtom3PosX / m_fPosCounter,m_fAtom3PosY / m_fPosCounter,((CAtom*)g_oaAtoms[g_iFixRealAtomType[2]])->m_pElement->m_fRadius*0.75,((CAtom*)g_oaAtoms[g_iFixRealAtomType[2]])->m_pElement->m_iColorR/255.0,((CAtom*)g_oaAtoms[g_iFixRealAtomType[2]])->m_pElement->m_iColorG/255.0,((CAtom*)g_oaAtoms[g_iFixRealAtomType[2]])->m_pElement->m_iColorB/255.0);
5339
void CConditionGroup::Reset()
5343
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
5344
((CConditionSubGroup*)m_oaConditionSubGroups[z])->Reset();
5346
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
5347
m_iPassCounter[z] = 0;
5351
void CConditionSubGroup::Reset()
5355
for (z=0;z<m_oaConditions.GetSize();z++)
5356
((CNbSearch*)m_oaConditions[z])->Reset();
5360
void CRDF::CopyFrom(CRDF *p)
5365
m_bAdaptive = p->m_bAdaptive;
5366
m_bRadialCorrect = p->m_bRadialCorrect;
5367
m_bSelf = p->m_bSelf;
5368
m_fMinDist = p->m_fMinDist;
5369
m_fMaxDist = p->m_fMaxDist;
5370
m_iCombinations = p->m_iCombinations;
5371
m_iHistogramRes = p->m_iHistogramRes;
5372
m_iRefAtomGes = p->m_iRefAtomGes;
5373
m_iRefOrSec[0] = p->m_iRefOrSec[0];
5374
m_iRefOrSec[1] = p->m_iRefOrSec[1];
5375
m_iResolution = p->m_iResolution;
5376
m_iShowAtomGes = p->m_iShowAtomGes;
5377
m_iShowMol = p->m_iShowMol;
5379
if (p->m_sName != NULL)
5381
try { m_sName = new char[strlen(p->m_sName)+1]; } catch(...) { m_sName = NULL; }
5382
if (m_sName == NULL) NewException((double)(strlen(p->m_sName)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5384
strcpy(m_sName,p->m_sName);
5385
} else m_sName = NULL;
5387
if (p->m_sShortName != NULL)
5389
try { m_sShortName = new char[strlen(p->m_sShortName)+1]; } catch(...) { m_sShortName = NULL; }
5390
if (m_sShortName == NULL) NewException((double)(strlen(p->m_sShortName)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5392
strcpy(m_sShortName,p->m_sShortName);
5393
} else m_sShortName = NULL;
5395
if (p->m_baDataEnabled != NULL)
5397
try { m_baDataEnabled = new CxByteArray[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_baDataEnabled = NULL; }
5398
if (m_baDataEnabled == NULL) NewException((double)((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*sizeof(CxByteArray),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5400
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
5401
m_baDataEnabled[z].CopyFrom(&p->m_baDataEnabled[z]);
5404
if (p->m_faData != NULL)
5406
try { m_faData = new CxDoubleArray[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_faData = NULL; }
5407
if (m_faData == NULL) NewException((double)((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*sizeof(CxDoubleArray),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5409
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
5410
m_faData[z].CopyFrom(&p->m_faData[z]);
5413
for (z=0;z<p->m_oaVectors.GetSize();z++)
5415
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
5416
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5418
ag->CopyFrom((CAtomGroup*)p->m_oaVectors[z]);
5419
m_oaVectors.Add(ag);
5422
m_faMinMaxDist.CopyFrom(&p->m_faMinMaxDist);
5424
if (p->m_pRDF != NULL)
5426
try { m_pRDF = new CDF(); } catch(...) { m_pRDF = NULL; }
5427
if (m_pRDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5429
m_pRDF->CopyFrom(p->m_pRDF);
5434
void CADF::CopyFrom(CADF *p)
5439
m_bCosine = p->m_bCosine;
5440
m_bFoldAngle = p->m_bFoldAngle;
5441
m_bMirror = p->m_bMirror;
5442
m_bOrtho[0] = p->m_bOrtho[0];
5443
m_bOrtho[1] = p->m_bOrtho[1];
5444
m_iVecType[0] = p->m_iVecType[0];
5445
m_iVecType[1] = p->m_iVecType[1];
5446
m_bSelf = p->m_bSelf;
5447
m_bStat = p->m_bStat;
5448
m_fMinAngle = p->m_fMinAngle;
5449
m_fMaxAngle = p->m_fMaxAngle;
5450
m_iCombinations = p->m_iCombinations;
5451
m_iHistogramRes = p->m_iHistogramRes;
5453
for (z2=0;z2<3;z2++)
5454
m_iRefOrSec[z][z2] = p->m_iRefOrSec[z][z2];
5455
m_iResolution = p->m_iResolution;
5456
m_iShowMol = p->m_iShowMol;
5458
if (p->m_sName != NULL)
5460
try { m_sName = new char[strlen(p->m_sName)+1]; } catch(...) { m_sName = NULL; }
5461
if (m_sName == NULL) NewException((double)(strlen(p->m_sName)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5463
strcpy(m_sName,p->m_sName);
5464
} else m_sName = NULL;
5466
if (p->m_sShortName != NULL)
5468
try { m_sShortName = new char[strlen(p->m_sShortName)+1]; } catch(...) { m_sShortName = NULL; }
5469
if (m_sShortName == NULL) NewException((double)(strlen(p->m_sShortName)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5471
strcpy(m_sShortName,p->m_sShortName);
5472
} else m_sShortName = NULL;
5474
if (p->m_baDataEnabled != NULL)
5476
try { m_baDataEnabled = new CxByteArray[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_baDataEnabled = NULL; }
5477
if (m_baDataEnabled == NULL) NewException((double)((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*sizeof(CxByteArray),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5479
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
5480
m_baDataEnabled[z].CopyFrom(&p->m_baDataEnabled[z]);
5483
if (p->m_faData != NULL)
5485
try { m_faData = new CxDoubleArray[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_faData = NULL; }
5486
if (m_faData == NULL) NewException((double)((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*sizeof(CxDoubleArray),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5488
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
5489
m_faData[z].CopyFrom(&p->m_faData[z]);
5492
for (z=0;z<p->m_oaVectors.GetSize();z++)
5494
if (p->m_oaVectors[z] != NULL)
5496
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
5497
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5499
ag->CopyFrom((CAtomGroup*)p->m_oaVectors[z]);
5500
m_oaVectors.Add(ag);
5501
} else m_oaVectors.Add(NULL);
5504
m_faMinMaxAngle.CopyFrom(&p->m_faMinMaxAngle);
5506
if (p->m_pADF != NULL)
5508
try { m_pADF = new CDF(); } catch(...) { m_pADF = NULL; }
5509
if (m_pADF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5511
m_pADF->CopyFrom(p->m_pADF);
5516
void CConditionSubGroup::CopyFrom(CConditionSubGroup *p)
5521
m_fPassed = p->m_fPassed;
5522
m_fTotal = p->m_fTotal;
5523
m_iCombinations = p->m_iCombinations;
5524
m_iNumber = p->m_iNumber;
5525
m_iShowMol = p->m_iShowMol;
5526
if (p->m_bTempPassed != NULL)
5528
try { m_bTempPassed = new bool[g_iGesVirtAtomCount]; } catch(...) { m_bTempPassed = NULL; }
5529
if (m_bTempPassed == NULL) NewException((double)g_iGesVirtAtomCount*sizeof(bool),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5531
memcpy(m_bTempPassed,p->m_bTempPassed,sizeof(bool)*g_iGesVirtAtomCount);
5533
for (z=0;z<p->m_oaConditions.GetSize();z++)
5535
try { nb = new CNbSearch(); } catch(...) { nb = NULL; }
5536
if (nb == NULL) NewException((double)sizeof(CNbSearch),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5538
nb->CopyFrom((CNbSearch*)p->m_oaConditions[z]);
5539
m_oaConditions.Add(nb);
5544
void CConditionGroup::CopyFrom(CConditionGroup *p)
5547
CConditionSubGroup *sg;
5549
m_bInactive = p->m_bInactive;
5550
m_iShowMol = p->m_iShowMol;
5551
m_iRefMol = p->m_iRefMol;
5552
m_iHistoGes = p->m_iHistoGes;
5553
m_bAnyPassed = p->m_bAnyPassed;
5554
m_fTableGes = p->m_fTableGes;
5555
m_fPassed = p->m_fPassed;
5556
m_fTotal = p->m_fTotal;
5557
m_bInvertCondition = p->m_bInvertCondition;
5559
if (p->m_bAlwaysTrue != NULL)
5561
try { m_bAlwaysTrue = new bool[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_bAlwaysTrue = NULL; }
5562
if (m_bAlwaysTrue == NULL) NewException((double)((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*sizeof(bool),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5564
memcpy(m_bAlwaysTrue,p->m_bAlwaysTrue,sizeof(bool)*((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize());
5566
if (p->m_iPassCounter != NULL)
5568
try { m_iPassCounter = new long[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iPassCounter = NULL; }
5569
if (m_iPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5571
memcpy(m_iPassCounter,p->m_iPassCounter,sizeof(long)*((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize());
5573
if (p->m_iOMPassCounter != NULL)
5575
try { m_iOMPassCounter = new long[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iOMPassCounter = NULL; }
5576
if (m_iOMPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5578
memcpy(m_iOMPassCounter,p->m_iOMPassCounter,sizeof(long)*((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize());
5580
if (p->m_iRMPassCounter != NULL)
5582
try { m_iRMPassCounter = new long[((CMolecule*)g_oaMolecules[m_iRefMol])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iRMPassCounter = NULL; }
5583
if (m_iRMPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[m_iRefMol])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5585
memcpy(m_iRMPassCounter,p->m_iRMPassCounter,sizeof(long)*((CMolecule*)g_oaMolecules[m_iRefMol])->m_laSingleMolIndex.GetSize());
5587
for (z=0;z<p->m_oaConditionSubGroups.GetSize();z++)
5589
try { sg = new CConditionSubGroup(); } catch(...) { sg = NULL; }
5590
if (sg == NULL) NewException((double)sizeof(CConditionSubGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5592
sg->CopyFrom((CConditionSubGroup*)p->m_oaConditionSubGroups[z]);
5593
m_oaConditionSubGroups.Add(sg);
5596
if (p->m_pTable != NULL)
5598
try { m_pTable = new double[(((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_iCombinations+1) * (((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)]; } catch(...) { m_pTable = NULL; }
5599
if (m_pTable == NULL) NewException((double)(((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_iCombinations+1) * (((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)*sizeof(double),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5601
memcpy(m_pTable,p->m_pTable,sizeof(double)*(((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_iCombinations+1) * (((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1));
5604
if (p->m_pHistogram != NULL)
5606
try { m_pHistogram = new unsigned long[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()+1]; } catch(...) { m_pHistogram = NULL; }
5607
if (m_pHistogram == NULL) NewException((double)(((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()+1)*sizeof(unsigned long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5609
memcpy(m_pHistogram,p->m_pHistogram,sizeof(unsigned long)*(((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()+1));
5614
void CConditionGroup::Parse_OnlyValues()
5619
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
5621
mprintf(YELLOW,">>> %d. set of conditions >>>\n\n",z+1);
5622
((CConditionSubGroup*)m_oaConditionSubGroups[z])->Parse_OnlyValues();
5623
mprintf(YELLOW,"<<< End of %d. set of conditions <<<\n\n",z+1);
5628
void CConditionSubGroup::Parse_OnlyValues()
5633
for (z=0;z<m_oaConditions.GetSize();z++)
5635
mprintf(YELLOW," >>> %d. condition within this set >>>\n\n",z+1);
5636
((CNbSearch*)m_oaConditions[z])->Parse_OnlyValues();
5637
mprintf(YELLOW,"\n <<< End of %d. condition <<<\n\n",z+1);
5643
void CConditionGroup::CopyResults(CConditionGroup *p)
5647
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
5648
((CConditionSubGroup*)m_oaConditionSubGroups[z])->CopyResults((CConditionSubGroup*)p->m_oaConditionSubGroups[z]);
5652
void CConditionSubGroup::CopyResults(CConditionSubGroup *p)
5656
for (z=0;z<m_oaConditions.GetSize();z++)
5657
((CNbSearch*)m_oaConditions[z])->CopyResults((CNbSearch*)p->m_oaConditions[z]);
5661
void CConditionGroup::ReScan(CSingleMolecule *rm)
5664
int z, z2, t1, t2, i;
5669
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
5670
((CConditionSubGroup*)m_oaConditionSubGroups[z])->ReScan(rm);
5672
if (m_oaConditionSubGroups.GetSize() == 2)
5674
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
5678
for (z2=0;z2<((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_oaConditions.GetSize();z2++)
5679
t1 += ((CNbSearch*)((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_oaConditions[z2])->m_iCombPassCount[z];
5680
for (z2=0;z2<((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_oaConditions.GetSize();z2++)
5681
t2 += ((CNbSearch*)((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_oaConditions[z2])->m_iCombPassCount[z];
5682
m_pTable[t1*(((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)+t2]++;
5688
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
5691
if (m_bInvertCondition)
5693
for (z2=0;z2<m_oaConditionSubGroups.GetSize();z2++)
5694
if (((CConditionSubGroup*)m_oaConditionSubGroups[z2])->Contains(z))
5697
m_iPassCounter[z]++;
5698
m_bAnyPassed = true;
5701
for (z2=0;z2<m_oaConditionSubGroups.GetSize();z2++)
5702
if (((CConditionSubGroup*)m_oaConditionSubGroups[z2])->Contains(z))
5704
// mprintf("passed[%d]++\n",z);
5706
m_iPassCounter[z]++;
5707
m_bAnyPassed = true;
5721
void CConditionSubGroup::ReScan(CSingleMolecule *rm)
5725
for (z=0;z<m_oaConditions.GetSize();z++)
5726
((CNbSearch*)m_oaConditions[z])->ReScan(rm);
5728
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
5731
for (z2=0;z2<m_oaConditions.GetSize();z2++)
5732
if (!((CNbSearch*)m_oaConditions[z2])->m_bPassed[z])
5740
CNbSearch* CConditionGroup::AddSingleCondition(int rm, int sm, int gridmode)
5743
CConditionSubGroup *sg;
5749
try { m_bAlwaysTrue = new bool[((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_bAlwaysTrue = NULL; }
5750
if (m_bAlwaysTrue == NULL) NewException((double)((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()*sizeof(bool),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5752
try { m_iPassCounter = new long[((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iPassCounter = NULL; }
5753
if (m_iPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5755
try { m_iOMPassCounter = new long[((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iOMPassCounter = NULL; }
5756
if (m_iOMPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5758
for (z=0;z<((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize();z++)
5760
m_bAlwaysTrue[z] = false;
5761
m_iPassCounter[z] = 0;
5762
m_iOMPassCounter[z] = 0;
5765
try { m_iRMPassCounter = new long[((CMolecule*)g_oaMolecules[rm])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iRMPassCounter = NULL; }
5766
if (m_iRMPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[rm])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5768
for (z=0;z<((CMolecule*)g_oaMolecules[rm])->m_laSingleMolIndex.GetSize();z++)
5769
m_iRMPassCounter[z] = 0;
5771
try { sg = new CConditionSubGroup(); } catch(...) { sg = NULL; }
5772
if (sg == NULL) NewException((double)sizeof(CConditionSubGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5774
sg->m_iShowMol = m_iShowMol;
5775
sg->m_iNumber = m_oaConditionSubGroups.GetSize();
5776
m_oaConditionSubGroups.Add(sg);
5778
m_bInvertCondition = false;
5782
try { m_pHistogram = new unsigned long[((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()+1]; } catch(...) { m_pHistogram = NULL; }
5783
if (m_pHistogram == NULL) NewException((double)(((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()+1)*sizeof(unsigned long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5785
for (z=0;z<((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()+1;z++)
5786
m_pHistogram[z] = 0;
5789
return sg->AddSingleCondition(rm,sm,gridmode);
5793
CNbSearch* CConditionSubGroup::AddSingleCondition(int rm, int sm, int gridmode)
5798
m_iCombinations = 0;
5800
try { n = new CNbSearch(); } catch(...) { n = NULL; }
5801
if (n == NULL) NewException((double)sizeof(CNbSearch),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5803
n->m_iNumber = m_oaConditions.GetSize();
5804
m_oaConditions.Add(n);
5805
n->ParseGrid(rm,sm,gridmode);
5806
m_iCombinations += n->m_iCombinationsEnabled;
5808
try { m_bTempPassed = new bool[g_iGesVirtAtomCount]; } catch(...) { m_bTempPassed = NULL; }
5809
if (m_bTempPassed == NULL) NewException((double)g_iGesVirtAtomCount*sizeof(bool),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5816
void CObservation::BuildTimeDiff(CDF *df, bool ddf)
5818
int z, z2, z3, z4, i;
5820
double tf, tfa, tfsq, tfs, tf0;
5823
try { df->m_pTimeDiff = new CDF(); } catch(...) { df->m_pTimeDiff = NULL; }
5824
if (df->m_pTimeDiff == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5826
df->m_pTimeDiff->m_iResolution = m_iTimeDiffDepth;
5827
df->m_pTimeDiff->m_fMinVal = 0;
5828
df->m_pTimeDiff->m_fMaxVal = m_iTimeDiffDepth * g_fTimestepLength / 1000.0;
5829
df->m_pTimeDiff->Create();
5830
df->m_pTimeDiff->SetLabelX("Tau [ps]");
5831
sprintf(buf,"Delta ");
5832
strcat(buf,df->m_sLabelX);
5833
df->m_pTimeDiff->SetLabelY(buf);
5835
try { df->m_pTimeDiffAbs = new CDF(); } catch(...) { df->m_pTimeDiffAbs = NULL; }
5836
if (df->m_pTimeDiffAbs == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5838
df->m_pTimeDiffAbs->m_iResolution = m_iTimeDiffDepth;
5839
df->m_pTimeDiffAbs->m_fMinVal = 0;
5840
df->m_pTimeDiffAbs->m_fMaxVal = m_iTimeDiffDepth * g_fTimestepLength / 1000.0;
5841
df->m_pTimeDiffAbs->Create();
5842
df->m_pTimeDiffAbs->SetLabelX("Tau [ps]");
5843
df->m_pTimeDiffAbs->SetLabelY(buf);
5845
sprintf(buf,"Delta Square ");
5846
strcat(buf,df->m_sLabelX);
5848
try { df->m_pTimeDiffSqr = new CDF(); } catch(...) { df->m_pTimeDiffSqr = NULL; }
5849
if (df->m_pTimeDiffSqr == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5851
df->m_pTimeDiffSqr->m_iResolution = m_iTimeDiffDepth;
5852
df->m_pTimeDiffSqr->m_fMinVal = 0;
5853
df->m_pTimeDiffSqr->m_fMaxVal = m_iTimeDiffDepth * g_fTimestepLength / 1000.0;
5854
df->m_pTimeDiffSqr->Create();
5855
df->m_pTimeDiffSqr->SetLabelX("Tau [ps]");
5856
df->m_pTimeDiffSqr->SetLabelY(buf);
5860
sprintf(buf,"Delta ");
5861
strcat(buf,df->m_sLabelX);
5863
try { df->m_p3DTimeDiff = new C2DF(); } catch(...) { df->m_p3DTimeDiff = NULL; }
5864
if (df->m_p3DTimeDiff == NULL) NewException((double)sizeof(C2DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5866
df->m_p3DTimeDiff->m_iRes[0] = m_iTimeDiffDepth/m_iTimeDiffStride3D;
5867
df->m_p3DTimeDiff->m_iRes[1] = m_iTimeDiffRes3D;
5868
df->m_p3DTimeDiff->m_fMinVal[0] = 0;
5869
df->m_p3DTimeDiff->m_fMaxVal[0] = m_iTimeDiffDepth * g_fTimestepLength / 1000.0;
5870
df->m_p3DTimeDiff->m_fMinVal[1] = m_fTimeDiffMinVal3D;
5871
df->m_p3DTimeDiff->m_fMaxVal[1] = m_fTimeDiffMaxVal3D;
5872
df->m_p3DTimeDiff->Create();
5873
df->m_p3DTimeDiff->SetLabelX("Tau [ps]");
5874
df->m_p3DTimeDiff->SetLabelY(df->m_sLabelX);
5875
df->m_p3DTimeDiff->SetLabelZ(buf);
5877
try { df->m_p3DTimeDiffAbs = new C2DF(); } catch(...) { df->m_p3DTimeDiffAbs = NULL; }
5878
if (df->m_p3DTimeDiffAbs == NULL) NewException((double)sizeof(C2DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5880
df->m_p3DTimeDiffAbs->m_iRes[0] = m_iTimeDiffDepth/m_iTimeDiffStride3D;
5881
df->m_p3DTimeDiffAbs->m_iRes[1] = m_iTimeDiffRes3D;
5882
df->m_p3DTimeDiffAbs->m_fMinVal[0] = 0;
5883
df->m_p3DTimeDiffAbs->m_fMaxVal[0] = m_iTimeDiffDepth * g_fTimestepLength / 1000.0;
5884
df->m_p3DTimeDiffAbs->m_fMinVal[1] = m_fTimeDiffMinVal3D;
5885
df->m_p3DTimeDiffAbs->m_fMaxVal[1] = m_fTimeDiffMaxVal3D;
5886
df->m_p3DTimeDiffAbs->Create();
5887
df->m_p3DTimeDiffAbs->SetLabelX("Tau [ps]");
5888
df->m_p3DTimeDiffAbs->SetLabelY(df->m_sLabelX);
5889
df->m_p3DTimeDiffAbs->SetLabelZ(buf);
5891
if (m_iTimeDiffDistSteps != 0)
5893
try { df->m_pTimeDiffDistPairs = new C2DF*[m_iTimeDiffDepth/m_iTimeDiffStride3D/m_iTimeDiffDistSteps]; } catch(...) { df->m_pTimeDiffDistPairs = NULL; }
5894
if (df->m_pTimeDiffDistPairs == NULL) NewException((double)m_iTimeDiffDepth/m_iTimeDiffStride3D/m_iTimeDiffDistSteps*sizeof(C2DF*),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5896
for (z=0;z<m_iTimeDiffDepth/m_iTimeDiffStride3D/m_iTimeDiffDistSteps;z++)
5898
try { df->m_pTimeDiffDistPairs[z] = new C2DF(); } catch(...) { df->m_pTimeDiffDistPairs[z] = NULL; }
5899
if (df->m_pTimeDiffDistPairs[z] == NULL) NewException((double)sizeof(C2DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5901
df->m_pTimeDiffDistPairs[z]->m_iRes[0] = m_iTimeDiffDistResX;
5902
df->m_pTimeDiffDistPairs[z]->m_iRes[1] = m_iTimeDiffDistResY;
5903
df->m_pTimeDiffDistPairs[z]->m_fMinVal[0] = m_fTimeDiffDistMinValX;
5904
df->m_pTimeDiffDistPairs[z]->m_fMaxVal[0] = m_fTimeDiffDistMaxValX;
5905
df->m_pTimeDiffDistPairs[z]->m_fMinVal[1] = m_fTimeDiffDistMinValY;
5906
df->m_pTimeDiffDistPairs[z]->m_fMaxVal[1] = m_fTimeDiffDistMaxValY;
5907
df->m_pTimeDiffDistPairs[z]->Create();
5908
df->m_pTimeDiffDistPairs[z]->SetLabelX(df->m_sLabelX);
5909
df->m_pTimeDiffDistPairs[z]->SetLabelY(df->m_sLabelX);
5913
try { df->m_pTimeDiffDist3DF = new C3DF(); } catch(...) { df->m_pTimeDiffDist3DF = NULL; }
5914
if (df->m_pTimeDiffDist3DF == NULL) NewException((double)sizeof(C3DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5916
df->m_pTimeDiffDist3DF->m_iRes[0] = m_iTimeDiffDistResX;
5917
df->m_pTimeDiffDist3DF->m_iRes[1] = m_iTimeDiffDistResY;
5918
df->m_pTimeDiffDist3DF->m_iRes[2] = m_iTimeDiffDepth/m_iTimeDiffStride3D;
5919
df->m_pTimeDiffDist3DF->m_fMinVal[0] = m_fTimeDiffDistMinValX;
5920
df->m_pTimeDiffDist3DF->m_fMaxVal[0] = m_fTimeDiffDistMaxValX;
5921
df->m_pTimeDiffDist3DF->m_fMinVal[1] = m_fTimeDiffDistMinValY;
5922
df->m_pTimeDiffDist3DF->m_fMaxVal[1] = m_fTimeDiffDistMaxValY;
5923
df->m_pTimeDiffDist3DF->m_fMinVal[2] = 0;
5924
df->m_pTimeDiffDist3DF->m_fMaxVal[2] = m_iTimeDiffDepth * g_fTimestepLength / 1000.0;
5925
df->m_pTimeDiffDist3DF->Create();
5926
df->m_pTimeDiffDist3DF->SetLabelX(df->m_sLabelX);
5927
df->m_pTimeDiffDist3DF->SetLabelY(df->m_sLabelX);
5929
sprintf(buf,"Delta Square ");
5930
strcat(buf,df->m_sLabelX);
5932
try { df->m_p3DTimeDiffSqr = new C2DF(); } catch(...) { df->m_p3DTimeDiffSqr = NULL; }
5933
if (df->m_p3DTimeDiffSqr == NULL) NewException((double)sizeof(C3DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5935
df->m_p3DTimeDiffSqr->m_iRes[0] = m_iTimeDiffDepth/m_iTimeDiffStride3D;
5936
df->m_p3DTimeDiffSqr->m_iRes[1] = m_iTimeDiffRes3D;
5937
df->m_p3DTimeDiffSqr->m_fMinVal[0] = 0;
5938
df->m_p3DTimeDiffSqr->m_fMaxVal[0] = m_iTimeDiffDepth * g_fTimestepLength / 1000.0;
5939
df->m_p3DTimeDiffSqr->m_fMinVal[1] = m_fTimeDiffMinVal3D;
5940
df->m_p3DTimeDiffSqr->m_fMaxVal[1] = m_fTimeDiffMaxVal3D;
5941
df->m_p3DTimeDiffSqr->Create();
5942
df->m_p3DTimeDiffSqr->SetLabelX("Tau [ps]");
5943
df->m_p3DTimeDiffSqr->SetLabelY(df->m_sLabelX);
5944
df->m_p3DTimeDiffSqr->SetLabelZ(buf);
5946
try { df->m_p3DTimeDiffT = new C2DF(); } catch(...) { df->m_p3DTimeDiffT = NULL; }
5947
if (df->m_p3DTimeDiffT == NULL) NewException((double)sizeof(C2DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5949
df->m_p3DTimeDiffT->m_iRes[0] = m_iTimeDiffDepth/m_iTimeDiffStride3D;
5950
df->m_p3DTimeDiffT->m_iRes[1] = m_iTimeDiffRes3D;
5951
df->m_p3DTimeDiffT->m_fMinVal[0] = 0;
5952
df->m_p3DTimeDiffT->m_fMaxVal[0] = m_iTimeDiffDepth * g_fTimestepLength / 1000.0;
5953
df->m_p3DTimeDiffT->m_fMinVal[1] = m_fTimeDiffMinVal3D;
5954
df->m_p3DTimeDiffT->m_fMaxVal[1] = m_fTimeDiffMaxVal3D;
5955
df->m_p3DTimeDiffT->Create();
5958
for (z2=0;z2<df->m_oaTimeDiffBuf.GetSize();z2++)
5960
mprintf(" %4d/%d 2D [",z2+1,df->m_oaTimeDiffBuf.GetSize());
5961
ptfa = (CxFloatArray*)df->m_oaTimeDiffBuf[z2];
5962
tfs = m_iTimeDiffDepth/50.0;
5963
for (z3=0;z3<m_iTimeDiffDepth;z3++) // Das ist das Tau
5965
if (fmod(z3,tfs) < 1.0)
5970
for (z4=0;z4<(int)ptfa->GetSize()-z3-1;z4++) // Das ist der Startpunkt
5972
tf0 = (*ptfa)[z3+z4]-(*ptfa)[z4];
5984
df->m_pTimeDiff->AddToBin_Int(z3,tf/(ptfa->GetSize()-z3-1));
5985
df->m_pTimeDiffAbs->AddToBin_Int(z3,tfa/(ptfa->GetSize()-z3-1));
5986
df->m_pTimeDiffSqr->AddToBin_Int(z3,tfsq/(ptfa->GetSize()-z3-1));
5988
df->m_pTimeDiff->m_fBinEntries += ptfa->GetSize()-z3-2;
5989
df->m_pTimeDiffAbs->m_fBinEntries += ptfa->GetSize()-z3-2;
5990
df->m_pTimeDiffSqr->m_fBinEntries += ptfa->GetSize()-z3-2;
5995
mprintf(" %4d/%d 3D [",z2+1,df->m_oaTimeDiffBuf.GetSize());
5996
tfs = m_iTimeDiffDepth/50.0;
5997
for (z3=0;z3<m_iTimeDiffDepth;z3+=m_iTimeDiffStride3D) // Das ist das Tau
5999
if (fmod(z3,tfs) < 1.0)
6001
i = z3/m_iTimeDiffStride3D;
6002
for (z4=0;z4<(int)ptfa->GetSize()-z3-1;z4++) // Das ist der Startpunkt
6004
tf0 = (*ptfa)[z3+z4]-(*ptfa)[z4];
6012
df->m_p3DTimeDiff->AddToBin_IntX(i,(*ptfa)[z4],tf0);
6013
df->m_p3DTimeDiffAbs->AddToBin_IntX(i,(*ptfa)[z4],fabs(tf0));
6014
df->m_p3DTimeDiffSqr->AddToBin_IntX(i,(*ptfa)[z4],tf0*tf0);
6015
df->m_p3DTimeDiffT->AddToBin_IntX(i,(*ptfa)[z4],1.0);
6016
df->m_pTimeDiffDist3DF->AddToBin_IntZ((*ptfa)[z4],(*ptfa)[z3+z4],i);
6017
if (m_iTimeDiffDistSteps != 0)
6018
if ((i % m_iTimeDiffDistSteps) == 0)
6019
df->m_pTimeDiffDistPairs[i/m_iTimeDiffDistSteps]->AddToBin((*ptfa)[z4],(*ptfa)[z3+z4]);
6025
for (z3=0;z3<m_iTimeDiffDepth;z3++) // Das ist das Tau
6027
df->m_pTimeDiff->m_pBin[z3] /= df->m_oaTimeDiffBuf.GetSize();
6028
df->m_pTimeDiffAbs->m_pBin[z3] /= df->m_oaTimeDiffBuf.GetSize();
6029
df->m_pTimeDiffSqr->m_pBin[z3] /= df->m_oaTimeDiffBuf.GetSize();
6033
for (z2=0;z2<df->m_p3DTimeDiff->m_iRes[0]*df->m_p3DTimeDiff->m_iRes[1];z2++)
6035
if (df->m_p3DTimeDiffT->m_pBin[z2] != 0)
6037
df->m_p3DTimeDiff->m_pBin[z2] /= df->m_p3DTimeDiffT->m_pBin[z2];
6038
df->m_p3DTimeDiffAbs->m_pBin[z2] /= df->m_p3DTimeDiffT->m_pBin[z2];
6039
df->m_p3DTimeDiffSqr->m_pBin[z2] /= df->m_p3DTimeDiffT->m_pBin[z2];
6042
if (m_iTimeDiffDistSteps != 0)
6043
for (z=0;z<m_iTimeDiffDepth/m_iTimeDiffStride3D/m_iTimeDiffDistSteps;z++)
6044
df->m_pTimeDiffDistPairs[z]->NormalizeBinIntegral(1000000.0);
6049
void CObservation::WriteTimeDiff(CDF *df, const char *anaup, const char *analow, const char *name, const char *multibuf, bool ddf)
6055
mprintf(" Creating temporal difference plot...\n");
6056
BuildTimeDiff(df,ddf);
6057
mprintf(" (%.0f bin entries)\n",df->m_pTimeDiff->m_fBinEntries);
6058
sprintf(buf,"%s_timediff_%s%s.csv",analow,name,multibuf);
6059
mprintf(" Saving %s temporal difference plot as \"%s\"...\n",anaup,buf);
6060
df->m_pTimeDiff->Write("",buf,"",true);
6061
sprintf(buf,"%s_timediff_%s%s.agr",analow,name,multibuf);
6062
mprintf(" Saving %s temporal difference plot AGR file as \"%s\"...\n",anaup,buf);
6063
df->m_pTimeDiff->WriteAgr("",buf,"",name,false);
6065
sprintf(buf,"%s_timediff_%s%s_abs.csv",analow,name,multibuf);
6066
mprintf(" Saving %s absolute temporal difference plot as \"%s\"...\n",anaup,buf);
6067
df->m_pTimeDiffAbs->Write("",buf,"",true);
6068
sprintf(buf,"%s_timediff_%s%s_abs.agr",analow,name,multibuf);
6069
mprintf(" Saving %s absolute temporal difference plot AGR file as \"%s\"...\n",anaup,buf);
6070
df->m_pTimeDiffAbs->WriteAgr("",buf,"",name,false);
6072
sprintf(buf,"%s_timediff_%s%s_sqr.csv",analow,name,multibuf);
6073
mprintf(" Saving %s squared temporal difference plot as \"%s\"...\n",anaup,buf);
6074
df->m_pTimeDiffSqr->Write("",buf,"",true);
6075
sprintf(buf,"%s_timediff_%s%s_sqr.agr",analow,name,multibuf);
6076
mprintf(" Saving %s squared temporal difference plot AGR file as \"%s\"...\n",anaup,buf);
6077
df->m_pTimeDiffSqr->WriteAgr("",buf,"",name,false);
6081
mprintf(" Writing temporal 3D difference plot...\n");
6082
mprintf(" (%.0f bin entries)\n",df->m_p3DTimeDiff->m_fBinEntries);
6083
sprintf(buf,"%s_timediff_%s%s_triples.csv",analow,name,multibuf);
6084
mprintf(" Saving %s temporal difference plot triples as \"%s\"...\n",anaup,buf);
6085
df->m_p3DTimeDiff->Write("",buf,"");
6086
sprintf(buf,"%s_timediff_%s%s_matrix.csv",analow,name,multibuf);
6087
mprintf(" Saving %s temporal difference plot matrix as \"%s\"...\n",anaup,buf);
6088
df->m_p3DTimeDiff->WriteCSV("",buf,"");
6089
sprintf(buf,"%s_timediff_%s%s.nb",analow,name,multibuf);
6090
mprintf(" Saving %s temporal difference plot Mathematica Notebook as \"%s\"...\n",anaup,buf);
6091
df->m_p3DTimeDiff->WriteMathematicaNb("",buf,"",false);
6092
sprintf(buf,"%s_timediff_%s%s",analow,name,multibuf);
6093
mprintf(" Saving %s temporal difference plot Gnuplot Input as \"%s.gp\"...\n",anaup,buf);
6094
df->m_p3DTimeDiff->WriteGnuplotInput("",buf,"",false);
6096
sprintf(buf,"%s_timediff_%s%s_triples_abs.csv",analow,name,multibuf);
6097
mprintf(" Saving %s absolute temporal difference plot triples as \"%s\"...\n",anaup,buf);
6098
df->m_p3DTimeDiffAbs->Write("",buf,"");
6099
sprintf(buf,"%s_timediff_%s%s_matrix_abs.csv",analow,name,multibuf);
6100
mprintf(" Saving %s absolute temporal difference plot matrix as \"%s\"...\n",anaup,buf);
6101
df->m_p3DTimeDiffAbs->WriteCSV("",buf,"");
6102
sprintf(buf,"%s_timediff_%s%s_abs.nb",analow,name,multibuf);
6103
mprintf(" Saving %s absolute temporal difference plot Mathematica Notebook as \"%s\"...\n",anaup,buf);
6104
df->m_p3DTimeDiffAbs->WriteMathematicaNb("",buf,"",false);
6105
sprintf(buf,"%s_timediff_%s%s_abs",analow,name,multibuf);
6106
mprintf(" Saving %s absolute temporal difference plot Gnuplot Input as \"%s.gp\"...\n",anaup,buf);
6107
df->m_p3DTimeDiffAbs->WriteGnuplotInput("",buf,"",false);
6109
sprintf(buf,"%s_timediff_%s%s_triples_sqr.csv",analow,name,multibuf);
6110
mprintf(" Saving %s squared temporal difference plot triples as \"%s\"...\n",anaup,buf);
6111
df->m_p3DTimeDiffSqr->Write("",buf,"");
6112
sprintf(buf,"%s_timediff_%s%s_matrix_sqr.csv",analow,name,multibuf);
6113
mprintf(" Saving %s squared temporal difference plot matrix as \"%s\"...\n",anaup,buf);
6114
df->m_p3DTimeDiffSqr->WriteCSV("",buf,"");
6115
sprintf(buf,"%s_timediff_%s%s_sqr.nb",analow,name,multibuf);
6116
mprintf(" Saving %s squared temporal difference plot Mathematica Notebook as \"%s\"...\n",anaup,buf);
6117
df->m_p3DTimeDiffSqr->WriteMathematicaNb("",buf,"",false);
6118
sprintf(buf,"%s_timediff_%s%s_sqr",analow,name,multibuf);
6119
mprintf(" Saving %s squared temporal difference plot Gnuplot Input as \"%s.gp\"...\n",anaup,buf);
6120
df->m_p3DTimeDiffSqr->WriteGnuplotInput("",buf,"",false);
6122
if (m_iTimeDiffDistSteps != 0)
6124
for (z=0;z<m_iTimeDiffDepth/m_iTimeDiffStride3D/m_iTimeDiffDistSteps;z++)
6126
sprintf(buf,"%s_timediff_beforeafter_%s%s_tau%.3f_triples.csv",analow,name,multibuf,z*m_iTimeDiffStride3D*m_iTimeDiffDistSteps*g_fTimestepLength/1000.0);
6127
mprintf(" Saving %s before/after plot triples as \"%s\"...\n",anaup,buf);
6128
df->m_pTimeDiffDistPairs[z]->Write("",buf,"");
6129
sprintf(buf,"%s_timediff_beforeafter_%s%s_tau%.3f_matrix.csv",analow,name,multibuf,z*m_iTimeDiffStride3D*m_iTimeDiffDistSteps*g_fTimestepLength/1000.0);
6130
mprintf(" Saving %s before/after plot matrix as \"%s\"...\n",anaup,buf);
6131
df->m_pTimeDiffDistPairs[z]->WriteCSV("",buf,"");
6132
sprintf(buf,"%s_timediff_beforeafter_%s%s_tau%.3f.nb",analow,name,multibuf,z*m_iTimeDiffStride3D*m_iTimeDiffDistSteps*g_fTimestepLength/1000.0);
6133
mprintf(" Saving %s before/after plot Mathematica Notebook as \"%s\"...\n",anaup,buf);
6134
df->m_pTimeDiffDistPairs[z]->WriteMathematicaNb("",buf,"",false);
6135
sprintf(buf,"%s_timediff_beforeafter_%s%s_tau%.3f",analow,name,multibuf,z*m_iTimeDiffStride3D*m_iTimeDiffDistSteps*g_fTimestepLength/1000.0);
6136
mprintf(" Saving %s before/after plot Gnuplot Input as \"%s.gp\"...\n",anaup,buf);
6137
df->m_pTimeDiffDistPairs[z]->WriteGnuplotInput("",buf,"",false);
6140
for (z2=0;z2<=3;z2++)
6142
try { temp3DF = new C3DF(); } catch(...) { temp3DF = NULL; }
6143
if (temp3DF == NULL) NewException((double)sizeof(C3DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
6145
temp3DF->CopyFrom(df->m_pTimeDiffDist3DF);
6148
temp3DF->Smooth(z2);
6149
sprintf(buf,".s%d%s.plt",z2,multibuf);
6150
} else sprintf(buf,"%s.plt",multibuf);
6151
mprintf(" Saving 3D Plot as \"%s%s\"...\n",name,buf);
6152
temp3DF->WritePLT("",name,buf,false);
6155
sprintf(buf,".s%d%s.cube",z2,multibuf);
6156
else sprintf(buf,"%s.cube",multibuf);
6157
mprintf(" Saving 3D Plot as \"%s%s\"...\n",name,buf);
6158
temp3DF->WriteCube("",name,buf,false);
6164
void CObservation::CreateTimeDiff(CDF *df, int comb)
6171
for (z2=0;z2<((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex.GetSize()*comb;z2++)
6173
try { ptfa = new CxFloatArray("CObservation::CreateTimeDiff():ptfa"); } catch(...) { ptfa = NULL; }
6174
if (ptfa == NULL) NewException((double)sizeof(CxFloatArray),__FILE__,__LINE__,__PRETTY_FUNCTION__);
6176
if (g_iTrajSteps != -1)
6178
ptfa->SetMaxSize((long)(g_iTrajSteps*1.1));
6179
ptfa->SetGrow((long)(g_iTrajSteps*0.1));
6180
} else ptfa->SetGrow(1000);
6181
df->m_oaTimeDiffBuf.Add(ptfa);
6185
for (z2=0;z2<((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex.GetSize()*((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*comb;z2++)
6187
try { ptfa = new CxFloatArray("CObservation::CreateTimeDiff():ptfa"); } catch(...) { ptfa = NULL; }
6188
if (ptfa == NULL) NewException((double)sizeof(CxFloatArray),__FILE__,__LINE__,__PRETTY_FUNCTION__);
6190
if (g_iTrajSteps != -1)
6192
ptfa->SetMaxSize((long)(g_iTrajSteps*1.1));
6193
ptfa->SetGrow((long)(g_iTrajSteps*0.1));
6194
} else ptfa->SetGrow(1000);
6195
df->m_oaTimeDiffBuf.Add(ptfa);
6201
void CMSD::WriteSplit(const char *s)
6207
a = OpenFileWrite(s,true);
6208
mfprintf(a,"# tau [ps]; Total MSD [pm^2]");
6210
for (z=0;z<m_pAtomGroup->m_oaAtoms.GetSize();z++)
6211
for (z2=0;z2<((CxIntArray*)m_pAtomGroup->m_oaAtoms[z])->GetSize();z2++)
6212
for (z3=0;z3<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z3++)
6214
if (m_pAtomGroup->m_baRealAtomType[z] == g_iVirtAtomType)
6215
mfprintf(a,"; Mol. %d #%d",z3+1,((CxIntArray*)m_pAtomGroup->m_oaAtoms[z])->GetAt(z2)+1);
6216
else mfprintf(a,"; Mol. %d %s%d",z3+1,((CAtom*)g_oaAtoms[m_pAtomGroup->m_baRealAtomType[z]])->m_sName,((CxIntArray*)m_pAtomGroup->m_oaAtoms[z])->GetAt(z2)+1);
6220
for (z=0;z<m_pMSD->m_iResolution;z++)
6222
mfprintf(a,"%f; %f",m_pMSD->m_fMinVal+z*(m_pMSD->m_fMaxVal-m_pMSD->m_fMinVal)/m_pMSD->m_iResolution,m_pMSD->m_pBin[z]);
6224
for (z2=0;z2<m_pAtomGroup->m_iAtomGes;z2++)
6225
for (z3=0;z3<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z3++)
6227
af = m_pSplitMSD[z2*((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()+z3];
6228
mfprintf(a,"; %f",af->m_pBin[z]);
4679
m_bBinOnlyPassedAtoms = false;
4680
m_bBinOnlyNotPassedAtoms = false;
4682
m_waSaveRefList.SetName("CObservation::m_waSaveRefList");
4683
m_waSaveShowList.SetName("CObservation::m_waSaveShowList");
4684
m_waObsRefList.SetName("CObservation::m_waObsRefList");
4685
m_waObsShowList.SetName("CObservation::m_waObsShowList");
4686
m_waObsShow2List.SetName("CObservation::m_waObsShow2List");
4687
m_waDecompTypeRefOffs.SetName("CObservation::m_waDecompTypeRefOffs");
4688
m_waDecompTypeObsOffs.SetName("CObservation::m_waDecompTypeObsOffs");
4689
m_waDecompTypeRefList.SetName("CObservation::m_waDecompTypeRefList");
4690
m_waDecompTypeObsList.SetName("CObservation::m_waDecompTypeObsList");
4691
m_iaRMRegions.SetName("CObservation::m_iaRMRegions");
4692
m_iaOM1Regions.SetName("CObservation::m_iaOM1Regions");
4693
m_iaOM2Regions.SetName("CObservation::m_iaOM2Regions");
4697
CObservation::~CObservation()
4701
if (m_pConditions != NULL)
4703
delete m_pConditions;
4704
m_pConditions = NULL;
4721
if (m_pVACF != NULL)
4726
if (m_pDipACF != NULL)
4734
for (z=0;z<g_iCDFChannels;z++)
4736
if (m_pRDF[z] != NULL)
4747
for (z=0;z<g_iCDFChannels;z++)
4749
if (m_pADF[z] != NULL)
4760
for (z=0;z<g_iCDFChannels;z++)
4762
if (m_pDDF[z] != NULL)
4771
if (m_pDipDF != NULL)
4773
for (z=0;z<g_iCDFChannels;z++)
4775
if (m_pDipDF[z] != NULL)
4786
for (z=0;z<g_iCDFChannels;z++)
4788
if (m_pVDF[z] != NULL)
4800
void CSingleMolecule::BuildAtomCodes()
4802
int z, z2, c1, c2, i;
4806
// Die Anfangswerte der AtomCodes: [Ordnungszahl] * 10.0 + [Zahl der Nicht-Wasserstoff-Bindungen]
4807
for (z=0;z<m_oaMolAtoms.GetSize();z++)
4809
ma = (CMolAtom*)m_oaMolAtoms[z];
4810
ma->m_fAtomCode = 10.0 * ((CAtom*)g_oaAtoms[m_baAtomIndex[ma->m_iType]])->m_pElement->m_fMass;
4813
for (z2=0;z2<ma->m_oaBonds.GetSize();z2++)
4815
// Alle Wasserstoff-Atome ueberspringen
4816
if (((CAtom*)g_oaAtoms[m_baAtomIndex[((CMolAtom*)ma->m_oaBonds[z2])->m_iType]])->m_pElement->m_fMass < 4.5)
4823
mprintf(" Atom %d (%s%d): 10.0 * %.2f + %d = %.2f\n",z+1,((CAtom*)g_oaAtoms[m_baAtomIndex[ma->m_iType]])->m_sName,ma->m_iOffset+1,((CAtom*)g_oaAtoms[m_baAtomIndex[ma->m_iType]])->m_pElement->m_fMass,i,ma->m_fAtomCode);
4828
c1 = CountDifferentAtomCodes();
4831
mprintf(WHITE,"\n Cycle %d: %d different atom codes exist.\n\n",i+1,c1);
4833
for (z=0;z<m_oaMolAtoms.GetSize();z++)
4835
ma = (CMolAtom*)m_oaMolAtoms[z];
4836
ma->m_fTempAtomCode = ma->m_fAtomCode * 5.0;
4838
for (z2=0;z2<ma->m_oaBonds.GetSize();z2++)
4839
ma->m_fTempAtomCode += ((CMolAtom*)ma->m_oaBonds[z2])->m_fAtomCode;
4841
for (z=0;z<m_oaMolAtoms.GetSize();z++)
4843
ma = (CMolAtom*)m_oaMolAtoms[z];
4844
ma->m_fAtomCode = ma->m_fTempAtomCode;
4847
mprintf(" Atom %d (%s%d): %.2f\n",z+1,((CAtom*)g_oaAtoms[m_baAtomIndex[ma->m_iType]])->m_sName,ma->m_iOffset+1,ma->m_fAtomCode);
4849
c2 = CountDifferentAtomCodes();
4851
// mprintf("Iteration %d: %d classes before, %d classes after.\n",i,c1,c2);
4855
mprintf(WHITE,"\nSorting...\n");
4857
m_iAtomClasses = c2;
4858
// mprintf("Finished.\n");
4859
// mprintf("%d Iterations, %d atom classes found.\n",i,c2);
4860
// mprintf("Sorting Atom Codes...");
4862
// Sortieren mittels StackSort
4863
for (z=0;z<m_oaMolAtoms.GetSize();z++)
4867
for (z2=z;z2<m_oaMolAtoms.GetSize();z2++)
4869
if (((CMolAtom*)m_oaMolAtoms[z2])->m_fAtomCode > ac)
4871
ac = ((CMolAtom*)m_oaMolAtoms[z2])->m_fAtomCode;
4877
ma = (CMolAtom*)m_oaMolAtoms[z];
4878
m_oaMolAtoms[z] = m_oaMolAtoms[i];
4879
m_oaMolAtoms[i] = ma;
4880
((CMolAtom*)m_oaMolAtoms[z])->m_iMolAtomNumber = z;
4883
eprintf("CSingleMolecule::BuildAtomCodes(): Weird error.\n");
4890
for (z=0;z<m_oaMolAtoms.GetSize();z++)
4892
ma = (CMolAtom*)m_oaMolAtoms[z];
4893
mprintf(" Atom %d (%s%d): %.2f\n",z+1,((CAtom*)g_oaAtoms[m_baAtomIndex[ma->m_iType]])->m_sName,ma->m_iOffset+1,ma->m_fAtomCode);
4895
mprintf(WHITE,"Finished.\n\n");
4897
// mprintf("Finished.\n");
4901
int CSingleMolecule::CountDifferentAtomCodes()
4906
try { d = new double[m_oaMolAtoms.GetSize()]; } catch(...) { d = NULL; }
4907
if (d == NULL) NewException((double)m_oaMolAtoms.GetSize()*sizeof(double),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4910
for (z=0;z<m_oaMolAtoms.GetSize();z++)
4912
for (z2=0;z2<i;z2++)
4913
if (d[z2] == ((CMolAtom*)m_oaMolAtoms[z])->m_fAtomCode)
4915
d[i] = ((CMolAtom*)m_oaMolAtoms[z])->m_fAtomCode;
4932
try { m_pMSD = new CAF(); } catch(...) { m_pMSD = NULL; }
4933
if (m_pMSD == NULL) NewException((double)sizeof(CAF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4935
mprintf(WHITE,"\n*** Mean Square Displacement\n\n");
4937
try { m_pAtomGroup = new CAtomGroup(); } catch(...) { m_pAtomGroup = NULL; }
4938
if (m_pAtomGroup == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
4941
mprintf(" Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2] ",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
4942
inpprintf("! Which atom(s) to take from OM %s (e.g. \"C1,C3-5,H\", \"*\"=all)? [#2]\n",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName);
4944
if (strlen(buf) == 0)
4946
if (!m_pAtomGroup->ParseAtoms((CMolecule*)g_oaMolecules[m_iShowMol],"#2"))
4948
eprintf("Weird error.\n");
4949
inpprintf("! Weird error.\n");
4952
} else if (!m_pAtomGroup->ParseAtoms((CMolecule*)g_oaMolecules[m_iShowMol],buf))
4954
eprintf("Wrong input.\n");
4955
inpprintf("! Wrong input.\n");
4960
if (g_iTrajSteps != -1)
4961
m_iResolution = AskUnsignedInteger(" Enter the resolution (=depth) for this MSD (in time steps): [%d] ",int(g_iTrajSteps*0.75),int(g_iTrajSteps*0.75));
4962
else m_iResolution = AskUnsignedInteger(" Enter the resolution (=depth) for this MSD (in time steps): [10000] ",10000);
4964
m_iShowAtoms = m_pAtomGroup->m_iAtomGes;
4966
/* if (g_iTrajSteps != -1)
4968
if (g_bMSDCacheMode)
4970
tf = g_iTrajSteps*m_pAtomGroup->m_iAtomGes*((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*3.0f*sizeof(float)/1024.0f/1024.0f;
4972
if (!AskYesNo(" This will occupy %.0f MB RAM (once, not for every MSD!). Continue (y/n)? [yes] ",true,tf))
4976
tf = m_iResolution*g_iGesVirtAtomCount*12.0f*sizeof(double)/1024.0f/1024.0f;
4978
if (!AskYesNo(" This will occupy %.0f MB RAM (once, not for every MSD!). Continue (y/n)? [yes] ",true,tf))
4982
/* if (m_iResolution > g_iMaxMSDDepth)
4983
g_iMaxMSDDepth = m_iReolution;*/
4985
ti = m_iResolution / 1000;
4988
m_iStride = AskUnsignedInteger(" Take every n-th step for the time axis of the MSD: [%d] ",ti,ti);
4989
m_iStride2 = AskUnsignedInteger(" Shift correlation window n time steps at once: [%d] ",m_iStride,m_iStride);
4993
m_bSplit = AskYesNo(" Decompose this MSD into contributions from each individual molecule (y/n)? [no] ",false);
4994
if (AskYesNo(" Take into account only certain dimensions for displacement (y/n)? [no] ",false))
4996
m_bTakeX = AskYesNo(" Take into account contributions along X axis (y/n)? [yes] ",true);
4997
m_bTakeY = AskYesNo(" Take into account contributions along X axis (y/n)? [yes] ",true);
4998
m_bTakeZ = AskYesNo(" Take into account contributions along X axis (y/n)? [yes] ",true);
5018
void CMSD::BuildName()
5023
sprintf(tmp,"%s_%s",((CMolecule*)g_oaMolecules[m_iShowMol])->m_sName,m_pAtomGroup->m_sName);
5025
if ((!m_bTakeX) || (!m_bTakeY) || (!m_bTakeZ))
5036
try { m_sName = new char[strlen(tmp)+1]; } catch(...) { m_sName = NULL; }
5037
if (m_sName == NULL) NewException((double)(strlen(tmp)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5039
strcpy(m_sName,tmp);
5044
void CVHDF::CorrectCount()
5048
for (y=0;y<m_iResolution;y++)
5049
for (x=0;x<m_iDepth/m_iStride;x++)
5050
if (m_pCount[x] != 0)
5051
m_pVHDF->m_pBin[y*m_iDepth/m_iStride+x] /= m_pCount[x];
5055
void CConditionSubGroup::PrintData()
5060
mprintf(GREEN,"\n*** Data for %d. set of conditions ***\n\n",m_iNumber+1);
5061
mprintf(" %.0f of %.0f molecules passed this set of conditions (%.4f percent).\n",m_fPassed,m_fTotal,ZeroDivide(m_fPassed,m_fTotal)*100.0f);
5063
for (z=0;z<m_oaConditions.GetSize();z++)
5065
mprintf(" - Condition %d: %.0f of %.0f molecules passed (%.4f percent).\n",z+1,((CNbSearch*)m_oaConditions[z])->m_fMoleculesPassed,((CNbSearch*)m_oaConditions[z])->m_fMoleculesTotal,ZeroDivide(((CNbSearch*)m_oaConditions[z])->m_fMoleculesPassed,((CNbSearch*)m_oaConditions[z])->m_fMoleculesTotal)*100.0);
5066
d *= ZeroDivide(((CNbSearch*)m_oaConditions[z])->m_fMoleculesPassed,((CNbSearch*)m_oaConditions[z])->m_fMoleculesTotal);
5069
if (m_oaConditions.GetSize() > 1)
5071
mprintf(" The product of the condition probabilities is %.4f percent.\n",d*100.0);
5072
mprintf(" If the conditions would be uncorrelated, this would be also the probability for the set.\n");
5073
mprintf(" Therefore, the conditions are %s correlated for %.4f percent.\n\n",(d<ZeroDivide(m_fPassed,m_fTotal))?"positively":"negatively",(d<ZeroDivide(m_fPassed,m_fTotal))?(ZeroDivide(ZeroDivide(m_fPassed,m_fTotal),d)-1.0)*100.0:(ZeroDivide(d,ZeroDivide(m_fPassed,m_fTotal))-1.0)*100.0);
5076
for (z=0;z<m_oaConditions.GetSize();z++)
5077
((CNbSearch*)m_oaConditions[z])->PrintTable();
5081
void CConditionSubGroup::PrintData(FILE *a)
5085
mfprintf(a,"\n*** Data for %d. set of conditions ***\n\n",m_iNumber+1);
5086
mfprintf(a," %.0f of %.0f molecules passed this set of conditions (%.4f percent).\n",m_fPassed,m_fTotal,ZeroDivide(m_fPassed,m_fTotal)*100.0f);
5087
for (z=0;z<m_oaConditions.GetSize();z++)
5088
((CNbSearch*)m_oaConditions[z])->PrintTable(a);
5092
void CConditionSubGroup::PrintSingle(int om)
5096
for (z=0;z<m_oaConditions.GetSize();z++)
5097
((CNbSearch*)m_oaConditions[z])->PrintSingle(om);
5101
void CConditionGroup::PrintSingle(int om)
5105
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
5106
((CConditionSubGroup*)m_oaConditionSubGroups[z])->PrintSingle(om);
5110
void CConditionGroup::PrintTable()
5113
double tf1, tf2, tf3;
5115
mprintf(WHITE,"*** Condition Table ***\n\n");
5116
mprintf(" The rows indicate how many subconditions of condition 1 are fulfilled.\n");
5117
mprintf(" The columns indicate how many subconditions of condition 2 are fulfilled.\n\n");
5120
for (z=0;z<((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1;z++)
5121
mprintf("| %4d ",z);
5124
for (z=0;z<((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1;z++)
5125
mprintf("|---------",z);
5130
for (z=0;z<((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_iCombinations+1;z++)
5133
for (z2=0;z2<((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1;z2++)
5135
if ((z > 0) && (z2 == 0))
5136
tf1 += m_pTable[z*(((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)+z2];
5137
if ((z == 0) && (z2 > 0))
5138
tf2 += m_pTable[z*(((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)+z2];
5139
if ((z > 0) && (z2 > 0))
5140
tf3 += m_pTable[z*(((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)+z2];
5141
mprintf("| %7.3f ",m_pTable[z*(((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)+z2]/m_fTableGes*100.0);
5146
mprintf(" A RM/OM pair fulfills no condition: %7.3f percent of the time.\n",m_pTable[0]/m_fTableGes*100.0);
5147
mprintf(" A RM/OM pair fulfills only condition 1: %7.3f percent of the time.\n",tf1/m_fTableGes*100.0);
5148
mprintf(" A RM/OM pair fulfills only condition 2: %7.3f percent of the time.\n",tf2/m_fTableGes*100.0);
5149
mprintf(" A RM/OM pair fulfills both conditions: %7.3f percent of the time.\n",tf3/m_fTableGes*100.0);
5150
mprintf(" Total: %7.3f percent of the time.\n",100.0);
5152
mprintf(WHITE,"*** Condition Table End ***\n\n");
5156
void CObservation::ListCDFObservations(int z)
5158
int z2, ti, ti2, ti3;
5161
switch(g_iObsChannel[z])
5166
if (m_bSecondShowMol && (z == 1))
5167
m_pRDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol2])->m_laSingleMolIndex[0]],&tempwa);
5168
else m_pRDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex[0]],&tempwa);
5169
} else m_pRDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],&tempwa);
5170
for (z2=0;z2<tempwa.GetSize()/2;z2++)
5173
ti2 = tempwa[z2*2+1];
5174
mprintf(" * %2d.) Distance %s%d (%s) <--> %s%d (%s)\n",z2+1,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName);
5181
if (m_bSecondShowMol && (z == 1))
5182
m_pADF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol2])->m_laSingleMolIndex[0]],&tempwa);
5183
else m_pADF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex[0]],&tempwa);
5184
} else m_pADF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],&tempwa);
5185
for (z2=0;z2<tempwa.GetSize()/6;z2++)
5187
mprintf(" * %2d.) Angle ",z2+1);
5188
if (m_pADF[z]->m_bOrtho[0])
5191
ti2 = tempwa[z2*6+1];
5192
ti3 = tempwa[z2*6+2];
5193
mprintf("[%s%d (%s), %s%d (%s), %s%d (%s)] to ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti3]])->m_sName,g_waAtomMolNumber[ti3]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti3]])->m_sName);
5197
ti2 = tempwa[z2*6+1];
5198
mprintf("[%s%d (%s) --> %s%d (%s)] to ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName);
5200
if (m_pADF[z]->m_bOrtho[1])
5202
ti = tempwa[z2*6+3];
5203
ti2 = tempwa[z2*6+4];
5204
ti3 = tempwa[z2*6+5];
5205
mprintf("[%s%d (%s), %s%d (%s), %s%d (%s)]\n",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti3]])->m_sName,g_waAtomMolNumber[ti3]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti3]])->m_sName);
5208
ti = tempwa[z2*6+3];
5209
ti2 = tempwa[z2*6+4];
5210
mprintf("[%s%d (%s) --> %s%d (%s)]\n",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName);
5218
if (m_bSecondShowMol && (z == 1))
5219
m_pDDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol2])->m_laSingleMolIndex[0]],&tempwa);
5220
else m_pDDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex[0]],&tempwa);
5221
} else m_pDDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],&tempwa);
5222
for (z2=0;z2<tempwa.GetSize()/9;z2++)
5224
mprintf(" * %2d.) Dihedral Angle ",z2+1);
5225
if (m_pDDF[z]->m_bOrtho[0])
5228
ti2 = tempwa[z2*9+1];
5229
ti3 = tempwa[z2*9+2];
5230
mprintf("[%s%d (%s), %s%d (%s), %s%d (%s)] - ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti3]])->m_sName,g_waAtomMolNumber[ti3]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti3]])->m_sName);
5234
ti2 = tempwa[z2*9+1];
5235
mprintf("[%s%d (%s) --> %s%d (%s)] - ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName);
5237
if (m_pDDF[z]->m_bOrtho[1])
5239
ti = tempwa[z2*9+3];
5240
ti2 = tempwa[z2*9+4];
5241
ti3 = tempwa[z2*9+5];
5242
mprintf("[%s%d (%s), %s%d (%s), %s%d (%s)] - ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti3]])->m_sName,g_waAtomMolNumber[ti3]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti3]])->m_sName);
5245
ti = tempwa[z2*9+3];
5246
ti2 = tempwa[z2*9+4];
5247
mprintf("[%s%d (%s) --> %s%d (%s)] - ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName);
5249
if (m_pDDF[z]->m_bOrtho[2])
5251
ti = tempwa[z2*9+6];
5252
ti2 = tempwa[z2*9+7];
5253
ti3 = tempwa[z2*9+8];
5254
mprintf("[%s%d (%s), %s%d (%s), %s%d (%s)]\n",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti3]])->m_sName,g_waAtomMolNumber[ti3]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti3]])->m_sName);
5257
ti = tempwa[z2*9+6];
5258
ti2 = tempwa[z2*9+7];
5259
mprintf("[%s%d (%s) --> %s%d (%s)]\n",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName);
5265
eprintf("(not implemented)\n");
5269
eprintf("(not implemented)\n");
5275
if (m_bSecondShowMol && (z == 1))
5276
m_pPlDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol2])->m_laSingleMolIndex[0]],&tempwa);
5277
else m_pPlDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex[0]],&tempwa);
5278
} else m_pPlDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],&tempwa);
5279
for (z2=0;z2<tempwa.GetSize()/4;z2++)
5281
mprintf(" * %2d.) Distance from Plane ",z2+1);
5282
if (m_pPlDF[z]->m_bNormal)
5285
ti2 = tempwa[z2*4+1];
5286
mprintf("[%s%d (%s) --> %s%d (%s)] - ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName);
5290
ti2 = tempwa[z2*4+1];
5291
ti3 = tempwa[z2*4+2];
5292
mprintf("[%s%d (%s), %s%d (%s), %s%d (%s)] - ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti3]])->m_sName,g_waAtomMolNumber[ti3]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti3]])->m_sName);
5294
ti = tempwa[z2*4+3];
5295
mprintf("%s%d (%s)\n",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName);
5302
if (m_bSecondShowMol && (z == 1))
5303
m_pLiDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol2])->m_laSingleMolIndex[0]],&tempwa);
5304
else m_pLiDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex[0]],&tempwa);
5305
} else m_pLiDF[z]->BuildAtomList((CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],(CSingleMolecule*)g_oaSingleMolecules[((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex[0]],&tempwa);
5306
for (z2=0;z2<tempwa.GetSize()/4;z2++)
5308
mprintf(" * %2d.) Distance from Plane ",z2+1);
5309
if (m_pLiDF[z]->m_bNormal)
5312
ti2 = tempwa[z2*4+1];
5313
ti3 = tempwa[z2*4+2];
5314
mprintf("[%s%d (%s), %s%d (%s), %s%d (%s)] - ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti3]])->m_sName,g_waAtomMolNumber[ti3]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti3]])->m_sName);
5318
ti2 = tempwa[z2*4+1];
5319
mprintf("[%s%d (%s) --> %s%d (%s)] - ",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName,((CAtom*)g_oaAtoms[g_waAtomRealElement[ti2]])->m_sName,g_waAtomMolNumber[ti2]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti2]])->m_sName);
5321
ti = tempwa[z2*4+3];
5322
mprintf("%s%d (%s)\n",((CAtom*)g_oaAtoms[g_waAtomRealElement[ti]])->m_sName,g_waAtomMolNumber[ti]+1,((CMolecule*)g_oaMolecules[g_waAtomMolIndex[ti]])->m_sName);
5329
void CSDF::CreateCutPlane()
5334
try { m_pCutPlane = new C2DF(); } catch(...) { m_pCutPlane = NULL; }
5335
if (m_pCutPlane == NULL) NewException((double)sizeof(C2DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5337
m_pCutPlane->m_fMinVal[0] = -m_fRadius;
5338
m_pCutPlane->m_fMinVal[1] = -m_fRadius;
5339
m_pCutPlane->m_fMaxVal[0] = m_fRadius;
5340
m_pCutPlane->m_fMaxVal[1] = m_fRadius;
5341
m_pCutPlane->m_iRes[0] = m_iCutPlaneResolution;
5342
m_pCutPlane->m_iRes[1] = m_iCutPlaneResolution;
5343
m_pCutPlane->SetLabelX("X [pm]");
5344
m_pCutPlane->SetLabelY("Y [pm]");
5345
m_pCutPlane->Create();
5348
for (y=0;y<m_iCutPlaneResolution;y++)
5350
vec[1] = (float)(((y+0.5)/m_pCutPlane->m_iRes[1])*(m_pCutPlane->m_fMaxVal[1]-m_pCutPlane->m_fMinVal[1])+m_pCutPlane->m_fMinVal[1]);
5351
for (x=0;x<m_iCutPlaneResolution;x++)
5353
vec[0] = (float)(((x+0.5)/m_pCutPlane->m_iRes[0])*(m_pCutPlane->m_fMaxVal[0]-m_pCutPlane->m_fMinVal[0])+m_pCutPlane->m_fMinVal[0]);
5354
m_pCutPlane->AddToBin(x,y,m_pSDF->GetValue(vec));
5357
if (m_bCutPlaneShowAtoms)
5359
m_pCutPlane->AddCircle(0,0,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_pElement->m_fRadius*0.75,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_pElement->m_iColorR/255.0,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_pElement->m_iColorG/255.0,((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_pElement->m_iColorB/255.0);
5360
m_pCutPlane->AddCircle(m_fAtom2PosX / m_fPosCounter,0,((CAtom*)g_oaAtoms[g_iFixRealAtomType[1]])->m_pElement->m_fRadius*0.75,((CAtom*)g_oaAtoms[g_iFixRealAtomType[1]])->m_pElement->m_iColorR/255.0,((CAtom*)g_oaAtoms[g_iFixRealAtomType[1]])->m_pElement->m_iColorG/255.0,((CAtom*)g_oaAtoms[g_iFixRealAtomType[1]])->m_pElement->m_iColorB/255.0);
5361
m_pCutPlane->AddCircle(m_fAtom3PosX / m_fPosCounter,m_fAtom3PosY / m_fPosCounter,((CAtom*)g_oaAtoms[g_iFixRealAtomType[2]])->m_pElement->m_fRadius*0.75,((CAtom*)g_oaAtoms[g_iFixRealAtomType[2]])->m_pElement->m_iColorR/255.0,((CAtom*)g_oaAtoms[g_iFixRealAtomType[2]])->m_pElement->m_iColorG/255.0,((CAtom*)g_oaAtoms[g_iFixRealAtomType[2]])->m_pElement->m_iColorB/255.0);
5366
void CConditionGroup::Reset()
5370
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
5371
((CConditionSubGroup*)m_oaConditionSubGroups[z])->Reset();
5373
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
5374
m_iPassCounter[z] = 0;
5378
void CConditionSubGroup::Reset()
5382
for (z=0;z<m_oaConditions.GetSize();z++)
5383
((CNbSearch*)m_oaConditions[z])->Reset();
5387
void CRDF::CopyFrom(CRDF *p)
5392
m_bAdaptive = p->m_bAdaptive;
5393
m_bRadialCorrect = p->m_bRadialCorrect;
5394
m_bSelf = p->m_bSelf;
5395
m_fMinDist = p->m_fMinDist;
5396
m_fMaxDist = p->m_fMaxDist;
5397
m_iCombinations = p->m_iCombinations;
5398
m_iHistogramRes = p->m_iHistogramRes;
5399
m_iRefAtomGes = p->m_iRefAtomGes;
5400
m_iRefOrSec[0] = p->m_iRefOrSec[0];
5401
m_iRefOrSec[1] = p->m_iRefOrSec[1];
5402
m_iResolution = p->m_iResolution;
5403
m_iShowAtomGes = p->m_iShowAtomGes;
5404
m_iShowMol = p->m_iShowMol;
5406
if (p->m_sName != NULL)
5408
try { m_sName = new char[strlen(p->m_sName)+1]; } catch(...) { m_sName = NULL; }
5409
if (m_sName == NULL) NewException((double)(strlen(p->m_sName)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5411
strcpy(m_sName,p->m_sName);
5412
} else m_sName = NULL;
5414
if (p->m_sShortName != NULL)
5416
try { m_sShortName = new char[strlen(p->m_sShortName)+1]; } catch(...) { m_sShortName = NULL; }
5417
if (m_sShortName == NULL) NewException((double)(strlen(p->m_sShortName)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5419
strcpy(m_sShortName,p->m_sShortName);
5420
} else m_sShortName = NULL;
5422
if (p->m_baDataEnabled != NULL)
5424
try { m_baDataEnabled = new CxByteArray[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_baDataEnabled = NULL; }
5425
if (m_baDataEnabled == NULL) NewException((double)((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*sizeof(CxByteArray),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5427
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
5428
m_baDataEnabled[z].CopyFrom(&p->m_baDataEnabled[z]);
5431
if (p->m_faData != NULL)
5433
try { m_faData = new CxDoubleArray[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_faData = NULL; }
5434
if (m_faData == NULL) NewException((double)((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*sizeof(CxDoubleArray),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5436
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
5437
m_faData[z].CopyFrom(&p->m_faData[z]);
5440
for (z=0;z<p->m_oaVectors.GetSize();z++)
5442
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
5443
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5445
ag->CopyFrom((CAtomGroup*)p->m_oaVectors[z]);
5446
m_oaVectors.Add(ag);
5449
m_faMinMaxDist.CopyFrom(&p->m_faMinMaxDist);
5451
if (p->m_pRDF != NULL)
5453
try { m_pRDF = new CDF(); } catch(...) { m_pRDF = NULL; }
5454
if (m_pRDF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5456
m_pRDF->CopyFrom(p->m_pRDF);
5461
void CADF::CopyFrom(CADF *p)
5466
m_bCosine = p->m_bCosine;
5467
m_bFoldAngle = p->m_bFoldAngle;
5468
m_bMirror = p->m_bMirror;
5469
m_bOrtho[0] = p->m_bOrtho[0];
5470
m_bOrtho[1] = p->m_bOrtho[1];
5471
m_iVecType[0] = p->m_iVecType[0];
5472
m_iVecType[1] = p->m_iVecType[1];
5473
m_bSelf = p->m_bSelf;
5474
m_bStat = p->m_bStat;
5475
m_fMinAngle = p->m_fMinAngle;
5476
m_fMaxAngle = p->m_fMaxAngle;
5477
m_iCombinations = p->m_iCombinations;
5478
m_iHistogramRes = p->m_iHistogramRes;
5480
for (z2=0;z2<3;z2++)
5481
m_iRefOrSec[z][z2] = p->m_iRefOrSec[z][z2];
5482
m_iResolution = p->m_iResolution;
5483
m_iShowMol = p->m_iShowMol;
5485
if (p->m_sName != NULL)
5487
try { m_sName = new char[strlen(p->m_sName)+1]; } catch(...) { m_sName = NULL; }
5488
if (m_sName == NULL) NewException((double)(strlen(p->m_sName)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5490
strcpy(m_sName,p->m_sName);
5491
} else m_sName = NULL;
5493
if (p->m_sShortName != NULL)
5495
try { m_sShortName = new char[strlen(p->m_sShortName)+1]; } catch(...) { m_sShortName = NULL; }
5496
if (m_sShortName == NULL) NewException((double)(strlen(p->m_sShortName)+1)*sizeof(char),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5498
strcpy(m_sShortName,p->m_sShortName);
5499
} else m_sShortName = NULL;
5501
if (p->m_baDataEnabled != NULL)
5503
try { m_baDataEnabled = new CxByteArray[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_baDataEnabled = NULL; }
5504
if (m_baDataEnabled == NULL) NewException((double)((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*sizeof(CxByteArray),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5506
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
5507
m_baDataEnabled[z].CopyFrom(&p->m_baDataEnabled[z]);
5510
if (p->m_faData != NULL)
5512
try { m_faData = new CxDoubleArray[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_faData = NULL; }
5513
if (m_faData == NULL) NewException((double)((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*sizeof(CxDoubleArray),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5515
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
5516
m_faData[z].CopyFrom(&p->m_faData[z]);
5519
for (z=0;z<p->m_oaVectors.GetSize();z++)
5521
if (p->m_oaVectors[z] != NULL)
5523
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
5524
if (ag == NULL) NewException((double)sizeof(CAtomGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5526
ag->CopyFrom((CAtomGroup*)p->m_oaVectors[z]);
5527
m_oaVectors.Add(ag);
5528
} else m_oaVectors.Add(NULL);
5531
m_faMinMaxAngle.CopyFrom(&p->m_faMinMaxAngle);
5533
if (p->m_pADF != NULL)
5535
try { m_pADF = new CDF(); } catch(...) { m_pADF = NULL; }
5536
if (m_pADF == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5538
m_pADF->CopyFrom(p->m_pADF);
5543
void CConditionSubGroup::CopyFrom(CConditionSubGroup *p)
5548
m_fPassed = p->m_fPassed;
5549
m_fTotal = p->m_fTotal;
5550
m_iCombinations = p->m_iCombinations;
5551
m_iNumber = p->m_iNumber;
5552
m_iShowMol = p->m_iShowMol;
5553
if (p->m_bTempPassed != NULL)
5555
try { m_bTempPassed = new bool[g_iGesVirtAtomCount]; } catch(...) { m_bTempPassed = NULL; }
5556
if (m_bTempPassed == NULL) NewException((double)g_iGesVirtAtomCount*sizeof(bool),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5558
memcpy(m_bTempPassed,p->m_bTempPassed,sizeof(bool)*g_iGesVirtAtomCount);
5560
for (z=0;z<p->m_oaConditions.GetSize();z++)
5562
try { nb = new CNbSearch(); } catch(...) { nb = NULL; }
5563
if (nb == NULL) NewException((double)sizeof(CNbSearch),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5565
nb->CopyFrom((CNbSearch*)p->m_oaConditions[z]);
5566
m_oaConditions.Add(nb);
5571
void CConditionGroup::CopyFrom(CConditionGroup *p)
5574
CConditionSubGroup *sg;
5576
m_bInactive = p->m_bInactive;
5577
m_iShowMol = p->m_iShowMol;
5578
m_iRefMol = p->m_iRefMol;
5579
m_iHistoGes = p->m_iHistoGes;
5580
m_bAnyPassed = p->m_bAnyPassed;
5581
m_fTableGes = p->m_fTableGes;
5582
m_fPassed = p->m_fPassed;
5583
m_fTotal = p->m_fTotal;
5584
m_bInvertCondition = p->m_bInvertCondition;
5586
if (p->m_bAlwaysTrue != NULL)
5588
try { m_bAlwaysTrue = new bool[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_bAlwaysTrue = NULL; }
5589
if (m_bAlwaysTrue == NULL) NewException((double)((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*sizeof(bool),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5591
memcpy(m_bAlwaysTrue,p->m_bAlwaysTrue,sizeof(bool)*((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize());
5593
if (p->m_iPassCounter != NULL)
5595
try { m_iPassCounter = new long[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iPassCounter = NULL; }
5596
if (m_iPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5598
memcpy(m_iPassCounter,p->m_iPassCounter,sizeof(long)*((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize());
5600
if (p->m_iOMPassCounter != NULL)
5602
try { m_iOMPassCounter = new long[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iOMPassCounter = NULL; }
5603
if (m_iOMPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5605
memcpy(m_iOMPassCounter,p->m_iOMPassCounter,sizeof(long)*((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize());
5607
if (p->m_iRMPassCounter != NULL)
5609
try { m_iRMPassCounter = new long[((CMolecule*)g_oaMolecules[m_iRefMol])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iRMPassCounter = NULL; }
5610
if (m_iRMPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[m_iRefMol])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5612
memcpy(m_iRMPassCounter,p->m_iRMPassCounter,sizeof(long)*((CMolecule*)g_oaMolecules[m_iRefMol])->m_laSingleMolIndex.GetSize());
5614
for (z=0;z<p->m_oaConditionSubGroups.GetSize();z++)
5616
try { sg = new CConditionSubGroup(); } catch(...) { sg = NULL; }
5617
if (sg == NULL) NewException((double)sizeof(CConditionSubGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5619
sg->CopyFrom((CConditionSubGroup*)p->m_oaConditionSubGroups[z]);
5620
m_oaConditionSubGroups.Add(sg);
5623
if (p->m_pTable != NULL)
5625
try { m_pTable = new double[(((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_iCombinations+1) * (((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)]; } catch(...) { m_pTable = NULL; }
5626
if (m_pTable == NULL) NewException((double)(((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_iCombinations+1) * (((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)*sizeof(double),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5628
memcpy(m_pTable,p->m_pTable,sizeof(double)*(((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_iCombinations+1) * (((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1));
5631
if (p->m_pHistogram != NULL)
5633
try { m_pHistogram = new unsigned long[((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()+1]; } catch(...) { m_pHistogram = NULL; }
5634
if (m_pHistogram == NULL) NewException((double)(((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()+1)*sizeof(unsigned long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5636
memcpy(m_pHistogram,p->m_pHistogram,sizeof(unsigned long)*(((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()+1));
5641
void CConditionGroup::Parse_OnlyValues()
5646
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
5648
mprintf(YELLOW,">>> %d. set of conditions >>>\n\n",z+1);
5649
((CConditionSubGroup*)m_oaConditionSubGroups[z])->Parse_OnlyValues();
5650
mprintf(YELLOW,"<<< End of %d. set of conditions <<<\n\n",z+1);
5655
void CConditionSubGroup::Parse_OnlyValues()
5660
for (z=0;z<m_oaConditions.GetSize();z++)
5662
mprintf(YELLOW," >>> %d. condition within this set >>>\n\n",z+1);
5663
((CNbSearch*)m_oaConditions[z])->Parse_OnlyValues();
5664
mprintf(YELLOW,"\n <<< End of %d. condition <<<\n\n",z+1);
5670
void CConditionGroup::CopyResults(CConditionGroup *p)
5674
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
5675
((CConditionSubGroup*)m_oaConditionSubGroups[z])->CopyResults((CConditionSubGroup*)p->m_oaConditionSubGroups[z]);
5679
void CConditionSubGroup::CopyResults(CConditionSubGroup *p)
5683
for (z=0;z<m_oaConditions.GetSize();z++)
5684
((CNbSearch*)m_oaConditions[z])->CopyResults((CNbSearch*)p->m_oaConditions[z]);
5688
void CConditionGroup::ReScan(CSingleMolecule *rm)
5691
int z, z2, t1, t2, i;
5696
for (z=0;z<m_oaConditionSubGroups.GetSize();z++)
5697
((CConditionSubGroup*)m_oaConditionSubGroups[z])->ReScan(rm);
5699
if (m_oaConditionSubGroups.GetSize() == 2)
5701
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
5705
for (z2=0;z2<((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_oaConditions.GetSize();z2++)
5706
t1 += ((CNbSearch*)((CConditionSubGroup*)m_oaConditionSubGroups[0])->m_oaConditions[z2])->m_iCombPassCount[z];
5707
for (z2=0;z2<((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_oaConditions.GetSize();z2++)
5708
t2 += ((CNbSearch*)((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_oaConditions[z2])->m_iCombPassCount[z];
5709
m_pTable[t1*(((CConditionSubGroup*)m_oaConditionSubGroups[1])->m_iCombinations+1)+t2]++;
5715
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
5718
if (m_bInvertCondition)
5720
for (z2=0;z2<m_oaConditionSubGroups.GetSize();z2++)
5721
if (((CConditionSubGroup*)m_oaConditionSubGroups[z2])->Contains(z))
5724
m_iPassCounter[z]++;
5725
m_bAnyPassed = true;
5728
for (z2=0;z2<m_oaConditionSubGroups.GetSize();z2++)
5729
if (((CConditionSubGroup*)m_oaConditionSubGroups[z2])->Contains(z))
5731
// mprintf("passed[%d]++\n",z);
5733
m_iPassCounter[z]++;
5734
m_bAnyPassed = true;
5748
void CConditionSubGroup::ReScan(CSingleMolecule *rm)
5752
for (z=0;z<m_oaConditions.GetSize();z++)
5753
((CNbSearch*)m_oaConditions[z])->ReScan(rm);
5755
for (z=0;z<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z++)
5758
for (z2=0;z2<m_oaConditions.GetSize();z2++)
5759
if (!((CNbSearch*)m_oaConditions[z2])->m_bPassed[z])
5767
CNbSearch* CConditionGroup::AddSingleCondition(int rm, int sm, int gridmode)
5770
CConditionSubGroup *sg;
5776
try { m_bAlwaysTrue = new bool[((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_bAlwaysTrue = NULL; }
5777
if (m_bAlwaysTrue == NULL) NewException((double)((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()*sizeof(bool),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5779
try { m_iPassCounter = new long[((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iPassCounter = NULL; }
5780
if (m_iPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5782
try { m_iOMPassCounter = new long[((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iOMPassCounter = NULL; }
5783
if (m_iOMPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5785
for (z=0;z<((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize();z++)
5787
m_bAlwaysTrue[z] = false;
5788
m_iPassCounter[z] = 0;
5789
m_iOMPassCounter[z] = 0;
5792
try { m_iRMPassCounter = new long[((CMolecule*)g_oaMolecules[rm])->m_laSingleMolIndex.GetSize()]; } catch(...) { m_iRMPassCounter = NULL; }
5793
if (m_iRMPassCounter == NULL) NewException((double)((CMolecule*)g_oaMolecules[rm])->m_laSingleMolIndex.GetSize()*sizeof(long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5795
for (z=0;z<((CMolecule*)g_oaMolecules[rm])->m_laSingleMolIndex.GetSize();z++)
5796
m_iRMPassCounter[z] = 0;
5798
try { sg = new CConditionSubGroup(); } catch(...) { sg = NULL; }
5799
if (sg == NULL) NewException((double)sizeof(CConditionSubGroup),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5801
sg->m_iShowMol = m_iShowMol;
5802
sg->m_iNumber = m_oaConditionSubGroups.GetSize();
5803
m_oaConditionSubGroups.Add(sg);
5805
m_bInvertCondition = false;
5809
try { m_pHistogram = new unsigned long[((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()+1]; } catch(...) { m_pHistogram = NULL; }
5810
if (m_pHistogram == NULL) NewException((double)(((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()+1)*sizeof(unsigned long),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5812
for (z=0;z<((CMolecule*)g_oaMolecules[sm])->m_laSingleMolIndex.GetSize()+1;z++)
5813
m_pHistogram[z] = 0;
5816
return sg->AddSingleCondition(rm,sm,gridmode);
5820
CNbSearch* CConditionSubGroup::AddSingleCondition(int rm, int sm, int gridmode)
5825
m_iCombinations = 0;
5827
try { n = new CNbSearch(); } catch(...) { n = NULL; }
5828
if (n == NULL) NewException((double)sizeof(CNbSearch),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5830
n->m_iNumber = m_oaConditions.GetSize();
5831
m_oaConditions.Add(n);
5832
n->ParseGrid(rm,sm,gridmode);
5833
m_iCombinations += n->m_iCombinationsEnabled;
5835
try { m_bTempPassed = new bool[g_iGesVirtAtomCount]; } catch(...) { m_bTempPassed = NULL; }
5836
if (m_bTempPassed == NULL) NewException((double)g_iGesVirtAtomCount*sizeof(bool),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5843
void CObservation::BuildTimeDiff(CDF *df, bool ddf)
5845
int z, z2, z3, z4, i;
5847
double tf, tfa, tfsq, tfs, tf0;
5850
try { df->m_pTimeDiff = new CDF(); } catch(...) { df->m_pTimeDiff = NULL; }
5851
if (df->m_pTimeDiff == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5853
df->m_pTimeDiff->m_iResolution = m_iTimeDiffDepth;
5854
df->m_pTimeDiff->m_fMinVal = 0;
5855
df->m_pTimeDiff->m_fMaxVal = m_iTimeDiffDepth * g_fTimestepLength / 1000.0;
5856
df->m_pTimeDiff->Create();
5857
df->m_pTimeDiff->SetLabelX("Tau [ps]");
5858
sprintf(buf,"Delta ");
5859
strcat(buf,df->m_sLabelX);
5860
df->m_pTimeDiff->SetLabelY(buf);
5862
try { df->m_pTimeDiffAbs = new CDF(); } catch(...) { df->m_pTimeDiffAbs = NULL; }
5863
if (df->m_pTimeDiffAbs == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5865
df->m_pTimeDiffAbs->m_iResolution = m_iTimeDiffDepth;
5866
df->m_pTimeDiffAbs->m_fMinVal = 0;
5867
df->m_pTimeDiffAbs->m_fMaxVal = m_iTimeDiffDepth * g_fTimestepLength / 1000.0;
5868
df->m_pTimeDiffAbs->Create();
5869
df->m_pTimeDiffAbs->SetLabelX("Tau [ps]");
5870
df->m_pTimeDiffAbs->SetLabelY(buf);
5872
sprintf(buf,"Delta Square ");
5873
strcat(buf,df->m_sLabelX);
5875
try { df->m_pTimeDiffSqr = new CDF(); } catch(...) { df->m_pTimeDiffSqr = NULL; }
5876
if (df->m_pTimeDiffSqr == NULL) NewException((double)sizeof(CDF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5878
df->m_pTimeDiffSqr->m_iResolution = m_iTimeDiffDepth;
5879
df->m_pTimeDiffSqr->m_fMinVal = 0;
5880
df->m_pTimeDiffSqr->m_fMaxVal = m_iTimeDiffDepth * g_fTimestepLength / 1000.0;
5881
df->m_pTimeDiffSqr->Create();
5882
df->m_pTimeDiffSqr->SetLabelX("Tau [ps]");
5883
df->m_pTimeDiffSqr->SetLabelY(buf);
5887
sprintf(buf,"Delta ");
5888
strcat(buf,df->m_sLabelX);
5890
try { df->m_p3DTimeDiff = new C2DF(); } catch(...) { df->m_p3DTimeDiff = NULL; }
5891
if (df->m_p3DTimeDiff == NULL) NewException((double)sizeof(C2DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5893
df->m_p3DTimeDiff->m_iRes[0] = m_iTimeDiffDepth/m_iTimeDiffStride3D;
5894
df->m_p3DTimeDiff->m_iRes[1] = m_iTimeDiffRes3D;
5895
df->m_p3DTimeDiff->m_fMinVal[0] = 0;
5896
df->m_p3DTimeDiff->m_fMaxVal[0] = m_iTimeDiffDepth * g_fTimestepLength / 1000.0;
5897
df->m_p3DTimeDiff->m_fMinVal[1] = m_fTimeDiffMinVal3D;
5898
df->m_p3DTimeDiff->m_fMaxVal[1] = m_fTimeDiffMaxVal3D;
5899
df->m_p3DTimeDiff->Create();
5900
df->m_p3DTimeDiff->SetLabelX("Tau [ps]");
5901
df->m_p3DTimeDiff->SetLabelY(df->m_sLabelX);
5902
df->m_p3DTimeDiff->SetLabelZ(buf);
5904
try { df->m_p3DTimeDiffAbs = new C2DF(); } catch(...) { df->m_p3DTimeDiffAbs = NULL; }
5905
if (df->m_p3DTimeDiffAbs == NULL) NewException((double)sizeof(C2DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5907
df->m_p3DTimeDiffAbs->m_iRes[0] = m_iTimeDiffDepth/m_iTimeDiffStride3D;
5908
df->m_p3DTimeDiffAbs->m_iRes[1] = m_iTimeDiffRes3D;
5909
df->m_p3DTimeDiffAbs->m_fMinVal[0] = 0;
5910
df->m_p3DTimeDiffAbs->m_fMaxVal[0] = m_iTimeDiffDepth * g_fTimestepLength / 1000.0;
5911
df->m_p3DTimeDiffAbs->m_fMinVal[1] = m_fTimeDiffMinVal3D;
5912
df->m_p3DTimeDiffAbs->m_fMaxVal[1] = m_fTimeDiffMaxVal3D;
5913
df->m_p3DTimeDiffAbs->Create();
5914
df->m_p3DTimeDiffAbs->SetLabelX("Tau [ps]");
5915
df->m_p3DTimeDiffAbs->SetLabelY(df->m_sLabelX);
5916
df->m_p3DTimeDiffAbs->SetLabelZ(buf);
5918
if (m_iTimeDiffDistSteps != 0)
5920
try { df->m_pTimeDiffDistPairs = new C2DF*[m_iTimeDiffDepth/m_iTimeDiffStride3D/m_iTimeDiffDistSteps]; } catch(...) { df->m_pTimeDiffDistPairs = NULL; }
5921
if (df->m_pTimeDiffDistPairs == NULL) NewException((double)m_iTimeDiffDepth/m_iTimeDiffStride3D/m_iTimeDiffDistSteps*sizeof(C2DF*),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5923
for (z=0;z<m_iTimeDiffDepth/m_iTimeDiffStride3D/m_iTimeDiffDistSteps;z++)
5925
try { df->m_pTimeDiffDistPairs[z] = new C2DF(); } catch(...) { df->m_pTimeDiffDistPairs[z] = NULL; }
5926
if (df->m_pTimeDiffDistPairs[z] == NULL) NewException((double)sizeof(C2DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5928
df->m_pTimeDiffDistPairs[z]->m_iRes[0] = m_iTimeDiffDistResX;
5929
df->m_pTimeDiffDistPairs[z]->m_iRes[1] = m_iTimeDiffDistResY;
5930
df->m_pTimeDiffDistPairs[z]->m_fMinVal[0] = m_fTimeDiffDistMinValX;
5931
df->m_pTimeDiffDistPairs[z]->m_fMaxVal[0] = m_fTimeDiffDistMaxValX;
5932
df->m_pTimeDiffDistPairs[z]->m_fMinVal[1] = m_fTimeDiffDistMinValY;
5933
df->m_pTimeDiffDistPairs[z]->m_fMaxVal[1] = m_fTimeDiffDistMaxValY;
5934
df->m_pTimeDiffDistPairs[z]->Create();
5935
df->m_pTimeDiffDistPairs[z]->SetLabelX(df->m_sLabelX);
5936
df->m_pTimeDiffDistPairs[z]->SetLabelY(df->m_sLabelX);
5940
try { df->m_pTimeDiffDist3DF = new C3DF(); } catch(...) { df->m_pTimeDiffDist3DF = NULL; }
5941
if (df->m_pTimeDiffDist3DF == NULL) NewException((double)sizeof(C3DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5943
df->m_pTimeDiffDist3DF->m_iRes[0] = m_iTimeDiffDistResX;
5944
df->m_pTimeDiffDist3DF->m_iRes[1] = m_iTimeDiffDistResY;
5945
df->m_pTimeDiffDist3DF->m_iRes[2] = m_iTimeDiffDepth/m_iTimeDiffStride3D;
5946
df->m_pTimeDiffDist3DF->m_fMinVal[0] = m_fTimeDiffDistMinValX;
5947
df->m_pTimeDiffDist3DF->m_fMaxVal[0] = m_fTimeDiffDistMaxValX;
5948
df->m_pTimeDiffDist3DF->m_fMinVal[1] = m_fTimeDiffDistMinValY;
5949
df->m_pTimeDiffDist3DF->m_fMaxVal[1] = m_fTimeDiffDistMaxValY;
5950
df->m_pTimeDiffDist3DF->m_fMinVal[2] = 0;
5951
df->m_pTimeDiffDist3DF->m_fMaxVal[2] = m_iTimeDiffDepth * g_fTimestepLength / 1000.0;
5952
df->m_pTimeDiffDist3DF->Create();
5953
df->m_pTimeDiffDist3DF->SetLabelX(df->m_sLabelX);
5954
df->m_pTimeDiffDist3DF->SetLabelY(df->m_sLabelX);
5956
sprintf(buf,"Delta Square ");
5957
strcat(buf,df->m_sLabelX);
5959
try { df->m_p3DTimeDiffSqr = new C2DF(); } catch(...) { df->m_p3DTimeDiffSqr = NULL; }
5960
if (df->m_p3DTimeDiffSqr == NULL) NewException((double)sizeof(C3DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5962
df->m_p3DTimeDiffSqr->m_iRes[0] = m_iTimeDiffDepth/m_iTimeDiffStride3D;
5963
df->m_p3DTimeDiffSqr->m_iRes[1] = m_iTimeDiffRes3D;
5964
df->m_p3DTimeDiffSqr->m_fMinVal[0] = 0;
5965
df->m_p3DTimeDiffSqr->m_fMaxVal[0] = m_iTimeDiffDepth * g_fTimestepLength / 1000.0;
5966
df->m_p3DTimeDiffSqr->m_fMinVal[1] = m_fTimeDiffMinVal3D;
5967
df->m_p3DTimeDiffSqr->m_fMaxVal[1] = m_fTimeDiffMaxVal3D;
5968
df->m_p3DTimeDiffSqr->Create();
5969
df->m_p3DTimeDiffSqr->SetLabelX("Tau [ps]");
5970
df->m_p3DTimeDiffSqr->SetLabelY(df->m_sLabelX);
5971
df->m_p3DTimeDiffSqr->SetLabelZ(buf);
5973
try { df->m_p3DTimeDiffT = new C2DF(); } catch(...) { df->m_p3DTimeDiffT = NULL; }
5974
if (df->m_p3DTimeDiffT == NULL) NewException((double)sizeof(C2DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
5976
df->m_p3DTimeDiffT->m_iRes[0] = m_iTimeDiffDepth/m_iTimeDiffStride3D;
5977
df->m_p3DTimeDiffT->m_iRes[1] = m_iTimeDiffRes3D;
5978
df->m_p3DTimeDiffT->m_fMinVal[0] = 0;
5979
df->m_p3DTimeDiffT->m_fMaxVal[0] = m_iTimeDiffDepth * g_fTimestepLength / 1000.0;
5980
df->m_p3DTimeDiffT->m_fMinVal[1] = m_fTimeDiffMinVal3D;
5981
df->m_p3DTimeDiffT->m_fMaxVal[1] = m_fTimeDiffMaxVal3D;
5982
df->m_p3DTimeDiffT->Create();
5985
for (z2=0;z2<df->m_oaTimeDiffBuf.GetSize();z2++)
5987
mprintf(" %4d/%d 2D [",z2+1,df->m_oaTimeDiffBuf.GetSize());
5988
ptfa = (CxFloatArray*)df->m_oaTimeDiffBuf[z2];
5989
tfs = m_iTimeDiffDepth/50.0;
5990
for (z3=0;z3<m_iTimeDiffDepth;z3++) // Das ist das Tau
5992
if (fmod(z3,tfs) < 1.0)
5997
for (z4=0;z4<(int)ptfa->GetSize()-z3-1;z4++) // Das ist der Startpunkt
5999
tf0 = (*ptfa)[z3+z4]-(*ptfa)[z4];
6011
df->m_pTimeDiff->AddToBin_Int(z3,tf/(ptfa->GetSize()-z3-1));
6012
df->m_pTimeDiffAbs->AddToBin_Int(z3,tfa/(ptfa->GetSize()-z3-1));
6013
df->m_pTimeDiffSqr->AddToBin_Int(z3,tfsq/(ptfa->GetSize()-z3-1));
6015
df->m_pTimeDiff->m_fBinEntries += ptfa->GetSize()-z3-2;
6016
df->m_pTimeDiffAbs->m_fBinEntries += ptfa->GetSize()-z3-2;
6017
df->m_pTimeDiffSqr->m_fBinEntries += ptfa->GetSize()-z3-2;
6022
mprintf(" %4d/%d 3D [",z2+1,df->m_oaTimeDiffBuf.GetSize());
6023
tfs = m_iTimeDiffDepth/50.0;
6024
for (z3=0;z3<m_iTimeDiffDepth;z3+=m_iTimeDiffStride3D) // Das ist das Tau
6026
if (fmod(z3,tfs) < 1.0)
6028
i = z3/m_iTimeDiffStride3D;
6029
for (z4=0;z4<(int)ptfa->GetSize()-z3-1;z4++) // Das ist der Startpunkt
6031
tf0 = (*ptfa)[z3+z4]-(*ptfa)[z4];
6039
df->m_p3DTimeDiff->AddToBin_IntX(i,(*ptfa)[z4],tf0);
6040
df->m_p3DTimeDiffAbs->AddToBin_IntX(i,(*ptfa)[z4],fabs(tf0));
6041
df->m_p3DTimeDiffSqr->AddToBin_IntX(i,(*ptfa)[z4],tf0*tf0);
6042
df->m_p3DTimeDiffT->AddToBin_IntX(i,(*ptfa)[z4],1.0);
6043
df->m_pTimeDiffDist3DF->AddToBin_IntZ((*ptfa)[z4],(*ptfa)[z3+z4],i);
6044
if (m_iTimeDiffDistSteps != 0)
6045
if ((i % m_iTimeDiffDistSteps) == 0)
6046
df->m_pTimeDiffDistPairs[i/m_iTimeDiffDistSteps]->AddToBin((*ptfa)[z4],(*ptfa)[z3+z4]);
6052
for (z3=0;z3<m_iTimeDiffDepth;z3++) // Das ist das Tau
6054
df->m_pTimeDiff->m_pBin[z3] /= df->m_oaTimeDiffBuf.GetSize();
6055
df->m_pTimeDiffAbs->m_pBin[z3] /= df->m_oaTimeDiffBuf.GetSize();
6056
df->m_pTimeDiffSqr->m_pBin[z3] /= df->m_oaTimeDiffBuf.GetSize();
6060
for (z2=0;z2<df->m_p3DTimeDiff->m_iRes[0]*df->m_p3DTimeDiff->m_iRes[1];z2++)
6062
if (df->m_p3DTimeDiffT->m_pBin[z2] != 0)
6064
df->m_p3DTimeDiff->m_pBin[z2] /= df->m_p3DTimeDiffT->m_pBin[z2];
6065
df->m_p3DTimeDiffAbs->m_pBin[z2] /= df->m_p3DTimeDiffT->m_pBin[z2];
6066
df->m_p3DTimeDiffSqr->m_pBin[z2] /= df->m_p3DTimeDiffT->m_pBin[z2];
6069
if (m_iTimeDiffDistSteps != 0)
6070
for (z=0;z<m_iTimeDiffDepth/m_iTimeDiffStride3D/m_iTimeDiffDistSteps;z++)
6071
df->m_pTimeDiffDistPairs[z]->NormalizeBinIntegral(1000000.0);
6076
void CObservation::WriteTimeDiff(CDF *df, const char *anaup, const char *analow, const char *name, const char *multibuf, bool ddf)
6082
mprintf(" Creating temporal difference plot...\n");
6083
BuildTimeDiff(df,ddf);
6084
mprintf(" (%.0f bin entries)\n",df->m_pTimeDiff->m_fBinEntries);
6085
sprintf(buf,"%s_timediff_%s%s.csv",analow,name,multibuf);
6086
mprintf(" Saving %s temporal difference plot as \"%s\"...\n",anaup,buf);
6087
df->m_pTimeDiff->Write("",buf,"",true);
6088
sprintf(buf,"%s_timediff_%s%s.agr",analow,name,multibuf);
6089
mprintf(" Saving %s temporal difference plot AGR file as \"%s\"...\n",anaup,buf);
6090
df->m_pTimeDiff->WriteAgr("",buf,"",name,false);
6092
sprintf(buf,"%s_timediff_%s%s_abs.csv",analow,name,multibuf);
6093
mprintf(" Saving %s absolute temporal difference plot as \"%s\"...\n",anaup,buf);
6094
df->m_pTimeDiffAbs->Write("",buf,"",true);
6095
sprintf(buf,"%s_timediff_%s%s_abs.agr",analow,name,multibuf);
6096
mprintf(" Saving %s absolute temporal difference plot AGR file as \"%s\"...\n",anaup,buf);
6097
df->m_pTimeDiffAbs->WriteAgr("",buf,"",name,false);
6099
sprintf(buf,"%s_timediff_%s%s_sqr.csv",analow,name,multibuf);
6100
mprintf(" Saving %s squared temporal difference plot as \"%s\"...\n",anaup,buf);
6101
df->m_pTimeDiffSqr->Write("",buf,"",true);
6102
sprintf(buf,"%s_timediff_%s%s_sqr.agr",analow,name,multibuf);
6103
mprintf(" Saving %s squared temporal difference plot AGR file as \"%s\"...\n",anaup,buf);
6104
df->m_pTimeDiffSqr->WriteAgr("",buf,"",name,false);
6108
mprintf(" Writing temporal 3D difference plot...\n");
6109
mprintf(" (%.0f bin entries)\n",df->m_p3DTimeDiff->m_fBinEntries);
6110
sprintf(buf,"%s_timediff_%s%s_triples.csv",analow,name,multibuf);
6111
mprintf(" Saving %s temporal difference plot triples as \"%s\"...\n",anaup,buf);
6112
df->m_p3DTimeDiff->Write("",buf,"");
6113
sprintf(buf,"%s_timediff_%s%s_matrix.csv",analow,name,multibuf);
6114
mprintf(" Saving %s temporal difference plot matrix as \"%s\"...\n",anaup,buf);
6115
df->m_p3DTimeDiff->WriteCSV("",buf,"");
6116
sprintf(buf,"%s_timediff_%s%s.nb",analow,name,multibuf);
6117
mprintf(" Saving %s temporal difference plot Mathematica Notebook as \"%s\"...\n",anaup,buf);
6118
df->m_p3DTimeDiff->WriteMathematicaNb("",buf,"",false);
6119
sprintf(buf,"%s_timediff_%s%s",analow,name,multibuf);
6120
mprintf(" Saving %s temporal difference plot Gnuplot Input as \"%s.gp\"...\n",anaup,buf);
6121
df->m_p3DTimeDiff->WriteGnuplotInput("",buf,"",false);
6123
sprintf(buf,"%s_timediff_%s%s_triples_abs.csv",analow,name,multibuf);
6124
mprintf(" Saving %s absolute temporal difference plot triples as \"%s\"...\n",anaup,buf);
6125
df->m_p3DTimeDiffAbs->Write("",buf,"");
6126
sprintf(buf,"%s_timediff_%s%s_matrix_abs.csv",analow,name,multibuf);
6127
mprintf(" Saving %s absolute temporal difference plot matrix as \"%s\"...\n",anaup,buf);
6128
df->m_p3DTimeDiffAbs->WriteCSV("",buf,"");
6129
sprintf(buf,"%s_timediff_%s%s_abs.nb",analow,name,multibuf);
6130
mprintf(" Saving %s absolute temporal difference plot Mathematica Notebook as \"%s\"...\n",anaup,buf);
6131
df->m_p3DTimeDiffAbs->WriteMathematicaNb("",buf,"",false);
6132
sprintf(buf,"%s_timediff_%s%s_abs",analow,name,multibuf);
6133
mprintf(" Saving %s absolute temporal difference plot Gnuplot Input as \"%s.gp\"...\n",anaup,buf);
6134
df->m_p3DTimeDiffAbs->WriteGnuplotInput("",buf,"",false);
6136
sprintf(buf,"%s_timediff_%s%s_triples_sqr.csv",analow,name,multibuf);
6137
mprintf(" Saving %s squared temporal difference plot triples as \"%s\"...\n",anaup,buf);
6138
df->m_p3DTimeDiffSqr->Write("",buf,"");
6139
sprintf(buf,"%s_timediff_%s%s_matrix_sqr.csv",analow,name,multibuf);
6140
mprintf(" Saving %s squared temporal difference plot matrix as \"%s\"...\n",anaup,buf);
6141
df->m_p3DTimeDiffSqr->WriteCSV("",buf,"");
6142
sprintf(buf,"%s_timediff_%s%s_sqr.nb",analow,name,multibuf);
6143
mprintf(" Saving %s squared temporal difference plot Mathematica Notebook as \"%s\"...\n",anaup,buf);
6144
df->m_p3DTimeDiffSqr->WriteMathematicaNb("",buf,"",false);
6145
sprintf(buf,"%s_timediff_%s%s_sqr",analow,name,multibuf);
6146
mprintf(" Saving %s squared temporal difference plot Gnuplot Input as \"%s.gp\"...\n",anaup,buf);
6147
df->m_p3DTimeDiffSqr->WriteGnuplotInput("",buf,"",false);
6149
if (m_iTimeDiffDistSteps != 0)
6151
for (z=0;z<m_iTimeDiffDepth/m_iTimeDiffStride3D/m_iTimeDiffDistSteps;z++)
6153
sprintf(buf,"%s_timediff_beforeafter_%s%s_tau%.3f_triples.csv",analow,name,multibuf,z*m_iTimeDiffStride3D*m_iTimeDiffDistSteps*g_fTimestepLength/1000.0);
6154
mprintf(" Saving %s before/after plot triples as \"%s\"...\n",anaup,buf);
6155
df->m_pTimeDiffDistPairs[z]->Write("",buf,"");
6156
sprintf(buf,"%s_timediff_beforeafter_%s%s_tau%.3f_matrix.csv",analow,name,multibuf,z*m_iTimeDiffStride3D*m_iTimeDiffDistSteps*g_fTimestepLength/1000.0);
6157
mprintf(" Saving %s before/after plot matrix as \"%s\"...\n",anaup,buf);
6158
df->m_pTimeDiffDistPairs[z]->WriteCSV("",buf,"");
6159
sprintf(buf,"%s_timediff_beforeafter_%s%s_tau%.3f.nb",analow,name,multibuf,z*m_iTimeDiffStride3D*m_iTimeDiffDistSteps*g_fTimestepLength/1000.0);
6160
mprintf(" Saving %s before/after plot Mathematica Notebook as \"%s\"...\n",anaup,buf);
6161
df->m_pTimeDiffDistPairs[z]->WriteMathematicaNb("",buf,"",false);
6162
sprintf(buf,"%s_timediff_beforeafter_%s%s_tau%.3f",analow,name,multibuf,z*m_iTimeDiffStride3D*m_iTimeDiffDistSteps*g_fTimestepLength/1000.0);
6163
mprintf(" Saving %s before/after plot Gnuplot Input as \"%s.gp\"...\n",anaup,buf);
6164
df->m_pTimeDiffDistPairs[z]->WriteGnuplotInput("",buf,"",false);
6167
for (z2=0;z2<=3;z2++)
6169
try { temp3DF = new C3DF(); } catch(...) { temp3DF = NULL; }
6170
if (temp3DF == NULL) NewException((double)sizeof(C3DF),__FILE__,__LINE__,__PRETTY_FUNCTION__);
6172
temp3DF->CopyFrom(df->m_pTimeDiffDist3DF);
6175
temp3DF->Smooth(z2);
6176
sprintf(buf,".s%d%s.plt",z2,multibuf);
6177
} else sprintf(buf,"%s.plt",multibuf);
6178
mprintf(" Saving 3D Plot as \"%s%s\"...\n",name,buf);
6179
temp3DF->WritePLT("",name,buf,false);
6182
sprintf(buf,".s%d%s.cube",z2,multibuf);
6183
else sprintf(buf,"%s.cube",multibuf);
6184
mprintf(" Saving 3D Plot as \"%s%s\"...\n",name,buf);
6185
temp3DF->WriteCube("",name,buf,false);
6191
void CObservation::CreateTimeDiff(CDF *df, int comb)
6198
for (z2=0;z2<((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex.GetSize()*comb;z2++)
6200
try { ptfa = new CxFloatArray("CObservation::CreateTimeDiff():ptfa"); } catch(...) { ptfa = NULL; }
6201
if (ptfa == NULL) NewException((double)sizeof(CxFloatArray),__FILE__,__LINE__,__PRETTY_FUNCTION__);
6203
if (g_iTrajSteps != -1)
6205
ptfa->SetMaxSize((long)(g_iTrajSteps*1.1));
6206
ptfa->SetGrow((long)(g_iTrajSteps*0.1));
6207
} else ptfa->SetGrow(1000);
6208
df->m_oaTimeDiffBuf.Add(ptfa);
6212
for (z2=0;z2<((CMolecule*)g_oaMolecules[g_iFixMol])->m_laSingleMolIndex.GetSize()*((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()*comb;z2++)
6214
try { ptfa = new CxFloatArray("CObservation::CreateTimeDiff():ptfa"); } catch(...) { ptfa = NULL; }
6215
if (ptfa == NULL) NewException((double)sizeof(CxFloatArray),__FILE__,__LINE__,__PRETTY_FUNCTION__);
6217
if (g_iTrajSteps != -1)
6219
ptfa->SetMaxSize((long)(g_iTrajSteps*1.1));
6220
ptfa->SetGrow((long)(g_iTrajSteps*0.1));
6221
} else ptfa->SetGrow(1000);
6222
df->m_oaTimeDiffBuf.Add(ptfa);
6228
void CMSD::WriteSplit(const char *s)
6234
a = OpenFileWrite(s,true);
6235
mfprintf(a,"# tau [ps]; Total MSD [pm^2]");
6237
for (z=0;z<m_pAtomGroup->m_oaAtoms.GetSize();z++)
6238
for (z2=0;z2<((CxIntArray*)m_pAtomGroup->m_oaAtoms[z])->GetSize();z2++)
6239
for (z3=0;z3<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z3++)
6241
if (m_pAtomGroup->m_baRealAtomType[z] == g_iVirtAtomType)
6242
mfprintf(a,"; Mol. %d #%d",z3+1,((CxIntArray*)m_pAtomGroup->m_oaAtoms[z])->GetAt(z2)+1);
6243
else mfprintf(a,"; Mol. %d %s%d",z3+1,((CAtom*)g_oaAtoms[m_pAtomGroup->m_baRealAtomType[z]])->m_sName,((CxIntArray*)m_pAtomGroup->m_oaAtoms[z])->GetAt(z2)+1);
6247
for (z=0;z<m_pMSD->m_iResolution;z++)
6249
mfprintf(a,"%f; %f",m_pMSD->m_fMinVal+z*(m_pMSD->m_fMaxVal-m_pMSD->m_fMinVal)/m_pMSD->m_iResolution,m_pMSD->m_pBin[z]);
6251
for (z2=0;z2<m_pAtomGroup->m_iAtomGes;z2++)
6252
for (z3=0;z3<((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize();z3++)
6254
af = m_pSplitMSD[z2*((CMolecule*)g_oaMolecules[m_iShowMol])->m_laSingleMolIndex.GetSize()+z3];
6255
mfprintf(a,"; %f",af->m_pBin[z]);