GADGET-4
parameters.h
Go to the documentation of this file.
1/*******************************************************************************
2 * \copyright This file is part of the GADGET4 N-body/SPH code developed
3 * \copyright by Volker Springel. Copyright (C) 2014-2020 by Volker Springel
4 * \copyright (vspringel@mpa-garching.mpg.de) and all contributing authors.
5 *******************************************************************************/
6
12#ifndef PARAMETERS_H
13#define PARAMETERS_H
14
15#include "../data/dtypes.h"
16#include "../mpi_utils/setcomm.h"
17
18#define PARAM_DOUBLE 1
19#define PARAM_STRING 2
20#define PARAM_INT 3
21
22#define PARAM_FIXED 0
23#define PARAM_CHANGEABLE 1
24
25#define MAXLEN_PARAM_TAG 50
26#define MAXLEN_PARAM_VALUE 200
27#define MAX_PARAMETERS 300
29class parameters : public setcomm
30{
31 public:
32 // constructors
33 parameters() : setcomm("delayed init") {}
34 parameters(MPI_Comm comm) : setcomm(comm) {}
35
36 int read_parameter_file(const char *fname);
37
38 void add_param(const char *name, void *buf, int type, int flag);
39
40 void write_used_parameters(const char *dirname, const char *fname);
41
42 int NParameters = 0;
43
49};
50
51#endif /* PARAMETERS_H */
char ParametersType[MAX_PARAMETERS]
Definition: parameters.h:46
char ParametersTag[MAX_PARAMETERS][MAXLEN_PARAM_TAG]
Definition: parameters.h:44
parameters(MPI_Comm comm)
Definition: parameters.h:34
void add_param(const char *name, void *buf, int type, int flag)
Definition: parameters.cc:30
int ParameterSequence[MAX_PARAMETERS]
Definition: parameters.h:48
void write_used_parameters(const char *dirname, const char *fname)
Definition: parameters.cc:195
int NParameters
Definition: parameters.h:42
int read_parameter_file(const char *fname)
This function parses the parameter file.
Definition: parameters.cc:57
void * ParametersValue[MAX_PARAMETERS]
Definition: parameters.h:45
char ParametersChangeable[MAX_PARAMETERS]
Definition: parameters.h:47
#define MAXLEN_PARAM_TAG
Definition: parameters.h:25
#define MAX_PARAMETERS
Definition: parameters.h:27