2020-08-18 14:27:28 +02:00
|
|
|
/*
|
|
|
|
* =======================================================================================
|
|
|
|
*
|
2020-08-19 10:47:40 +02:00
|
|
|
* Author: Jan Eitzinger (je), jan.eitzinger@fau.de
|
2021-03-23 09:26:41 +01:00
|
|
|
* Copyright (c) 2021 RRZE, University Erlangen-Nuremberg
|
2020-08-18 14:27:28 +02:00
|
|
|
*
|
2020-08-19 10:47:40 +02:00
|
|
|
* This file is part of MD-Bench.
|
2020-08-18 14:27:28 +02:00
|
|
|
*
|
2020-08-19 10:47:40 +02:00
|
|
|
* MD-Bench is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU Lesser General Public License as published
|
|
|
|
* by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2020-08-18 14:27:28 +02:00
|
|
|
*
|
2020-08-19 10:47:40 +02:00
|
|
|
* MD-Bench 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 Lesser General Public License for more
|
|
|
|
* details.
|
2020-08-18 14:27:28 +02:00
|
|
|
*
|
2020-08-19 10:47:40 +02:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License along
|
|
|
|
* with MD-Bench. If not, see <https://www.gnu.org/licenses/>.
|
2020-08-18 14:27:28 +02:00
|
|
|
* =======================================================================================
|
|
|
|
*/
|
|
|
|
#include <parameter.h>
|
|
|
|
|
|
|
|
#ifndef __ATOM_H_
|
|
|
|
#define __ATOM_H_
|
|
|
|
|
2022-03-05 03:21:52 +01:00
|
|
|
#define DELTA 20000
|
|
|
|
|
2022-01-25 00:43:10 +01:00
|
|
|
#define CLUSTER_DIM_M 4
|
2022-02-04 17:52:48 +01:00
|
|
|
#define CLUSTER_DIM_N VECTOR_WIDTH
|
2022-01-25 00:43:10 +01:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int bin;
|
|
|
|
int natoms;
|
2022-02-02 18:00:44 +01:00
|
|
|
int type[CLUSTER_DIM_M];
|
2022-01-25 00:43:10 +01:00
|
|
|
MD_FLOAT bbminx, bbmaxx;
|
|
|
|
MD_FLOAT bbminy, bbmaxy;
|
|
|
|
MD_FLOAT bbminz, bbmaxz;
|
|
|
|
} Cluster;
|
|
|
|
|
2020-08-18 14:27:28 +02:00
|
|
|
typedef struct {
|
|
|
|
int Natoms, Nlocal, Nghost, Nmax;
|
2022-01-25 00:43:10 +01:00
|
|
|
int Nclusters, Nclusters_local, Nclusters_ghost, Nclusters_max;
|
2020-11-05 12:41:44 +01:00
|
|
|
MD_FLOAT *x, *y, *z;
|
|
|
|
MD_FLOAT *vx, *vy, *vz;
|
2022-01-25 00:43:10 +01:00
|
|
|
MD_FLOAT *cl_x;
|
2022-01-28 18:07:41 +01:00
|
|
|
MD_FLOAT *cl_v;
|
|
|
|
MD_FLOAT *cl_f;
|
2021-11-03 00:57:24 +01:00
|
|
|
int *border_map;
|
2021-05-19 23:51:02 +02:00
|
|
|
int *type;
|
|
|
|
int ntypes;
|
|
|
|
MD_FLOAT *epsilon;
|
|
|
|
MD_FLOAT *sigma6;
|
|
|
|
MD_FLOAT *cutforcesq;
|
|
|
|
MD_FLOAT *cutneighsq;
|
2022-01-25 00:43:10 +01:00
|
|
|
Cluster *clusters;
|
2022-01-25 12:19:28 +01:00
|
|
|
int *PBCx, *PBCy, *PBCz;
|
2020-08-18 14:27:28 +02:00
|
|
|
} Atom;
|
|
|
|
|
2020-08-19 09:00:35 +02:00
|
|
|
extern void initAtom(Atom*);
|
2020-08-18 14:27:28 +02:00
|
|
|
extern void createAtom(Atom*, Parameter*);
|
2021-11-30 01:33:55 +01:00
|
|
|
extern int readAtom(Atom*, Parameter*);
|
2022-02-24 02:36:17 +01:00
|
|
|
extern int readAtom_pdb(Atom*, Parameter*);
|
2022-03-03 20:03:33 +01:00
|
|
|
extern int readAtom_gro(Atom*, Parameter*);
|
2022-02-24 02:36:17 +01:00
|
|
|
extern int readAtom_dmp(Atom*, Parameter*);
|
2020-08-18 14:27:28 +02:00
|
|
|
extern void growAtom(Atom*);
|
2022-01-25 00:43:10 +01:00
|
|
|
extern void growClusters(Atom*);
|
|
|
|
|
2022-02-02 18:00:44 +01:00
|
|
|
#define cluster_pos_ptr(ci) &(atom->cl_x[(ci) * CLUSTER_DIM_M * 3])
|
|
|
|
#define cluster_velocity_ptr(ci) &(atom->cl_v[(ci) * CLUSTER_DIM_M * 3])
|
|
|
|
#define cluster_force_ptr(ci) &(atom->cl_f[(ci) * CLUSTER_DIM_M * 3])
|
2021-03-20 18:32:50 +01:00
|
|
|
|
|
|
|
#ifdef AOS
|
2021-03-23 16:21:08 +01:00
|
|
|
#define POS_DATA_LAYOUT "AoS"
|
|
|
|
#define atom_x(i) atom->x[(i) * 3 + 0]
|
|
|
|
#define atom_y(i) atom->x[(i) * 3 + 1]
|
|
|
|
#define atom_z(i) atom->x[(i) * 3 + 2]
|
2021-03-20 18:32:50 +01:00
|
|
|
#else
|
2021-03-23 16:21:08 +01:00
|
|
|
#define POS_DATA_LAYOUT "SoA"
|
|
|
|
#define atom_x(i) atom->x[i]
|
|
|
|
#define atom_y(i) atom->y[i]
|
|
|
|
#define atom_z(i) atom->z[i]
|
2022-02-02 18:00:44 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CLUSTER_AOS
|
|
|
|
#define cluster_x(cptr, i) cptr[(i) * 3 + 0]
|
|
|
|
#define cluster_y(cptr, i) cptr[(i) * 3 + 1]
|
|
|
|
#define cluster_z(cptr, i) cptr[(i) * 3 + 2]
|
|
|
|
#else
|
|
|
|
#define cluster_x(cptr, i) cptr[0 * CLUSTER_DIM_M + (i)]
|
|
|
|
#define cluster_y(cptr, i) cptr[1 * CLUSTER_DIM_M + (i)]
|
|
|
|
#define cluster_z(cptr, i) cptr[2 * CLUSTER_DIM_M + (i)]
|
2021-03-20 18:32:50 +01:00
|
|
|
#endif
|
|
|
|
|
2020-08-18 14:27:28 +02:00
|
|
|
#endif
|