Commit de6ff01b authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14542 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 94da81ba
Loading
Loading
Loading
Loading

src/USER-DPD/README

0 → 100644
+35 −0
Original line number Diff line number Diff line
This package implements the dissipative particle dynamics (DPD) method
under isothermal, isoenergetic, isobaric and isenthalpic conditions.
The DPD equations of motion are integrated through the Shardlow
splitting algorithm.

Currently, the package has the following features:

* A new DPD atom style for tracking the DPD particle internal energies
  and internal temperature

* Compute commands for accessing the DPD particle internal energies
  and internal temperature

* "fix eos" commands for relating the DPD internal energy to the DPD
  internal temperature through a coarse-grained particle
  equation-of-state

* "fix shardlow" command for integrating the stochastic ODEs

* Pair styles for modeling a DPD fluid

* Commands for setting the particle internal temperature

See the doc pages for "atom style dpd", "compute dpd" and "compute
dpd/atom", "fix eos/cv" and "fix eos/table", "fix shardlow", "pair
dpd/conservative" and "pair dpd/fdt" and "pair dpd/fdt/energy"
commands to get started.  At the bottom of the doc page are many links
to additional documentation contained in the doc/USER/dpd directory.

There are example scripts for using this package in examples/USER/dpd.

The primary people who created this package are James Larentzos
(james.p.larentzos.civ at mail.mil), Timothy Mattox (Timothy.Mattox at
engilitycorp.com) and John Brennan (john.k.brennan.civ at mail.mil).
Contact them directly if you have questions.
+871 −0

File added.

Preview size limit exceeded, changes collapsed.

+95 −0
Original line number Diff line number Diff line
/* ----------------------------------------------------------------------
   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
   http://lammps.sandia.gov, Sandia National Laboratories
   Steve Plimpton, sjplimp@sandia.gov

   Copyright (2003) Sandia Corporation.  Under the terms of Contract
   DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
   certain rights in this software.  This software is distributed under
   the GNU General Public License.

   See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */

/* ----------------------------------------------------------------------
   Contributing author: James Larentzos (Engility Corporation)
------------------------------------------------------------------------- */

#ifdef ATOM_CLASS

AtomStyle(dpd,AtomVecDPD)

#else

#ifndef LMP_ATOM_VEC_DPD_H
#define LMP_ATOM_VEC_DPD_H

#include "atom_vec.h"

namespace LAMMPS_NS {

class AtomVecDPD : public AtomVec {
 public:
  AtomVecDPD(class LAMMPS *);
  virtual ~AtomVecDPD() {}
  void grow(int);
  void grow_reset();
  void copy(int, int, int);
  virtual int pack_comm(int, int *, double *, int, int *);
  virtual int pack_comm_vel(int, int *, double *, int, int *);
  int pack_comm_hybrid(int, int *, double *);
  virtual void unpack_comm(int, int, double *);
  virtual void unpack_comm_vel(int, int, double *);
  int unpack_comm_hybrid(int, int, double *);
  int pack_reverse(int, int, double *);
  void unpack_reverse(int, int *, double *);
  virtual int pack_border(int, int *, double *, int, int *);
  virtual int pack_border_vel(int, int *, double *, int, int *);
  int pack_border_hybrid(int, int *, double *);
  virtual void unpack_border(int, int, double *);
  virtual void unpack_border_vel(int, int, double *);
  int unpack_border_hybrid(int, int, double *);
  virtual int pack_exchange(int, double *);
  virtual int unpack_exchange(double *);
  int size_restart();
  int pack_restart(int, double *);
  int unpack_restart(double *);
  void create_atom(int, double *);
  void data_atom(double *, imageint, char **);
  int data_atom_hybrid(int, char **);
  void pack_data(double **);
  int pack_data_hybrid(int, double *);
  void write_data(FILE *, int, double **);
  int write_data_hybrid(FILE *, double *);
  bigint memory_usage();
  double *uCond,*uMech,*dpdTheta;
  double *duCond,*duMech;

 protected:
  tagint *tag;
  int *type,*mask;
  imageint *image;
  double **x,**v,**f;
};

}

#endif
#endif

/* ERROR/WARNING messages:

E: Per-processor system is too big

The number of owned atoms plus ghost atoms on a single
processor must fit in 32-bit integer.

E: Invalid atom type in Atoms section of data file

Atom types must range from 1 to specified # of types.

E: Internal temperature in Atoms section of data file must be > zero

All internal temperatures must be > zero

*/
+88 −0
Original line number Diff line number Diff line
/* ----------------------------------------------------------------------
   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
   http://lammps.sandia.gov, Sandia National Laboratories
   Steve Plimpton, sjplimp@sandia.gov

   Copyright (2003) Sandia Corporation.  Under the terms of Contract
   DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
   certain rights in this software.  This software is distributed under
   the GNU General Public License.

   See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */

/* ----------------------------------------------------------------------
   Contributing author: James Larentzos (Engility Corporation)
------------------------------------------------------------------------- */

#include <mpi.h>
#include "compute_dpd.h"
#include "atom.h"
#include "update.h"
#include "force.h"
#include "domain.h"
#include "group.h"
#include "error.h"

using namespace LAMMPS_NS;

/* ---------------------------------------------------------------------- */

ComputeDpd::ComputeDpd(LAMMPS *lmp, int narg, char **arg) :
  Compute(lmp, narg, arg)
{
  if (narg != 3) error->all(FLERR,"Illegal compute dpd command");

  vector_flag = 1;
  size_vector = 5;
  extvector = 0;
  
  vector = new double[size_vector];
  
  if (atom->dpd_flag != 1) error->all(FLERR,"compute dpd requires atom_style with internal temperature and energies (e.g. dpd)");
}

/* ---------------------------------------------------------------------- */

ComputeDpd::~ComputeDpd()
{

  delete [] vector;

}

/* ---------------------------------------------------------------------- */

void ComputeDpd::compute_vector()
{
  invoked_vector = update->ntimestep;

  double *uCond = atom->uCond;
  double *uMech = atom->uMech;
  double *dpdTheta = atom->dpdTheta;
  int nlocal = atom->nlocal;
  int *mask = atom->mask;
  int natoms;

  dpdU = new double[size_vector];

  for (int i = 0; i < size_vector; i++) dpdU[i] = double(0.0);

  for (int i = 0; i < nlocal; i++){
    if (mask[i] & groupbit){
      dpdU[0] += uCond[i];
      dpdU[1] += uMech[i];
      dpdU[2] += uCond[i] + uMech[i];
      dpdU[3] += 1.0 / dpdTheta[i];
      dpdU[4]++;
    }
  }
    
  MPI_Allreduce(dpdU,vector,size_vector,MPI_DOUBLE,MPI_SUM,world);

  natoms = vector[4];
  vector[3] = natoms / vector[3];

  delete [] dpdU;

}
+60 −0
Original line number Diff line number Diff line
/* ----------------------------------------------------------------------
   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
   http://lammps.sandia.gov, Sandia National Laboratories
   Steve Plimpton, sjplimp@sandia.gov

   Copyright (2003) Sandia Corporation.  Under the terms of Contract
   DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
   certain rights in this software.  This software is distributed under
   the GNU General Public License.

   See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */

/* ----------------------------------------------------------------------
   Contributing author: James Larentzos (Engility Corporation)
------------------------------------------------------------------------- */

#ifdef COMPUTE_CLASS

ComputeStyle(dpd,ComputeDpd)

#else

#ifndef LMP_COMPUTE_DPD_H
#define LMP_COMPUTE_DPD_H

#include "compute.h"

namespace LAMMPS_NS {

class ComputeDpd : public Compute {
 public:
  ComputeDpd(class LAMMPS *, int, char **);
  ~ComputeDpd();
  void init() {}
  void compute_vector();

 private:
  double *dpdU;

};

}

#endif
#endif

/* ERROR/WARNING messages:

E: Illegal ... command

Self-explanatory.  Check the input script syntax and compare to the
documentation for the command.  You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.

E: compute dpd requires atom_style with internal temperature and energies (e.g. dpd)

Self-explanatory.  

*/
Loading