Dear Lammps users,

I'm trying to make a crystalmaker generator program, The program

should be able to generate FCC, BCC, and a custom lattice basis

structure, if the primitive lattice vectors and the positions of the

atoms (basis) are given. I have sucesfully created a BCC and FCC

structure. The algorithm is as follow ..1). Define the primitive

lattice vectos 2). Translatre the cell R = na1 + ma2 + la3 , where

n,m,l are integers, and 3). Create the conventional cell , and then

defining a cuting radious (look the source code below). I tried to

open Lammps source code "Lattice.cpp " , and reuse it as part of my

source code , but i have failed to grasp the idea behind creation of a

custum lattice structue. Can someone please explain me how lammps

creates a custum lattice ?

Thank you

Oscar Guerrero .

// RCUT SECTION for BCC and FCC crystal structure only

// create a spherical octant region around the cell box then cut atoms

// creating paraleliped (put atoms inside conventional cell) use

1.3*radius cut is fine

radius = sqrt(rcutx*rcutx + rcuty*rcuty + rcutz*rcutz);

for (int i = 1; i <= 1.3*radius; i++){

for (int j = 1; j <= 1.3*radius; j++){

for (int k = 1; k <= 1.3*radius; k++){

x = i*arg1[0] + j*arg2[0] + k*arg3[0];

y = i*arg1[1] + j*arg2[1] + k*arg3[1];

z = i*arg1[2] + j*arg2[2] + k*arg3[2];

if( (x <= a*rcutx) && (x > 0) ){

if( (y <= a*rcuty) && (y > 0) ){

if( (z <= a*rcutz) && (z > 0) ){

store.rx.push_back (x);

store.ry.push_back (y);

store.rz.push_back (z);

total_atoms = total_atoms + 1 ;

// the if conditional is used to ignore atoms are outside the

conventional cubic cell

}}}}}}