-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from jjmaldonis/master
started adding pieces of the functionality
- Loading branch information
Showing
39 changed files
with
1,403 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
{ | ||
"globals": | ||
{ | ||
"USE_MPI4PY": true | ||
}, | ||
"generators": { | ||
"structure_type": "cluster", | ||
"initializers": [ | ||
{ | ||
"number_of_individuals": 5, | ||
"data": { | ||
"filenames": [ | ||
"/home/jmaldonis/StructOpt_modular/examples/Au18/structure1.xyz", | ||
"/home/jmaldonis/StructOpt_modular/examples/Au18/structure2.xyz", | ||
"/home/jmaldonis/StructOpt_modular/examples/Au18/structure3.xyz", | ||
"/home/jmaldonis/StructOpt_modular/examples/Au18/structure4.xyz", | ||
"/home/jmaldonis/StructOpt_modular/examples/Au18/structure5.xyz" | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
"fitnesses": | ||
{ | ||
"modules": [ | ||
"LAMMPS", | ||
"FEMSIM" | ||
], | ||
"weights": [ | ||
1.0, | ||
1.0 | ||
], | ||
"FEMSIM": { | ||
"parameter_filename": "/home/maldonis/USIT/StructOpt/StructOpt/fitness/FEMSIM/femsim-hrmc/parameters/femsim.in", | ||
"vk_data_filename": "/home/maldonis/USIT/StructOpt/StructOpt/fitness/FEMSIM/femsim-hrmc/data/fem_exp_Zr50Cu35Al15_t3.txt", | ||
"xsize": 28.2842712474619, | ||
"ysize": 28.2842712474619, | ||
"zsize": 28.2842712474619, | ||
"Q": 0.0305, | ||
"nphi": 1, | ||
"npsi": 40, | ||
"ntheta": 20, | ||
"thickness_scaling_factor": 28.6378 | ||
}, | ||
"LAMMPS":{ | ||
"keep_files": true, | ||
"min_style": "cg\nmin_modify line quadratic", | ||
"minimize": "1e-8 1e-8 5000 10000", | ||
"pair_style": "eam", | ||
"parallel": true, | ||
"potential_file": "/home/jmaldonis/StructOpt/examples/Au18/Au_u3.eam", | ||
"thermo_steps": 1000 | ||
} | ||
}, | ||
"relaxations": | ||
{ | ||
"modules": [ | ||
"LAMMPS" | ||
], | ||
"LAMMPS":{ | ||
"keep_files": true, | ||
"min_style": "cg\nmin_modify line quadratic", | ||
"minimize": "1e-8 1e-8 5000 10000", | ||
"pair_style": "eam", | ||
"parallel": true, | ||
"potential_file": "/home/jmaldonis/StructOpt/examples/Au18/Au_u3.eam", | ||
"thermo_steps": 1000 | ||
} | ||
}, | ||
"mutations": { | ||
"options": [ | ||
"move_atoms", | ||
"swap_positions", | ||
"swap_species", | ||
"rotate_atoms", | ||
"rotate_cluster" | ||
] | ||
}, | ||
"fingerprinters": { | ||
"options": [] | ||
}, | ||
|
||
"crossovers": { | ||
"options": ["do_nothing"] | ||
}, | ||
"predators": { | ||
"options": ["do_nothing"] | ||
}, | ||
"selections": { | ||
"options": ["do_nothing"] | ||
}, | ||
|
||
"fileio": {}, | ||
"postprocessing": {}, | ||
"tools": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
4 | ||
10.0 10.0 10.0 | ||
Zr 1.0 1.0 1.0 | ||
Zr 2.0 2.0 2.0 | ||
Zr 3.0 3.0 3.0 | ||
Zr 4.0 4.0 4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
4 | ||
10.0 10.0 10.0 | ||
Zr 1.0 1.0 1.0 | ||
Zr 2.0 2.0 2.0 | ||
Zr 3.0 3.0 3.0 | ||
Zr 4.0 4.0 4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
4 | ||
10.0 10.0 10.0 | ||
Zr 1.0 1.0 1.0 | ||
Zr 2.0 2.0 2.0 | ||
Zr 3.0 3.0 3.0 | ||
Zr 4.0 4.0 4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
4 | ||
10.0 10.0 10.0 | ||
Zr 1.0 1.0 1.0 | ||
Zr 2.0 2.0 2.0 | ||
Zr 3.0 3.0 3.0 | ||
Zr 4.0 4.0 4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
4 | ||
10.0 10.0 10.0 | ||
Zr 1.0 1.0 1.0 | ||
Zr 2.0 2.0 2.0 | ||
Zr 3.0 3.0 3.0 | ||
Zr 4.0 4.0 4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
rm cluster/*.pyc | ||
rm cluster/individual/*.pyc | ||
rm cluster/population/*.pyc | ||
rm common/*.pyc | ||
rm common/individual/*.pyc | ||
rm common/individual/fingerprinters/*.pyc | ||
rm common/individual/fitnesses/*.pyc | ||
rm common/individual/generators/*.pyc | ||
rm common/individual/mutations/*.pyc | ||
rm common/individual/relaxations/*.pyc | ||
rm common/population/*.pyc | ||
rm common/population/crossovers/*.pyc | ||
rm common/population/fitnesses/*.pyc | ||
rm common/population/predators/*.pyc | ||
rm common/population/relaxations/*.pyc | ||
rm common/population/selections/*.pyc | ||
rm crystal/*.pyc | ||
rm crystal/individual/*.pyc | ||
rm crystal/population/*.pyc | ||
rm defect/*.pyc | ||
rm defect/individual/*.pyc | ||
rm defect/population/*.pyc | ||
rm fileio/*.pyc | ||
rm postprocessing/*.pyc | ||
rm surface/*.pyc | ||
rm surface/individual/*.pyc | ||
rm surface/population/*.pyc | ||
rm tools/*.pyc | ||
|
||
rm -rf cluster/__pycache__ | ||
rm -rf cluster/individual/pycache__ | ||
rm -rf cluster/population/pycache__ | ||
rm -rf common/pycache__ | ||
rm -rf common/individual/pycache__ | ||
rm -rf common/individual/fingerprinters/pycache__ | ||
rm -rf common/individual/fitnesses/pycache__ | ||
rm -rf common/individual/generators/pycache__ | ||
rm -rf common/individual/mutations/pycache__ | ||
rm -rf common/individual/relaxations/pycache__ | ||
rm -rf common/population/pycache__ | ||
rm -rf common/population/crossovers/pycache__ | ||
rm -rf common/population/fitnesses/pycache__ | ||
rm -rf common/population/predators/pycache__ | ||
rm -rf common/population/relaxations/pycache__ | ||
rm -rf common/population/selections/pycache__ | ||
rm -rf crystal/pycache__ | ||
rm -rf crystal/individual/pycache__ | ||
rm -rf crystal/population/pycache__ | ||
rm -rf defect/pycache__ | ||
rm -rf defect/individual/pycache__ | ||
rm -rf defect/population/pycache__ | ||
rm -rf fileio/pycache__ | ||
rm -rf postprocessing/pycache__ | ||
rm -rf surface/pycache__ | ||
rm -rf surface/individual/pycache__ | ||
rm -rf surface/population/pycache__ | ||
rm -rf tools/pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import individual, population |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,41 @@ | ||
import functools | ||
import numpy as np | ||
|
||
import structopt | ||
from structopt.common.individual import Individual | ||
from .read_xyz import read_xyz | ||
|
||
|
||
def generate(individual, *args, **kwargs): | ||
def generate(individual, **kwargs): | ||
""" Uses the relevant parameters from structopt to intialize the input Individual by modifying it in-place. | ||
Args: | ||
individual (Individual): an Individual that is uninitialized | ||
*args, **kwargs: arguments for either ase.Atoms or a different generator function | ||
**kwargs: keyword arguments for either ase.Atoms or a different generator function | ||
""" | ||
if 'filenames' in kwargs: | ||
filename = kwargs['filenames'][individual.index] | ||
atoms = read_xyz(filename) | ||
individual.extend(atoms) | ||
#individual.set_atomic_numbers(atoms.get_atomic_numbers()) | ||
#individual.set_charges(atoms.get_charges()) | ||
#individual.set_chemical_symbols(atoms.get_chemical_symbols()) | ||
#individual.set_initial_magnetic_moments(atoms.get_initial_magnetic_moments()) | ||
#individual.set_masses(atoms.get_masses()) | ||
#individual.set_momenta(atoms.get_momenta()) | ||
#individual.set_positions(atoms.get_positions()) | ||
#individual.set_scaled_positions(atoms.get_scaled_positions()) | ||
#individual.set_tags(atoms.get_tags()) | ||
#individual.set_velocities(atoms.get_velocities()) | ||
|
||
individual.set_pbc(True) | ||
with open(filename) as of: | ||
of.readline() # number of atoms | ||
sizes = of.readline() # comment == box size | ||
sizes = sizes.split()[:3] | ||
sizes = [float(x) for x in sizes] | ||
cell = np.identity(3) | ||
np.fill_diagonal(cell, sizes) | ||
individual.set_cell(cell) | ||
|
||
return None | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import structopt.fileio | ||
|
||
def read_xyz(filename): | ||
return structopt.fileio.read_xyz(filename) |
Oops, something went wrong.