-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged collection of updates for the latest aiida, aiida-vasp, and ph…
…onopy
- Loading branch information
Showing
67 changed files
with
1,770 additions
and
21,427 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
*.py[cod] | ||
*~ | ||
MANIFEST | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Packages | ||
*.egg | ||
*.egg-info | ||
dist | ||
build | ||
eggs | ||
parts | ||
bin | ||
var | ||
sdist | ||
develop-eggs | ||
.installed.cfg | ||
lib | ||
lib64 | ||
|
||
# Installer logs | ||
pip-log.txt | ||
|
||
# Unit test / coverage reports | ||
.coverage | ||
.tox | ||
nosetests.xml | ||
|
||
# Translations | ||
*.mo | ||
|
||
# Mr Developer | ||
.mr.developer.cfg | ||
.project | ||
.pydevproject | ||
|
||
# Doc | ||
.buildinfo | ||
.doctrees | ||
_build |
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,20 +1,6 @@ | ||
|
||
AiiDA Phonopy plugin | ||
==================== | ||
|
||
This a phonopy plugin for AiiDA. This plugin includes workflows to calculate | ||
phonon band structure, DOS, thermal properties and mode Gruneisen parameters. | ||
It provides interfaces for VASP, Quantum ESPRESSO and LAMMPS to calculate the | ||
atomic forces and relax the crystal structure. | ||
|
||
|
||
Examples | ||
-------- | ||
Some test calculations are found in the folder **/examples** | ||
|
||
- plugins: examples of basic functionality of phonopy remote plugin. These tests require | ||
the previous calculation of forces or force constants that should be already stored in the database | ||
- workchains: examples of the full phonon calculation / gruneisen parameters from scratch. These workflows | ||
require the installation of plugins for VASP, LAMMPS or QuantumESPRESSO. | ||
- tools: example scripts for visualize the results of phonon/gruneisen workchains. These scripts require | ||
matplotlib. | ||
This a phonopy plugin for AiiDA. This plugin includes workflows to | ||
calculate phonons with supercell and finite displacement approaches. | ||
Currently it provides interfaces only to VASP. |
File renamed without changes.
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,120 @@ | ||
from aiida.common import CalcInfo, CodeInfo | ||
from aiida.plugins import DataFactory | ||
from aiida_phonopy.common.raw_parsers import (get_BORN_txt, | ||
get_phonopy_conf_file_txt, | ||
get_poscar_txt) | ||
|
||
Dict = DataFactory('dict') | ||
StructureData = DataFactory('structure') | ||
ArrayData = DataFactory('array') | ||
|
||
|
||
class BasePhonopyCalculation(object): | ||
""" | ||
A basic plugin for calculating force constants using Phonopy. | ||
Requirement: the node should be able to import phonopy if NAC is used | ||
""" | ||
|
||
_INPUT_CELL = 'POSCAR' | ||
_INPUT_FORCE_SETS = 'FORCE_SETS' | ||
_INPUT_NAC = 'BORN' | ||
|
||
@classmethod | ||
def _baseclass_use_methods(cls, spec): | ||
spec.input('settings', valid_type=Dict, required=True, | ||
help=('Use a node that specifies the phonopy ' | ||
'parameters for the namelists')) | ||
spec.input('structure', valid_type=StructureData, required=True, | ||
help=('Use a node for the structure')) | ||
spec.input('force_sets', valid_type=ArrayData, required=False, | ||
help=('Use a node that specifies the force_sets ' | ||
'array for the namelists')) | ||
spec.input('nac_params', valid_type=ArrayData, required=False, | ||
help=('Use a node for the Non-analitical ' | ||
'corrections parameters arrays')) | ||
spec.input('primitive', valid_type=StructureData, | ||
required=False, help=('Use a node for the structure')) | ||
spec.input('metadata.options.withmpi', valid_type=bool, default=False) | ||
|
||
def _create_additional_files(self, folder): | ||
pass | ||
|
||
def prepare_for_submission(self, folder): | ||
"""Create the input files from the input nodes passed to this instance of the `CalcJob`. | ||
:param folder: an `aiida.common.folders.Folder` to temporarily write files on disk | ||
:return: `aiida.common.datastructures.CalcInfo` instance | ||
""" | ||
|
||
self.logger.info("prepare_for_submission") | ||
|
||
self._internal_retrieve_list = [] | ||
self._additional_cmd_params = [] | ||
self._calculation_cmd = [] | ||
|
||
settings = self.inputs.settings | ||
structure = self.inputs.structure | ||
code = self.inputs.code | ||
|
||
############################## | ||
# END OF INITIAL INPUT CHECK # | ||
############################## | ||
|
||
# ================= prepare the python input files ================= | ||
|
||
self._create_additional_files(folder) | ||
|
||
cell_txt = get_poscar_txt(structure) | ||
input_txt = get_phonopy_conf_file_txt(settings) | ||
|
||
input_filename = folder.get_abs_path( | ||
self.inputs.metadata.options.input_filename) | ||
with open(input_filename, 'w') as infile: | ||
infile.write(input_txt) | ||
|
||
cell_filename = folder.get_abs_path(self._INPUT_CELL) | ||
with open(cell_filename, 'w') as infile: | ||
infile.write(cell_txt) | ||
|
||
if ('nac_params' in self.inputs and | ||
'primitive' in self.inputs): | ||
born_txt = get_BORN_txt( | ||
self.inputs.nac_params, | ||
self.inputs.primitive, | ||
settings['symmetry_tolerance']) | ||
|
||
nac_filename = folder.get_abs_path(self._INPUT_NAC) | ||
with open(nac_filename, 'w') as infile: | ||
infile.write(born_txt) | ||
for params in self._additional_cmd_params: | ||
params.append('--nac') | ||
|
||
# ============================ calcinfo =============================== | ||
|
||
local_copy_list = [] | ||
remote_copy_list = [] | ||
|
||
calcinfo = CalcInfo() | ||
|
||
calcinfo.uuid = self.uuid | ||
|
||
# Empty command line by default | ||
calcinfo.local_copy_list = local_copy_list | ||
calcinfo.remote_copy_list = remote_copy_list | ||
|
||
# Retrieve files | ||
calcinfo.retrieve_list = self._internal_retrieve_list | ||
|
||
calcinfo.codes_info = [] | ||
for default_params, additional_params in zip( | ||
self._calculation_cmd, self._additional_cmd_params): | ||
codeinfo = CodeInfo() | ||
codeinfo.cmdline_params = ( | ||
[self.inputs.metadata.options.input_filename, ] | ||
+ default_params + additional_params) | ||
codeinfo.code_uuid = code.uuid | ||
codeinfo.stdout_name = self.inputs.metadata.options.output_filename | ||
codeinfo.withmpi = False | ||
calcinfo.codes_info.append(codeinfo) | ||
|
||
return calcinfo |
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
Oops, something went wrong.