Commit 24446daa authored by Daniel Leidert's avatar Daniel Leidert

New upstream version 170812

parent 66e0089a
......@@ -2,8 +2,9 @@
# TRAVIS - Trajectory Analyzer and Visualizer
# http://www.travis-analyzer.de/
#
# Copyright (c) 2009-2015 Martin Brehm
# 2012-2015 Martin Thomas
# Copyright (c) 2009-2017 Martin Brehm
# 2012-2017 Martin Thomas
# 2009-2017 Barbara Kirchner
#
# This file written by Martin Brehm.
#
......
......@@ -5,9 +5,9 @@
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
Kirchner Group, University of Leipzig
Copyright (c) 2009-2017 Martin Brehm, University of Halle (Saale)
2012-2017 Martin Thomas
2009-2017 Barbara Kirchner, University of Bonn
Please read our article:
......
......@@ -2,8 +2,8 @@
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
Copyright (c) 2009-2017 Martin Brehm
2012-2017 Martin Thomas
This file written by Martin Brehm.
......@@ -21,6 +21,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
// This must always be the first include directive
#include "config.h"
#include "2df.h"
#include "travis.h"
......@@ -153,7 +157,7 @@ void C2DF::CorrectRadialDist(int channel)
{
for (z=0;z<m_iRes[0];z++)
{
d = pow(m_fMinVal[0]+(z+1.0)/m_iRes[0]*(m_fMaxVal[0]-m_fMinVal[0]),3) - pow(m_fMinVal[0]+((double)z)/m_iRes[0]*(m_fMaxVal[0]-m_fMinVal[0]),3);
d = mypow(m_fMinVal[0]+(z+1.0)/m_iRes[0]*(m_fMaxVal[0]-m_fMinVal[0]),3) - mypow(m_fMinVal[0]+((double)z)/m_iRes[0]*(m_fMaxVal[0]-m_fMinVal[0]),3);
for (z2=0;z2<m_iRes[1];z2++)
{
m_pBin[z2*m_iRes[0]+z] /= d;
......@@ -163,7 +167,7 @@ void C2DF::CorrectRadialDist(int channel)
{
for (z2=0;z2<m_iRes[1];z2++)
{
d = pow(m_fMinVal[1]+(z2+1.0)/m_iRes[1]*(m_fMaxVal[1]-m_fMinVal[1]),3) - pow(m_fMinVal[1]+((double)z2)/m_iRes[1]*(m_fMaxVal[1]-m_fMinVal[1]),3);
d = mypow(m_fMinVal[1]+(z2+1.0)/m_iRes[1]*(m_fMaxVal[1]-m_fMinVal[1]),3) - mypow(m_fMinVal[1]+((double)z2)/m_iRes[1]*(m_fMaxVal[1]-m_fMinVal[1]),3);
for (z=0;z<m_iRes[0];z++)
{
m_pBin[z2*m_iRes[0]+z] /= d;
......@@ -184,7 +188,7 @@ void C2DF::CorrectLiRadialDist(int channel)
{
for (z=0;z<m_iRes[0];z++)
{
d = pow(m_fMinVal[0]+(z+1.0)/m_iRes[0]*(m_fMaxVal[0]-m_fMinVal[0]),2) - pow(m_fMinVal[0]+((double)z)/m_iRes[0]*(m_fMaxVal[0]-m_fMinVal[0]),2);
d = mypow(m_fMinVal[0]+(z+1.0)/m_iRes[0]*(m_fMaxVal[0]-m_fMinVal[0]),2) - mypow(m_fMinVal[0]+((double)z)/m_iRes[0]*(m_fMaxVal[0]-m_fMinVal[0]),2);
for (z2=0;z2<m_iRes[1];z2++)
{
m_pBin[z2*m_iRes[0]+z] /= d;
......@@ -194,7 +198,7 @@ void C2DF::CorrectLiRadialDist(int channel)
{
for (z2=0;z2<m_iRes[1];z2++)
{
d = pow(m_fMinVal[1]+(z2+1.0)/m_iRes[1]*(m_fMaxVal[1]-m_fMinVal[1]),2) - pow(m_fMinVal[1]+((double)z2)/m_iRes[1]*(m_fMaxVal[1]-m_fMinVal[1]),2);
d = mypow(m_fMinVal[1]+(z2+1.0)/m_iRes[1]*(m_fMaxVal[1]-m_fMinVal[1]),2) - mypow(m_fMinVal[1]+((double)z2)/m_iRes[1]*(m_fMaxVal[1]-m_fMinVal[1]),2);
for (z=0;z<m_iRes[0];z++)
{
m_pBin[z2*m_iRes[0]+z] /= d;
......@@ -214,12 +218,12 @@ void C2DF::UnCorrectRadialDist(int channel)
{
for (z=0;z<m_iRes[0];z++)
for (z2=0;z2<m_iRes[1];z2++)
m_pBin[z2*m_iRes[0]+z] *= (double)(pow(m_fMinVal[0]+(z+1.0)/m_iRes[0]*(m_fMaxVal[0]-m_fMinVal[0]),3) - pow(m_fMinVal[0]+((double)z)/m_iRes[0]*(m_fMaxVal[0]-m_fMinVal[0]),3));
m_pBin[z2*m_iRes[0]+z] *= (double)(mypow(m_fMinVal[0]+(z+1.0)/m_iRes[0]*(m_fMaxVal[0]-m_fMinVal[0]),3) - mypow(m_fMinVal[0]+((double)z)/m_iRes[0]*(m_fMaxVal[0]-m_fMinVal[0]),3));
} else
{
for (z=0;z<m_iRes[0];z++)
for (z2=0;z2<m_iRes[1];z2++)
m_pBin[z2*m_iRes[0]+z] *= (double)(pow(m_fMinVal[1]+(z2+1.0)/m_iRes[1]*(m_fMaxVal[1]-m_fMinVal[1]),3) - pow(m_fMinVal[1]+((double)z2)/m_iRes[1]*(m_fMaxVal[1]-m_fMinVal[1]),3));
m_pBin[z2*m_iRes[0]+z] *= (double)(mypow(m_fMinVal[1]+(z2+1.0)/m_iRes[1]*(m_fMaxVal[1]-m_fMinVal[1]),3) - mypow(m_fMinVal[1]+((double)z2)/m_iRes[1]*(m_fMaxVal[1]-m_fMinVal[1]),3));
}
BTOUT;
}
......@@ -526,8 +530,8 @@ double C2DF::NormalizeBinIntegral(double val)
d = val/d;
for (z=0;z<m_iRes[0]*m_iRes[1];z++)
m_pBin[z]*=d;
return d;
BTOUT;
return d;
}
......@@ -830,7 +834,7 @@ void C2DF::WriteMathematica(const char *prefix, const char *name, const char *su
}
void C2DF::WriteGnuplotInput(const char *prefix, const char *name, const char *suffix, bool manrange)
void C2DF::WriteGnuplotInput(const char *prefix, const char *name, const char *suffix, bool manrange, bool printinfo)
{
FILE *a, *b;
int z, z2;
......@@ -865,8 +869,8 @@ void C2DF::WriteGnuplotInput(const char *prefix, const char *name, const char *s
if (!manrange)
CalcMaxEntry();
CreateTicks(m_fMinVal[0],m_fMaxVal[0],majorx,minorx);
CreateTicks(m_fMinVal[1],m_fMaxVal[1],majory,minory);
CreateTicks(m_fMinVal[0],m_fMaxVal[0],majorx,minorx,printinfo);
CreateTicks(m_fMinVal[1],m_fMaxVal[1],majory,minory,printinfo);
mfprintf(b,"# Total plot width in pixel\n");
mfprintf(b,"s_widthpixel = %d\n",m_iPlotPixel);
......@@ -911,7 +915,10 @@ void C2DF::WriteGnuplotInput(const char *prefix, const char *name, const char *s
mfprintf(b,"s_ncontour = %lu\n",g_pDatabase->GetInt("/PLOT2D/DEFAULTS/CONTOUR_LINES"));
mfprintf(b,"\n");
mfprintf(b,"# Plotting function\n");
mfprintf(b,"f_plot(x) = x**%G\n",m_fPlotExp);
if (m_iColorScale == 4) // Plus-Minus-Plot
mfprintf(b,"f_plot(x) = abs(x)**%G * sgn(x)",m_fPlotExp);
else
mfprintf(b,"f_plot(x) = x**%G\n",m_fPlotExp);
mfprintf(b,"\n");
mfprintf(b,"# Minimum X\n");
mfprintf(b,"s_xmin = %f\n",m_fMinVal[0]);
......@@ -958,6 +965,8 @@ void C2DF::WriteGnuplotInput(const char *prefix, const char *name, const char *s
mfprintf(b,"\n");
mfprintf(b,"if (s_zauto) s_zmin = GPVAL_Z_MIN; s_zmax = GPVAL_Z_MAX\n");
mfprintf(b,"\n");
if (m_iColorScale == 4) // Plus-Minus-Plot
mfprintf(b,"if (abs(s_zmin) > abs(s_zmax)) s_zmax=abs(s_zmin); else s_zmin=-abs(s_zmax)\n\n");
mfprintf(b,"font_string = sprintf(\"%cs,%cd\", \"Helvetica\", 24*s_scale)\n",'%','%');
mfprintf(b,"titlefont_string = sprintf(\"%cs,%cd\", \"Helvetica\", 24*1.2*s_scale*s_titlefontscale)\n",'%','%');
mfprintf(b,"labelfont_string = sprintf(\"%cs,%cd\", \"Helvetica\", 24*s_scale*s_labelfontscale)\n",'%','%');
......@@ -975,7 +984,10 @@ void C2DF::WriteGnuplotInput(const char *prefix, const char *name, const char *s
mfprintf(b,"\n");
mfprintf(b,"set pm3d interpolate s_xipl,s_yipl map\n");
mfprintf(b,"\n");
mfprintf(b,"set palette model RGB functions gray<=0.0 ? 1.0 : gray<0.2 ? 1.0-(5.0**1.5*gray**1.5)*0.8 : gray<0.4 ? 0.2-(gray-0.2) : gray<0.6 ? 5.0**0.5*(gray-0.4)**0.5 : gray<0.8 ? 1.0 : gray<1.0 ? 1.0 : 1.0, gray<=0.0 ? 1.0 : gray<0.2 ? 1.0-(5.0**1.5*gray**1.5)*0.8 : gray<0.4 ? 0.2+0.8*(5.0**0.75*(gray-0.2)**0.75) : gray<0.6 ? 1.0 : gray<0.8 ? 1.0-5.0*(gray-0.6) : gray<1.0 ? 0.0 : 0.0, gray<=0.0 ? 1.0 : gray<0.2 ? 1.0 : gray<0.4 ? 1.0-5.0**1.33*(gray-0.2)**1.33 : gray<0.6 ? 0.0 : gray<0.8 ? 0.0 : gray<1.0 ? 5.0*(gray-0.8) : 1.0\n");
if (m_iColorScale == 4) // Plus-Minus-Plot
mfprintf(b,"set palette model RGB functions gray<=0.0 ? 0.0 : gray<0.1 ? 0.0 : gray<0.4 ? 0.0 : gray<0.5 ? (gray-0.4)/0.1 : gray<0.6 ? 1.0 : gray<0.8 ? 1.0 : gray<1.0 ? 1.0 : 1.0, gray<=0.0 ? 0.0 : gray<0.1 ? 0.0 : gray<0.4 ? (gray-0.1)/0.3 : gray<0.5 ? 1.0 : gray<0.6 ? 1.0 : gray<0.8 ? ((0.8-gray)/0.2)**0.5 : gray<1.0 ? 0.0 : 0.0, gray<=0.0 ? 0.5 : gray<0.1 ? 0.5+gray*5.0 : gray<0.4 ? 1.0 : gray<0.5 ? 1.0 : gray<0.6 ? (0.6-gray)/0.1 : gray<0.8 ? 0.0 : gray<1.0 ? (gray-0.8)/0.1 : 1.0\n");
else
mfprintf(b,"set palette model RGB functions gray<=0.0 ? 1.0 : gray<0.2 ? 1.0-(5.0**1.5*gray**1.5)*0.8 : gray<0.4 ? 0.2-(gray-0.2) : gray<0.6 ? 5.0**0.5*(gray-0.4)**0.5 : gray<0.8 ? 1.0 : gray<1.0 ? 1.0 : 1.0, gray<=0.0 ? 1.0 : gray<0.2 ? 1.0-(5.0**1.5*gray**1.5)*0.8 : gray<0.4 ? 0.2+0.8*(5.0**0.75*(gray-0.2)**0.75) : gray<0.6 ? 1.0 : gray<0.8 ? 1.0-5.0*(gray-0.6) : gray<1.0 ? 0.0 : 0.0, gray<=0.0 ? 1.0 : gray<0.2 ? 1.0 : gray<0.4 ? 1.0-5.0**1.33*(gray-0.2)**1.33 : gray<0.6 ? 0.0 : gray<0.8 ? 0.0 : gray<1.0 ? 5.0*(gray-0.8) : 1.0\n");
mfprintf(b,"\n");
mfprintf(b,"if (s_contour) set palette maxcolors s_ncontour; else set palette maxcolors 0\n");
mfprintf(b,"\n");
......@@ -1050,7 +1062,7 @@ void C2DF::WriteGnuplotInput(const char *prefix, const char *name, const char *s
}
void C2DF::WriteMathematicaNb(const char *prefix, const char *name, const char *suffix, bool manrange)
void C2DF::WriteMathematicaNb(const char *prefix, const char *name, const char *suffix, bool manrange, bool printinfo)
{
BTIN;
FILE *a;
......@@ -1072,8 +1084,8 @@ void C2DF::WriteMathematicaNb(const char *prefix, const char *name, const char *
if ((m_iPlotType == 1) && (!m_bContourLines))
m_iPlotType = 2;
CreateTicks(m_fMinVal[0],m_fMaxVal[0],majorx,minorx);
CreateTicks(m_fMinVal[1],m_fMaxVal[1],majory,minory);
CreateTicks(m_fMinVal[0],m_fMaxVal[0],majorx,minorx,printinfo);
CreateTicks(m_fMinVal[1],m_fMaxVal[1],majory,minory,printinfo);
a = OpenFileWrite(buf,true);
......@@ -4707,6 +4719,7 @@ void C2DF::CalcMaxEntry()
{
BTIN;
int z, z2;
double a;
m_fMaxEntry = -99999999.0;
m_fMinEntry = 99999999.0;
......@@ -4720,6 +4733,12 @@ void C2DF::CalcMaxEntry()
m_fMinEntry = m_pBin[z*m_iRes[0]+z2];
}
}
if (fabs(m_fMinEntry) > m_fMaxEntry)
a = fabs(m_fMinEntry);
else
a = m_fMaxEntry;
m_fEps = nextafter(a,2.0*a) - a;
BTOUT;
}
......@@ -5254,7 +5273,7 @@ void C2DF::NormalizeUniform(double fac)
r1 = m_fMinVal[0] + ((double)zx) / m_iRes[0] * (m_fMaxVal[0] - m_fMinVal[0]);
r2 = m_fMinVal[0] + (zx+1.0) / m_iRes[0] * (m_fMaxVal[0] - m_fMinVal[0]);
vol = 2.0/3.0*Pi * ( pow(r2,3) * dca - pow(r1,3) * dca );
vol = 2.0/3.0*Pi * ( mypow(r2,3) * dca - mypow(r1,3) * dca );
m_pBin[zy*m_iRes[0]+zx] *= fac / vol;
}
......
......@@ -2,8 +2,8 @@
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
Copyright (c) 2009-2017 Martin Brehm
2012-2017 Martin Thomas
This file written by Martin Brehm.
......@@ -21,9 +21,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef _2DF_H
#define _2DF_H
// This must always be the first include directive
#include "config.h"
#include <math.h>
#include <stdio.h>
#include "xdvector3.h"
......@@ -89,8 +94,8 @@ public:
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 WriteGnuplotInput(const char *prefix, const char *name, const char *suffix, bool manrange, bool printinfo=true);
void WriteMathematicaNb(const char *prefix, const char *name, const char *suffix, bool manrange, bool printinfo=true);
void Create();
void CorrectRadialDist(int channel);
void CorrectLiRadialDist(int channel);
......@@ -137,6 +142,8 @@ public:
bool m_bContourLines;
int m_iPlotPixel;
double m_fEps;
CxObArray m_oaCircles;
void AddToBin_IntX_fast(int x, double y)
......
This diff is collapsed.
......@@ -2,8 +2,8 @@
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
Copyright (c) 2009-2017 Martin Brehm
2012-2017 Martin Thomas
This file written by Martin Brehm.
......@@ -21,6 +21,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
// This must always be the first include directive
#include "config.h"
#include "acf.h"
#include "travis.h"
#include "maintools.h"
......@@ -152,7 +156,7 @@ void CACF::Window()
BTIN;
int z;
for (z=0;z<m_iSize;z++)
m_pData[z] *= (double)pow(cos((double)z/m_iSize*Pi),2);
m_pData[z] *= (double)mypow(cos((double)z/m_iSize*Pi),2);
BTOUT;
}
......@@ -267,8 +271,8 @@ _atoms:
{
if (!m_oAtoms.ParseAtoms((CMolecule*)g_oaMolecules[m_iShowMol],buf))
{
eprintf("Wrong input.\n");
inpprintf("! Wrong input.\n");
eprintf("Invalid input.\n");
inpprintf("! Invalid input.\n");
goto _atoms;
}
}
......
......@@ -2,8 +2,8 @@
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
Copyright (c) 2009-2017 Martin Brehm
2012-2017 Martin Thomas
This file written by Martin Brehm.
......@@ -21,9 +21,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef ACF_H
#define ACF_H
// This must always be the first include directive
#include "config.h"
#include "xobject.h"
#include "backtrace.h"
#include "spectrum.h"
......@@ -31,6 +36,7 @@
#include "atomgroup.h"
#include "xintarray.h"
class CSingleMolecule;
......
......@@ -2,8 +2,8 @@
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
Copyright (c) 2009-2017 Martin Brehm
2012-2017 Martin Thomas
This file written by Martin Brehm.
......@@ -21,9 +21,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef AGGREGATE_H
#define AGGREGATE_H
// This must always be the first include directive
#include "config.h"
#include "xobject.h"
#include "xdvector3.h"
#include "xintarray.h"
......
......@@ -2,8 +2,8 @@
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
Copyright (c) 2009-2017 Martin Brehm
2012-2017 Martin Thomas
This file written by Martin Brehm.
......@@ -21,9 +21,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef ANALYSIS_H
#define ANALYSIS_H
// This must always be the first include directive
#include "config.h"
#include "backtrace.h"
#include "xobject.h"
......
......@@ -2,8 +2,8 @@
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
Copyright (c) 2009-2017 Martin Brehm
2012-2017 Martin Thomas
This file written by Martin Brehm.
......@@ -21,6 +21,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
// This must always be the first include directive
#include "config.h"
#include "analysisgroup.h"
......
......@@ -2,8 +2,8 @@
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
Copyright (c) 2009-2017 Martin Brehm
2012-2017 Martin Thomas
This file written by Martin Brehm.
......@@ -21,9 +21,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef ANALYSISGROUP_H
#define ANALYSISGROUP_H
// This must always be the first include directive
#include "config.h"
#include "backtrace.h"
#include "xobject.h"
#include "xobarray.h"
......
......@@ -2,8 +2,8 @@
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
Copyright (c) 2009-2017 Martin Brehm
2012-2017 Martin Thomas
This file written by Martin Brehm.
......@@ -21,6 +21,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
// This must always be the first include directive
#include "config.h"
#include "asciiart.h"
......
......@@ -2,8 +2,8 @@
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
Copyright (c) 2009-2017 Martin Brehm
2012-2017 Martin Thomas
This file written by Martin Brehm.
......@@ -21,9 +21,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef ASCIIART_H
#define ASCIIART_H
// This must always be the first include directive
#include "config.h"
#include "xobject.h"
#include "xobarray.h"
#include "backtrace.h"
......
......@@ -2,8 +2,8 @@
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
Copyright (c) 2009-2017 Martin Brehm
2012-2017 Martin Thomas
This file written by Martin Brehm.
......@@ -21,6 +21,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
// This must always be the first include directive
#include "config.h"
#include "atomgroup.h"
#include "moltools.h"
#include "travis.h"
......@@ -66,7 +70,7 @@ void CAtomGroup::AddAtom(int atom, int num, bool all)
{
if (atoms->GetAt(z2) == num)
{
eprintf("CAtomGroup::AddAtom(): Atom %s%d already included, ignoring this.\n",((CAtom*)g_oaAtoms[atom])->m_sName,num+1);
eprintf("CAtomGroup::AddAtom(): Atom %s%d already included, ignoring this.\n",(const char*)((CAtom*)g_oaAtoms[atom])->m_sName,num+1);
BTOUT;
return;
}
......@@ -207,7 +211,7 @@ bool CAtomGroup::ParseAtoms(CMolecule *mol, const char *s)
buf[q-p] = 0;
if (atoi(buf)-1 >= mol->m_waAtomCount[atom])
{
eprintf("Error: Only %d %s atoms in the molecule (requested: %d)\n",mol->m_waAtomCount[atom],((CAtom*)g_oaAtoms[mol->m_baAtomIndex[atom]])->m_sName,atoi(buf));
eprintf("Error: Only %d %s atoms in the molecule (requested: %d)\n",mol->m_waAtomCount[atom],(const char*)((CAtom*)g_oaAtoms[mol->m_baAtomIndex[atom]])->m_sName,atoi(buf));
BTOUT;
return false;
}
......@@ -298,7 +302,7 @@ void CAtomGroup::BuildName()
CxIntArray *atoms;
int z, z2, z3;
tmp.sprintf("");
tmp = "";
for (z=0;z<m_baAtomType.GetSize();z++)
{
if (m_baAllAtoms[z])
......@@ -325,10 +329,10 @@ void CAtomGroup::BuildName()
if (z3 > z2)
{
// sprintf(buf2,"%s%d-%d",((CAtom*)g_oaAtoms[m_baRealAtomType[z]])->m_sName,atoms->GetAt(z2)+1,atoms->GetAt(z3)+1);
buf2.sprintf("%s%d-%d",((CAtom*)g_oaAtoms[m_baRealAtomType[z]])->m_sName,atoms->GetAt(z2)+1,atoms->GetAt(z3)+1);
buf2.sprintf("%s%d-%d",(const char*)((CAtom*)g_oaAtoms[m_baRealAtomType[z]])->m_sName,atoms->GetAt(z2)+1,atoms->GetAt(z3)+1);
z2 = z3;
} else
buf2.sprintf("%s%d",((CAtom*)g_oaAtoms[m_baRealAtomType[z]])->m_sName,atoms->GetAt(z2)+1);
buf2.sprintf("%s%d",(const char*)((CAtom*)g_oaAtoms[m_baRealAtomType[z]])->m_sName,atoms->GetAt(z2)+1);
// sprintf(buf2,"%s%d",((CAtom*)g_oaAtoms[m_baRealAtomType[z]])->m_sName,atoms->GetAt(z2)+1);
// strcat(tmp,buf2);
......
......@@ -2,8 +2,8 @@
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
Copyright (c) 2009-2017 Martin Brehm
2012-2017 Martin Thomas
This file written by Martin Brehm.
......@@ -21,9 +21,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef ATOMGROUP_H
#define ATOMGROUP_H
// This must always be the first include directive
#include "config.h"
#include "xobject.h"
#include "xbytearray.h"
#include "tools.h"
......
......@@ -2,8 +2,8 @@
TRAVIS - Trajectory Analyzer and Visualizer
http://www.travis-analyzer.de/
Copyright (c) 2009-2016 Martin Brehm
2012-2016 Martin Thomas
Copyright (c) 2009-2017 Martin Brehm
2012-2017 Martin Thomas
This file written by Martin Brehm.
......@@ -22,6 +22,9 @@
*****************************************************************************/
// This must always be the first include directive
#include "config.h"
#include "backtrace.h"
#include "travis.h"
#include "maintools.h"
......@@ -107,7 +110,7 @@ void DumpLinuxBacktrace()
a = fopen("tmp.txt","rt");
if (a == NULL)
{
eprintf("Error. Make sure you have the addr2line tool installed and writing permission to this directory.\n");
eprintf("Error. Make sure you have the addr2line tool installed (it is part of \"binutils\")\nand writing permission to this directory.\n");
continue;
}
mprintf("- [%10p] ",buffer[z]);
......@@ -177,6 +180,68 @@ void Crash()
}
void CrashAbort()
{
bool b;
g_bCheckWrite = false;
UninstallSignalHandler();
b = g_bGlobalPsycho;
g_bGlobalPsycho = false;
mprintf(WHITE,"TRAVIS had to abort execution.\n");
mprintf(WHITE,"Hopefully, the reason was printed above this message.\n");
BTDUMP;
#ifdef TARGET_LINUX
DumpLinuxBacktrace();
#endif
if (g_bSMode)
{
mprintf("\n");
g_bGlobalPsycho = b;
PrintSMode();
g_bGlobalPsycho = false;
mprintf("\n");
}
eprintf("Delivering control to operating system.\n");
/*#ifdef TARGET_WINDOWS
char buf[2];
gets(buf);
#endif*/
abort();
}
void CrashTerm()
{
bool b;
g_bCheckWrite = false;
UninstallSignalHandler();
b = g_bGlobalPsycho;
g_bGlobalPsycho = false;
mprintf(WHITE,"TRAVIS received a termination request (SIGTERM) from the operating system\n");
mprintf(WHITE,"and therefore has to stop execution.\n");
BTDUMP;
#ifdef TARGET_LINUX
DumpLinuxBacktrace();
#endif
if (g_bSMode)
{
mprintf("\n");
g_bGlobalPsycho = b;
PrintSMode();
g_bGlobalPsycho = false;
mprintf("\n");
}
eprintf("Delivering control to operating system.\n");
/*#ifdef TARGET_WINDOWS
char buf[2];
gets(buf);
#endif*/
abort();
}
void CrashInt()