2021-10-26 00:40:39 +02:00
|
|
|
/*
|
|
|
|
* =======================================================================================
|
|
|
|
*
|
|
|
|
* Author: Jan Eitzinger (je), jan.eitzinger@fau.de
|
|
|
|
* Copyright (c) 2020 RRZE, University Erlangen-Nuremberg
|
|
|
|
*
|
|
|
|
* This file is part of MD-Bench.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
* =======================================================================================
|
|
|
|
*/
|
2021-10-26 01:19:11 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2021-10-26 00:40:39 +02:00
|
|
|
#include <atom.h>
|
|
|
|
#include <parameter.h>
|
|
|
|
|
|
|
|
#ifndef __EAM_H_
|
|
|
|
#define __EAM_H_
|
|
|
|
typedef struct {
|
|
|
|
int nrho, nr;
|
|
|
|
MD_FLOAT drho, dr, cut, mass;
|
|
|
|
MD_FLOAT *frho, *rhor, *zr;
|
|
|
|
} Funcfl;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
MD_FLOAT* fp;
|
|
|
|
int nmax;
|
|
|
|
int nrho, nr;
|
|
|
|
int nrho_tot, nr_tot;
|
|
|
|
MD_FLOAT dr, rdr, drho, rdrho;
|
|
|
|
MD_FLOAT *frho, *rhor, *z2r;
|
|
|
|
MD_FLOAT *rhor_spline, *frho_spline, *z2r_spline;
|
2021-10-26 01:40:02 +02:00
|
|
|
Funcfl file;
|
2021-10-26 00:40:39 +02:00
|
|
|
} Eam;
|
|
|
|
|
2021-10-26 13:55:14 +02:00
|
|
|
void initEam(Eam* eam, Parameter* param);
|
|
|
|
void coeff(Eam* eam, Parameter* param);
|
|
|
|
void init_style(Eam* eam, Parameter *param);
|
2021-10-26 00:40:39 +02:00
|
|
|
void read_file(Funcfl* file, const char* filename);
|
|
|
|
void file2array(Eam* eam);
|
2021-10-26 13:55:14 +02:00
|
|
|
void array2spline(Eam* eam, Parameter* param);
|
2021-10-26 01:19:11 +02:00
|
|
|
void interpolate(int n, MD_FLOAT delta, MD_FLOAT* f, MD_FLOAT* spline);
|
|
|
|
void grab(FILE* fptr, int n, MD_FLOAT* list);
|
2021-10-26 00:40:39 +02:00
|
|
|
#endif
|