Skip to content

Commit

Permalink
Merge branch 'retrieve_Jij_files'
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippRue committed Nov 19, 2018
2 parents fe7f39a + 5d48bc5 commit b29a6f4
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 11 deletions.
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Changelog

## Conventions used for this changelog

- keep it concise but human readable
- keep the *UNRELEASED* section up to date with the `develop` branch
- create a new subsection for each release version
- each version should have the following information:
- a release date in the format `YYYY-MM-DD`
- a list of added new feature
- a list of changed functionnality of existing features
- a list of deprecated features (features that will be deleted in a future release)
- a list of removed feature (previously marked deprecated)
- a list of bug fixes

----

## *UNRELEASED* (last updated: 2018-11-19)

**Here we collect the list of *added*, *changed*, *deprecated*, *removed* and *fixed* features in preparation for the next release.**

Start of large KKR repository holding *voronoi*, *KKRhost*, *KKRimp*, *KKRsusc*, and *PKKprime* with major refactoring of code structure.


### Added
- None

### Changed
- kkr calculation retrieves Jij files

### Deprecated
- KKRimporter calculation now also retrieves Jij files

### Removed
- None

### Fixed
- None

----

17 changes: 16 additions & 1 deletion aiida_kkr/calculations/kkr.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
__copyright__ = (u"Copyright (c), 2017, Forschungszentrum Jülich GmbH, "
"IAS-1/PGI-1, Germany. All rights reserved.")
__license__ = "MIT license, see LICENSE.txt file"
__version__ = "0.6"
__version__ = "0.7"
__contributors__ = ("Jens Broeder", "Philipp Rüßmann")


Expand Down Expand Up @@ -93,6 +93,9 @@ def _init_internal_params(self):
self._KKRFLEX_INTERCELL_REF = 'kkrflex_intercell_ref'
self._KKRFLEX_INTERCELL_CMOMS = 'kkrflex_intercell_cmoms'
self._ALL_KKRFLEX_FILES = [self._KKRFLEX_GREEN, self._KKRFLEX_TMAT, self._KKRFLEX_ATOMINFO, self._KKRFLEX_INTERCELL_REF, self._KKRFLEX_INTERCELL_CMOMS]
# Jij files
self._Jij_ATOM = 'Jij.atom%0.5i'
self._SHELLS_DAT = 'shells.dat'

# template.product entry point defined in setup.json
self._default_parser = 'kkr.kkrparser'
Expand Down Expand Up @@ -539,6 +542,18 @@ def _prepare_for_submission(self, tempfolder, inputdict):
add_files.append((self._QDOS_ATOM%(iatom+1, ispin+1)).replace(' ','0'))
calcinfo.retrieve_list += add_files

# 4. Jij calculation
retrieve_Jij_files = False
if 'RUNOPT' in parameters.get_dict().keys():
runopts = parameters.get_dict()['RUNOPT']
if runopts is not None :
stripped_run_opts = [i.strip() for i in runopts]
if 'XCPL' in stripped_run_opts:
retrieve_Jij_files = True
if retrieve_Jij_files:
add_files = [self._SHELLS_DAT] + [self._Jij_ATOM%iatom for iatom in range(1,natom+1)]
print('adding files for Jij output', add_files)
calcinfo.retrieve_list += add_files

codeinfo = CodeInfo()
codeinfo.cmdline_params = []
Expand Down
18 changes: 13 additions & 5 deletions aiida_kkr/calculations/kkrimporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
__copyright__ = (u"Copyright (c), 2017, Forschungszentrum Jülich GmbH, "
"IAS-1/PGI-1, Germany. All rights reserved.")
__license__ = "MIT license, see LICENSE.txt file"
__version__ = "0.1"
__version__ = "0.2"
__contributors__ = ("Philipp Rüßmann")


Expand Down Expand Up @@ -215,12 +215,20 @@ def _prepare_for_retrieval(self, open_transport):
# Manually set the files that will be copied to the repository and that
# the parser will extract the results from. This would normally be
# performed in self._prepare_for_submission prior to submission.

natom = 1000 # maximal number of atom-resolved files that are retrieved
# TODO take actual natom value (maybe extract from number of files that are there)
self._set_attr('retrieve_list',
[self._DEFAULT_OUTPUT_FILE, self._NONCO_ANGLES_OUT,
self._OUTPUT_0_INIT, self._OUTPUT_000, self._OUTPUT_2,
[self._INPUT_FILE_NAME, # inputcard needed for parsing
self._DEFAULT_OUTPUT_FILE, # out_kkr, std shell output
self._NONCO_ANGLES_OUT, # nonco angles files
self._OUTPUT_0_INIT, self._OUTPUT_000, self._OUTPUT_2, # output files in new(er) style
'output.0','output.1a','output.1b','output.1c','output.2', # try to import old style output
self._OUT_TIMING_000,
self._OUT_POTENTIAL, self._SHAPEFUN]) # make sure to retrieve potential and shapefun as well
self._OUT_TIMING_000, # timing file
self._OUT_POTENTIAL, self._SHAPEFUN # make sure to retrieve potential and shapefun as well
# add Jij files etc for other run options
] + [self._SHELLS_DAT] + [self._Jij_ATOM%iatom for iatom in range(1,natom+1)]
)
self._set_attr('retrieve_singlefile_list', [])

# Make sure the calculation and input links are stored.
Expand Down
18 changes: 16 additions & 2 deletions aiida_kkr/tools/common_workfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,16 @@ def structure_from_params(parameters):
"""
from aiida_kkr.tools.common_functions import get_aBohr2Ang
from aiida.common.constants import elements as PeriodicTableElements
from aiida_kkr.tools.kkr_params import kkrparams
from numpy import array
StructureData = DataFactory('structure')

is_complete = True
#check input
if not isinstance(parameters, kkrparams):
raise InputValidationError('input parameters needs to be a "kkrparams" instance!')

# initialize some stuff
StructureData = DataFactory('structure')
is_complete = True
for icheck in ['<ZATOM>', '<RBASIS>', 'BRAVAIS', 'ALATBASIS']:
if parameters.get_value(icheck) is None:
is_complete = False
Expand Down Expand Up @@ -625,13 +630,22 @@ def structure_from_params(parameters):
else:
pos_all = pos_all * alat * get_aBohr2Ang() # now positions are in Ang. units

# extract atom numbers
zatom_all = parameters.get_value('<ZATOM>')
# convert to list if input contains a single entry only
if type(zatom_all) != list:
zatom_all = [zatom_all]
pos_all = [pos_all]

#extract weights and sites for CPA calculations
if natyp==naez:
weights = [1. for i in range(natyp)]
sites = range(1,natyp+1)
else:
weights = parameters.get_value('<CPA-CONC>')
sites = parameters.get_value('<SITE>')

# fill structure from zatom, weights and sites information
for isite in sites:
pos = pos_all[sites.index(isite)]
weight = weights[sites.index(isite)]
Expand Down
9 changes: 7 additions & 2 deletions aiida_kkr/tools/kkr_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def raw_input(msg):
__copyright__ = (u"Copyright (c), 2017, Forschungszentrum Jülich GmbH,"
"IAS-1/PGI-1, Germany. All rights reserved.")
__license__ = "MIT license, see LICENSE.txt file"
__version__ = "0.5"
__version__ = "0.6"
__contributors__ = u"Philipp Rüßmann"

# This defines the default parameters for KKR used in the aiida plugin:
Expand Down Expand Up @@ -425,7 +425,12 @@ def _create_keywords_dict(self, **kwargs):
('RUNOPT', [None, '%s%s%s%s%s%s%s%s', False, 'Running and test options: 8-character keywords in a row without spaces between them']),
('TESTOPT', [None, '%s%s%s%s%s%s%s%s\n%s%s%s%s%s%s%s%s', False, 'Running and test options: optional 8-character keywords in a row without spaces between them plus a secod row of the same.']),
#file names
('FILES', [None, '%s', False, 'Name of potential and shapefun file (list of two strings, empty string will set back to default of the one file that is supposed to be changed)'])
('FILES', [None, '%s', False, 'Name of potential and shapefun file (list of two strings, empty string will set back to default of the one file that is supposed to be changed)']),
# special options
('JIJRAD', [None, '%f', False, 'Radius in alat which defines the cutoff for calcultion of Jij pairs']),
('JIJRADXY', [None, '%f', False, 'use a cylindical cluster in which Jij pairs are searched for']),
('JIJSITEI', [None, '%i', False, 'allow for the selection of specific sites in i in the unit cell, which should be considered in the calculation (default: all sites)']),
('JIJSITEJ', [None, '%i', False, 'allow for the selection of specific sites in j in the unit cell, which should be considered in the calculation (default: all sites)'])
])

for key in kwargs:
Expand Down
2 changes: 1 addition & 1 deletion setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"Topic :: Scientific/Engineering :: Physics",
"Natural Language :: English"
],
"version": "0.1.0",
"version": "0.1.2",
"setup_requires": ["reentry"],
"reentry_register": true,
"install_requires": [
Expand Down

0 comments on commit b29a6f4

Please sign in to comment.