Commit 94958626 authored by Daniel Leidert's avatar Daniel Leidert

New upstream version 160919

parent 537392ca
This diff is collapsed.
#*****************************************************************************
# TRAVIS - Trajectory Analyzer and Visualizer
# http://www.travis-analyzer.de/
#
# Copyright (c) 2009-2015 Martin Brehm
# 2012-2015 Martin Thomas
#
# This file written by Martin Brehm.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#*****************************************************************************
# TRAVIS Makefile
# Edit the follwing lines according to your needs
# Your C++ compiler
CXX = g++
#**************************************************************************
# You should not need to edit the following part
#**************************************************************************
CFLAGS = -g -Wall -Wextra -pedantic -ansi -O2 $(FFTW_INCLUDE)
CFLAGS_PROF = -g -Wall -Wextra -pedantic -ansi -O2 -pg $(FFTW_INCLUDE)
CFLAGS_DEB = -g -Wall -Wextra -pedantic -ansi -O0 $(FFTW_INCLUDE)
CFLAGS_REL = -g -Wall -Wextra -pedantic -ansi -O3 $(FFTW_INCLUDE) -march=athlon-fx
LDFLAGS = $(FFTW_LIB)
SRC = $(wildcard src/*.cpp)
OBJ = $(SRC:%.cpp=%.o)
BIN = exe/travis
all: executable
debug: CFLAGS = $(CFLAGS_DEB)
debug: executable
release: CFLAGS = $(CFLAGS_REL)
release: executable
profile: CFLAGS = $(CFLAGS_PROF)
profile: executable
executable: $(OBJ)
mkdir -p exe
$(CXX) $(CFLAGS) -o $(BIN) $(OBJ) $(LDFLAGS)
%.o: %.cpp
$(CXX) $(CFLAGS) -c $< -o $@
.PHONY: clean
clean:
rm -f $(OBJ)
.PHONY: distclean
distclean:
rm -f $(OBJ)
rm -rf exe
***************************************************
*** TRAVIS - Trajectory Analyzer and Visualizer ***
***************************************************
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
Kirchner Group, University of Leipzig
Please read our article:
M. Brehm and B. Kirchner, J. Chem. Inf. Model. 2011, 51 (8), pp 2007-2023
TRAVIS ("TRajectory Analyzer and VISualizer") is a program package
for analyzing and visualizing Monte Carlo and molecular dynamics trajectories.
TRAVIS is open-source freeware and licensed under the terms of the
GNU General Public License v3 (see file COPYING).
* Installation *
To compile TRAVIS, open the Makefile and set the CXX variable
to the C++ compiler of your choice. Then just enter "make". If everything
worked, an executable ("travis") should appear in the "exe" directory.
TRAVIS does not require any external libraries.
When compiling TRAVIS on systems that are not running Linux, you may have to
edit the "config.h" file in the "src" directory. Comment out the "TARGET_LINUX" line.
If you are building an Windows version, you may want to uncomment the "TARGET_WINDOWS" line.
With both lines commented out, you get a platform-independent build without
special features.
This diff is collapsed.
/*****************************************************************************
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
This file written by Martin Brehm.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef _2DF_H
#define _2DF_H
#include <math.h>
#include <stdio.h>
#include "xdvector3.h"
#include "xdoublearray.h"
#include "backtrace.h"
#include "df.h"
class CMathematicaCircle : public CxObject
{
public:
CMathematicaCircle() { }
~CMathematicaCircle() { }
double m_fPosX, m_fPosY, m_fRadius;
double m_fColorR, m_fColorG, m_fColorB;
};
class C2DF : public CxObject
{
public:
double CalcCorrelationFactor();
void NormalizeUniform(double fac);
void Log();
void WriteHistogram(const char *prefix, const char *name, const char *suffix);
void CalcHistogram();
double GetValue(double x, double y);
void AddCircle(double x, double y, double r, double cr, double cg, double cb);
void NormalizeYCount();
void NormalizeXCount();
void SwapAxes();
void Mirror(double plane, int channel);
void WriteCombinedPlot(const char *prefix, const char *name, const char *suffix);
// double m_fMathematicaColorOffset;
// double m_fMathematicaColorScale;
void Subtract(C2DF *df);
void CopyFrom(C2DF *df);
void MakeTensorProduct(C2DF *inp);
void SetLabelX(const char *s);
void SetLabelY(const char *s);
void SetLabelZ(const char *s);
void CalcMaxEntry();
void StepY(int y);
void NormRDF(double n);
C2DF();
~C2DF();
void MultiplyBin(double m);
// void AddToBin(double x, const CxVector3 &vec);
void AddToBin(double x, double y);
// void AddToBin(double x, int y);
void AddToBin(int x, int y, double val);
void AddToBin(double x, double y, double val);
void AddToBin_IntX(int x, double y, double val);
void AddToBin_IntY(double x, int y, double val);
// void AddToBin_IntX_fast(int x, double y);
// void AddToSingleBin(double x, double y, double val);
void NormalizeBin(double mi, double ma);
double NormalizeBinIntegral(double val);
double PPMBin();
void Write(const char *prefix, const char *name, const char *suffix);
void WriteGraceBunch(int channel, int graphs, double fac, const char *prefix, const char *name, const char *suffix);
void WriteCSV(const char *prefix, const char *name, const char *suffix);
void WriteXProjection(const char *prefix, const char *name, const char *suffix);
void WriteYProjection(const char *prefix, const char *name, const char *suffix);
void WriteMathematica(const char *prefix, const char *name, const char *suffix);
void WriteGnuplotInput(const char *prefix, const char *name, const char *suffix, bool manrange);
void WriteMathematicaNb(const char *prefix, const char *name, const char *suffix, bool manrange);
void Create();
void CorrectRadialDist(int channel);
void CorrectLiRadialDist(int channel);
void UnCorrectRadialDist(int channel);
void CorrectAngle(int channel);
void UnCorrectAngle(int channel);
// void AngleCorrectX();
double m_fMinVal[2];
double m_fMaxVal[2];
double m_fFac[2];
CDF *m_pChannels[2];
double m_fAspectRatio;
double m_fMinEntry;
double m_fMaxEntry;
char *m_sLabelX;
char *m_sLabelY;
char *m_sLabelZ;
char* m_sName;
char* m_sShortName;
double *m_fCountX;
double *m_fCountY;
int m_iRes[2];
int m_iHistogramRes;
double *m_pBin;
double *m_pHistogram;
double m_fBinEntries;
double m_fSkipEntries;
unsigned long *m_pStepsY;
int m_iPlotType;
int m_iSmoothGrade;
int m_iInterpolationOrder;
double m_fPlotExp;
int m_iExpLegend;
int m_iColorScale;
int m_iGPInterpolation;
bool m_bContourLines;
int m_iPlotPixel;
CxObArray m_oaCircles;
void AddToBin_IntX_fast(int x, double y)
{
double ry;
int iy;
if (y > m_fMaxVal[1])
return;
m_fBinEntries++;
ry = (y-m_fMinVal[1])*m_fFac[1] - 0.5;
iy = (int)floor(ry);
if (iy < 0)
{
iy = 0;
ry = 0;
} else if (iy > m_iRes[1]-2)
{
iy = m_iRes[1]-2;
ry = 1.0;
} else
ry -= iy;
m_pBin[ iy * m_iRes[0] + x] += (1.0-ry);
m_pBin[(iy+1) * m_iRes[0] + x] += ry ;
}
};
/*inline void C2DF::AddToBin(double x, int y)
{
BXIN;
double rx;
int ix;
if ((x < m_fMinVal[0]) || (x > m_fMaxVal[0]))
{
m_fSkipEntries++;
BXOUT;
return;
}
m_fBinEntries++;
rx = ((x-m_fMinVal[0])/(m_fMaxVal[0]-m_fMinVal[0]))*((double)m_iRes[0]-1);
ix = (int)floor(rx);
rx -= ix;
m_pBin[y*m_iRes[0] + ix] += 1-rx;
m_pBin[y*m_iRes[0] + ix +1] += rx;
m_fCountX[ix] += 1.0-rx;
m_fCountX[ix+1] += rx;
m_fCountY[y]++;
BXOUT;
}*/
#endif
This diff is collapsed.
This diff is collapsed.
/*****************************************************************************
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
This file written by Martin Brehm.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef ACF_H
#define ACF_H
#include "xobject.h"
#include "backtrace.h"
#include "spectrum.h"
#include "fft.h"
#include "atomgroup.h"
#include "xintarray.h"
class CSingleMolecule;
class CACF : public CxObject
{
public:
bool m_bExcludeR0;
// bool m_b2ndDerivative;
int m_iDerivative;
bool m_bDerivative;
void Mirror(int i);
int m_iShowAtomGes;
void BuildAtomList(CSingleMolecule *obs, CxIntArray *vec);
CAtomGroup m_oAtoms;
int m_iShowMol;
void BuildName();
CACF();
~CACF();
void Window();
void WriteACF(const char *pre, const char *s, const char *post);
void Normalize();
void NormalizeCached();
void Multiply(double f);
void MultiplyCached(double f);
void Create();
void Transform(CFFT *fft);
void Parse();
char* m_sName;
double *m_pData;
unsigned long *m_pCounter;
int m_iSize;
CSpectrum *m_pSpectrum;
// int m_iStride;
bool m_bWindowFunction;
bool m_bSpectrum;
bool m_bMassWeight;
double m_fSpecWaveNumber;
int m_iZeroPadding;
int m_iZeroPadding0;
int m_iMirror;
bool m_bACF_DB;
CxObArray m_oaCache;
bool m_bDecomposeModes;
int m_iParticles;
CxObArray m_oaCCRMatrix;
};
#endif
/*****************************************************************************
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
This file written by Martin Brehm.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef AGGREGATE_H
#define AGGREGATE_H
#include "xobject.h"
#include "xdvector3.h"
#include "xintarray.h"
class CAggregate : public CxObject
{
public:
CxIntArray m_laLifeIntervals;
CAggregate() { }
~CAggregate() { }
int m_iSingleMol2;
CxDVector3 m_vStart;
CxDVector3 m_vFirstStart;
CxDoubleArray m_faTempTrace;
unsigned long m_iStart;
unsigned long m_iFirstStart;
CxDVector3 m_vEnd;
signed long m_iEnd;
bool m_bStillAlive;
};
#endif
/*****************************************************************************
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
This file written by Martin Brehm.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef ANALYSIS_H
#define ANALYSIS_H
#include "backtrace.h"
#include "xobject.h"
class CAnalysis : public CxObject
{
public:
CAnalysis()
{
m_sAbbrev = NULL;
m_sName = NULL;
}
~CAnalysis()
{
if (m_sAbbrev != NULL)
{
delete[] m_sAbbrev;
m_sAbbrev = NULL;
}
if (m_sName != NULL)
{
delete[] m_sName;
m_sName = NULL;
}
}
char* m_sAbbrev;
char* m_sName;
};
#endif
/*****************************************************************************
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
This file written by Martin Brehm.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#include "analysisgroup.h"
CAnalysisGroup::CAnalysisGroup()
{
m_sGroupName = NULL;
m_oaAnalyses.SetName("CAnalysisGroup::m_oaAnalyses");
}
CAnalysisGroup::~CAnalysisGroup()
{
if (m_sGroupName != NULL)
{
delete[] m_sGroupName;
m_sGroupName = NULL;
}
}
/*****************************************************************************
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
This file written by Martin Brehm.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef ANALYSISGROUP_H
#define ANALYSISGROUP_H
#include "backtrace.h"
#include "xobject.h"
#include "xobarray.h"
#include "analysis.h"
class CAnalysisGroup : public CxObject
{
public:
CAnalysisGroup();
~CAnalysisGroup();
char* m_sGroupName;
CxObArray m_oaAnalyses;
};
#endif
/*****************************************************************************
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
This file written by Martin Brehm.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#include "asciiart.h"
CAsciiArt::CAsciiArt()
{
BTIN;
m_iPosX = -1;
m_iPosY = -1;
m_iSelectedPiece = -1;
m_oaAsciiPieces.SetName("CAsciiArt::m_oaAsciiPieces");
AddPiece(" , \n\
,::.::::. / `. \n\
;:: `. ( ,--. \n\
,; : _,--'\"\\/\"\"-.\\_ \n\
,: `./ ,---./( O )) `; \n\
; `. _,' ( `-' ) /_. \n\
; : ,' \\ , (o\\\\ \n\
; : \\ \\-. -.__--' \\' ) \n\
; ; /\\ ( `-._`-._ \\/ \n\
';, ; : | -.`._'\\ `. \n\
; ; : `-.,-.. ) \\'\\ ^. \n\
; ; `.__ )))\\ ) (`.\\ \\ \n\
; ; `-`///(, \\ \\ \\) ,ooo. \n\
;,; ; `` ))))_;'( 88888p \n\
; ; ((-='--',-,Y8888' \n\
; : ; ,:'-' `\"' \n\
; ` ; | \n\
; (_ __ _,-' \n\
`---. ;\"(,-' / ____ \n\
-hrr- \\ (__/\\\\_`-.-. _____/ \n\
,(( '/\\/\\/\\`-;;)) ______// \n\
((\\''/\\/\\/\\/\\/\\/`/\\ _____/ ____/ \n\
/'/\\/\\/\\/\\/\\/\\/\\/\\/) __/ _____/ \n\
(\\/\\/\\/\\/\\/\\/\\/\\/\\_/ _/ ___/ \n\
`-|\"\"--\"-.___,--'|-'__/ \n\
| | / \n\
| __,--' \n\
_\\,----\"\"'");
AddPiece(" ,--\"`-.-._ \n\
,' ,.:::::. `. \n\
| ;' `:: | \n\
,--,-, .::::..;',' \n\
,' ,' \"\" ,'_ \n\
'-)\",'o \"_\\ \n\
_,' \"\"' .::. .:o; \n\
; :::' ; \n\
; `::; ; \n\
: (_;_ ;:: ;\\ \n\
; / ;::. ; \\ \n\
/ / ,:' ;:: \\ \n\
__|__/_ /:: ; \\ ` \n\
_,-' `-<::'___ ;| \\ \\ \n\
,-' _,-\"\"\";-._`.(__ `. ;| \\ | ____ \n\
( ,--'__,--' |`-`(@) \\( `. `. ,-' `-. \n\
\\___.-' \\ |::. \\ : `. `./,-'\"\"`. \\ \n\
\\ |::. ) : .-. `-._ ' `--.--' ) \n\
\\ .-`.:' / : / `-.__ __,-' \n\
-hrr- ) `.' ; / `\"' \n\
( `' ,\\ , ---.( \n\
,' --- `:`--' : : \\ \n\
( : : ; `--`--`-' \n\
`-`--`--' ");
AddPiece(" ,--.\"\"\n\
__,----( o )) \n\
,'--. , ( \n\
-\"\",:-( o ),-'/ ; \n\
( o) `o _,'\\ / ;( \n\
`-;_-<'\\_|-'/ ' ) \n\
`.`-.__/ ' | \n\
\\`. `. .__, ; \n\
)_;--. \\` | \n\
/'(__,-: ) ; \n\
;' (_,-: _,:: .| \n\
; ( , ) _,':::' ,; \n\
; )-,;' `:' .:: \n\
| `' ; `:::\\ \n\
: ,' ' `:\\ \n\