forked from rikigigi/analisi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testtraiettoria.cpp
53 lines (40 loc) · 1.28 KB
/
testtraiettoria.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
*
* (c) Riccardo Bertossa, 2019
*
* Use at your own risk.
*
* If you modified the code, I could be happy if you contribute on github!
*
**/
#include "testtraiettoria.h"
#include <iostream>
#include <fstream>
TestTraiettoria::TestTraiettoria(std::string filename) : Traiettoria(filename)
{
std::ofstream out("analisi_test.debug");
int n_timesteps=get_ntimesteps();
double *coord=new double [n_timesteps];
double *coord_cm=new double [n_timesteps];
for (unsigned int i=0;i<n_timesteps;i++){
coord[i]=0.0;
coord_cm[i]=0.0;
}
unsigned int n_b=31;
const unsigned int iatom=47,icoord=3;
unsigned int ts_b=n_timesteps/(n_b+1);
imposta_dimensione_finestra_accesso(ts_b*2);
for (unsigned int ib=0;ib<n_b;ib++) {
std::cout << "Blocco "<<ib<<"\n";
imposta_inizio_accesso(ts_b*ib);
for (unsigned int ts=ts_b*ib;ts<ts_b*(ib+2);ts++) {
out << ts <<" " <<posizioni(ts,iatom)[icoord] << " " << coord[ts] << " "<<posizioni_cm(ts,0)[icoord]<< " " << coord_cm[ts] <<"\n";
coord[ts]=posizioni(ts,iatom)[icoord];
coord_cm[ts]=posizioni_cm(ts,0)[icoord];
}
std::cout << "\n";
}
std::cout << "#--------\n";
delete [] coord;
delete [] coord_cm;
}