4
$\begingroup$

I am beginner in Lammps. How can I create a single atom in the center of a box? (I am totally new) Thanks.

Actualization:

enter image description here

What is wrong?

Actualization 2.

enter image description here

$\endgroup$
2
  • 1
    $\begingroup$ +1, I saw that you have posted your question twice, so please delete the other one. Thank you $\endgroup$ Jan 1 at 4:37
  • $\begingroup$ ok! Now, it is deleted. $\endgroup$
    – eraldcoil
    Jan 1 at 4:41

1 Answer 1

4
$\begingroup$

In your input script you need to define the atomic coordinates, box dimensions, and atom type. For instance, to create a cubic box with a side length of 10 angstroms, you can use the following:

# Set atom type and properties
atom_style atomic
atom_modify map array sort 0 0


# Box dimensions
lattice fcc 1.0
region box block 0 1 0 1 0 1 units lattice
create_box 1 box
mass 1 1.00794

# Create the single atom at the center of the box
create_atoms 1 single 0.5 0.5 0.5

The atom style is set to atomic, and the atom_modify command is used to specify how the atom information is mapped. Next, the box dimensions are defined using the lattice and region commands, creating a cubic box with a lattice constant of 1.0 Angstrom. The create_box command creates the simulation box based on the region we have defined. Then the mass of atom type 1 is set to the mass of hydrogen as an example (the mass of hydrogen is approximately 1.00794 AMU). finally, The create_atoms command creates a single atom of type 1 at the center of the box. You have to setup other input parameters according to your own purpose.

$\endgroup$
8
  • $\begingroup$ I upped the image of this code. Why appears a lot of atoms? $\endgroup$
    – eraldcoil
    Jan 1 at 4:43
  • $\begingroup$ @eraldcoil, you may check it now, the mass command should be after creating the box, if you still have the error, try to remove the 'atom_modify map array sort 0 0' as it is not necessary in this case. I am sorry I couldn't test that cause I don't have lammps atm. $\endgroup$ Jan 1 at 5:28
  • $\begingroup$ Still not works $\endgroup$
    – eraldcoil
    Jan 1 at 5:38
  • $\begingroup$ Now, it 's work! $\endgroup$
    – eraldcoil
    Jan 1 at 5:44
  • 1
    $\begingroup$ @eraldcoil check the documentation here docs.lammps.org/mass.html, mass command can set the mass of the atomic type either with inded or type label, I took hydrogen as an example with a mass of 1.00794. Another example would have been 'mass C 12.01' in which mass command was used with the label 'C' of carbon and a mass of 12 AMU $\endgroup$ Jan 1 at 6:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .