yukawa_z pair_style

Dear Steve,
I am planning to modify the pair_style yukawa module and write a new pair style yukawa/z for treating colloidal particle interaction with a wall. The concept here is the (colloid/wall) interaction will only be a function of z distance from the wall. In that case, I have few questions. I will appreciate if you could guide me through.

I am assuming that the only changes (with respect to pair style Yukawa) will be made to following functions (in bold) as far as login is concerned.

This is pair_yakawa_z.h

ifdef PAIR_CLASS
PairStyle(yukawa_z,PairYukawa_z)
#else
#ifndef LMP_PAIR_YUKAWA_z_H
#define LMP_PAIR_YUKAWA_z_H
#include “pair.h”
namespace LAMMPS_NS {

class PairYukawa/z : public Pair {
public:
PairYukawa/z(class LAMMPS *);
virtual ~PairYukawa/z();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
virtual double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
virtual double single(int, int, int, int, double, double, double, double &);

protected:
double cut_global;
double kappa;
double **cut,**a,**offset;

void allocate();
};

Once this is done, I go in pair_yukawa_z.cpp, modify the names of the functions to Yukawa_z, and modify the code in the compute and single function.

Please let me know if I am on the right path.

Best Regards,
Vikas

Dear Steve,
I am planning to modify the pair_style yukawa module and write a new pair
style yukawa/z for treating colloidal particle interaction with a wall. The
concept here is the (colloid/wall) interaction will only be a function of z
distance from the wall. In that case, I have few questions. I will
appreciate if you could guide me through.

I am assuming that the only changes (with respect to pair style Yukawa) will
be made to following functions (in bold) as far as login is concerned.

This is pair_yakawa_z.h

ifdef PAIR_CLASS
PairStyle(yukawa_z,PairYukawa_z)
#else
#ifndef LMP_PAIR_YUKAWA_z_H
#define LMP_PAIR_YUKAWA_z_H
#include "pair.h"
namespace LAMMPS_NS {

class PairYukawa/z : public Pair {

                          ^^^^^^

this is not a valid class name,
try PairYukawaZ instead.

public:
PairYukawa/z(class LAMMPS *);
virtual ~PairYukawa/z();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
virtual double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
virtual double single(int, int, int, int, double, double, double, double
&);

protected:
double cut_global;
double kappa;
double **cut,**a,**offset;

void allocate();
};

Once this is done, I go in pair_yukawa_z.cpp, modify the names of the
functions to Yukawa_z, and modify the code in the compute and single
function.

Please let me know if I am on the right path.

yes. but it might be cleaner and easier to maintain,
if you make your class a derived class of PairYukawa
and then only write a new compute (and single, if you
want/need to. you can disable support for single with
setting single_enable to 0 in the constructor)

cheers,
    axel.

Dear Steve,
I am planning to modify the pair_style yukawa module and write a new pair
style yukawa/z for treating colloidal particle interaction with a wall. The
concept here is the (colloid/wall) interaction will only be a function of z
distance from the wall. In that case, I have few questions. I will
appreciate if you could guide me through.

I am assuming that the only changes (with respect to pair style Yukawa) will
be made to following functions (in bold) as far as login is concerned.

This is pair_yakawa_z.h

ifdef PAIR_CLASS
PairStyle(yukawa_z,PairYukawa_z)

...and i forgot. the second argument in
this macro evaluation has to be the class
name from below.

axel.

What you're describing doesn't sound like
a pair style. There is a fix wall/colloid command.
If that's different than what you want, maybe you
could add a fix wall/yukawa or fix wall/colloid/yukawa.

If it's a single particle interacting with a idealized
wall, then it's not a pair style in LAMMPS lingo.

Steve