-
Notifications
You must be signed in to change notification settings - Fork 0
/
sim_libs.h
82 lines (55 loc) · 2.22 KB
/
sim_libs.h
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
Copyright 2013, Vasudevan Venkateshwaran, Garde group @ RPI
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/>.
sim_libs.h
The main library routine definitions needed by the program
*/
// Headers
#include <iostream>
#include <fstream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstdio>
#include <vector>
#include <ctime>
#include "unistd.h"
#include "xdrfile.h"
#include "xdrfile_xtc.h"
#include "fftw3.h"
#include "sim_io.h"
#include "grid.h"
#ifndef _sim_libs_h
#define _sim_libs_h
/* Routines in sim_libs.cpp */
// Center of mass
double calculate_com ( double *h, int nx, int ny );
void remove_comm ( double *h, int nx, int ny, double zinit );
// FFTW FFT calculation
void duplicate_fftw_array ( fftw_complex *h, fftw_complex* hc, int nx, int ny );
void dftreal ( double *h, fftw_complex *htwiddle, int nx, int ny, int nh );
void idftreal ( fftw_complex *htwiddle, double *h, int nx, int ny, int nh );
void normalize_fft_array ( fftw_complex *h, int nx, int ny, int nyh );
void normalize_ifft_array ( double *h, int nx, int ny );
// Initalizing the velocity
void init_velocity ( double* , int , int , double );
// Generating noise terms for langevin damping
void generate_psitwiddle(fftw_complex *psitwiddle, int nx, int ny, int nh,
double mean, double var);
// Generating the k-vector magnitudes
void generate_modksq ( double *modksq, t_Grid* grid );
// Force calculation
void calcforce(fftw_complex *htwiddle, fftw_complex *psitwiddle,
fftw_complex *fpintwiddle, fftw_complex *Gt, double *modksq,
double gamma, double dx, double dy, int elstart, int nfftwpoints );
#endif /* _sim_libs_h */