AiiDA Workchain for Viscosity
AiiDA workflow for automated calculation of shear viscosity of a molecular liquid
Features
- Generation of Gromacs molecular topology using ACPYPE and GAFF force field from SMILES string
- RESP partial charge calculation using Veloxchem
- Parallel shear viscosity calculation for several shear rates using Gromacs
- Output: Newtonian shear viscosity
Install
From EESSI
Check the EESSI documentation to see on which version of EESSI the package is available.
Run on a system with EESSI pre-installed or install EESSI on your own system
Load the package from EESSI:
# Follow instructions of your system to initialize EESSI
# For a local/native installation:
# source /cvmfs/software.eessi.io/versions/2023.06/init/lmod/bash
module load EESSI/2023.06 # Or the latest version that has the package available
module load AITW-viscosity
From PyPI
pip install AITW-aiida-viscosity[plotting,tui]
From source (development version)
Download the source code and install it using pip.
cd <PATH to folder with pyproject.toml>
pip install .[plotting,tui]
The extra dependencies are optional and used for:
plotting: for plotting the results of the viscosity calculation.tui: for adding anaitw-viscosity tuisubcommand launching a text user interface (TUI) to help setting up the workchain inputs.
Usage
The package provides the following AiiDA entry point that can be used to load the workchains
Main workchain
Workchains performing the full calculations advertised by the package.
aitw.gromacs.viscosity: Compute the viscosity of a molecule starting from the SMILES string (uses al the previou).
Sub-workchains
Workchains performing smaller parts of the full calculation that can also be used independently.
aitw.veloxchem.resp_charges: Generate GROMACS input files with RESP charges computed using Veloxchem starting from a SMILES string.aitw.gromacs.equilibration: Equilibrate a box of molecules using GROMACS starting.aitw.gromacs.nemd: Perform Non-Equilibrium Molecular Dynamics (NEMD) simulations using GROMACS.
CLI
The tool makes available 2 main cli commands grouped following the normal aiida CLI style.
aitw-viscosity workflow launch viscosity: Launch the viscosity workchain from the command line.aitw-viscosity data plot-viscosity: Plot the results of a completed viscosity workchain.
For both commands you can use the -h / --help flag to get more information about the available options.
example
aitw-viscosity workflow launch viscosity \
--acpype <ACPYPE CODE IDENTIFIER> \
--gromacs <GROMACS CODE IDENTIFIER> \
--veloxchem <VELOXCHEM CODE IDENTIFIER> \
--obabel <OPENBABEL CODE IDENTIFIER> \
--smiles-string 'CC(=C)C(=O)OC1C[C@H]2CC[C@]1(C)C2(C)C' \
--num-molecules 100 \
--num-steps 5000000 \
--temperature 343
Replace the <CODE IDENTIFIER> with the actual code identifiers (PK or label) of the installed codes in your AiiDA database.
Adjust the other parameters as needed.
OUTPUT:
# ...
# REPORT
# ...
# Output link Node pk and type
# ------------------------------------------------------------
# acpype__gro SinglefileData<9308>
# acpype__itp SinglefileData<9311>
# acpype__pdb SinglefileData<9317>
# acpype__top SinglefileData<9314>
# equilibrated_box_length_nm Float<9381>
# equilibrated_gro SinglefileData<9378>
# eta_N Float<9563>
# nemd__edr_0_002 SinglefileData<9451>
# nemd__edr_0_005 SinglefileData<9444>
# nemd__edr_0_01 SinglefileData<9472>
# nemd__edr_0_02 SinglefileData<9465>
# nemd__edr_0_05 SinglefileData<9458>
# nemd__edr_0_1 SinglefileData<9479>
# nemd__edr_0_2 SinglefileData<9486>
# sigma_E Float<9564>
# system_gro SinglefileData<9344>
# viscosity_data ArrayData<9561>
# xyz SinglefileData<9323>
Plotting the results
aitw-viscosity data plot-viscosity 9561 --show-plot
Replace the PK of the viscosity ArrayData with the actual PK from your run.
Use --help to see all the available options.
NOTE: Not all possible inputs to the workchain are exposed through the CLI. For more advanced usage, consider running the workchain programmatically.
Programmatically
See the CLI file for an example of how to run the workchain programmatically.
EG: The same code in the function launch_workflow could be adjusted and used in a python script to automate launching the workflow for multiple molecules/parameters at once.
Using the daemon (requires AiiDA to be configured with RabbitMQ and a database) is required to run all the submitted workchains in parallel.
Tips
When running the MonomerWorkChain on a remote computer (e.g. an HPC cluster) it is suggested to also install some of the required codes locally on the machine to speed up the calculation and avoid submitting many serial jobs to the cluster.
In particular the following are always run serially:
- ACPYPE
- OpenBabel
- Veloxchem
GROMACS will also run several initialization calculations that only requires one core. For this reason the workchain allows as an input 2 different GROMACS codes:
gmx_code: used for parallel runsgmx_code_local: used for single core runs
Using a local GROMACS installation for gmx_code_local will also improve the speed of the workchains.
This can also be provided through the CLI with the --gromacs-local option.
Tab autocompletion
Enabling tab autocompletion https://click.palletsprojects.com/en/stable/shell-completion/
E.G for bash run the command
eval "$(_AITW_VISCOSITY_COMPLETE=bash_source aitw-viscosity)"
You can also add it to either ~/.bashrc or, if you are using a virtual environment, to bin/activate of the virtual environment to avoid running the command for every new shell.
Metadata
Release files for AITW-aiida-viscosity 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aitw_aiida_viscosity-1.0.1.tar.gz | 25.4 kB | Without provenance | Details for aitw_aiida_viscosity-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aitw_aiida_viscosity-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for aitw_aiida_viscosity-1.0.1-py3-none-any.whl |
Total release size: 58.2 kB
Release files / aitw_aiida_viscosity-1.0.1.tar.gz
| Download URL | aitw_aiida_viscosity-1.0.1.tar.gz |
|---|---|
| Size | 25.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a604342abb7a475f0f0531027bee7a64b71f6795842bdbad17a4e3897e6604b
|
|
BLAKE2b-256 checksum How to use checksums |
4fe5eea981018bc8f349ad60c82d424fd07246718593bd82723e49fc76b3ce64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.34.2
|
Release files / aitw_aiida_viscosity-1.0.1-py3-none-any.whl
| Download URL | aitw_aiida_viscosity-1.0.1-py3-none-any.whl |
|---|---|
| Size | 32.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b77dda2a74d19e2a54efb935b07ce4b04ebb661df16616195df347a86417eef0
|
|
BLAKE2b-256 checksum How to use checksums |
c783165f6c09f48753beb2164e3cbb4e0c7442f1c001403cdc8349b4982b23b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.34.2
|
Security for AITW-aiida-viscosity 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.