2020-08-18 14:27:28 +02:00
|
|
|
/*
|
2022-09-05 10:39:42 +02:00
|
|
|
* Copyright (C) 2022 NHR@FAU, University Erlangen-Nuremberg.
|
|
|
|
* All rights reserved. This file is part of MD-Bench.
|
|
|
|
* Use of this source code is governed by a LGPL-3.0
|
|
|
|
* license that can be found in the LICENSE file.
|
2020-08-18 14:27:28 +02:00
|
|
|
*/
|
|
|
|
#ifndef __UTIL_H_
|
|
|
|
#define __UTIL_H_
|
|
|
|
|
|
|
|
#ifndef MIN
|
2022-08-16 18:36:47 +02:00
|
|
|
# define MIN(x,y) ((x)<(y)?(x):(y))
|
2020-08-18 14:27:28 +02:00
|
|
|
#endif
|
2022-08-16 18:36:47 +02:00
|
|
|
|
2020-08-18 14:27:28 +02:00
|
|
|
#ifndef MAX
|
2022-08-16 18:36:47 +02:00
|
|
|
# define MAX(x,y) ((x)>(y)?(x):(y))
|
2020-08-18 14:27:28 +02:00
|
|
|
#endif
|
2022-08-16 18:36:47 +02:00
|
|
|
|
2020-08-18 14:27:28 +02:00
|
|
|
#ifndef ABS
|
2022-08-16 18:36:47 +02:00
|
|
|
# define ABS(a) ((a) >= 0 ? (a) : -(a))
|
2020-08-18 14:27:28 +02:00
|
|
|
#endif
|
2022-08-16 18:36:47 +02:00
|
|
|
|
2022-12-14 16:17:28 +01:00
|
|
|
#define DEBUG_MESSAGE debug_printf
|
2022-03-17 02:44:34 +01:00
|
|
|
|
|
|
|
#ifndef MAXLINE
|
2022-08-16 18:36:47 +02:00
|
|
|
# define MAXLINE 4096
|
2022-03-17 02:44:34 +01:00
|
|
|
#endif
|
2020-08-18 14:27:28 +02:00
|
|
|
|
2021-12-01 00:07:45 +01:00
|
|
|
#define FF_LJ 0
|
|
|
|
#define FF_EAM 1
|
2022-07-07 00:47:38 +02:00
|
|
|
#define FF_DEM 2
|
2021-12-01 00:07:45 +01:00
|
|
|
|
2022-08-16 18:36:47 +02:00
|
|
|
#if PRECISION == 1
|
|
|
|
# define PRECISION_STRING "single"
|
|
|
|
#else
|
|
|
|
# define PRECISION_STRING "double"
|
|
|
|
#endif
|
|
|
|
|
2020-08-18 14:27:28 +02:00
|
|
|
extern double myrandom(int*);
|
2021-12-01 00:07:45 +01:00
|
|
|
extern void random_reset(int *seed, int ibase, double *coord);
|
|
|
|
extern int str2ff(const char *string);
|
|
|
|
extern const char* ff2str(int ff);
|
2022-08-09 18:53:53 +02:00
|
|
|
extern int get_num_threads();
|
2022-11-08 15:30:37 +01:00
|
|
|
extern void readline(char *line, FILE *fp);
|
2022-12-14 16:17:28 +01:00
|
|
|
extern void debug_printf(const char *format, ...);
|
2022-08-09 18:53:53 +02:00
|
|
|
|
2020-08-18 14:27:28 +02:00
|
|
|
#endif
|