2022-08-09 18:53:53 +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.
|
2022-08-09 18:53:53 +02:00
|
|
|
*/
|
2022-08-12 18:12:29 +02:00
|
|
|
#include <stdbool.h>
|
|
|
|
//---
|
2022-08-09 18:53:53 +02:00
|
|
|
#include <parameter.h>
|
|
|
|
#include <atom.h>
|
|
|
|
|
2022-08-12 17:28:06 +02:00
|
|
|
void initialIntegrate_cpu(bool reneigh, Parameter *param, Atom *atom) {
|
2022-08-09 18:53:53 +02:00
|
|
|
for(int i = 0; i < atom->Nlocal; i++) {
|
|
|
|
atom_vx(i) += param->dtforce * atom_fx(i);
|
|
|
|
atom_vy(i) += param->dtforce * atom_fy(i);
|
|
|
|
atom_vz(i) += param->dtforce * atom_fz(i);
|
|
|
|
atom_x(i) = atom_x(i) + param->dt * atom_vx(i);
|
|
|
|
atom_y(i) = atom_y(i) + param->dt * atom_vy(i);
|
|
|
|
atom_z(i) = atom_z(i) + param->dt * atom_vz(i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-12 17:28:06 +02:00
|
|
|
void finalIntegrate_cpu(bool reneigh, Parameter *param, Atom *atom) {
|
2022-08-09 18:53:53 +02:00
|
|
|
for(int i = 0; i < atom->Nlocal; i++) {
|
|
|
|
atom_vx(i) += param->dtforce * atom_fx(i);
|
|
|
|
atom_vy(i) += param->dtforce * atom_fy(i);
|
|
|
|
atom_vz(i) += param->dtforce * atom_fz(i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CUDA_TARGET
|
2022-08-12 17:28:06 +02:00
|
|
|
void initialIntegrate_cuda(bool, Parameter*, Atom*);
|
|
|
|
void finalIntegrate_cuda(bool, Parameter*, Atom*);
|
2022-08-09 18:53:53 +02:00
|
|
|
#endif
|