Skip to content

Commit

Permalink
Added runfiles for multielement Gaussian grid
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomDefaultUser committed Dec 2, 2024
1 parent 240ca44 commit a6ff4c3
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 6 deletions.
24 changes: 20 additions & 4 deletions mala/descriptors/atomic_density.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,16 @@ def __calculate_lammps(self, outdir, **kwargs):

# Create LAMMPS instance.
lammps_dict = {
"sigma": self.parameters.atomic_density_sigma,
"rcutfac": self.parameters.atomic_density_cutoff,
}
if len(set(self._atoms.numbers)) == 1:
lammps_dict["sigma"] = self.parameters.atomic_density_sigma
else:
for i in range(len(set(self._atoms.numbers))):
lammps_dict["sigma" + str(i + 1)] = (
self.parameters.atomic_density_sigma
)

lmp = self._setup_lammps(nx, ny, nz, lammps_dict)

# For now the file is chosen automatically, because this is used
Expand All @@ -161,15 +168,24 @@ def __calculate_lammps(self, outdir, **kwargs):
if self.parameters._configuration["mpi"]:
if self.parameters.use_z_splitting:
self.parameters.lammps_compute_file = os.path.join(
filepath, "in.ggrid.python"
filepath,
"in.ggrid_n{0}.python".format(
len(set(self._atoms.numbers))
),
)
else:
self.parameters.lammps_compute_file = os.path.join(
filepath, "in.ggrid_defaultproc.python"
filepath,
"in.ggrid_defaultproc_n{0}.python".format(
len(set(self._atoms.numbers))
),
)
else:
self.parameters.lammps_compute_file = os.path.join(
filepath, "in.ggrid_defaultproc.python"
filepath,
"in.ggrid_defaultproc_n{0}.python".format(
len(set(self._atoms.numbers))
),
)

# Do the LAMMPS calculation and clean up.
Expand Down
25 changes: 25 additions & 0 deletions mala/descriptors/in.ggrid_defaultproc_n2.python
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Calculate Gaussian atomic density descriptors on a 3D grid

# pass in values ngridx, ngridy, ngridz, sigma, atom_config_fname
# using command-line -var option

# Initialize simulation

units metal
read_data ${atom_config_fname}
mass * 1.0


# is this important? or does it just need to be big enough?
variable radelem1 equal 0.5
variable radelem2 equal 0.5
variable rcutneigh equal 2.0*${rcutfac}*${radelem1}

pair_style zero ${rcutneigh}
pair_coeff * *

compute ggrid all gaussian/grid/local grid ${ngridx} ${ngridy} ${ngridz} ${rcutfac} ${radelem1} ${radelem2} ${sigma1} ${sigma2}

thermo_modify norm yes

run 0
32 changes: 32 additions & 0 deletions mala/descriptors/in.ggrid_n1.python
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Calculate Gaussian atomic density descriptors on a 3D grid

# pass in values ngridx, ngridy, ngridz, sigma, atom_config_fname
# using command-line -var option

# set up processor grid to match QE
${lammps_procs}

# Initialize simulation

units metal
read_data ${atom_config_fname}
mass * 1.0


# is this important? or does it just need to be big enough?
variable radelem1 equal 0.5
variable radelem2 equal 0.5
variable rcutneigh equal 2.0*${rcutfac}*${radelem1}

pair_style zero ${rcutneigh}
pair_coeff * *

# set up plane cutoff values to evenly distribute grid points
${zbal}


compute ggrid all gaussian/grid/local grid ${ngridx} ${ngridy} ${ngridz} ${rcutfac} ${radelem1} ${radelem2} ${sigma1} ${sigma2}

thermo_modify norm yes

run 0
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ mass * 1.0


# is this important? or does it just need to be big enough?
variable radelem equal 0.5
variable radelem1 equal 0.5
variable radelem2 equal 0.5
variable rcutneigh equal 2.0*${rcutfac}*${radelem}

pair_style zero ${rcutneigh}
Expand All @@ -24,7 +25,7 @@ pair_coeff * *
${zbal}


compute ggrid all gaussian/grid/local grid ${ngridx} ${ngridy} ${ngridz} ${rcutfac} ${radelem} ${sigma}
compute ggrid all gaussian/grid/local grid ${ngridx} ${ngridy} ${ngridz} ${rcutfac} ${radelem1} ${radelem2} ${sigma1} ${sigma2}

thermo_modify norm yes

Expand Down

0 comments on commit a6ff4c3

Please sign in to comment.