Pair coeff error.

Hi,

My situation is the following. I am simulating liquid hydrocarbons
between two walls. The fluid is created with moltemplate and throuhg a
read_data call I load it. The walls are created with lattice command. I
am trying to create the bonds in the lattice using create_bonds but I am
getting this error when lammps get to the line this command is called.

LAMMPS log:

LAMMPS (15 May 2015)
Reading data file ...
  orthogonal box = (0 0 -27.5) to (48.96 48.96 72.5)
  1 by 2 by 4 MPI processor grid
  reading atoms ...
  5000 atoms
  scanning bonds ...
  4 = max bonds/atom
  scanning angles ...
  6 = max angles/atom
  scanning dihedrals ...
  15 = max dihedrals/atom
  reading bonds ...
  4900 bonds
  reading angles ...
  9600 angles
  reading dihedrals ...
  13500 dihedrals
Finding 1-2 1-3 1-4 neighbors ...
Special bond factors lj: 0 0 0
Special bond factors coul: 0 0 0
  4 = max # of 1-2 neighbors
  6 = max # of 1-3 neighbors
  12 = max # of 1-4 neighbors
  16 = max # of special neighbors
HERE1
Lattice spacing in x,y,z = 4.08 4.08 4.08
Created 5184 atoms
Created 5184 atoms
5184 atoms in group lower_g
5184 atoms in group upper_g
Setting atom values ...
  5184 settings made for type
Setting atom values ...
  5184 settings made for type
10368 atoms in group wall_g
5000 atoms in group flow_g
HERE2
ERROR: All pair coeffs are not set (../pair.cpp:218)

If I run the same code but without creating bonds in the lattice (just
pair interactions) it works perfectly. If you check below "HERE3"
message is not printed so the problem is with created_bond call.

I have this set up:

- system.inint

Data file with the information about the system, atom positions and
bonds, but *not* bond/angle/pair/dihedral coefficients.

-system.init:

    units real
    atom_style full
    bond_style harmonic
    angle_style harmonic
    dihedral_style opls
    pair_style lj/cut/coul/long 10.0 10.0
    pair_modify mix geometric
    boundary p p f

-system.walls:

lattice fcc 4.08
region lower_reg block INF INF INF INF INF 10.0 units box
create_atoms 4 region lower_reg units box
region upper_reg block INF INF INF INF 35.0 INF units box
create_atoms 4 region upper_reg units box
group lower_g region lower_reg
group upper_g region upper_reg
set group lower_g type 4
set group upper_g type 4
group wall_g union lower_g upper_g
group flow_g subtract all wall_g

bond_coeff 7 20 2.885
print "HERE2"
create_bonds upper_g upper_g 7 0.0 5.0
create_bonds lower_g lower_g 7 0.0 5.0
print "HERE3"

- system.settings

    # Kspace configuration
    special_bonds lj/coul 0.0 0.0 0.5
    kspace_style pppm 0.0001
    kspace_modify slab 3.0
    # Coefficients
    pair_coeff 1 1 0.066 3.5
    pair_coeff 2 2 0.066 3.5
    pair_coeff 3 3 0.03 2.5
    pair_coeff 4 4 2.6250 2.655
    bond_coeff 1 268.0 1.529
    bond_coeff 2 268.0 1.529
    bond_coeff 3 268.0 1.529
    bond_coeff 4 268.0 1.529
    bond_coeff 5 340.0 1.09
    bond_coeff 6 340.0 1.09
    .
    .
    .
    continue...

In the main script I include the file this way:

include system.init
include system.data
include sytem.walls
include system.settings

I have tried everything I could but cannot make it works. Do not know
what has to do bond creation with pair coefficient definition.

Thanks in advance,

Eduardo

Hi,

My situation is the following. I am simulating liquid hydrocarbons
between two walls. The fluid is created with moltemplate and throuhg a
read_data call I load it. The walls are created with lattice command. I
am trying to create the bonds in the lattice using create_bonds but I am
getting this error when lammps get to the line this command is called.

LAMMPS log:

LAMMPS (15 May 2015)
Reading data file ...
  orthogonal box = (0 0 -27.5) to (48.96 48.96 72.5)
  1 by 2 by 4 MPI processor grid
  reading atoms ...
  5000 atoms
  scanning bonds ...
  4 = max bonds/atom
  scanning angles ...
  6 = max angles/atom
  scanning dihedrals ...
  15 = max dihedrals/atom
  reading bonds ...
  4900 bonds
  reading angles ...
  9600 angles
  reading dihedrals ...
  13500 dihedrals
Finding 1-2 1-3 1-4 neighbors ...
Special bond factors lj: 0 0 0
Special bond factors coul: 0 0 0
  4 = max # of 1-2 neighbors
  6 = max # of 1-3 neighbors
  12 = max # of 1-4 neighbors
  16 = max # of special neighbors
HERE1
Lattice spacing in x,y,z = 4.08 4.08 4.08
Created 5184 atoms
Created 5184 atoms
5184 atoms in group lower_g
5184 atoms in group upper_g
Setting atom values ...
  5184 settings made for type
Setting atom values ...
  5184 settings made for type
10368 atoms in group wall_g
5000 atoms in group flow_g
HERE2
ERROR: All pair coeffs are not set (../pair.cpp:218)

If I run the same code but without creating bonds in the lattice (just
pair interactions) it works perfectly. If you check below "HERE3"
message is not printed so the problem is with created_bond call.

I have this set up:

- system.inint

Data file with the information about the system, atom positions and
bonds, but *not* bond/angle/pair/dihedral coefficients.

-system.init:

    units real
    atom_style full
    bond_style harmonic
    angle_style harmonic
    dihedral_style opls
    pair_style lj/cut/coul/long 10.0 10.0
    pair_modify mix geometric
    boundary p p f

-system.walls:

lattice fcc 4.08
region lower_reg block INF INF INF INF INF 10.0 units box
create_atoms 4 region lower_reg units box
region upper_reg block INF INF INF INF 35.0 INF units box
create_atoms 4 region upper_reg units box
group lower_g region lower_reg
group upper_g region upper_reg
set group lower_g type 4
set group upper_g type 4
group wall_g union lower_g upper_g
group flow_g subtract all wall_g

bond_coeff 7 20 2.885
print "HERE2"
create_bonds upper_g upper_g 7 0.0 5.0
create_bonds lower_g lower_g 7 0.0 5.0
print "HERE3"

- system.settings

    # Kspace configuration
    special_bonds lj/coul 0.0 0.0 0.5
    kspace_style pppm 0.0001
    kspace_modify slab 3.0
    # Coefficients
    pair_coeff 1 1 0.066 3.5
    pair_coeff 2 2 0.066 3.5
    pair_coeff 3 3 0.03 2.5
    pair_coeff 4 4 2.6250 2.655
    bond_coeff 1 268.0 1.529
    bond_coeff 2 268.0 1.529
    bond_coeff 3 268.0 1.529
    bond_coeff 4 268.0 1.529
    bond_coeff 5 340.0 1.09
    bond_coeff 6 340.0 1.09
    .
    .
    .
    continue...

In the main script I include the file this way:

include system.init
include system.data
include sytem.walls
include system.settings

I have tried everything I could but cannot make it works. Do not know
what has to do bond creation with pair coefficient definition.

from the create_bonds documentation:

An additional requirement is that your system must be ready to perform
a simulation. This means, for example, that all pair_style
coefficients be set via the pair_coeff command. A bond_style command
and all bond coefficients must also be set, even if no bonds exist
before this command is invoked. This is because the building of
neighbor list requires initialization and setup of a simulation,
similar to what a run command would require.

axel.

Thanks Axel for your time.

I reorganized everything so now all bonds/pairs are defined before
calling create_atoms. But I think there is something wrong with
create_bonds because in this case:

.
.
.
print "HERE2"
create_bonds upper_g upper_g 7 0.0 5.0
create_bonds lower_g lower_g 7 0.0 5.0
print "HERE3"
kspace_style pppm 0.0001
kspace_modify slab 3.0
special_bonds lj/coul 0.0 0.0 0.5

I get:

HERE2
ERROR: Pair style requires a KSpace style
(../pair_lj_cut_coul_long.cpp:706)

Then following this I first define a kspace_style:

kspace_style pppm 0.0001
kspace_modify slab 3.0
print "HERE2"
create_bonds upper_g upper_g 7 0.0 5.0
create_bonds lower_g lower_g 7 0.0 5.0
print "HERE3"
special_bonds lj/coul 0.0 0.0 0.5

And get:

HERE2
ERROR: Create_bonds command requires no kspace_style be defined
(../create_bonds.cpp:105)

Which is what the docummentation claims. But then there is a circular
dependency of cannot-be-defined/need-to-be-defined. Maybe you or other
one in the list have a clue about what is happening but to my begginer's
eyes seems like a bug.

Regards,

Eduardo

P.S: BTW I am a MSc student at Imperial College London in Theory and
Simulation of Materials --I read you like to know who you are e-mailing
to. :slight_smile:

Hi,

Which is what the docummentation claims. But then there is a circular
dependency of cannot-be-defined/need-to-be-defined. Maybe you or other
one in the list have a clue about what is happening but to my begginer's
eyes seems like a bug.

The documentation states "no kspace_style defined".

The documentation also suggests the following:
1. define your simulation parameters with no kspace
2. use create_bonds
3. modify the simulation parameters to replace the interactions, enabling kspace

or at least this is what I understand by """Note that you can change any of
these settings after this command executes, e.g. if you wish to use long-range
Coulombic interactions via the kspace_style command for your subsequent
simulation. """

Pierre

Hi Pierre,

Thanks, I see the point. Maybe it is me, but it would be better to
automatically turn the pair_style with culombic interactions off in the
fix code and then re-stablish the pair_style given by the user. It would
be more clean this way IMHO.

Thanks all!

Edu

The create_bonds doc page explains why you need to have
defined a pair style with appropriate cutoff, special bonds
settings, etc.

But you can do what is needed very simply:

create_atoms

pair_style lj/cut 10.0
pair_coeff * *
bond_style harmonic
bond_coeff * 1.0 1.0

create_bonds ...

# actual settings
pair_style foo
pair_coeff ...
bond_style foo
bond_coeff ...
kspace_style foo
special_bonds ...
other settings

I.e. Just use lj/cut with an appropriate cutoff for your created bond
lengths,
with pair_coeff * *, ditto a simple bond style, create your bonds,
then setup the real params for your system.

It would be possible, I suppose, for LAMMPS to set aside everything
you may (or may not) have already setup, create its own pair style and
other settings,
then restore what you had before. But there might be other problems with
that I'm not thinking of ...

Steve