Commit 16911adc authored by julient31's avatar julient31
Browse files

Commit1 JT 083018

- started to work on ewald_dipole (not yet triclinic)
- compiles and runs (no memory issue)
- check the energy accuracy
parent cf1d421e
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -23,11 +23,12 @@ velocity all create 1.0 87287
#pair_coeff	* * 1.0 1.0 2.5
#pair_coeff      * 2 1.0 1.0 5.0
pair_style      lj/cut/dipole/long 3.0
pair_coeff      * * 1.0 1.0
pair_coeff      * * 0.0 0.0

#kspace_style    pppm/disp 1.0e-4
kspace_style    pppm/dipole 1.0e-4
kspace_modify   gewald/disp 0.1
#kspace_style    pppm/dipole 1.0e-4
kspace_style    ewald/dipole 1.0e-4
kspace_modify   gewald 0.1

neighbor	0.3 bin
neigh_modify	every 2 delay 4 check yes
+4 −3
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ boundary p p p
atom_modify 	map array 

lattice 	hcp 2.5071
region 		box block 0.0 20.0 0.0 20.0 0.0 8.0
region 		box block 0.0 8.0 0.0 8.0 0.0 8.0
create_box 	1 box
create_atoms 	1 box

@@ -33,7 +33,7 @@ neighbor 0.1 bin
neigh_modify 	every 10 check yes delay 20

kspace_style pppm/dipole/spin 1.0e-4

kspace_modify mesh 32 32 32
#fix 		1 all precession/spin zeeman 1.0 0.0 0.0 1.0
fix 		1 all precession/spin zeeman 0.0 0.0 0.0 1.0
fix 		2 all langevin/spin 0.0 0.0 21
@@ -58,4 +58,5 @@ thermo 10
compute 	outsp all property/atom spx spy spz sp fmx fmy fmz
dump 		100 all custom 1 dump_cobalt_hcp.lammpstrj type x y z c_outsp[1] c_outsp[2] c_outsp[3]

run 		20000
#run 		20000
run 		1
+847 −0

File added.

Preview size limit exceeded, changes collapsed.

+104 −0
Original line number Diff line number Diff line
/* -*- c++ -*- ----------------------------------------------------------
   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.
------------------------------------------------------------------------- */

#ifdef KSPACE_CLASS

KSpaceStyle(ewald/dipole,EwaldDipole)

#else

#ifndef LMP_EWALD_DIPOLE_H
#define LMP_EWALD_DIPOLE_H

#include "ewald.h"

namespace LAMMPS_NS {

class EwaldDipole : public Ewald {
 public:
  EwaldDipole(class LAMMPS *, int, char **);
  virtual ~EwaldDipole();
  void init();
  void setup();
  virtual void compute(int, int);

 protected:
  double musum,musqsum,mu2;
  double **muk; 		// mu_i dot k

  void musum_musq(); 
  double rms_dipole(int, double, bigint);
  virtual void eik_dot_r();
  void slabcorr();

  // triclinic

  //void eik_dot_r_triclinic();

};

}

#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: Cannot use EwaldDipole with 2d simulation

The kspace style ewald cannot be used in 2d simulations.  You can use
2d EwaldDipole in a 3d simulation; see the kspace_modify command.

E: Kspace style requires atom attribute q

The atom style defined does not have these attributes.

E: Cannot use nonperiodic boundaries with EwaldDipole

For kspace style ewald, all 3 dimensions must have periodic boundaries
unless you use the kspace_modify command to define a 2d slab with a
non-periodic z dimension.

E: Incorrect boundaries with slab EwaldDipole

Must have periodic x,y dimensions and non-periodic z dimension to use
2d slab option with EwaldDipole.

E: Cannot (yet) use EwaldDipole with triclinic box and slab correction

This feature is not yet supported.

E: KSpace style is incompatible with Pair style

Setting a kspace style requires that a pair style with matching
long-range Coulombic or dispersion components be used.

E: KSpace accuracy must be > 0

The kspace accuracy designated in the input must be greater than zero.

E: Must use 'kspace_modify gewald' for uncharged system

UNDOCUMENTED

E: Cannot (yet) use K-space slab correction with compute group/group for triclinic systems

This option is not yet supported.

*/
+0 −3
Original line number Diff line number Diff line
@@ -100,9 +100,6 @@ PPPM::PPPM(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg),
  nyhi_in = nylo_in = nyhi_out = nylo_out = 0;
  nzhi_in = nzlo_in = nzhi_out = nzlo_out = 0;

  // test 
  nlower = nupper = 0;

  density_brick = vdx_brick = vdy_brick = vdz_brick = NULL;
  density_fft = NULL;
  u_brick = NULL;
Loading