#ifdef FIX_CLASS
FixStyle(rx,FixRX)
#else
#ifndef LMP_FIX_RX_H
#define LMP_FIX_RX_H
#include "fix.h"
typedef int (*fnptr)(double, const double *, double *, void *);
namespace LAMMPS_NS {
enum { ODE_LAMMPS_RK4, ODE_LAMMPS_RKF45 };
class FixRX : public Fix {
public:
FixRX(class LAMMPS *, int, char **);
~FixRX();
int setmask();
void post_constructor();
virtual void init();
void init_list(int, class NeighList *);
virtual void setup_pre_force(int);
virtual void pre_force(int);
protected:
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
int pack_forward_comm(int , int *, double *, int, int *);
void unpack_forward_comm(int , int , double *);
class NeighList *list;
double tmpArg;
int *mol2param; int nreactions; int maxparam; struct Param {
double cp;
int ispecies;
char *name; };
Param *params;
int nspecies;
void read_file(char *);
void setupParams();
double *Arr, *nArr, *Ea, *tempExp;
double **stoich, **stoichReactants, **stoichProducts;
double *kR;
void rk4(int, double*, void*);
void rkf45(int, double*, void*, int ode_counter[]);
void rkf45_step (const int neq, const double h, double y[], double y_out[],
double rwk[], void *);
int rkf45_h0 (const int neq, const double t, const double t_stop,
const double hmin, const double hmax,
double& h0, double y[], double rwk[], void *v_params);
class PairDPDfdtEnergy *pairDPDE;
double *dpdThetaLocal;
double *sumWeights;
void computeLocalTemperature();
int localTempFlag,wtFlag,odeIntegrationFlag;
double sigFactor;
int rhs(double, const double *, double *, void *);
int rhs_dense (double, const double *, double *, void *);
struct UserRHSData
{
double *kFor;
double *rxnRateLaw;
};
bool useSparseKinetics;
void initSparse(void);
int rhs_sparse(double, const double *, double *, void *) const;
int sparseKinetics_maxReactants; int sparseKinetics_maxProducts; int sparseKinetics_maxSpecies;
double **sparseKinetics_nu; int **sparseKinetics_nuk; int **sparseKinetics_inu;
bool *sparseKinetics_isIntegralReaction;
int minSteps; int maxIters; double relTol, absTol;
int diagnosticFrequency; enum { numDiagnosticCounters = 5 };
enum { StepSum=0, FuncSum, TimeSum, AtomSum, CountSum };
double diagnosticCounter[ numDiagnosticCounters ];
int *diagnosticCounterPerODE[ numDiagnosticCounters ];
void odeDiagnostics(void);
private:
char *kineticsFile;
char *id_fix_species,*id_fix_species_old;
class FixPropertyAtom *fix_species,*fix_species_old;
int restartFlag;
};
}
#endif
#endif