Comments (4)
The first thing that must be done is create functions to write certain input "blocks".
-
The basic control block, should be placed in the input before any other control block. It should accept the following
LAMMPS
keywords:- units (required, if not given by the user, a default will have to be given)
- newton (optional)
- processors (optional)
-
The structure block, should contain the information that describes the structure, the following
LAMMPS
tags should be accepted:- box tilt (by default it should be set to large, but can be overwritten by the user, could it be perhaps determined by the structure?)
- boundary (should be gotten from the
orm.StructureData
) - dimension (should be gotten from the
orm.StructureData
) - atom_style and read_data (the
orm.StructureData
should be written in aLAMMPS
compatible format, and the file name should be given here)
-
The potential block, should include information needed to describe the potential information. If one modifies the
aiida-lammps
potential data type many of these factors could be passed to the input as attributes of the data node. The following keywords should be present:- pair_style (either given by the user or auto-generated from the input potential, if one modifies the potential data type this could be one of the attributes)
- pair_coeff (for some potentials the data needs to be passed directly instead of being read in a file, this means that depending on the type of potential either a set of values or a potential file needs to be passed).
-
The compute block should contain as many of the compute options options given by
LAMMPS
. -
The simulation block should contain information about the MD simulation itself, time steps, number of steps, temperature etc.
Probably one needs to make a more narrow division in the simulation block, as probably different control options are needed for relaxation, pure MD and minimization.
from aiida-lammps.
I was working on the "fix" block, which would deal with the fix options from LAMMPS, and how they can be set into the input. And I was thinking that the user could pass the parameters, into a dictionary in the following way
parameters_fix = {
'box/relax':{
'group':'all', 'type':[{'keyword': 'tri', 'value':1e-3}, {'keyword': 'couple', 'value': 'none'}]
},
'brownian':{
'group':'all', 'type':[100, 1.0, {'keyword':'rng', 'value':'gaussian'}]
}
}
Each "fix" as defined in the LAMMPS input is a key in the dictionary, whose value is a nested dictionary that contains the group option (to which subset of atoms the fix will be applied) then the "type" of fix is passed as a list, whose entries can be dictionaries with key value pairs and/or single entries. The key value pair makes sense for a lot of of the entries, as usually that is how they are setup in LAMMPS. However, the capability of passing single values is also provided as some inputs do not follow this key value approach, instead the value is just passed directly to the "fix".
This would mean of course that the user would need to know this, however, this seems like a reasonable assumption since the LAMMPS documentation explains how each input has to be passed.
A dictionary such as this would allow the ix strings to be written with a simple function
fix_string = ""
for key, value in parameters_fix.items():
fix_string += f"fix {key.replace('/','_')}_aiida {value['group']} {key} "
fix_string += " ".join([f"{entry['keyword']} {entry['value']}" if isinstance(entry, dict) else f"{entry}" for entry in value['type']])
fix_string += "\n"
which produces a LAMMPS compatible text block
fix box_relax_aiida all box/relax tri 0.001 couple none
fix brownian_aiida all brownian 100 1.0 rng gaussian
The names for each fix are auto-generated, so that of that way they can be recreated in other parts of the input is needed.
As far as I know there is no need to keep the order in mind when one is generating the keywords, if this is important the issue becomes much more complicated (this is what can happen in the compute and one needs to be careful).
What do you think @chrisjsewell ? Do you think this is a good solution for this part?
from aiida-lammps.
One issue with the flexible input file generation is also how to discriminate the computes and fixes between global and local since they have to be printed in different files, thermo
and dump
respectively. To solve this issue a helper json file with information from each of the quantities that can be printed in lammps is added to the code, of this way when generating the string to print the calculation the plugin will know whether the quantity should go to thermo
and or dump
.
The json file also stores the size of the vectors so that the headers can be properly written, this should help with the parsing of the output files. However, there are some variables which are either not well documented and/or the sizes are dynamical so getting their size before hand is not possible.
from aiida-lammps.
Closed via #35
from aiida-lammps.
Related Issues (20)
- Allow for other `pair_style` HOT 2
- Allow for dynamically computing vectorial properties HOT 8
- dependabot tests failing for python>3.8 HOT 1
- Change the location of the source
- problem with dimensionality for non-periodic boundary conditions in lammps.base HOT 14
- Change linter to ruff+mypy
- Add possibility to run any LAMMPS script HOT 6
- Naming of `CalcJob` plugins HOT 3
- Handling of the restarfile HOT 2
- Adding CODECOV token explicitly to avoid issues with the github actions HOT 5
- Removal of deprecated features HOT 3
- Example for running from file missing HOT 1
- :ok_hand: Expanding the list of required values in the `LammpsPotentialData` HOT 1
- :books: Update README.md HOT 1
- :books: Docs: Documentation overhaul HOT 4
- Remove unnecessary inputs from the calculation HOT 1
- :recycle: Add warnings and errors to the parsing HOT 5
- Return non zero exit code if LAMMPS errors out in the raw calculation HOT 2
- Add an explicit way to get extra retrieved files in the calculations HOT 3
- Make release 1.0.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiida-lammps.