├── .github └── workflows │ └── release.yaml ├── .gitignore ├── .pre-commit-config.yaml ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── example ├── example.esh └── example.py ├── pyemc ├── __init__.py ├── emc │ ├── HISTORY │ ├── LICENSE │ ├── README │ ├── bin │ │ ├── emc_linux_aarch64 │ │ ├── emc_linux_x86_64 │ │ ├── emc_linux_x86_64.fc15 │ │ ├── emc_macos │ │ └── emc_win32.exe │ ├── docs │ │ └── emc.pdf │ ├── examples │ │ ├── setup │ │ │ ├── chemistry │ │ │ │ ├── bulk │ │ │ │ │ └── setup.esh │ │ │ │ ├── field │ │ │ │ │ ├── charmm │ │ │ │ │ │ ├── chemistry.esh │ │ │ │ │ │ ├── setup.sh │ │ │ │ │ │ └── solution.esh │ │ │ │ │ ├── dpd │ │ │ │ │ │ ├── name.esh │ │ │ │ │ │ └── setup.sh │ │ │ │ │ ├── generate │ │ │ │ │ │ ├── build.emc │ │ │ │ │ │ ├── field.esh │ │ │ │ │ │ ├── field.in │ │ │ │ │ │ └── field.prm │ │ │ │ │ ├── lj │ │ │ │ │ │ └── field.esh │ │ │ │ │ ├── opls │ │ │ │ │ │ ├── aa │ │ │ │ │ │ │ ├── name.esh │ │ │ │ │ │ │ └── setup.sh │ │ │ │ │ │ ├── ua │ │ │ │ │ │ │ ├── name.esh │ │ │ │ │ │ │ └── setup.sh │ │ │ │ │ │ └── water │ │ │ │ │ │ │ └── water.esh │ │ │ │ │ ├── pcff │ │ │ │ │ │ ├── name.esh │ │ │ │ │ │ └── setup.sh │ │ │ │ │ ├── trappe │ │ │ │ │ │ ├── name.esh │ │ │ │ │ │ └── setup.sh │ │ │ │ │ └── user │ │ │ │ │ │ ├── build.emc │ │ │ │ │ │ ├── polymer.esh │ │ │ │ │ │ ├── polymer.in │ │ │ │ │ │ ├── polymer.prm │ │ │ │ │ │ └── polymer.top │ │ │ │ ├── multiphase │ │ │ │ │ └── multiphase.esh │ │ │ │ ├── polymer │ │ │ │ │ ├── alternate │ │ │ │ │ │ ├── build.emc │ │ │ │ │ │ ├── dpd.in │ │ │ │ │ │ ├── polymer.esh │ │ │ │ │ │ └── setup.sh │ │ │ │ │ ├── biphase │ │ │ │ │ │ ├── polymer.esh │ │ │ │ │ │ └── setup.sh │ │ │ │ │ ├── block │ │ │ │ │ │ ├── polymer.esh │ │ │ │ │ │ └── setup.sh │ │ │ │ │ ├── copolymer │ │ │ │ │ │ └── polymer.esh │ │ │ │ │ ├── dendrimer │ │ │ │ │ │ ├── polymer.esh │ │ │ │ │ │ └── setup.sh │ │ │ │ │ ├── homopolymer │ │ │ │ │ │ ├── build.emc │ │ │ │ │ │ ├── polymer.esh │ │ │ │ │ │ ├── polymer.in │ │ │ │ │ │ └── setup.sh │ │ │ │ │ ├── random │ │ │ │ │ │ ├── polymer.esh │ │ │ │ │ │ └── setup.sh │ │ │ │ │ └── random_block │ │ │ │ │ │ ├── block.in │ │ │ │ │ │ ├── block.prm │ │ │ │ │ │ ├── build.emc │ │ │ │ │ │ ├── polymer.esh │ │ │ │ │ │ └── setup.sh │ │ │ │ ├── qm │ │ │ │ │ └── setup.esh │ │ │ │ ├── record │ │ │ │ │ ├── cat.sh │ │ │ │ │ ├── exec.sh │ │ │ │ │ └── fullerene.esh │ │ │ │ └── surface │ │ │ │ │ ├── lammps.sh │ │ │ │ │ ├── lmp2pdb.emc │ │ │ │ │ └── surface.esh │ │ │ └── environment │ │ │ │ ├── field │ │ │ │ ├── README │ │ │ │ ├── chemistry │ │ │ │ │ ├── field │ │ │ │ │ │ └── stage │ │ │ │ │ │ │ └── lj.prm │ │ │ │ │ ├── scripts │ │ │ │ │ │ └── lj.sh │ │ │ │ │ └── stages │ │ │ │ │ │ └── lj │ │ │ │ │ │ └── stage.esh │ │ │ │ └── setup │ │ │ │ │ ├── 2018070100.esh │ │ │ │ │ └── lj.esh │ │ │ │ ├── green-kubo │ │ │ │ └── viscosity.esh │ │ │ │ ├── nemd │ │ │ │ └── shear.esh │ │ │ │ └── t_glass │ │ │ │ ├── README │ │ │ │ └── setup │ │ │ │ ├── 2023072600.esh │ │ │ │ ├── 2023072601.esh │ │ │ │ ├── 2023072610.esh │ │ │ │ └── 2023072611.esh │ │ └── tutorial │ │ │ ├── bulk │ │ │ ├── copolymer │ │ │ ├── graft │ │ │ ├── multiphase │ │ │ ├── shear │ │ │ ├── surface │ │ │ └── t_glass │ ├── field │ │ ├── .DS_Store │ │ ├── born │ │ │ └── 2016 │ │ │ │ ├── convert.sh │ │ │ │ ├── guillot.define │ │ │ │ ├── guillot.prm │ │ │ │ ├── guillot.top │ │ │ │ ├── matsui.define │ │ │ │ ├── matsui.prm │ │ │ │ └── matsui.top │ │ ├── cff │ │ │ ├── al2o3.frc │ │ │ ├── al2o3_templates.dat │ │ │ ├── c3s.frc │ │ │ ├── c3s_templates.dat │ │ │ ├── caso4.frc │ │ │ ├── caso4_templates.dat │ │ │ ├── sio2.frc │ │ │ ├── sio2_templates.dat │ │ │ ├── template.frc │ │ │ ├── template_templates.dat │ │ │ ├── zno.frc │ │ │ └── zno_templates.dat │ │ ├── charmm.tgz │ │ ├── charmm │ │ │ └── c36a │ │ │ │ ├── carb.prm │ │ │ │ ├── carb.top │ │ │ │ ├── cgenff.prm │ │ │ │ ├── cgenff.top │ │ │ │ ├── ethers.prm │ │ │ │ ├── ethers.top │ │ │ │ ├── lipid.prm │ │ │ │ ├── lipid.top │ │ │ │ ├── na.prm │ │ │ │ ├── na.top │ │ │ │ ├── prot.prm │ │ │ │ ├── prot.top │ │ │ │ ├── water_ions.prm │ │ │ │ └── water_ions.top │ │ ├── dpd │ │ │ ├── general.prm │ │ │ └── srp.prm │ │ ├── gauss │ │ │ └── general.prm │ │ ├── martini │ │ │ ├── .DS_Store │ │ │ ├── v2.0 │ │ │ │ ├── aminoacids.prm │ │ │ │ ├── cholesterol.prm │ │ │ │ ├── convert.out │ │ │ │ ├── convert.sh │ │ │ │ ├── file.prm │ │ │ │ ├── ions.prm │ │ │ │ ├── lipids.prm │ │ │ │ ├── martini.prm │ │ │ │ ├── other.prm │ │ │ │ ├── polymers.prm │ │ │ │ ├── solvents.prm │ │ │ │ ├── src │ │ │ │ │ ├── aminoacids.itp │ │ │ │ │ ├── cholesterol.itp │ │ │ │ │ ├── ions.itp │ │ │ │ │ ├── lipids.itp │ │ │ │ │ ├── martini.itp │ │ │ │ │ ├── other.itp │ │ │ │ │ ├── other.prm │ │ │ │ │ ├── polymers.itp │ │ │ │ │ ├── solvents.itp │ │ │ │ │ ├── sugars.itp │ │ │ │ │ ├── surfactants.itp │ │ │ │ │ └── xemium.itp │ │ │ │ ├── sugars.prm │ │ │ │ ├── surfactants.prm │ │ │ │ └── xemium.prm │ │ │ └── v3.0 │ │ │ │ ├── convert.out │ │ │ │ ├── convert.sh │ │ │ │ ├── martini.prm.gz │ │ │ │ └── src │ │ │ │ ├── ions.itp │ │ │ │ ├── martini.itp │ │ │ │ ├── nucleobases.itp │ │ │ │ ├── phospholipids.itp │ │ │ │ ├── small_molecules.itp │ │ │ │ ├── solvents.itp │ │ │ │ └── sugars.itp │ │ ├── opls │ │ │ └── 2012 │ │ │ │ ├── convert.sh │ │ │ │ ├── opls-aa.debug │ │ │ │ ├── opls-aa.define │ │ │ │ ├── opls-aa.prm │ │ │ │ ├── opls-aa.top │ │ │ │ ├── opls-ua.define │ │ │ │ ├── opls-ua.prm │ │ │ │ ├── opls-ua.top │ │ │ │ └── src │ │ │ │ ├── add.txt │ │ │ │ ├── oplsaa.par │ │ │ │ ├── oplsaa.sb │ │ │ │ ├── reoplsff.zip │ │ │ │ └── trim.pl │ │ ├── pcff │ │ │ ├── pcff.frc │ │ │ ├── pcff.rlb │ │ │ └── pcff_templates.dat │ │ ├── pcff_ore │ │ │ ├── pcff_ore.frc │ │ │ └── pcff_ore_templates.dat │ │ ├── polystyrene │ │ │ ├── README │ │ │ ├── smoothed_e-e.m │ │ │ ├── smoothed_m-e.m │ │ │ ├── smoothed_m-m.m │ │ │ ├── smoothed_m-r.m │ │ │ ├── smoothed_r-e.m │ │ │ └── smoothed_r-r.m │ │ ├── sdk │ │ │ └── v1.0 │ │ │ │ ├── convert.sh │ │ │ │ ├── sdk.define │ │ │ │ ├── sdk.prm │ │ │ │ └── src │ │ │ │ ├── angle.dat │ │ │ │ ├── bond.dat │ │ │ │ ├── convert.sh │ │ │ │ ├── mass.dat │ │ │ │ ├── pair.dat │ │ │ │ ├── sdk.xlsx │ │ │ │ └── torsion.dat │ │ ├── trappe │ │ │ └── 2014 │ │ │ │ ├── convert.emc │ │ │ │ ├── convert.sh │ │ │ │ ├── e2k.sh │ │ │ │ ├── list.pl │ │ │ │ ├── torsions.pl │ │ │ │ ├── torsions.txt │ │ │ │ ├── trappe-eh.define │ │ │ │ ├── trappe-ua.define │ │ │ │ ├── trappe-ua.define.old │ │ │ │ ├── trappe-ua.field │ │ │ │ ├── trappe-ua.prm │ │ │ │ └── trappe-ua.top │ │ └── uff │ │ │ └── src │ │ │ ├── README │ │ │ └── uff.ff │ ├── modules │ │ └── changes.txt │ ├── scripts │ │ ├── .DS_Store │ │ ├── analyze │ │ │ ├── cavity.sh │ │ │ ├── files.sh │ │ │ ├── harvest.sh │ │ │ ├── last.sh │ │ │ ├── project.sh │ │ │ ├── sample │ │ │ │ ├── bond.emc │ │ │ │ ├── cavity.emc │ │ │ │ ├── distance.emc │ │ │ │ ├── gr.emc │ │ │ │ └── gyration.emc │ │ │ └── script.sh │ │ ├── average.pl │ │ ├── avg_error.pl │ │ ├── change.sh │ │ ├── change_header.pl │ │ ├── charmm2lammps.pl │ │ ├── clean_restart.pl │ │ ├── coding │ │ │ ├── cpmod.pl │ │ │ ├── cpmoddir.sh │ │ │ ├── emc_comments.pl │ │ │ ├── emc_parse_oper.pl │ │ │ ├── header.pl │ │ │ ├── hold.sh │ │ │ └── scrape.pl │ │ ├── emc.pl │ │ ├── emc.sh │ │ ├── emc2emc.emc │ │ ├── emc2energy.emc │ │ ├── emc2insight.emc │ │ ├── emc2lammps.emc │ │ ├── emc2pdb.emc │ │ ├── emc2volume.emc │ │ ├── emc2xyz.emc │ │ ├── emc_align.pl │ │ ├── emc_clean.sh │ │ ├── emc_error.sh │ │ ├── emc_generate.pl │ │ ├── emc_gromacs.pl │ │ ├── emc_martini.pl │ │ ├── emc_opls.pl │ │ ├── emc_sdk.pl │ │ ├── emc_setup.pl │ │ ├── emc_template.sh │ │ ├── emc_trappe.pl │ │ ├── hold.sh │ │ ├── insight2lammps.pl │ │ ├── lammps2emc.emc │ │ ├── lammps2lammps.emc │ │ ├── lammps2pdb.emc │ │ ├── last.sh │ │ ├── modules │ │ │ ├── EMC.pm │ │ │ ├── EMC │ │ │ │ ├── Analyze.pm │ │ │ │ ├── Chemistry.pm │ │ │ │ ├── Clusters.pm │ │ │ │ ├── Common.pm │ │ │ │ ├── Dist.pm │ │ │ │ ├── EMC.pm │ │ │ │ ├── Element.pm │ │ │ │ ├── Environment.pm │ │ │ │ ├── Fields.pm │ │ │ │ ├── GROMACS.pm │ │ │ │ ├── Global.pm │ │ │ │ ├── Groups.pm │ │ │ │ ├── Hash.pm │ │ │ │ ├── IO.pm │ │ │ │ ├── Item.pm │ │ │ │ ├── Job.pm │ │ │ │ ├── LAMMPS.pm │ │ │ │ ├── List.pm │ │ │ │ ├── MD.pm │ │ │ │ ├── Math.pm │ │ │ │ ├── Matrix.pm │ │ │ │ ├── Message.pm │ │ │ │ ├── NAMD.pm │ │ │ │ ├── Options.pm │ │ │ │ ├── PDB.pm │ │ │ │ ├── Parameters.pm │ │ │ │ ├── Polymers.pm │ │ │ │ ├── Profiles.pm │ │ │ │ ├── References.pm │ │ │ │ ├── Script.pm │ │ │ │ ├── Struct.pm │ │ │ │ ├── Types.pm │ │ │ │ └── Variables.pm │ │ │ └── EMCField.pm │ │ ├── myjobs.pl │ │ ├── openff.pl │ │ ├── pack.sh │ │ ├── pdb.emc │ │ ├── pdb_extract.pl │ │ ├── prm_compare.pl │ │ ├── prm_duplicate.pl │ │ ├── prm_extract.sh │ │ ├── prm_list_types.pl │ │ ├── prm_reduce.pl │ │ ├── prm_reduce.sh │ │ ├── prm_search.pl │ │ ├── psf_charge.pl │ │ ├── qjobs │ │ ├── replace.pl │ │ ├── run.sh │ │ ├── run_analyze.sh │ │ ├── run_host.sh │ │ ├── run_restart.sh │ │ ├── run_stat.sh │ │ ├── template.pl │ │ ├── traject2pdb.emc │ │ ├── trj_reduce.sh │ │ ├── try.sh │ │ ├── view_record.sh │ │ ├── view_vmd.sh │ │ └── xyz.emc │ ├── templates │ │ ├── chemistry.esh │ │ ├── cluster.esh │ │ ├── environment.esh │ │ ├── field.define │ │ ├── field.esh │ │ ├── import.esh │ │ ├── polymer.esh │ │ └── restart.sh │ └── vmd │ │ ├── README │ │ ├── license.txt │ │ ├── packages.tcl │ │ └── packages │ │ ├── gui.tcl │ │ ├── options.dat │ │ └── textview.tcl └── runner.py └── setup.py /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Upload Python Package 2 | 3 | on: 4 | release: 5 | types: [created] 6 | 7 | jobs: 8 | deploy: 9 | 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v2 14 | - name: Set up Python 15 | uses: actions/setup-python@v2 16 | with: 17 | python-version: 3.8 18 | - name: Install dependencies 19 | run: | 20 | python -m pip install --upgrade pip 21 | pip install setuptools wheel twine 22 | - name: Build and publish 23 | env: 24 | TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} 25 | TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} 26 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 27 | run: | 28 | python setup.py sdist bdist_wheel 29 | twine upload --skip-existing dist/* 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | exclude: "^pyemc/emc/" 2 | 3 | repos: 4 | - repo: https://github.com/pre-commit/pre-commit-hooks 5 | rev: v4.6.0 6 | hooks: 7 | - id: trailing-whitespace 8 | - id: check-added-large-files 9 | - id: check-ast 10 | - id: check-json 11 | - id: check-merge-conflict 12 | - id: check-xml 13 | - id: check-yaml 14 | - id: debug-statements 15 | - id: end-of-file-fixer 16 | - id: requirements-txt-fixer 17 | - id: mixed-line-ending 18 | args: ["--fix=auto"] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows 19 | 20 | # If you want to avoid flake8 errors due to unused vars or imports: 21 | - repo: https://github.com/PyCQA/autoflake 22 | rev: v2.3.1 23 | hooks: 24 | - id: autoflake 25 | args: [ 26 | --in-place, 27 | --remove-all-unused-imports, 28 | --remove-unused-variables, 29 | ] 30 | 31 | - repo: https://github.com/pycqa/isort 32 | rev: 5.13.2 33 | hooks: 34 | - id: isort 35 | 36 | - repo: https://github.com/google/yapf 37 | rev: 'v0.40.2' 38 | hooks: 39 | - id: yapf 40 | # https://github.com/pre-commit/mirrors-yapf/issues/15 41 | additional_dependencies: [toml] 42 | 43 | # - repo: https://github.com/psf/black 44 | # rev: stable 45 | # hooks: 46 | # - id: black 47 | # language_version: python3 48 | 49 | ## If like to embrace black styles even in the docs: 50 | # - repo: https://github.com/asottile/blacken-docs 51 | # rev: v1.12.0 52 | # hooks: 53 | # - id: blacken-docs 54 | # additional_dependencies: [black] 55 | - repo: https://github.com/PyCQA/flake8 56 | rev: 7.1.0 57 | hooks: 58 | - id: flake8 59 | ## You can add flake8 plugins via `additional_dependencies`: 60 | # additional_dependencies: [flake8-bugbear] 61 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.formatting.provider": "yapf" 3 | } 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Enhanced Monte Carlo (EMC) Python Interface 2 | 3 | [![PyPI version shields.io](https://img.shields.io/pypi/v/emc-pypi.svg?style=for-the-badge&logo=PyPI&logoColor=blue)](https://pypi.python.org/pypi/emc-pypi/) 4 | [![PyPI download month](https://img.shields.io/pypi/dm/emc-pypi.svg?style=for-the-badge&logo=PyPI)](https://pypi.python.org/pypi/emc-pypi/) 5 | 6 | This module is a thin Python wrapper library of the [EMC](http://montecarlo.sourceforge.net/emc/Welcome.html) package that allows you to use all EMC functionalities with Python interface. No pre-installation of EMC is needed. 7 | 8 | EMC creates input structures from SMILES strings and LAMMPS input files for particle simulations with atomistic force fields - Born, COMPASS, PCFF, CHARMM, OPLS, TraPPE or coarse-grained force fields - DPD, Martini, SDK. 9 | 10 | - See the [example input files](https://github.com/kevinshen56714/emc-pypi/tree/main/pyemc/emc/examples/setup) on how to prepare EMC input (.esh) files. 11 | - See the [docs](https://github.com/kevinshen56714/emc-pypi/blob/main/pyemc/emc/docs/emc.pdf) to understand more about EMC. 12 | 13 | The package works out of the box without pre-installation of EMC or any configuration. Please open an issue if you find something missing or not working as expected. 14 | 15 | ## Installation 16 | 17 | ```bash 18 | pip install emc-pypi 19 | ``` 20 | 21 | ## Usage 22 | 23 | ```python 24 | import pyemc 25 | 26 | # Run the emc.pl and generate the build.emc file for the build command 27 | pyemc.setup('your-setup-file.esh') 28 | 29 | # Or you can pass in arguments like this 30 | pyemc.setup('your-setup-file.esh', '-ntotal=1000', '-field=opls-aa') 31 | 32 | # Finally, run the emc executable to create simulation input files 33 | pyemc.build('build.emc') 34 | ``` 35 | 36 | ## Example 37 | 38 | Example input files are provided in the [example](https://github.com/kevinshen56714/emc-pypi/tree/main/example). Once installed, you can run the example by: 39 | 40 | ```python 41 | cd example 42 | python example.py 43 | ``` 44 | 45 | The example.esh file creates a system with 80% m/m water and 20% m/m alcohol. More examples are available [here](https://github.com/kevinshen56714/emc-pypi/tree/main/pyemc/emc/examples/setup) 46 | 47 | ## Citation 48 | 49 | In any publication of scientific results based in part or completely on the use of EMC, please cite the original paper: 50 | P.J. in 't Veld and G.C. Rutledge, Macromolecules 2003, 36, 7358 [[link](https://pubs.acs.org/doi/full/10.1021/ma0346658)] [[pdf](https://pubs.acs.org/doi/pdf/10.1021/ma0346658)] 51 | -------------------------------------------------------------------------------- /example/example.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc_setup.pl 2 | # 3 | # file: solution.esh 4 | # author: Pieter J. in 't Veld 5 | # date: August 15, 2016 6 | # purpose: Chemical input for emc_setup.pl 7 | # 8 | # notes: 9 | # - Create a simulation with 80% m/m water and 20% m/m alcohol 10 | # - Alternative to chemistry.esh file, containing an OPTIONS section, 11 | # to be used with emc_setup.pl v1.5 and up 12 | # - Allowed separators are commas and tabs, which can be used 13 | # interchangebly 14 | # - Call with 15 | # 16 | # emc_setup.pl solution 17 | # 18 | # or (for MacOS or Linux) 19 | # 20 | # ./solution.esh 21 | # 22 | # creates build.emc and solution.in 23 | # 24 | 25 | # Options 26 | # 27 | # - Format for options: 28 | # 29 | # option,value[,...] 30 | # 31 | # options create a self-contained way of setting up a simulation 32 | # - Replace exisiting scripts 33 | # - Add mass profiles to LAMMPS input script 34 | # - Create a simulation with a target number of 1000 particles 35 | # - Use resulting density of 1 g/cc 36 | # - Use OPLS-AA as force field 37 | 38 | ITEM OPTIONS 39 | 40 | replace true 41 | mass true 42 | ntotal 1000 43 | density 1 44 | field opls-aa 45 | build_dir . 46 | 47 | ITEM END 48 | 49 | # Shorthand 50 | # 51 | # - Format for shorthand: 52 | # 53 | # name,SMILES,fraction[,mol mass[,mol volume]] 54 | # 55 | # shorthand provides a quick way of constructing a chemistry file 56 | 57 | ITEM SHORTHAND 58 | 59 | water O,80 60 | alcohol CCO,20 61 | 62 | ITEM END 63 | 64 | # Alternative formal way for defining a simulation uses GROUPS and CLUSTERS. 65 | # Swapping the SHORTHAND section out with the sections below results in an 66 | # equivalent simulation definition. 67 | 68 | # Comments beginning 69 | 70 | ITEM COMMENTS 71 | 72 | # Groups 73 | # 74 | # - Format for groups: 75 | # 76 | # name,SMILES[,connect index,connect group:connect index[,...]] 77 | # 78 | # where the first connect index is the connection point in the current 79 | # group and the second in the connection group 80 | # - Asterix in SMILES denotes a connection point 81 | 82 | ITEM GROUPS 83 | 84 | water O 85 | alcohol CCO 86 | 87 | ITEM END 88 | 89 | # Clusters 90 | # 91 | # - Format for clusters: 92 | # 93 | # name,group,fraction[,mol mass[,mol volume]] 94 | # 95 | # molecular mass and volume are optional and function as an override 96 | # for mass calculation by means of a force field file; alternatively 97 | # surfaces can be included by using the group keyword 'surface' through 98 | # 99 | # name,surface,nx,file name 100 | # 101 | # file name refers to a crystal structure as available in ./lib with 102 | # nx repeat units in the x direction 103 | 104 | ITEM CLUSTERS 105 | 106 | water water,80 107 | alcohol alcohol,20 108 | 109 | ITEM END 110 | 111 | # Comments end 112 | 113 | ITEM END 114 | -------------------------------------------------------------------------------- /example/example.py: -------------------------------------------------------------------------------- 1 | import pyemc 2 | 3 | pyemc.setup('example.esh') 4 | pyemc.build('build.emc') 5 | -------------------------------------------------------------------------------- /pyemc/__init__.py: -------------------------------------------------------------------------------- 1 | from .runner import build, setup 2 | 3 | __all__ = [build, setup] 4 | -------------------------------------------------------------------------------- /pyemc/emc/bin/emc_linux_aarch64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinshen56714/emc-pypi/f32daee3b5d8e372a9b719c1b79ac37b81e3a6f3/pyemc/emc/bin/emc_linux_aarch64 -------------------------------------------------------------------------------- /pyemc/emc/bin/emc_linux_x86_64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinshen56714/emc-pypi/f32daee3b5d8e372a9b719c1b79ac37b81e3a6f3/pyemc/emc/bin/emc_linux_x86_64 -------------------------------------------------------------------------------- /pyemc/emc/bin/emc_linux_x86_64.fc15: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinshen56714/emc-pypi/f32daee3b5d8e372a9b719c1b79ac37b81e3a6f3/pyemc/emc/bin/emc_linux_x86_64.fc15 -------------------------------------------------------------------------------- /pyemc/emc/bin/emc_macos: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinshen56714/emc-pypi/f32daee3b5d8e372a9b719c1b79ac37b81e3a6f3/pyemc/emc/bin/emc_macos -------------------------------------------------------------------------------- /pyemc/emc/bin/emc_win32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinshen56714/emc-pypi/f32daee3b5d8e372a9b719c1b79ac37b81e3a6f3/pyemc/emc/bin/emc_win32.exe -------------------------------------------------------------------------------- /pyemc/emc/docs/emc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinshen56714/emc-pypi/f32daee3b5d8e372a9b719c1b79ac37b81e3a6f3/pyemc/emc/docs/emc.pdf -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/bulk/setup.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # file: bulk.esh 4 | # author: Pieter J. in 't Veld 5 | # date: July 4, 2016 6 | # purpose: Chemical input for emc.pl 7 | # 8 | # notes: 9 | # - Create a simulation with water, alcohol, salt and a sugar 10 | # - Alternative to chemistry.esh file, containing an OPTIONS section, 11 | # to be used with emc.pl v1.5 and up 12 | # - Allowed separators are commas and tabs, which can be used 13 | # interchangebly 14 | # - Call with 15 | # 16 | # emc.pl bulk 17 | # 18 | # or (for MacOS or Linux) 19 | # 20 | # ./bulk.esh 21 | # 22 | # creates build.emc and bulk.in 23 | # 24 | 25 | # Options 26 | # 27 | # - Format for options: 28 | # 29 | # option,value,... 30 | # 31 | # options create a self-contained way of setting up a simulation 32 | # - Replace exisiting scripts 33 | # - Add mass profiles to LAMMPS input script 34 | # - Create a simulation with a target number of 2000 particles 35 | # - Use resulting density of 1 g/cc 36 | # - Use PCFF as force field 37 | 38 | ITEM OPTIONS 39 | 40 | replace true 41 | mass true 42 | ntotal 2000 43 | density 1 44 | field pcff 45 | build_dir . 46 | 47 | ITEM END 48 | 49 | # Shorthand 50 | # 51 | # - Format for shorthand: 52 | # 53 | # name,SMILES,fraction[,mol mass[,mol volume]] 54 | # 55 | # shorthand provides a quick way of constructing a chemistry file 56 | 57 | ITEM SHORTHAND 58 | 59 | water O,45 60 | alcohol CCO,40 61 | salt [Na+].[Cl-],5 62 | sugar OCC1OC(O)C(O)C(O)C1O,10 63 | 64 | ITEM END 65 | 66 | # Alternative formal way for defining a simulation uses GROUPS and CLUSTERS. 67 | # Swapping the SHORTHAND section out with the sections below results in an 68 | # equivalent simulation definition. 69 | 70 | # Comments beginning 71 | 72 | ITEM COMMENTS 73 | 74 | # Groups 75 | # 76 | # - Format for groups: 77 | # 78 | # name,SMILES[,connect index,connect group:connect index[,...]] 79 | # 80 | # where the first connect index is the connection point in the current 81 | # group and the second in the connection group 82 | # - Asterix in SMILES denotes a connection point 83 | 84 | ITEM GROUPS 85 | 86 | water O 87 | alcohol CCO 88 | salt [Na+].[Cl-] 89 | glucose OCC1OC(O)C(O)C(O)C1O 90 | 91 | ITEM END 92 | 93 | # Clusters 94 | # 95 | # - Format for clusters: 96 | # 97 | # name,group,fraction[,mol mass[,mol volume]] 98 | # 99 | # molecular mass and volume are optional and function as an override 100 | # for mass calculation by means of a force field file; alternatively 101 | # surfaces can be included by using the group keyword 'surface' through 102 | # 103 | # name,surface,nx,file name 104 | # 105 | # file name refers to a crystal structure as available in ./lib with 106 | # nx repeat units in the x direction 107 | 108 | ITEM CLUSTERS 109 | 110 | water water,45 111 | alcohol alcohol,40 112 | salt salt,5 113 | sugar glucose,10 114 | 115 | ITEM END 116 | 117 | # Comments end 118 | 119 | ITEM END 120 | 121 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/charmm/chemistry.esh: -------------------------------------------------------------------------------- 1 | # Chemistry file old style 2 | # 3 | # file: chemistry.esh 4 | # author: Pieter J. in 't Veld 5 | # date: March 18, 2015 6 | # purpose: Chemical input for emc.pl 7 | # 8 | # notes: 9 | # - Create a simulation with 80% m/m water and 20% m/m ethanol 10 | # 11 | 12 | # molecule id,smiles string,fraction[,mol mass,mol vol] 13 | 14 | ethanol,CCO,20 15 | water,O,80 16 | 17 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/charmm/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # script: setup.sh 4 | # author: Pieter J. in 't Veld 5 | # date: March 18, 2015 6 | # purpose: Generate EMC build and LAMMPS input scripts 7 | # 8 | # notes: 9 | # - Create a simulation with a target number of 1000 particles 10 | # - Use CHARMM as force field 11 | # - Use mol fraction in number of molecule determination 12 | # - Replace exisiting scripts 13 | # - Write output to project name 'solution' 14 | # - Creates build.emc for EMC and solution.in for LAMMPS 15 | # 16 | # usage with vmd after build: vmd -e solution.vmd 17 | # 18 | 19 | emc.pl \ 20 | -ntotal=1000 -field=charmm \ 21 | -replace solution $@; 22 | 23 | #emc_${HOST} build.emc 2>&1 | tee build.out 24 | 25 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/charmm/solution.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # file: solution.esh 4 | # author: Pieter J. in 't Veld 5 | # date: August 15, 2016 6 | # purpose: Chemical input for emc.pl 7 | # 8 | # notes: 9 | # - Create a simulation with 80% m/m water and 20% m/m alcohol 10 | # - Alternative to chemistry.esh file, containing an OPTIONS section, 11 | # to be used with emc.pl v1.5 and up 12 | # - Allowed separators are commas and tabs, which can be used 13 | # interchangebly 14 | # - Call with 15 | # 16 | # emc.pl solution 17 | # 18 | # or (for MacOS or Linux) 19 | # 20 | # ./solution.esh 21 | # 22 | # creates build.emc and solution.in 23 | # 24 | 25 | # Options 26 | # 27 | # - Format for options: 28 | # 29 | # option,value[,...] 30 | # 31 | # options create a self-contained way of setting up a simulation 32 | # - Replace exisiting scripts 33 | # - Add mass profiles to LAMMPS input script 34 | # - Create a simulation with a target number of 1000 particles 35 | # - Use resulting density of 1 g/cc 36 | # - Use CHARMM as force field 37 | 38 | ITEM OPTIONS 39 | 40 | replace true 41 | mass true 42 | ntotal 1000 43 | density 1 44 | field charmm 45 | build_dir . 46 | 47 | ITEM END 48 | 49 | # Shorthand 50 | # 51 | # - Format for shorthand: 52 | # 53 | # name,SMILES,fraction[,mol mass[,mol volume]] 54 | # 55 | # shorthand provides a quick way of constructing a chemistry file 56 | 57 | ITEM SHORTHAND 58 | 59 | water O,80 60 | alcohol CCO,20 61 | 62 | ITEM END 63 | 64 | # Alternative formal way for defining a simulation uses GROUPS and CLUSTERS. 65 | # Swapping the SHORTHAND section out with the sections below results in an 66 | # equivalent simulation definition. 67 | 68 | # Comments beginning 69 | 70 | ITEM COMMENTS 71 | 72 | # Groups 73 | # 74 | # - Format for groups: 75 | # 76 | # name,SMILES[,connect index,connect group:connect index[,...]] 77 | # 78 | # where the first connect index is the connection point in the current 79 | # group and the second in the connection group 80 | # - Asterix in SMILES denotes a connection point 81 | 82 | ITEM GROUPS 83 | 84 | water O 85 | alcohol CCO 86 | 87 | ITEM END 88 | 89 | # Clusters 90 | # 91 | # - Format for clusters: 92 | # 93 | # name,group,fraction[,mol mass[,mol volume]] 94 | # 95 | # molecular mass and volume are optional and function as an override 96 | # for mass calculation by means of a force field file; alternatively 97 | # surfaces can be included by using the group keyword 'surface' through 98 | # 99 | # name,surface,nx,file name 100 | # 101 | # file name refers to a crystal structure as available in ./lib with 102 | # nx repeat units in the x direction 103 | 104 | ITEM CLUSTERS 105 | 106 | water water,80 107 | alcohol alcohol,20 108 | 109 | ITEM END 110 | 111 | # Comments end 112 | 113 | ITEM END 114 | 115 | 116 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/dpd/name.esh: -------------------------------------------------------------------------------- 1 | # short type,full type,M [g/mol],V [nm^3],ncons,charge,nrepeat,comment 2 | 3 | E,EO4,176.2120,0.2159,2,0,4,Ethylene oxide monomer (n=4) 4 | F,EO4t,163.1931,0.2008,1,0,4,Ethylene oxide terminator (n=4) 5 | K,IPDI,255.3162,0.3034,2,0,1,Isophorone diisocyanate monomer (n=1) 6 | L,ACA13,272.3466,0.3388,3,0,1,Acetamide branch (n=1) 7 | M,NYL2,226.318,0.2978,2,0,2,Nylon 6 monomer (n=2) 8 | N,AN3,159.1902,0.2058,2,0,3,Acrylonitrile monomer (n=3) 9 | P,PO3,174.2394,0.2255,2,0,3,Propylene oxide monomer (n=3) 10 | Q,PO3t,161.2205,0.2128,1,0,3,Propylene oxide terminator (n=3) 11 | S,STY2,208.3024,0.272,2,0,2,Styrene monomer (n=2) 12 | X,WAT8,144.1216,0.2048,0,0,8,Water (n=8) 13 | Y,MAI13,96.0653,0.0877,3,0,1,Maleimide (n=1) 14 | Z,CYA13,126.0513,0.0994,3,0,1,Cyanuric amide (n=1) 15 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/dpd/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # script: setup.sh 4 | # author: Pieter J. in 't Veld 5 | # date: March 18, 2015 6 | # purpose: Generate EMC build and LAMMPS input scripts 7 | # 8 | # notes: 9 | # - Create a simulation with a target number of 1000 particles 10 | # - Use DPD as force field 11 | # - Use mass fraction in number of molecule determination 12 | # - Replace exisiting scripts 13 | # - Add mass profiles to LAMMPS script 14 | # - Set build directory to current in LAMMPS script 15 | # - Use type WAT8 as reference 16 | # - Write output to project name 'dpd' 17 | # - First phase contains nylon, second (interphase) branch, and 18 | # third water 19 | # - Creates build.emc for EMC and dpd.in for LAMMPS 20 | # 21 | # usage with vmd after build: vmd -e dpd.vmd 22 | # 23 | 24 | emc.pl \ 25 | -field=dpd -mass -replace \ 26 | -profile -build_dir=. -rtype=WAT8 dpd nylon + branch + water 27 | 28 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/generate/field.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # script: field.esh 4 | # author: Pieter J. in 't Veld 5 | # date: September 24, 2017, March 12, 2018 6 | # purpose: Generate a general Lennard-Jones force field, where mass = 1, 7 | # sigma = 1, and epsilon = 1 for all nonbonded interaction types; 8 | # all bond lengths use a harmonic spring with k = 20 and l0 = 1; 9 | # all bond angles use a harmonic spring with k = 4 and 10 | # theta0 = 180 11 | # 12 | 13 | ITEM OPTIONS 14 | 15 | replace true 16 | field_type standard 17 | field_name field 18 | field_location . 19 | build_dir . 20 | charge false 21 | number true 22 | density 0.7 23 | temperature 1 24 | #emc_execute true # used to directly execute EMC after executing script 25 | 26 | ITEM END 27 | 28 | ITEM SHORTHAND 29 | 30 | lj ([lj])4,512 # create 512 molecules of 4 beads 31 | 32 | ITEM END 33 | 34 | ITEM FIELD # FIELD 35 | 36 | ITEM DEFINE 37 | 38 | ffname standard # use the standard force field 39 | cutoff 2.5 # set the nonbonded cutoff to 2.5 sigma 40 | nbonded 1 # exclude 1-2 interactions from nonbond 41 | 42 | ITEM END 43 | 44 | ITEM MASSES 45 | 46 | # type mass element ncons charge comment 47 | 48 | * 1 * 2 0 * 49 | 50 | ITEM END 51 | 52 | ITEM NONBOND 53 | 54 | # sigma in [-] 55 | # epsilon in [-] 56 | 57 | # type1 type2 sigma eps 58 | 59 | * * 1 1 60 | 61 | ITEM END 62 | 63 | ITEM BOND 64 | 65 | # 0.5*k*(l-l0)^2 66 | # 67 | # k in [1/A^2] 68 | # l0 in [-] 69 | 70 | # type1 type2 k l0 71 | 72 | * * 20 1 73 | 74 | ITEM END 75 | 76 | ITEM ANGLE 77 | 78 | # 0.5*k*(theta-theta0)^2 79 | # 80 | # k in [1/rad^2] 81 | # theta0 in [degree] 82 | 83 | # type1 type2 type3 k theta0 84 | 85 | * * * 4 180 86 | 87 | ITEM END 88 | 89 | ITEM END # FIELD 90 | 91 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/generate/field.in: -------------------------------------------------------------------------------- 1 | # LAMMPS input script for standardized atomistic simulations 2 | # Created by emc.pl v3.6.0, July 8, 2018 as part of EMC 3 | # on Sun Jul 8 12:15:11 EDT 2018 4 | 5 | # Variable definitions 6 | 7 | variable project index "field" # project name 8 | variable source index . # data directory 9 | variable params index . # parameter directory 10 | variable temperature index 1 # system temperature 11 | variable tdamp index 100 # temperature damping 12 | variable dielectric index 1 # medium dielectric 13 | variable kappa index 4 # electrostatics kappa 14 | variable cutoff index 2.5 # standard cutoff 15 | variable charge_cutoff index 2.5 # charge cutoff 16 | variable precision index 0.001 # kspace precision 17 | variable lseed index 723853 # langevin seed 18 | variable vseed index 1486234 # velocity init seed 19 | variable tequil index 1000 # equilibration time 20 | variable trun index 10000000 # run time 21 | variable frestart index 0 # 0: equil, 1: restart 22 | variable dtrestart index 100000 # delta restart time 23 | variable dtdump index 100000 # delta dump time 24 | variable dtthermo index 1000 # delta thermo time 25 | variable timestep index 0.005 # integration time step 26 | variable tfreq index 10 # profile sampling freq 27 | variable nsample index 1000 # profile conf sampling 28 | variable dtime equal ${tfreq}*${nsample} # profile dtime 29 | variable restart index ${params}/${project}.restart 30 | 31 | if "${frestart} != 0" then & 32 | "variable data index ${restart}" & 33 | else & 34 | "variable data index ${params}/${project}.data" & 35 | 36 | # LAMMPS atomistic input script 37 | 38 | echo screen 39 | units lj 40 | atom_style molecular 41 | 42 | # Interaction potential definition 43 | 44 | pair_style lj/cut ${cutoff} 45 | bond_style harmonic 46 | special_bonds lj/coul 0 0 0 47 | if "${frestart} != 0" then "read_restart ${data}" else "read_data ${data}" 48 | include ${params}/${project}.params 49 | 50 | # Integration conditions (check) 51 | 52 | timestep ${timestep} 53 | fix mom all momentum 100 linear 1 1 1 angular 54 | 55 | # Equilibration 56 | 57 | thermo ${dtthermo} 58 | if "${frestart} != 0" then "jump SELF simulate" 59 | velocity all create ${temperature} ${vseed} & 60 | dist gaussian rot yes mom yes sum yes 61 | fix temp all langevin ${temperature} ${temperature} ${tdamp} & 62 | ${lseed} 63 | fix int all nve/limit 0.1 64 | run ${tequil} 65 | unfix temp 66 | unfix int 67 | write_restart ${project}.restart2 68 | 69 | # Simulation 70 | 71 | label simulate 72 | 73 | # Integrator 74 | 75 | fix temp all langevin ${temperature} ${temperature} ${tdamp} & 76 | ${lseed} 77 | fix int all nve 78 | 79 | # System sampling: pressure 80 | 81 | fix sample_press all ave/time ${tfreq} ${nsample} ${dtime} & 82 | c_thermo_temp & 83 | c_thermo_press[1] c_thermo_press[2] c_thermo_press[3] & 84 | c_thermo_press[4] c_thermo_press[5] c_thermo_press[6] & 85 | file ${project}.pressure 86 | 87 | # Run conditions 88 | 89 | restart ${dtrestart} ${project}.restart1 ${project}.restart2 90 | dump 1 all custom ${dtdump} ${project}.dump id type x y z 91 | run ${trun} 92 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/generate/field.prm: -------------------------------------------------------------------------------- 1 | # 2 | # STANDARD interaction parameters 3 | # converted by emc.pl v3.6.0, July 8, 2018 by Pieter J. in 't Veld 4 | # to be used in conjuction with EMC v9.4.3 or higher 5 | # 6 | 7 | # Force field definition 8 | 9 | ITEM DEFINE 10 | 11 | FFMODE STANDARD 12 | FFTYPE COARSE 13 | FFDEPTH 1 14 | VERSION 1.0 15 | CREATED 2018-07-08 16 | LENGTH REDUCED 17 | ENERGY REDUCED 18 | DENSITY REDUCED 19 | MIX BERTHELOT 20 | CUTOFF 2.5 21 | NBONDED 1 22 | ANGLE IGNORE 23 | TORSION IGNORE 24 | IMPROP IGNORE 25 | 26 | ITEM END 27 | 28 | # Masses 29 | 30 | ITEM MASS 31 | 32 | # type mass element ncons charge comment 33 | 34 | * 1 * 2 0 * 35 | 36 | ITEM END 37 | 38 | # Nonbond wildcard parameters 39 | 40 | ITEM NONBOND_AUTO 41 | 42 | # type1 type2 epsilon sigma 43 | 44 | * * 1 1 45 | 46 | ITEM END 47 | 48 | # Bond wildcard parameters 49 | 50 | ITEM BOND_AUTO 51 | 52 | # type1 type2 k l0 53 | 54 | * * 20 1 55 | 56 | ITEM END 57 | 58 | # Angle wildcard parameters 59 | 60 | ITEM ANGLE_AUTO 61 | 62 | # type1 type2 type3 k theta0 63 | 64 | * * * 4 180 65 | 66 | ITEM END 67 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/lj/field.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | 3 | ITEM OPTIONS 4 | 5 | replace true 6 | field_type standard 7 | field_name field 8 | field_location . 9 | build_dir . 10 | charge false 11 | number true 12 | density 0.7 13 | temperature 1 14 | emc_execute true 15 | 16 | ITEM END 17 | 18 | ITEM SHORTHAND 19 | 20 | lj ([lj])4,256*8/4 21 | 22 | ITEM END 23 | 24 | ITEM FIELD # FIELD 25 | 26 | ITEM DEFINE 27 | 28 | ffname standard 29 | 30 | ITEM END 31 | 32 | ITEM MASSES 33 | 34 | * 1 * 2 0 * 35 | 36 | ITEM END 37 | 38 | ITEM NONBOND 39 | 40 | * * 1 1 41 | 42 | ITEM END 43 | 44 | ITEM BOND 45 | 46 | * * 20 1 47 | 48 | ITEM END 49 | 50 | ITEM ANGLE 51 | 52 | * * * 4 180 53 | 54 | ITEM END 55 | 56 | ITEM END # FIELD 57 | 58 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/opls/aa/name.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # file: solution.esh 4 | # author: Pieter J. in 't Veld 5 | # date: August 15, 2016 6 | # purpose: Chemical input for emc.pl 7 | # 8 | # notes: 9 | # - Create a simulation with 80% m/m water and 20% m/m alcohol 10 | # - Alternative to chemistry.esh file, containing an OPTIONS section, 11 | # to be used with emc.pl v1.5 and up 12 | # - Allowed separators are commas and tabs, which can be used 13 | # interchangebly 14 | # - Call with 15 | # 16 | # emc.pl solution 17 | # 18 | # or (for MacOS or Linux) 19 | # 20 | # ./solution.esh 21 | # 22 | # creates build.emc and solution.in 23 | # 24 | 25 | # Options 26 | # 27 | # - Format for options: 28 | # 29 | # option,value[,...] 30 | # 31 | # options create a self-contained way of setting up a simulation 32 | # - Replace exisiting scripts 33 | # - Add mass profiles to LAMMPS input script 34 | # - Create a simulation with a target number of 1000 particles 35 | # - Use resulting density of 1 g/cc 36 | # - Use OPLS-AA as force field 37 | 38 | ITEM OPTIONS 39 | 40 | replace true 41 | mass true 42 | ntotal 1000 43 | density 1 44 | field opls-aa 45 | build_dir . 46 | 47 | ITEM END 48 | 49 | # Shorthand 50 | # 51 | # - Format for shorthand: 52 | # 53 | # name,SMILES,fraction[,mol mass[,mol volume]] 54 | # 55 | # shorthand provides a quick way of constructing a chemistry file 56 | 57 | ITEM SHORTHAND 58 | 59 | water O,80 60 | alcohol CCO,20 61 | 62 | ITEM END 63 | 64 | # Alternative formal way for defining a simulation uses GROUPS and CLUSTERS. 65 | # Swapping the SHORTHAND section out with the sections below results in an 66 | # equivalent simulation definition. 67 | 68 | # Comments beginning 69 | 70 | ITEM COMMENTS 71 | 72 | # Groups 73 | # 74 | # - Format for groups: 75 | # 76 | # name,SMILES[,connect index,connect group:connect index[,...]] 77 | # 78 | # where the first connect index is the connection point in the current 79 | # group and the second in the connection group 80 | # - Asterix in SMILES denotes a connection point 81 | 82 | ITEM GROUPS 83 | 84 | water O 85 | alcohol CCO 86 | 87 | ITEM END 88 | 89 | # Clusters 90 | # 91 | # - Format for clusters: 92 | # 93 | # name,group,fraction[,mol mass[,mol volume]] 94 | # 95 | # molecular mass and volume are optional and function as an override 96 | # for mass calculation by means of a force field file; alternatively 97 | # surfaces can be included by using the group keyword 'surface' through 98 | # 99 | # name,surface,nx,file name 100 | # 101 | # file name refers to a crystal structure as available in ./lib with 102 | # nx repeat units in the x direction 103 | 104 | ITEM CLUSTERS 105 | 106 | water water,80 107 | alcohol alcohol,20 108 | 109 | ITEM END 110 | 111 | # Comments end 112 | 113 | ITEM END 114 | 115 | 116 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/opls/aa/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # script: setup.sh 4 | # author: Pieter J. in 't Veld 5 | # date: March 18, 2015 6 | # purpose: Generate EMC build and LAMMPS input scripts 7 | # 8 | # notes: 9 | # - Create a simulation with a target number of 1000 particles 10 | # - Use OPLS-AA as force field 11 | # - Use mol fraction in number of molecule determination 12 | # - Replace exisiting scripts 13 | # - Write output to project name 'solution' 14 | # - Creates build.emc for EMC and solution.in for LAMMPS 15 | # 16 | # usage with vmd after build: vmd -e solution.vmd 17 | # 18 | 19 | emc.pl \ 20 | -ntotal=1000 -field=opls-aa \ 21 | -replace solution $@; 22 | 23 | #emc_${HOST} build.emc 2>&1 | tee build.out 24 | 25 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/opls/ua/name.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # file: solution.esh 4 | # author: Pieter J. in 't Veld 5 | # date: August 15, 2016 6 | # purpose: Chemical input for emc.pl 7 | # 8 | # notes: 9 | # - Create a simulation with 80% m/m water and 20% m/m alcohol 10 | # - Alternative to chemistry.esh file, containing an OPTIONS section, 11 | # to be used with emc.pl v1.5 and up 12 | # - Allowed separators are commas and tabs, which can be used 13 | # interchangebly 14 | # - Call with 15 | # 16 | # emc.pl solution 17 | # 18 | # or (for MacOS or Linux) 19 | # 20 | # ./solution.esh 21 | # 22 | # creates build.emc and solution.in 23 | # 24 | 25 | # Options 26 | # 27 | # - Format for options: 28 | # 29 | # option,value[,...] 30 | # 31 | # options create a self-contained way of setting up a simulation 32 | # - Replace exisiting scripts 33 | # - Add mass profiles to LAMMPS input script 34 | # - Create a simulation with a target number of 1000 particles 35 | # - Use resulting density of 1 g/cc 36 | # - Use OPLS-UA as force field 37 | 38 | ITEM OPTIONS 39 | 40 | replace true 41 | mass true 42 | ntotal 1000 43 | density 1 44 | field opls-ua 45 | build_dir . 46 | 47 | ITEM END 48 | 49 | # Shorthand 50 | # 51 | # - Format for shorthand: 52 | # 53 | # name,SMILES,fraction[,mol mass[,mol volume]] 54 | # 55 | # shorthand provides a quick way of constructing a chemistry file 56 | 57 | ITEM SHORTHAND 58 | 59 | water O,80 60 | alcohol CCO,20 61 | 62 | ITEM END 63 | 64 | # Alternative formal way for defining a simulation uses GROUPS and CLUSTERS. 65 | # Swapping the SHORTHAND section out with the sections below results in an 66 | # equivalent simulation definition. 67 | 68 | # Comments beginning 69 | 70 | ITEM COMMENTS 71 | 72 | # Groups 73 | # 74 | # - Format for groups: 75 | # 76 | # name,SMILES[,connect index,connect group:connect index[,...]] 77 | # 78 | # where the first connect index is the connection point in the current 79 | # group and the second in the connection group 80 | # - Asterix in SMILES denotes a connection point 81 | 82 | ITEM GROUPS 83 | 84 | water O 85 | alcohol CCO 86 | 87 | ITEM END 88 | 89 | # Clusters 90 | # 91 | # - Format for clusters: 92 | # 93 | # name,group,fraction[,mol mass[,mol volume]] 94 | # 95 | # molecular mass and volume are optional and function as an override 96 | # for mass calculation by means of a force field file; alternatively 97 | # surfaces can be included by using the group keyword 'surface' through 98 | # 99 | # name,surface,nx,file name 100 | # 101 | # file name refers to a crystal structure as available in ./lib with 102 | # nx repeat units in the x direction 103 | 104 | ITEM CLUSTERS 105 | 106 | water water,80 107 | alcohol alcohol,20 108 | 109 | ITEM END 110 | 111 | # Comments end 112 | 113 | ITEM END 114 | 115 | 116 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/opls/ua/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # script: setup.sh 4 | # author: Pieter J. in 't Veld 5 | # date: March 18, 2015 6 | # purpose: Generate EMC build and LAMMPS input scripts 7 | # 8 | # notes: 9 | # - Create a simulation with a target number of 1000 particles 10 | # - Use OPLS-UA as force field 11 | # - Use mol fraction in number of molecule determination 12 | # - Replace exisiting scripts 13 | # - Write output to project name 'solution' 14 | # - Creates build.emc for EMC and solution.in for LAMMPS 15 | # 16 | # usage with vmd after build: vmd -e solution.vmd 17 | # 18 | 19 | emc.pl \ 20 | -ntotal=1000 -field=opls-ua \ 21 | -replace solution $@; 22 | 23 | #emc_${HOST} build.emc 2>&1 | tee build.out 24 | 25 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/opls/water/water.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | 3 | # Options 4 | 5 | ITEM OPTIONS 6 | 7 | seed -1 8 | field opls-aa 9 | charge true 10 | ntotal 1000 11 | mass true 12 | replace true 13 | profile true 14 | temperature 300 15 | phases water + gas vapor 16 | density 0.998 17 | shape 1 18 | build_dir . 19 | debug - 20 | 21 | ITEM END 22 | 23 | # Groups 24 | 25 | ITEM GROUPS 26 | 27 | water [O](H)(H) # SPC/E 28 | #water [OW3F](H)(H) # TIP3F 29 | #water [OW3P](H)(H) # TIP3P 30 | #water [O](H)(H)([LP]) # TIP4P 31 | #water [O](H)(H)([LP])([LP]) # TIP5P 32 | 33 | ITEM END 34 | 35 | # clusters 36 | 37 | ITEM CLUSTERS 38 | 39 | water water 1 40 | 41 | ITEM END 42 | 43 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/pcff/name.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # file: solution.esh 4 | # author: Pieter J. in 't Veld 5 | # date: August 15, 2016 6 | # purpose: Chemical input for emc.pl 7 | # 8 | # notes: 9 | # - Create a simulation with 80% m/m water and 20% m/m alcohol 10 | # - Alternative to chemistry.esh file, containing an OPTIONS section, 11 | # to be used with emc.pl v1.5 and up 12 | # - Allowed separators are commas and tabs, which can be used 13 | # interchangebly 14 | # - Call with 15 | # 16 | # emc.pl solution 17 | # 18 | # or (for MacOS or Linux) 19 | # 20 | # ./solution.esh 21 | # 22 | # creates build.emc and solution.in 23 | # 24 | 25 | # Options 26 | # 27 | # - Format for options: 28 | # 29 | # option,value[,...] 30 | # 31 | # options create a self-contained way of setting up a simulation 32 | # - Replace exisiting scripts 33 | # - Add mass profiles to LAMMPS input script 34 | # - Create a simulation with a target number of 1000 particles 35 | # - Use resulting density of 1 g/cc 36 | # - Use PCFF as force field 37 | 38 | ITEM OPTIONS 39 | 40 | replace true 41 | mass true 42 | ntotal 1000 43 | density 1 44 | field pcff 45 | build_dir . 46 | 47 | ITEM END 48 | 49 | # Shorthand 50 | # 51 | # - Format for shorthand: 52 | # 53 | # name,SMILES,fraction[,mol mass[,mol volume]] 54 | # 55 | # shorthand provides a quick way of constructing a chemistry file 56 | 57 | ITEM SHORTHAND 58 | 59 | water O,80 60 | alcohol CCO,20 61 | 62 | ITEM END 63 | 64 | # Alternative formal way for defining a simulation uses GROUPS and CLUSTERS. 65 | # Swapping the SHORTHAND section out with the sections below results in an 66 | # equivalent simulation definition. 67 | 68 | # Comments beginning 69 | 70 | ITEM COMMENTS 71 | 72 | # Groups 73 | # 74 | # - Format for groups: 75 | # 76 | # name,SMILES[,connect index,connect group:connect index[,...]] 77 | # 78 | # where the first connect index is the connection point in the current 79 | # group and the second in the connection group 80 | # - Asterix in SMILES denotes a connection point 81 | 82 | ITEM GROUPS 83 | 84 | water O 85 | alcohol CCO 86 | 87 | ITEM END 88 | 89 | # Clusters 90 | # 91 | # - Format for clusters: 92 | # 93 | # name,group,fraction[,mol mass[,mol volume]] 94 | # 95 | # molecular mass and volume are optional and function as an override 96 | # for mass calculation by means of a force field file; alternatively 97 | # surfaces can be included by using the group keyword 'surface' through 98 | # 99 | # name,surface,nx,file name 100 | # 101 | # file name refers to a crystal structure as available in ./lib with 102 | # nx repeat units in the x direction 103 | 104 | ITEM CLUSTERS 105 | 106 | water water,80 107 | alcohol alcohol,20 108 | 109 | ITEM END 110 | 111 | # Comments end 112 | 113 | ITEM END 114 | 115 | 116 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/pcff/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # script: setup.sh 4 | # author: Pieter J. in 't Veld 5 | # date: March 18, 2015 6 | # purpose: Generate EMC build and LAMMPS input scripts 7 | # 8 | # notes: 9 | # - Create a simulation with a target number of 1000 particles 10 | # - Use PCFF as force field 11 | # - Use mol fraction in number of molecule determination 12 | # - Replace exisiting scripts 13 | # - Write output to project name 'solution' 14 | # - Creates build.emc for EMC and solution.in for LAMMPS 15 | # 16 | # usage with vmd after build: vmd -e solution.vmd 17 | # 18 | 19 | emc.pl \ 20 | -ntotal=1000 -field=pcff \ 21 | -replace solution $@; 22 | 23 | #emc_${HOST} build.emc 2>&1 | tee build.out 24 | 25 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/trappe/name.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # file: solution.esh 4 | # author: Pieter J. in 't Veld 5 | # date: August 15, 2016 6 | # purpose: Chemical input for emc.pl 7 | # 8 | # notes: 9 | # - Create a simulation with 80% m/m water and 20% m/m alcohol 10 | # - Alternative to chemistry.esh file, containing an OPTIONS section, 11 | # to be used with emc.pl v1.5 and up 12 | # - Allowed separators are commas and tabs, which can be used 13 | # interchangebly 14 | # - Call with 15 | # 16 | # emc.pl solution 17 | # 18 | # or (for MacOS or Linux) 19 | # 20 | # ./solution.esh 21 | # 22 | # creates build.emc and solution.in 23 | # 24 | 25 | # Options 26 | # 27 | # - Format for options: 28 | # 29 | # option,value[,...] 30 | # 31 | # options create a self-contained way of setting up a simulation 32 | # - Replace exisiting scripts 33 | # - Add mass profiles to LAMMPS input script 34 | # - Create a simulation with a target number of 1000 particles 35 | # - Use resulting density of 1 g/cc 36 | # - Use TraPPE as force field 37 | 38 | ITEM OPTIONS 39 | 40 | replace true 41 | mass true 42 | ntotal 1000 43 | density 1 44 | field trappe 45 | build_dir . 46 | 47 | ITEM END 48 | 49 | # Shorthand 50 | # 51 | # - Format for shorthand: 52 | # 53 | # name,SMILES,fraction[,mol mass[,mol volume]] 54 | # 55 | # shorthand provides a quick way of constructing a chemistry file 56 | 57 | ITEM SHORTHAND 58 | 59 | water O,80 60 | alcohol CCO,20 61 | 62 | ITEM END 63 | 64 | # Alternative formal way for defining a simulation uses GROUPS and CLUSTERS. 65 | # Swapping the SHORTHAND section out with the sections below results in an 66 | # equivalent simulation definition. 67 | 68 | # Comments beginning 69 | 70 | ITEM COMMENTS 71 | 72 | # Groups 73 | # 74 | # - Format for groups: 75 | # 76 | # name,SMILES[,connect index,connect group:connect index[,...]] 77 | # 78 | # where the first connect index is the connection point in the current 79 | # group and the second in the connection group 80 | # - Asterix in SMILES denotes a connection point 81 | 82 | ITEM GROUPS 83 | 84 | water O 85 | alcohol CCO 86 | 87 | ITEM END 88 | 89 | # Clusters 90 | # 91 | # - Format for clusters: 92 | # 93 | # name,group,fraction[,mol mass[,mol volume]] 94 | # 95 | # molecular mass and volume are optional and function as an override 96 | # for mass calculation by means of a force field file; alternatively 97 | # surfaces can be included by using the group keyword 'surface' through 98 | # 99 | # name,surface,nx,file name 100 | # 101 | # file name refers to a crystal structure as available in ./lib with 102 | # nx repeat units in the x direction 103 | 104 | ITEM CLUSTERS 105 | 106 | water water,80 107 | alcohol alcohol,20 108 | 109 | ITEM END 110 | 111 | # Comments end 112 | 113 | ITEM END 114 | 115 | 116 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/trappe/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # script: setup.sh 4 | # author: Pieter J. in 't Veld 5 | # date: March 18, 2015 6 | # purpose: Generate EMC build and LAMMPS input scripts 7 | # 8 | # notes: 9 | # - Create a simulation with a target number of 1000 particles 10 | # - Use TraPPe as force field 11 | # - Use mol fraction in number of molecule determination 12 | # - Replace exisiting scripts 13 | # - Write output to project name 'solution' 14 | # - Creates build.emc for EMC and solution.in for LAMMPS 15 | # 16 | # usage with vmd after build: vmd -e solution.vmd 17 | # 18 | 19 | emc.pl \ 20 | -ntotal=1000 -field=trappe \ 21 | -replace solution $@; 22 | 23 | #emc_${HOST} build.emc 2>&1 | tee build.out 24 | 25 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/user/polymer.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # file: polymer.esh 4 | # author: Pieter J. in 't Veld 5 | # date: August 3, 2018 6 | # purpose: Example for user-defined force fields using standard force 7 | # field 8 | # 9 | # notes: 10 | # - Creation of a polyethylene melt using Paul-Yoon-Smith force field 11 | # definitions at rho = 0.85 g/cc and T = 300 K 12 | # - Creates a field with name 'polymer' in build directory 13 | # - Will execute EMC when path is set correctly 14 | # 15 | 16 | ITEM OPTIONS 17 | 18 | replace true 19 | field_type standard 20 | field_name polymer 21 | field_reduced false 22 | field_location . 23 | density 0.85 24 | temperature 300 25 | pressure 1 26 | ntotal 10000 27 | emc_execute true 28 | 29 | ITEM END 30 | 31 | # Groups 32 | 33 | ITEM GROUPS 34 | 35 | #ethyl *CC*,1,ethyl:2 36 | #methyl *C,1,ethyl:1,1,ethyl:2 37 | ethyl *CC*,1,ethyl:2,2,propyl:1 38 | propyl *C(C)C*,1,propyl:2,2,ethyl:1 39 | methyl *C,1,ethyl:1,1,ethyl:2,1,propyl:1,1,propyl:2 40 | 41 | ITEM END 42 | 43 | # Clusters 44 | 45 | ITEM CLUSTERS 46 | 47 | poly alternate 100 48 | 49 | ITEM END 50 | 51 | # Polymers 52 | 53 | ITEM POLYMERS 54 | 55 | poly 56 | #100 ethyl,50,methyl,2 57 | 100 ethyl:propyl=19:1,50,methyl,2 58 | #100 ethyl,38,propyl,2,methyl,2 59 | 60 | ITEM END 61 | 62 | # Field (Paul-Yoon-Smith adaptation) 63 | 64 | ITEM FIELD 65 | 66 | ITEM DEFINE 67 | 68 | ffname standard 69 | fftype united 70 | length angstrom 71 | energy kcal/mol 72 | density g/cc 73 | cutoff 10 74 | nbonded 3 75 | angle error 76 | torsion error 77 | 78 | ITEM END 79 | 80 | ITEM MASS 81 | 82 | # type mass element ncons charge comment 83 | 84 | ch 13.0189 C 3 0 CH (SP3) in alkanes 85 | ch2 14.0268 C 2 0 CH2 (SP3) in alkanes 86 | ch3 15.0347 C 1 0 CH3 methyl 87 | 88 | ITEM END 89 | 90 | ITEM RULES 91 | 92 | # type charge rule(s) 93 | 94 | ch 0 C(*)(*)(*) 95 | ch2 0 C(*)(*) 96 | ch3 0 C(*) 97 | 98 | ITEM END 99 | 100 | ITEM NONBOND 101 | 102 | # type1 type2 sigma eps 103 | 104 | ch ch 4.00904 0.01944 105 | ch2 ch2 4.00904 0.09344 106 | ch3 ch3 4.00904 0.22644 107 | 108 | ITEM END 109 | 110 | ITEM BOND 111 | 112 | # type1 type2 k l0 113 | 114 | * * 634 1.53 115 | 116 | ITEM END 117 | 118 | ITEM ANGLE 119 | 120 | # type1 type2 type3 k theta0 121 | 122 | * * * 120 110 123 | 124 | ITEM END 125 | 126 | ITEM TORSION 127 | 128 | # type1 type2 type3 type3 k n delta [...] 129 | 130 | * * * * 0.8 1 0 -0.4335 2 180 1.62 3 0 131 | 132 | ITEM END 133 | 134 | ITEM END 135 | 136 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/user/polymer.in: -------------------------------------------------------------------------------- 1 | # LAMMPS input script for standardized atomistic simulations 2 | # Created by emc.pl v4.1.5, January 4, 2024 as part of EMC 3 | # on Sun Feb 25 10:43:57 CET 2024 4 | 5 | # LAMMPS atomistic input script 6 | 7 | echo screen 8 | units real 9 | atom_style molecular 10 | 11 | # Variable definitions 12 | 13 | variable project index "polymer" # project name 14 | variable source index ../build # data directory 15 | variable params index ../build # parameter directory 16 | variable temperature index 300 # system temperature 17 | variable tdamp index 100 # temperature damping 18 | variable pressure index 1 # system pressure 19 | variable pdamp index 1000 # pressure damping 20 | variable dielectric index 1 # medium dielectric 21 | variable kappa index 4 # electrostatics kappa 22 | variable cutoff index 2.5 # standard cutoff 23 | variable charge_cutoff index 2.5 # charge cutoff 24 | variable precision index 0.001 # kspace precision 25 | variable lseed index 723853 # langevin seed 26 | variable vseed index 486234 # velocity seed 27 | variable tequil index 1000 # equilibration time 28 | variable dlimit index 0.1 # nve/limit distance 29 | variable trun index 10000000 # run time 30 | variable frestart index 0 # 0: equil, 1: restart 31 | variable dtrestart index 100000 # delta restart time 32 | variable dtdump index 100000 # delta dump time 33 | variable dtthermo index 1000 # delta thermo time 34 | variable timestep index 0.005 # integration time step 35 | variable tfreq index 10 # profile sampling freq 36 | variable nsample index 1000 # profile conf sampling 37 | variable dtime equal ${tfreq}*${nsample} # profile dtime 38 | variable restart index ${params}/${project}.restart 39 | 40 | if "${frestart} != 0" then & 41 | "variable data index ${restart}" & 42 | else & 43 | "variable data index ${params}/${project}.data" & 44 | 45 | # Interaction potential definition 46 | 47 | pair_style lj/cut ${cutoff} 48 | bond_style harmonic 49 | special_bonds lj/coul 0 0 0 50 | if "${frestart} != 0" then "read_restart ${data}" else "read_data ${data}" 51 | include ${params}/${project}.params 52 | 53 | # Integration conditions (check) 54 | 55 | timestep ${timestep} 56 | fix mom all momentum 100 linear 1 1 1 angular 57 | 58 | # Equilibration 59 | 60 | thermo ${dtthermo} 61 | if "${frestart} != 0" then "jump SELF simulate" 62 | velocity all create ${temperature} ${vseed} & 63 | dist gaussian rot yes mom yes sum yes 64 | fix temp all langevin ${temperature} ${temperature} ${tdamp} & 65 | ${lseed} 66 | fix int all nve/limit ${dlimit} 67 | run ${tequil} 68 | unfix temp 69 | unfix int 70 | write_restart ${project}.restart2 71 | 72 | # Simulation 73 | 74 | label simulate 75 | 76 | # Integrator 77 | 78 | fix int all npt temp ${temperature} ${temperature} ${tdamp} & 79 | iso ${pressure} ${pressure} ${pdamp} 80 | 81 | # System sampling: pressure 82 | 83 | fix sample_press all ave/time ${tfreq} ${nsample} ${dtime} & 84 | c_thermo_temp & 85 | c_thermo_press[1] c_thermo_press[2] c_thermo_press[3] & 86 | c_thermo_press[4] c_thermo_press[5] c_thermo_press[6] & 87 | file ${project}.pressure 88 | 89 | # Run conditions 90 | 91 | restart ${dtrestart} ${project}.restart1 ${project}.restart2 92 | dump 1 all custom ${dtdump} ${project}.dump id type x y z 93 | run ${trun} 94 | 95 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/user/polymer.prm: -------------------------------------------------------------------------------- 1 | # 2 | # STANDARD interaction parameters 3 | # converted by emc.pl v4.1.5, January 4, 2024 by Pieter J. in 't Veld 4 | # to be used in conjuction with EMC v9.4.4 or higher 5 | # 6 | 7 | # Force field definition 8 | 9 | ITEM DEFINE 10 | 11 | FFMODE STANDARD 12 | FFTYPE UNITED 13 | FFDEPTH 1 14 | VERSION 1.0 15 | CREATED 2024-02-25 16 | LENGTH ANGSTROM 17 | ENERGY KCAL/MOL 18 | DENSITY G/CC 19 | MIX BERTHELOT 20 | CUTOFF 10 21 | NBONDED 3 22 | ANGLE ERROR 23 | TORSION ERROR 24 | IMPROP IGNORE 25 | 26 | ITEM END 27 | 28 | # Masses 29 | 30 | ITEM MASS 31 | 32 | # type mass element ncons charge comment 33 | 34 | ch 1.3018900000e+01 C 3 0 CH (SP3) in alkanes 35 | ch2 1.4026800000e+01 C 2 0 CH2 (SP3) in alkanes 36 | ch3 1.5034700000e+01 C 1 0 CH3 methyl 37 | 38 | ITEM END 39 | 40 | # Nonbond parameters 41 | 42 | ITEM NONBOND 43 | 44 | # type1 type2 sigma epsilon 45 | 46 | ? ? 0.0000000000e+00 0.0000000000e+00 47 | ch ch 4.0090400000e+00 1.9440000000e-02 48 | ch2 ch2 4.0090400000e+00 9.3440000000e-02 49 | ch3 ch3 4.0090400000e+00 2.2644000000e-01 50 | 51 | ITEM END 52 | 53 | # Bond wildcard parameters 54 | 55 | ITEM BOND_AUTO 56 | 57 | # type1 type2 k l0 58 | 59 | * * 6.3400000000e+02 1.5300000000e+00 60 | 61 | ITEM END 62 | 63 | # Angle wildcard parameters 64 | 65 | ITEM ANGLE_AUTO 66 | 67 | # type1 type2 type3 k theta0 68 | 69 | * * * 1.2000000000e+02 1.1000000000e+02 70 | 71 | ITEM END 72 | 73 | # Torsion wildcard parameters 74 | 75 | ITEM TORSION_AUTO 76 | 77 | # type1 type2 type3 type4 k n delta [...] 78 | 79 | * * * * 8.0000000000e-01 1.0000000000e+00 0.0000000000e+00 -4.3350000000e-01 2.0000000000e+00 1.8000000000e+02 1.6200000000e+00 3.0000000000e+00 0.0000000000e+00 80 | 81 | ITEM END 82 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/field/user/polymer.top: -------------------------------------------------------------------------------- 1 | # 2 | # STANDARD topology 3 | # converted by emc.pl v4.1.5, January 4, 2024 by Pieter J. in 't Veld 4 | # to be used in conjuction with EMC v9.4.4 or higher 5 | # 6 | 7 | # Precedences 8 | 9 | ITEM PRECEDENCE 10 | 11 | ( 12 | (ch) 13 | (ch2) 14 | (ch3) 15 | ) 16 | 17 | ITEM END 18 | 19 | # Rules 20 | 21 | ITEM RULES 22 | 23 | # id type element index charge rule 24 | 25 | 0 ch C 1 0 C(*)(*)(*) 26 | 1 ch2 C 2 0 C(*)(*) 27 | 2 ch3 C 3 0 C(*) 28 | 29 | ITEM END 30 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/multiphase/multiphase.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | 3 | # Options 4 | 5 | ITEM OPTIONS 6 | 7 | ntotal 5000 8 | temperature 300 9 | density 1,0.8,0.8 10 | phases water + sds + oil 11 | field charmm/c32b1/all27_prot_lipid 12 | mass true 13 | profile true 14 | replace true 15 | build_dir . 16 | 17 | ITEM END 18 | 19 | # Shorthand 20 | 21 | ITEM SHORTHAND 22 | 23 | water O,0.4 24 | oil (C)8,0.4 25 | sds CCCCCCCCCCCCO:S(:O)(:O):O.[Na+],0.2 26 | 27 | ITEM END 28 | 29 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/alternate/polymer.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | 3 | # Options 4 | 5 | ITEM OPTIONS 6 | 7 | project dpd 8 | field dpd/general 9 | auto true 10 | ntotal 1000 11 | density 3 12 | replace true 13 | build_dir . 14 | sample volume 15 | profile density:true 16 | 17 | ITEM END 18 | 19 | # Groups 20 | 21 | ITEM GROUPS 22 | 23 | a *A*,1,a:2,2,b:1 24 | b *B*,1,b:2 25 | d *D,1,a:1,1,a:2,1,b:1,1,b:2 26 | 27 | ITEM END 28 | 29 | # Clusters 30 | 31 | ITEM CLUSTERS 32 | 33 | poly alternate,1 34 | 35 | ITEM END 36 | 37 | # Polymers 38 | 39 | ITEM POLYMERS 40 | 41 | poly 42 | 1 a,4,b,4,d,2 43 | 44 | ITEM END 45 | 46 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/alternate/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | emc.pl 4 | 5 | emc_${HOST} build.emc 2>&1 | tee build.out 6 | 7 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/biphase/polymer.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # Chemistry file new style 4 | # 5 | # file: chemistry.esh 6 | # author: Pieter J. in 't Veld 7 | # date: May 19, 2015 8 | # purpose: Chemical input for emc.pl 9 | # 10 | # notes: 11 | # - Create a simulation with water, salt and polyethylene 12 | # - Commas and tabs can be used interchangebly 13 | # - Demarcation 14 | # - Format for groups: 15 | # 16 | # name, SMILES[, connect index, connect group:connect index[, ...]] 17 | # 18 | # where the first connect index is the connection point in the current 19 | # group and the second in the connection group 20 | # - Asterix in SMILES denotes a connection point 21 | # - Format for clusters: 22 | # 23 | # name,group,fraction[,mol mass[,mol volume]] 24 | # 25 | # molecular mass and volume are optional and function as an override 26 | # for mass calculation by means of a force field file 27 | # - Format for polymers 28 | # 29 | # line 1: name 30 | # line 2: fraction,group,nrepeat[,group,nrepeat[, ...]] 31 | # 32 | # fraction in line 1 can be a mol, mass or volume fraction, as is the 33 | # case for clusters, fraction in line 2 always represents a mol 34 | # fraction 35 | # 36 | 37 | # Groups 38 | 39 | ITEM GROUPS 40 | 41 | water O 42 | salt [Na+].[Cl-] 43 | ethyl *CC*,1,ethyl:2 44 | methyl *C,1,ethyl:1,1,ethyl:2 45 | 46 | ITEM END 47 | 48 | # Clusters 49 | 50 | ITEM CLUSTERS 51 | 52 | water water 9 53 | salt salt 1 54 | poly random 10 55 | 56 | ITEM END 57 | 58 | # Polymers 59 | 60 | ITEM POLYMERS 61 | 62 | poly 63 | 10 ethyl,4,methyl,2 64 | 90 ethyl,6,methyl,2 65 | 66 | ITEM END 67 | 68 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/biphase/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # script: setup.sh 4 | # author: Pieter J. in 't Veld 5 | # date: May 19, 2015 6 | # purpose: Generate EMC build and LAMMPS input scripts 7 | # 8 | # notes: 9 | # - Create a simulation with a target number of 5000 particles 10 | # - Use OPLS-UA as force field 11 | # - Use mass fraction in number of molecule determination 12 | # - Add mass profile and mean square displacement calculations to LAMMPS 13 | # input script 14 | # - Replace exisiting scripts 15 | # - Write output to project name 'polymer' 16 | # - Generate a two-phase simulation with salt and water in the first 17 | # phase 18 | # - Creates build.emc for EMC and polymer.in for LAMMPS 19 | # 20 | # usage with vmd after build: vmd -e charmm.vmd 21 | # 22 | 23 | emc.pl \ 24 | -ntotal=5000 -mass -field=opls-ua \ 25 | -profile -msd -replace polymer salt water 26 | 27 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/block/polymer.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | 3 | # Options 4 | 5 | ITEM OPTIONS 6 | 7 | project dpd 8 | field dpd/general 9 | auto true 10 | ntotal 1000 11 | density 3 12 | replace true 13 | build_dir . 14 | 15 | ITEM END 16 | 17 | # Groups 18 | 19 | ITEM GROUPS 20 | 21 | a *A*,1,a:2,2,b:1 22 | b *B*,1,b:2 23 | d *D,1,a:1,1,a:2,1,b:1,1,b:2 24 | 25 | ITEM END 26 | 27 | # Clusters 28 | 29 | ITEM CLUSTERS 30 | 31 | poly block,1 32 | 33 | ITEM END 34 | 35 | # Polymers 36 | 37 | ITEM POLYMERS 38 | 39 | poly 40 | 1 a,4,b,4,d,2 41 | 42 | ITEM END 43 | 44 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/block/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | emc.pl 4 | 5 | emc_${HOST} build.emc 2>&1 | tee build.out 6 | 7 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/copolymer/polymer.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # Chemistry file new style 4 | # 5 | # file: chemistry.esh 6 | # author: Pieter J. in 't Veld 7 | # date: May 19, 2015 8 | # purpose: Chemical input for emc.pl 9 | # 10 | # notes: 11 | # - Create a simulation with water, salt and polyethylene 12 | # - Commas and tabs can be used interchangebly 13 | # - Demarcation 14 | # - Format for groups: 15 | # 16 | # name, SMILES[, connect index, connect group:connect index[, ...]] 17 | # 18 | # where the first connect index is the connection point in the current 19 | # group and the second in the connection group 20 | # - Asterix in SMILES denotes a connection point 21 | # - Format for clusters: 22 | # 23 | # name,group,fraction[,mol mass[,mol volume]] 24 | # 25 | # molecular mass and volume are optional and function as an override 26 | # for mass calculation by means of a force field file 27 | # - Format for polymers 28 | # 29 | # line 1: name 30 | # line 2: fraction,group[:group[=weight:...]],nrepeat[,...] 31 | # 32 | # fraction in line 1 can be a mol, mass or volume fraction, as is the 33 | # case for clusters, fraction in line 2 always represents a mol 34 | # fraction 35 | # 36 | # note: need to include terminators for correct mass calculation 37 | # 38 | 39 | # Options 40 | 41 | ITEM OPTIONS 42 | 43 | field opls-ua 44 | ntotal 5000 45 | mass true 46 | replace true 47 | 48 | ITEM END 49 | 50 | # Groups 51 | 52 | ITEM GROUPS 53 | 54 | ethyl *CC*,1,ethyl:2,1,propyl:2 55 | propyl *CC(C)*,1,propyl:2,1,ethyl:2 56 | methyl *C,1,ethyl:1,1,ethyl:2,1,propyl:1,1,propyl:2 57 | 58 | ITEM END 59 | 60 | # Clusters 61 | 62 | ITEM CLUSTERS 63 | 64 | poly random 100 65 | 66 | ITEM END 67 | 68 | # Polymers 69 | 70 | ITEM POLYMERS 71 | 72 | poly 73 | 100 ethyl:propyl=1:3,6,methyl,2 74 | 75 | ITEM END 76 | 77 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/dendrimer/polymer.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # Chemistry file new style 4 | # 5 | # file: chemistry.esh 6 | # author: Pieter J. in 't Veld 7 | # date: May 19, 2015 8 | # purpose: Chemical input for emc.pl 9 | # 10 | # notes: 11 | # - Create a simulation with water, salt and polyethylene 12 | # - Commas and tabs can be used interchangebly 13 | # - Demarcation 14 | # - Format for groups: 15 | # 16 | # name, SMILES[, connect index, connect group:connect index[, ...]] 17 | # 18 | # where the first connect index is the connection point in the current 19 | # group and the second in the connection group 20 | # - Asterix in SMILES denotes a connection point 21 | # - Format for clusters: 22 | # 23 | # name,group,fraction[,mol mass[,mol volume]] 24 | # 25 | # molecular mass and volume are optional and function as an override 26 | # for mass calculation by means of a force field file 27 | # - Format for polymers 28 | # 29 | # line 1: name 30 | # line 2: fraction,group[:group[=weight:...]],nrepeat[,...] 31 | # 32 | # fraction in line 1 can be a mol, mass or volume fraction, as is the 33 | # case for clusters, fraction in line 2 always represents a mol 34 | # fraction 35 | # 36 | # note: need to include terminators for correct mass calculation 37 | # 38 | 39 | # Groups 40 | 41 | ITEM GROUPS 42 | 43 | center *B(A*)A*,1,center:2,1,center:3 44 | termA *T,1,center:2,1,center:3 45 | termB *AT,1,center:1 46 | 47 | ITEM END 48 | 49 | # Clusters 50 | 51 | ITEM CLUSTERS 52 | 53 | poly random 1 54 | 55 | ITEM END 56 | 57 | # Polymers 58 | 59 | ITEM POLYMERS 60 | 61 | poly 62 | 1 center,9,termA,10,termB,1 63 | 64 | ITEM END 65 | 66 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/dendrimer/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # script: setup.sh 4 | # author: Pieter J. in 't Veld 5 | # date: May 19, 2015 6 | # purpose: Generate EMC build and LAMMPS input scripts 7 | # 8 | # notes: 9 | # - Create a simulation with a target number of 5000 particles 10 | # - Use OPLS-UA as force field 11 | # - Use mass fraction in number of molecule determination 12 | # - Add mass profile and mean square displacement calculations to LAMMPS 13 | # input script 14 | # - Replace exisiting scripts 15 | # - Write output to project name 'polymer' 16 | # - Generate a two-phase simulation with salt and water in the first 17 | # phase 18 | # - Creates build.emc for EMC and polymer.in for LAMMPS 19 | # 20 | # usage with vmd after build: vmd -e charmm.vmd 21 | # 22 | 23 | emc.pl \ 24 | -ntotal=5000 -density=3 -field=dpd/general \ 25 | -replace polymer 26 | 27 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/homopolymer/polymer.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # Chemistry file new style 4 | # 5 | # file: chemistry.esh 6 | # author: Pieter J. in 't Veld 7 | # date: May 19, 2015 8 | # purpose: Chemical input for emc.pl 9 | # 10 | # notes: 11 | # - Create a simulation with water, salt and polyethylene 12 | # - Commas and tabs can be used interchangebly 13 | # - Demarcation 14 | # - Format for groups: 15 | # 16 | # name, SMILES[, connect index, connect group:connect index[, ...]] 17 | # 18 | # where the first connect index is the connection point in the current 19 | # group and the second in the connection group 20 | # - Asterix in SMILES denotes a connection point 21 | # - Format for clusters: 22 | # 23 | # name,group,fraction[,mol mass[,mol volume]] 24 | # 25 | # molecular mass and volume are optional and function as an override 26 | # for mass calculation by means of a force field file 27 | # - Format for polymers 28 | # 29 | # line 1: name 30 | # line 2: fraction,group[:group[:...][=weight:...]],nrepeat[,...] 31 | # 32 | # fraction in line 1 can be a mol, mass or volume fraction, as is the 33 | # case for clusters, fraction in line 2 always represents a mol 34 | # fraction 35 | # 36 | # note: need to include terminators for correct mass calculation 37 | # 38 | 39 | ITEM OPTIONS 40 | 41 | replace true 42 | field pcff 43 | density 0.85 44 | ntotal 1000 45 | 46 | ITEM END 47 | 48 | # Groups 49 | 50 | ITEM GROUPS 51 | 52 | ethyl *CC*,1,ethyl:2 53 | methyl *C,1,ethyl:1,1,ethyl:2 54 | 55 | ITEM END 56 | 57 | # Clusters 58 | 59 | ITEM CLUSTERS 60 | 61 | poly alternate 1 62 | 63 | ITEM END 64 | 65 | # Polymers 66 | 67 | ITEM POLYMERS 68 | 69 | poly 70 | 100 ethyl,10,methyl,2 71 | 72 | ITEM END 73 | 74 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/homopolymer/polymer.in: -------------------------------------------------------------------------------- 1 | # LAMMPS input script for standardized atomistic simulations 2 | # Created by emc.pl v3.5.3, June 26, 2018 as part of EMC 3 | # on Wed Jun 27 19:17:46 CEST 2018 4 | 5 | # Variable definitions 6 | 7 | variable project index "polymer" # project name 8 | variable source index ../build # data directory 9 | variable params index ../build # parameter directory 10 | variable temperature index 300 # system temperature 11 | variable tdamp index 100 # temperature damping 12 | variable dielectric index 1 # medium dielectric 13 | variable kappa index 4 # electrostatics kappa 14 | variable cutoff index 9.5 # standard cutoff 15 | variable charge_cutoff index 9.5 # charge cutoff 16 | variable precision index 0.001 # kspace precision 17 | variable lseed index 723853 # langevin seed 18 | variable vseed index 1486234 # velocity init seed 19 | variable tequil index 1000 # equilibration time 20 | variable trun index 10000000 # run time 21 | variable frestart index 0 # 0: equil, 1: restart 22 | variable dtrestart index 100000 # delta restart time 23 | variable dtdump index 100000 # delta dump time 24 | variable dtthermo index 1000 # delta thermo time 25 | variable timestep index 1 # integration time step 26 | variable tfreq index 10 # profile sampling freq 27 | variable nsample index 1000 # profile conf sampling 28 | variable dtime equal ${tfreq}*${nsample} # profile dtime 29 | variable restart index ${params}/${project}.restart 30 | 31 | if "${frestart} != 0" then & 32 | "variable data index ${restart}" & 33 | else & 34 | "variable data index ${params}/${project}.data" & 35 | 36 | # LAMMPS atomistic input script 37 | 38 | echo screen 39 | units real 40 | atom_style full 41 | 42 | # Interaction potential definition 43 | 44 | pair_style lj/class2/coul/long ${cutoff} ${charge_cutoff} 45 | bond_style harmonic 46 | special_bonds lj/coul 0 0 1 47 | if "${frestart} != 0" then "read_restart ${data}" else "read_data ${data}" 48 | include ${params}/${project}.params 49 | 50 | # Integration conditions (check) 51 | 52 | timestep ${timestep} 53 | kspace_style pppm/cg ${precision} 54 | dielectric ${dielectric} 55 | fix mom all momentum 100 linear 1 1 1 angular 56 | 57 | # Equilibration 58 | 59 | thermo ${dtthermo} 60 | if "${frestart} != 0" then "jump SELF simulate" 61 | velocity all create ${temperature} ${vseed} & 62 | dist gaussian rot yes mom yes sum yes 63 | fix temp all langevin ${temperature} ${temperature} ${tdamp} & 64 | ${lseed} 65 | fix int all nve/limit 0.1 66 | run ${tequil} 67 | unfix temp 68 | unfix int 69 | write_restart ${project}.restart2 70 | 71 | # Simulation 72 | 73 | label simulate 74 | 75 | # Integrator 76 | 77 | fix temp all langevin ${temperature} ${temperature} ${tdamp} & 78 | ${lseed} 79 | fix int all nve 80 | 81 | # System sampling: pressure 82 | 83 | fix sample_press all ave/time ${tfreq} ${nsample} ${dtime} & 84 | c_thermo_temp & 85 | c_thermo_press[1] c_thermo_press[2] c_thermo_press[3] & 86 | c_thermo_press[4] c_thermo_press[5] c_thermo_press[6] & 87 | file ${project}.pressure 88 | 89 | # Run conditions 90 | 91 | restart ${dtrestart} ${project}.restart1 ${project}.restart2 92 | dump 1 all custom ${dtdump} ${project}.dump id type x y z 93 | run ${trun} 94 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/homopolymer/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # script: setup.sh 4 | # author: Pieter J. in 't Veld 5 | # date: May 19, 2015 6 | # purpose: Generate EMC build and LAMMPS input scripts 7 | # 8 | # notes: 9 | # - Create a simulation with a target number of 5000 particles 10 | # - Use OPLS-UA as force field 11 | # - Use mass fraction in number of molecule determination 12 | # - Add mass profile and mean square displacement calculations to LAMMPS 13 | # input script 14 | # - Replace exisiting scripts 15 | # - Write output to project name 'polymer' 16 | # - Generate a two-phase simulation with salt and water in the first 17 | # phase 18 | # - Creates build.emc for EMC and polymer.in for LAMMPS 19 | # 20 | # usage with vmd after build: vmd -e charmm.vmd 21 | # 22 | 23 | emc.pl \ 24 | -ntotal=5000 -mass -field=opls-ua \ 25 | -profile -msd -replace polymer 26 | 27 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/random/polymer.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | 3 | # Options 4 | 5 | ITEM OPTIONS 6 | 7 | project dpd 8 | field dpd/general 9 | auto true 10 | ntotal 1000 11 | density 3 12 | replace true 13 | build_dir . 14 | 15 | ITEM END 16 | 17 | # Groups 18 | 19 | ITEM GROUPS 20 | 21 | a *A*,1,a:2,2,b:1 22 | b *B*,1,b:2 23 | d *D,1,a:1,1,a:2,1,b:1,1,b:2 24 | 25 | ITEM END 26 | 27 | # Clusters 28 | 29 | ITEM CLUSTERS 30 | 31 | poly random,1 32 | 33 | ITEM END 34 | 35 | # Polymers 36 | 37 | ITEM POLYMERS 38 | 39 | poly 40 | 1 a,4,b,4,d,2 41 | 42 | ITEM END 43 | 44 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/random/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | emc.pl 4 | 5 | emc_${HOST} build.emc 2>&1 | tee build.out 6 | 7 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/random_block/block.prm: -------------------------------------------------------------------------------- 1 | # 2 | # DPD interaction parameters 3 | # to be used in conjuction with EMC v9.4.4 or higher 4 | # created by emc.pl v3.9.0, July 28, 2019 5 | # on Tue Jul 30 11:53:08 EDT 2019 6 | # 7 | 8 | # Force field definition 9 | 10 | ITEM DEFINE 11 | 12 | FFNAME DPD 13 | FFTYPE COARSE 14 | VERSION V3.9.0 15 | CREATED 30-07-2019 16 | MIX NONE 17 | DENSITY REDUCED 18 | ENERGY REDUCED 19 | LENGTH REDUCED 20 | NBONDED 0 21 | CUTOFF 1.0 22 | GAMMA 4.5 23 | DEFAULT 25.0 24 | ANGLE IGNORE 25 | TORSION IGNORE 26 | IMPROP IGNORE 27 | 28 | ITEM END 29 | 30 | # Masses 31 | 32 | ITEM MASS 33 | 34 | # type mass element ncons charge comment 35 | 36 | 37 | ITEM END 38 | 39 | # Typing equivalences 40 | 41 | ITEM EQUIVALENCE 42 | 43 | # type pair bond angle torsion improper 44 | 45 | ITEM END 46 | 47 | # Bond wildcard parameters 48 | 49 | ITEM BOND_AUTO 50 | 51 | # type1 type2 k l0 52 | 53 | * * 25 1 54 | 55 | ITEM END 56 | 57 | # Templates 58 | 59 | ITEM TEMPLATES 60 | 61 | # name smiles 62 | 63 | ITEM END 64 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/random_block/polymer.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | 3 | # Options 4 | 5 | ITEM OPTIONS 6 | 7 | project block 8 | field dpd/general 9 | ntotal 1e3 10 | replace true 11 | profile true 12 | mass true 13 | 14 | ITEM END 15 | 16 | # Groups 17 | 18 | ITEM GROUPS 19 | 20 | A:t *A*,1,A:2 21 | B:t *B*,1,A:2,1,B:2 22 | C:t *C*,1,A:2,1,B:2,1,C:2 23 | D:t *D*,1,A:2,1,B:2,1,C:2,1,D:2 24 | W W 25 | 26 | ITEM END 27 | 28 | # Clusters 29 | 30 | ITEM CLUSTERS 31 | 32 | poly random,1 33 | water W,1 34 | 35 | ITEM END 36 | 37 | # Profiles 38 | 39 | ITEM PROFILES 40 | 41 | all cluster poly water 42 | 43 | ITEM END 44 | 45 | # Polymers 46 | 47 | ITEM POLYMERS 48 | 49 | poly 50 | 0.25 A:B=1:2,5,C:D=1:1,5 51 | 0.25 A:B=1:2,10,C:D=1:1,10 52 | 0.25 A:B=1:2,10,C:D=1:1,10 53 | 0.25 A:B=1:2,10,C:D=1:1,10 54 | 55 | ITEM END 56 | 57 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/polymer/random_block/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | emc.pl 4 | 5 | emc_${HOST} build.emc 2>&1 | tee build.out 6 | 7 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/qm/setup.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # script: chemistry.esh 4 | # author: Pieter J. in 't Veld 5 | # date: March 12, 2024 6 | # purpose: Example for altering assigned partial charges 7 | # 8 | # notes: 9 | # 20240312 - Only works with emc.pl (not with emc.pl) 10 | # 11 | 12 | ITEM OPTIONS 13 | 14 | replace true 15 | field trappe-ua 16 | #system_charge false 17 | ntotal 1000 18 | density 0.1 19 | number true 20 | focus true 21 | emc_output exit=true 22 | emc_execute true 23 | 24 | ITEM END 25 | 26 | ITEM SHORTHAND 27 | 28 | # standard TraPPE water 29 | 30 | water O,1 31 | 32 | # additive partial charges to exisiting field 33 | # c=a is short for charges=additive (both options are valid) 34 | 35 | water1:c=a [O+0.2]([H-0.1])([H-0.1]),1 36 | 37 | # partial charges overriding exisiting field 38 | # c=o is short for charges=override (both options are valid) 39 | 40 | water2:c=o [O-0.8]([H+0.4])([H+0.4]),1 41 | 42 | ITEM END 43 | 44 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/record/cat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$1" = "" ]; then 4 | echo "usage: $0 root"; exit; 5 | fi 6 | 7 | if [ ! -e $(ls $1_*.pdb | head -1) ]; then 8 | echo "no files found"; echo; exit; 9 | fi; 10 | 11 | last=$(basename $(ls -r $1_*.pdb | head -1) .pdb); 12 | 13 | cat $1_*.pdb >$1.pdb 14 | cp $last.psf $1.psf; 15 | 16 | rm $1.pdb.gz $1.psf.gz; 17 | gzip $1.pdb $1.psf; 18 | 19 | echo "#!/usr/bin/env vmd -e 20 | 21 | # variables 22 | 23 | set project \"$1\" 24 | 25 | # load structure 26 | 27 | if { [file exists \$project.psf.gz] == 1} { 28 | exec gunzip \$project.psf.gz 29 | } 30 | if { [file exists \$project.pdb.gz] == 1} { 31 | exec gunzip \$project.pdb.gz 32 | 33 | } 34 | mol new \$project.psf waitfor all 35 | mol addfile \$project.pdb waitfor all 36 | 37 | exec gzip \$project.psf 38 | exec gzip \$project.pdb 39 | 40 | # set representation 41 | 42 | mol delrep 0 top 43 | mol representation Licorice 0.3 44 | mol selection {not {x = 0 and y = 0 and z = 0}} 45 | mol addrep top 46 | mol selupdate 0 top 1 47 | mol colupdate 0 top 0 48 | mol scaleminmax top 0 0.000000 0.000000 49 | mol smoothrep top 0 0 50 | mol showrep top 0 1 51 | 52 | mol representation PaperChain 1.000000 10.000000 53 | mol color Name 54 | mol selection {not {x = 0 and y = 0 and z = 0}} 55 | mol material EdgyGlass 56 | mol addrep top 57 | mol selupdate 1 top 1 58 | mol colupdate 1 top 0 59 | mol scaleminmax top 1 0.000000 0.000000 60 | mol smoothrep top 1 0 61 | 62 | # reset view 63 | 64 | display resetview 65 | 66 | # set periodic box 67 | 68 | pbc box 69 | " > $1.vmd; 70 | 71 | chmod +x $1.vmd; 72 | 73 | rm -f $1_*.pdb 74 | rm -f $1_*.psf 75 | rm -f $1_*.vmd 76 | 77 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/record/exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "${HOST}" == "" ]; then 4 | if [ $(uname) == Darwin ]; then EMC="emc_macos"; 5 | elif [ $(uname) == Linux ]; then EMC="emc_linux"; 6 | else EMC="emc_win32.exe"; fi; 7 | else 8 | EMC="emc_${HOST}"; 9 | fi; 10 | 11 | if [ "${EMC_ROOT}" != "" ]; then 12 | "${EMC_ROOT}/scripts/emc.pl" fullerene.esh; 13 | if [ -e build.emc ]; then 14 | rm -f record_*; 15 | "${EMC_ROOT}/bin/${EMC}" build 2>&1 | tee build.out; 16 | fi; 17 | else 18 | ./fullerene.esh; 19 | if [ -e build.emc ]; then 20 | rm -f record_*; 21 | ${EMC} build 2>&1 | tee build.out; 22 | fi; 23 | fi; 24 | 25 | if [ -e "$(ls record_*.pdb | head -1)" ]; then 26 | ./cat.sh record; 27 | fi; 28 | 29 | echo; echo "view with 'vmd -e record.vmd'"; echo; 30 | 31 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/record/fullerene.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | 3 | # Options 4 | 5 | ITEM OPTIONS 6 | 7 | seed -1 8 | replace true 9 | field trappe-ua 10 | density 0.01 11 | temperature 300 12 | number true 13 | 14 | nrelax 200 15 | radius 9.5 16 | build_center true 17 | 18 | weight nonbond=0.001, bond=0.001 19 | record name="record", frequency=10, inactive=true 20 | 21 | emc_depth 6 22 | 23 | ITEM END 24 | 25 | # Shorthand notation 26 | 27 | ITEM SHORTHAND 28 | 29 | c60 c12c3c4c5c1c6c7c8c2c9c1c3c2c3c4c4c%10c5c5c6c6c7c7c%11c8c9c8c9c1c2c1c2c3c4c3c4c%10c5c5c6c6c7c7c%11c8c8c9c1c1c2c3c2c4c5c6c3c7c8c1c23,1 30 | 31 | ITEM END 32 | 33 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/surface/lammps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mpiexec -n 2 \ 4 | lmp_${HOST} \ 5 | -var dtthermo 10 -var trun 0 -var dtdump 1 \ 6 | -in surface.in 2>&1 | tee surface.out 7 | 8 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/surface/lmp2pdb.emc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.sh 2 | (* EMC: Script *) 3 | 4 | variables = { 5 | name -> "surface" 6 | }; 7 | 8 | get = { 9 | name -> name, 10 | compress -> true 11 | }; 12 | 13 | traject = { 14 | mode -> read, 15 | scale -> false, 16 | name -> name+".dump" 17 | }; 18 | 19 | pdb = {name -> name+"_trj", forcefield -> auto, detect -> false, 20 | unwrap -> true, pbc -> true, cut -> true}; 21 | 22 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/chemistry/surface/surface.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | 3 | # Options 4 | 5 | ITEM OPTIONS 6 | 7 | project tutorial 8 | density 0.8 9 | temperature 298 10 | ntotal 1000 11 | shape 1.5 12 | build_dir . 13 | field opls-ua 14 | pdb_cut true 15 | charge false 16 | mass true 17 | profile true 18 | replace true 19 | 20 | ITEM END 21 | 22 | # Variables defining surface 23 | 24 | ITEM VARIABLES 25 | 26 | # following variables redefine counterparts occuring in "lib/diamond_bonded" 27 | 28 | diamond_chemistry "*C(*)(*)*" 29 | diamond_name "carbon" 30 | diamond_atomistic 1 31 | 32 | lbond 1.529 33 | 34 | ITEM END 35 | 36 | # Groups 37 | 38 | ITEM GROUPS 39 | 40 | decane (C)10 41 | 42 | ITEM END 43 | 44 | # Clusters 45 | 46 | ITEM CLUSTERS 47 | 48 | decane decane 1 49 | surface import 4 $root+"lib/diamond_bonded" emc 50 | 51 | ITEM END 52 | 53 | # Translation 54 | 55 | ITEM VERBATIM 2 56 | 57 | translate = {delta -> {0.5*geometry(xx), 0, 0}}; 58 | 59 | ITEM END 60 | 61 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/environment/field/chemistry/field/stage/lj.prm: -------------------------------------------------------------------------------- 1 | # 2 | # STANDARD interaction parameters 3 | # converted by emc.pl v3.5.3, June 28, 2018 by Pieter J. in 't Veld 4 | # to be used in conjuction with EMC v9.4.3 or higher 5 | # 6 | 7 | # Force field definition 8 | 9 | ITEM DEFINE 10 | 11 | FFMODE STANDARD 12 | FFTYPE COARSE 13 | FFDEPTH 1 14 | VERSION 1.0 15 | CREATED 2018-07-03 16 | LENGTH REDUCED 17 | ENERGY REDUCED 18 | DENSITY REDUCED 19 | MIX BERTHELOT 20 | CUTOFF 2.5 21 | NBONDED 2 22 | ANGLE ERROR 23 | TORSION IGNORE 24 | IMPROP IGNORE 25 | 26 | ITEM END 27 | 28 | # Masses 29 | 30 | ITEM MASS 31 | 32 | # type mass element ncons charge comment 33 | 34 | a 1 A 0 0 LJ type A 35 | b 1 B 0 0 LJ type B 36 | s 1 S 0 0 LJ type S 37 | t 1 T 0 0 LJ type T 38 | 39 | ITEM END 40 | 41 | # Nonbond wildcard parameters 42 | 43 | ITEM NONBOND_AUTO 44 | 45 | # type1 type2 epsilon sigma 46 | 47 | * * 1 1 48 | 49 | ITEM END 50 | 51 | # Bond wildcard parameters 52 | 53 | ITEM BOND_AUTO 54 | 55 | # type1 type2 k l0 56 | 57 | * * 100 1 58 | 59 | ITEM END 60 | 61 | # Angle wildcard parameters 62 | 63 | ITEM ANGLE_AUTO 64 | 65 | # type1 type2 type3 k theta0 66 | 67 | * a * 20 180 68 | * b * 20 120 69 | 70 | ITEM END 71 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/environment/field/chemistry/scripts/lj.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # script: scripts/lj.sh 4 | # author: emc.pl v3.9.2, November 19, 2019 5 | # date: Thu Dec 5 09:59:07 CET 2019 6 | # purpose: Create chemistry file based on sample definitions; this 7 | # script is auto-generated 8 | # 9 | 10 | # functions 11 | 12 | init() { 13 | while [ "$1" != "" ]; do 14 | case "$1" in 15 | -project) shift; project="$1";; 16 | -trial) shift; trial="$1";; 17 | -phase) shift; stage="$1";; 18 | -stage) shift; stage="$1";; 19 | -nbranches) shift; nbranches="$1";; 20 | -*) shift;; 21 | *) if [ "$chemistry" = "" ]; then chemistry="$home/$1.esh"; fi;; 22 | esac; 23 | shift; 24 | done; 25 | 26 | if [ "$chemistry" = "" ]; then chemistry="$home/chemistry.esh"; fi; 27 | if [ "$trial" = "" ]; then trial="generic"; fi; 28 | if [ "$stage" = "" ]; then stage="generic"; fi; 29 | 30 | template=stages/$project/$stage.esh; 31 | if [ ! -e "$template" ]; then error "nonexistent template '$template'"; fi; 32 | } 33 | 34 | error() { 35 | echo "Error: $@"; 36 | echo; 37 | exit -1; 38 | } 39 | 40 | # create chemistry file 41 | 42 | create() { 43 | cp "$template" "$chemistry"; 44 | 45 | replace "@GROUPS" "groups/$stage" "$trial"; 46 | replace "@CLUSTERS" "clusters/$stage" "$trial"; 47 | replace "@POLYMERS" "polymers/$stage" "$trial"; 48 | replace "@SHORTHAND" "shorthand/$stage" "$trial"; 49 | replace "@STRUCTURE" "structures/$stage" "$trial"; 50 | 51 | replace "@WORKDIR" "${HOME}/emc/v9.4.4/examples/setup/environment/field"; 52 | replace "@STAGE" "$stage"; 53 | replace "@TRIAL" "$trial"; 54 | replace "@NBRANCHES" "$nbranches"; 55 | 56 | chmod a+rx "$chemistry"; 57 | } 58 | 59 | replace() { 60 | if [ "$3" = "" ]; then 61 | if [ "$2" != "" ]; then 62 | replace.pl -v -q "$1" "$2" "$chemistry"; 63 | fi; 64 | elif [ -f "$2/$3.dat" ]; then 65 | replace.pl -v -q "$1" "$(cat $2/$3.dat)" "$chemistry"; 66 | fi; 67 | } 68 | 69 | # main 70 | 71 | home=$(pwd); 72 | project="lj"; 73 | cd $(dirname $0)/..; 74 | init $@; 75 | create; 76 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/environment/field/chemistry/stages/lj/stage.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # script: stages/lj/stage.esh 4 | # author: emc.pl v3.9.2, November 19, 2019 5 | # date: Thu Dec 5 09:59:07 CET 2019 6 | # purpose: EMC setup chemistry file as part of a multiple simulation 7 | # workflow; this file is auto-generated 8 | # 9 | 10 | 11 | # Command line options 12 | 13 | ITEM OPTIONS 14 | 15 | replace true 16 | ntotal 10000 17 | tequil 100000 18 | density 0.7 19 | temperature 1.0 20 | field_type standard 21 | field_name lj 22 | #field_location @{WORKDIR}/chemistry/field/@{STAGE}/ 23 | field_location . 24 | replace true 25 | 26 | ITEM END 27 | 28 | # Chemistry 29 | 30 | ITEM GROUPS 31 | 32 | a *a*,1,a:2,1,b:2,1,b:3,2,b:1 33 | b *b(*)*,1,a:2,2,a:1,3,a:1 34 | t *t,1,a:1,1,b:1,1,b:2,1,b:3 35 | s s 36 | 37 | ITEM END 38 | 39 | ITEM CLUSTERS 40 | 41 | solvent s,80 42 | polymer random,20 43 | 44 | ITEM END 45 | 46 | ITEM POLYMERS 47 | 48 | polymer 49 | 100 a,10,b,@{NBRANCHES},t,2+@{NBRANCHES} 50 | 51 | ITEM END 52 | 53 | # 54 | # LJ Force Field 55 | # 56 | 57 | ITEM FIELD 58 | 59 | # Definitions 60 | 61 | ITEM DEFINE 62 | 63 | FFNAME STANDARD 64 | FFTYPE COARSE 65 | LENGTH REDUCED 66 | ENERGY REDUCED 67 | DENSITY REDUCED 68 | MIX BERTHELOT 69 | CUTOFF 2.5 70 | NBONDED 2 71 | ANGLE ERROR 72 | 73 | ITEM END 74 | 75 | # Masses 76 | 77 | ITEM MASSES 78 | 79 | # type mass element ncons charge comment 80 | 81 | a 1 A 0 0 LJ type A 82 | b 1 B 0 0 LJ type B 83 | s 1 S 0 0 LJ type S 84 | t 1 T 0 0 LJ type T 85 | 86 | ITEM END 87 | 88 | # Nonbond parameters 89 | 90 | ITEM NONBOND 91 | 92 | # type1 type2 sigma eps 93 | 94 | * * 1 1 95 | 96 | ITEM END 97 | 98 | # Bond parameters 99 | 100 | ITEM BOND 101 | 102 | # type1 type2 k l0 103 | 104 | * * 100 1 105 | 106 | 107 | ITEM END 108 | 109 | # Angle parameters 110 | 111 | ITEM ANGLE 112 | 113 | # type1 type2 type3 k theta0 114 | 115 | * a * 20 180 116 | * b * 20 120 117 | 118 | ITEM END 119 | 120 | # Torsion parameters 121 | 122 | ITEM TORSION 123 | 124 | # type1 type2 type3 type3 k n delta [...] 125 | 126 | ITEM END 127 | 128 | ITEM END # FIELD 129 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/environment/field/setup/2018070100.esh: -------------------------------------------------------------------------------- 1 | lj.esh -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/environment/field/setup/lj.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # script: lj.esh 4 | # author: Pieter J. in 't Veld 5 | # date: June 23, 2018 6 | # purpose: Demonstration of user-defined force field 7 | # 8 | 9 | ITEM ENVIRONMENT 10 | 11 | project lj 12 | replace true 13 | name_testdir lj 14 | queue_build default 15 | queue_run default 16 | queue_analyze default 17 | #queue_ppn 40 18 | ncores 8 19 | trun - 20 | 21 | ITEM END 22 | 23 | # 24 | # Setup loops for simulations 25 | # 26 | 27 | ITEM LOOPS 28 | 29 | stage branched 30 | nbranches 2 4 6 31 | epsilon 0.9 1.0 1.1 32 | 33 | ITEM END # LOOPS 34 | 35 | # 36 | # Project stage branched 37 | # 38 | 39 | ITEM STAGE branched 40 | 41 | # Set script template 42 | 43 | ITEM TEMPLATE 44 | 45 | # Command line options 46 | 47 | ITEM OPTIONS 48 | 49 | replace true 50 | ntotal 10000 51 | tequil 100000 52 | density 0.7 53 | temperature 1.0 54 | field_type standard 55 | field_name lj 56 | field_location . 57 | replace true 58 | 59 | ITEM END 60 | 61 | # Chemistry 62 | 63 | ITEM GROUPS 64 | 65 | A *a*,1,A:2,1,B:2,1,B:3,2,B:1 66 | B *b(*)*,1,A:2,2,A:1,3,A:1 67 | T *t,1,A:1,1,B:1,1,B:2,1,B:3 68 | S s 69 | 70 | ITEM END 71 | 72 | ITEM CLUSTERS 73 | 74 | solvent S,80 75 | polymer random,20 76 | 77 | ITEM END 78 | 79 | ITEM POLYMERS 80 | 81 | polymer 82 | 100 A,10,B,@{NBRANCHES},T,2+@{NBRANCHES} 83 | 84 | ITEM END 85 | 86 | # 87 | # LJ Force Field 88 | # 89 | 90 | ITEM FIELD 91 | 92 | # Definitions 93 | 94 | ITEM DEFINE 95 | 96 | FFNAME STANDARD 97 | FFTYPE COARSE 98 | LENGTH REDUCED 99 | ENERGY REDUCED 100 | DENSITY REDUCED 101 | MIX BERTHELOT 102 | CUTOFF 2.5 103 | NBONDED 2 104 | ANGLE ERROR 105 | 106 | ITEM END 107 | 108 | # Masses 109 | 110 | ITEM MASS 111 | 112 | # type mass element ncons charge comment 113 | 114 | a 1 A 0 0 LJ type A 115 | b 1 B 0 0 LJ type B 116 | s 1 S 0 0 LJ type S 117 | t 1 T 0 0 LJ type T 118 | 119 | ITEM END 120 | 121 | # Nonbond parameters 122 | 123 | ITEM NONBOND 124 | 125 | # type1 type2 sigma eps 126 | 127 | * * 1 @{EPSILON} 128 | 129 | ITEM END 130 | 131 | # Bond parameters 132 | 133 | ITEM BOND 134 | 135 | # type1 type2 k l0 136 | 137 | * * 100 1 138 | 139 | ITEM END 140 | 141 | # Angle parameters 142 | 143 | ITEM ANGLE 144 | 145 | # type1 type2 type3 k theta0 146 | 147 | * a * 20 180 148 | * b * 20 120 149 | 150 | ITEM END 151 | 152 | # Torsion parameters 153 | 154 | ITEM TORSION 155 | 156 | # type1 type2 type3 type3 k n delta [...] 157 | 158 | ITEM END 159 | 160 | ITEM END # FIELD 161 | 162 | ITEM END # TEMPLATE 163 | 164 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/environment/green-kubo/viscosity.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | 3 | # 4 | # Zero shear simulation 5 | # 6 | 7 | ITEM OPTIONS 8 | 9 | project viscosity 10 | replace true 11 | environment true 12 | name_analyze date00 13 | name_build date00 14 | name_run date00 15 | queue_build default 16 | queue_run default 17 | queue_analyze default 18 | shear true, true 19 | restart false 20 | ncores 8 21 | trun - 22 | 23 | ITEM END 24 | 25 | ITEM LOOPS 26 | 27 | stage pure 28 | trial c-06 c-07 c-08 c-09 c-10 & 29 | c-11 c-12 c-13 c-14 c-15 30 | shear 0.00e0 31 | copy 10 32 | 33 | ITEM END 34 | 35 | # 36 | # Project stage pure 37 | # 38 | 39 | ITEM STAGE pure 40 | 41 | # Set script template 42 | 43 | ITEM TEMPLATE 44 | 45 | # Command line options 46 | 47 | ITEM OPTIONS 48 | 49 | replace true 50 | field opls-ua 51 | ntotal 10000 52 | tequil 100000 53 | density 0.85 54 | pressure 1.0 55 | temperature 300 56 | shear @SHEAR,erate 57 | sample green-kubo 58 | replace true 59 | increment empty 60 | 61 | ITEM END 62 | 63 | # Chemistry 64 | 65 | ITEM SHORTHAND 66 | 67 | molecule @STRUCTURE,1 68 | 69 | ITEM END 70 | 71 | ITEM END # TEMPLATE 72 | 73 | # Set structures 74 | 75 | ITEM STRUCTURES 76 | 77 | c-06 (C)6 78 | c-07 (C)7 79 | c-08 (C)8 80 | c-09 (C)9 81 | c-10 (C)10 82 | c-11 (C)11 83 | c-12 (C)12 84 | c-13 (C)13 85 | c-14 (C)14 86 | c-15 (C)15 87 | 88 | ITEM END 89 | 90 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/environment/nemd/shear.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | 3 | # 4 | # Zero shear simulation 5 | # 6 | 7 | ITEM OPTIONS 8 | 9 | project pure 10 | replace true 11 | environment true 12 | name_analyze date00 13 | name_build date00 14 | name_run date00 15 | queue_build default 16 | queue_analyze default 17 | shear true, true 18 | restart false 19 | ncores 8 20 | trun - 21 | 22 | ITEM END 23 | 24 | ITEM LOOPS 25 | 26 | stage pure 27 | trial c-06 c-07 c-08 c-09 c-10 & 28 | c-11 c-12 c-13 c-14 c-15 29 | shear 0.00e0 30 | copy 1 31 | 32 | ITEM END 33 | 34 | # 35 | # Subsequent shear simulation 36 | # 37 | 38 | ITEM OPTIONS 39 | 40 | name_build - 41 | name_run date10 42 | name_analyze date10 43 | restart true, ../../0.00e0 44 | 45 | ITEM END 46 | 47 | ITEM LOOPS 48 | 49 | shear 1.00e-4, 1.00e-5, 1.00e-6 50 | 51 | ITEM END 52 | 53 | # 54 | # Project stage pure 55 | # 56 | 57 | ITEM STAGE pure 58 | 59 | # Set script template 60 | 61 | ITEM TEMPLATE 62 | 63 | # Command line options 64 | 65 | ITEM OPTIONS 66 | 67 | replace true 68 | field opls-ua 69 | ntotal 10000 70 | tequil 100000 71 | density 0.85 72 | pressure 1.0 73 | temperature 300 74 | shear @SHEAR,erate 75 | replace true 76 | field_increment empty 77 | 78 | ITEM END 79 | 80 | # Chemistry 81 | 82 | ITEM SHORTHAND 83 | 84 | molecule @STRUCTURE,1 85 | 86 | ITEM END 87 | 88 | ITEM END # TEMPLATE 89 | 90 | # Set structures 91 | 92 | ITEM STRUCTURES 93 | 94 | c-06 (C)6 95 | c-07 (C)7 96 | c-08 (C)8 97 | c-09 (C)9 98 | c-10 (C)10 99 | c-11 (C)11 100 | c-12 (C)12 101 | c-13 (C)13 102 | c-14 (C)14 103 | c-15 (C)15 104 | c-16 (C)16 105 | 106 | ITEM END 107 | 108 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/environment/t_glass/README: -------------------------------------------------------------------------------- 1 | # Instructions 2 | # ------------ 3 | # - Create a base project directory 4 | # 5 | # mkdir ./project 6 | # 7 | # - Copy this setup directory to your project directory 8 | # 9 | # cp -pPR $EMC_ROOT/examples/setup/environment/t_glass/setup ./project 10 | # 11 | # - Execute all setup scripts from the root project directory, e.g. 12 | # 13 | # cd ./project 14 | # ./setup/2018061100.esh 15 | # 16 | # - Always have a ./project/setup directory in order to use multiple stages 17 | # within the same project 18 | # - The above structure warrants uniformity for future database solutions 19 | # - Keep a log of which scripts are stored in your ./project/setup directory; 20 | # see Index below for a suggestion 21 | # 22 | # Remarks 23 | # ------- 24 | # - Log file for explanation of different setup scripts 25 | # - It is advised to use date and serial number in setup script names 26 | # - Simulations create different atactic polymers 27 | # - Different types of analyses are performed 28 | # - Pressure, energy and density are sampled 29 | # - Cavity size analysis is performed additionally (see ITEM ANALYSIS 30 | # paragraph) 31 | # 32 | # Index 33 | # ----- 34 | .esh stage sub temperature remarks 35 | ------------------------------------------------------------------------------- 36 | 2023072600 00 a-pp s:200:300:5 atactic polypropylene 37 | a-ps s:320:420:5 atactic polystyrene 38 | 2023072601 00 a-pp s:200:300:5 atactic polypropylene 39 | a-ps s:320:420:5 atactic polystyrene 40 | different way 41 | 2023072610 00 a-pp s:200:300:5 atactic polypropylene 42 | a-ps s:320:420:5 atactic polystyrene 43 | same as 2023072600 but without 44 | comments 45 | 2023072611 00 a-pp s:200:300:5 atactic polypropylene 46 | a-ps s:320:420:5 atactic polystyrene 47 | same as 2023072601 but without 48 | comments 49 | 50 | -------------------------------------------------------------------------------- /pyemc/emc/examples/setup/environment/t_glass/setup/2023072611.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # script: t_glass.esh 4 | # author: Pieter J. in 't Veld 5 | # date: June 11, 2018, July 27, 2023. 6 | # purpose: Example for creating input for glass temperature calculations; 7 | # 8 | # notes: 9 | # 20180611 Creation date 10 | # 20230727 Adaptation for atactic polypropylene and polystyrene 11 | # Addition of comments 12 | # 13 | # - this script generates 420 simulations in total 14 | # - start simulations with 15 | # 16 | # ./run/2023072611.sh -build 17 | # 18 | # which spans an EMC build for each, chained with a subsequent LAMMPS 19 | # simulation 20 | # 21 | 22 | # 23 | # General settings 24 | # 25 | 26 | ITEM ENVIRONMENT 27 | 28 | project atom 29 | replace true 30 | queue_run default 31 | queue_build default 32 | queue_analyze default 33 | time_build 00:40:00 34 | time_analyze 24:00:00 35 | time_run 24:00:00 36 | name_testdir t_glass 37 | analyze_window 25 38 | ncores 20 39 | preprocess true 40 | trun - 41 | 42 | ITEM END # ENVIRONMENT 43 | 44 | # Analysis 45 | 46 | ITEM ANALYSIS 47 | 48 | cavity start=2e6, ninserts=1e5, record=false 49 | 50 | ITEM END # ANALYSIS 51 | 52 | # Variables 53 | 54 | ITEM VARIABLES 55 | 56 | pressure 1.0 57 | 58 | ITEM END # VARIABLES 59 | 60 | # Loops 61 | 62 | ITEM LOOPS 63 | 64 | stage 00 65 | field:h charmm trappe 66 | trial a-pp a-ps 67 | monomer:h *C(C)C* *C(c1ccccc1)C* 68 | temperature:p s:200:300:5 s:320:420:5 69 | density:h 0.85 1.00 70 | copy 5 71 | 72 | ITEM END # LOOPS 73 | 74 | # 75 | # Project stage 00 76 | # 77 | 78 | ITEM STAGE 00 79 | 80 | # Set script template 81 | 82 | ITEM TEMPLATE 83 | 84 | # Command line options 85 | 86 | ITEM OPTIONS 87 | 88 | #define charmm charmm/c36a/cgenff 89 | #define trappe trappe/2014/trappe-ua 90 | 91 | replace true 92 | field @{FIELD} 93 | field_increment empty 94 | ntotal 25000 95 | tequil 10000 96 | dtdump 1e6 97 | density @{DENSITY} 98 | pressure 1.0 99 | temperature @{TEMPERATURE} 100 | sample pressure=true, volume=true, energy=true 101 | 102 | ITEM END # OPTIONS 103 | 104 | # LAMMPS relaxation parameters 105 | 106 | ITEM VARIABLES 107 | 108 | trelax 5e5 109 | thigh @{TEMPERATURE}+400 110 | 111 | ITEM END # VARIABLES 112 | 113 | ITEM LAMMPS stage=simulation spot=tail 114 | 115 | fix int all npt temp ${temperature} ${thigh} ${tdamp} & 116 | iso ${pressure} ${pressure} ${pdamp} 117 | run ${trelax} 118 | unfix int 119 | 120 | fix int all npt temp ${thigh} ${temperature} ${tdamp} & 121 | iso ${pressure} ${pressure} ${pdamp} 122 | run ${trelax} 123 | unfix int 124 | 125 | write_restart ${project}.restart2 126 | 127 | ITEM END # LAMMPS 128 | 129 | # Chemistry 130 | 131 | # Groups 132 | 133 | ITEM GROUPS 134 | 135 | monomer @{MONOMER}, 1,monomer:2, 1,term:1, 2,term:1 136 | term *C 137 | 138 | ITEM END # GROUPS 139 | 140 | # Clusters 141 | 142 | ITEM CLUSTERS 143 | 144 | polymer alternate,1 145 | 146 | ITEM END # CLUSTERS 147 | 148 | # Polymers 149 | 150 | ITEM POLYMERS 151 | 152 | polymer 153 | 100 monomer,30,term,2 154 | 155 | ITEM END # POLYMERS 156 | 157 | ITEM END # TEMPLATE 158 | 159 | -------------------------------------------------------------------------------- /pyemc/emc/examples/tutorial/bulk: -------------------------------------------------------------------------------- 1 | ../setup/chemistry/bulk -------------------------------------------------------------------------------- /pyemc/emc/examples/tutorial/copolymer: -------------------------------------------------------------------------------- 1 | ../setup/chemistry/polymer/copolymer -------------------------------------------------------------------------------- /pyemc/emc/examples/tutorial/graft: -------------------------------------------------------------------------------- 1 | ../build/graft -------------------------------------------------------------------------------- /pyemc/emc/examples/tutorial/multiphase: -------------------------------------------------------------------------------- 1 | ../setup/chemistry/multiphase -------------------------------------------------------------------------------- /pyemc/emc/examples/tutorial/shear: -------------------------------------------------------------------------------- 1 | ../setup/environment/nemd -------------------------------------------------------------------------------- /pyemc/emc/examples/tutorial/surface: -------------------------------------------------------------------------------- 1 | ../setup/chemistry/surface -------------------------------------------------------------------------------- /pyemc/emc/examples/tutorial/t_glass: -------------------------------------------------------------------------------- 1 | ../setup/environment/t_glass -------------------------------------------------------------------------------- /pyemc/emc/field/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinshen56714/emc-pypi/f32daee3b5d8e372a9b719c1b79ac37b81e3a6f3/pyemc/emc/field/.DS_Store -------------------------------------------------------------------------------- /pyemc/emc/field/born/2016/convert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | script=../../../scripts/emc_field.pl; 4 | 5 | $script matsui; 6 | $script guillot; 7 | 8 | -------------------------------------------------------------------------------- /pyemc/emc/field/born/2016/guillot.prm: -------------------------------------------------------------------------------- 1 | # 2 | # Born interaction parameters using guillot.define 3 | # converted by field.pl v1.0, May 21, 2016 by Pieter J. in 't Veld 4 | # to be used in conjuction with EMC v9.3.9 or higher 5 | # 6 | 7 | # Force field definition 8 | 9 | ITEM DEFINE 10 | 11 | FFMODE BORN 12 | FFTYPE ATOMISTIC 13 | FFDEPTH 4 14 | VERSION Jan 2008 15 | CREATED Oct 2019 16 | LENGTH ANGSTROM 17 | ENERGY KCAL/MOL 18 | DENSITY G/CC 19 | MIX BERTHELOT 20 | CUTOFF 10.5 21 | NBONDED 0 22 | PAIR14 EXCLUDE 23 | ANGLE ERROR 24 | TORSION ERROR 25 | 26 | ITEM END 27 | 28 | # Literature references 29 | 30 | ITEM REFERENCES 31 | 32 | # year volume page journal 33 | 34 | 2008 71 1249 Geochim. Cosmochim. Acta 35 | 36 | ITEM END 37 | 38 | # Masses 39 | 40 | ITEM MASS 41 | 42 | # type mass element ncons charge comment 43 | 44 | ? 1 ? 0 0 Dummy 45 | al+3 26.982 Al 0 3 Aluminium 46 | ca+2 40.078 Ca 0 2 Calcium 47 | fe+2 55.845 Fe 0 2 Iron +2 48 | fe+3 55.845 Fe 0 3 Iron +3 49 | k+ 39.098 K 0 1 Potassium 50 | mg+2 24.305 Mg 0 2 Magnesium 51 | na+ 22.990 Na 0 1 Sodium 52 | o-2 15.9994 O 0 -2 Oxygen 53 | si+4 28.085 Si 0 4 Silicon 54 | ti+4 47.867 Ti 0 4 Titanium 55 | 56 | ITEM END 57 | 58 | # Typing equivalences 59 | 60 | ITEM EQUIVALENCE_AUTO 61 | 62 | # type pair incr bond angle torsion improper 63 | 64 | ? ? ? ? ? ? ? 65 | al+3 al+3 al+3 al+3 al+3 al+3 al+3 66 | ca+2 ca+2 ca+2 ca+2 ca+2 ca+2 ca+2 67 | fe+2 fe+2 fe+2 fe+2 fe+2 fe+2 fe+2 68 | fe+3 fe+3 fe+3 fe+3 fe+3 fe+3 fe+3 69 | k+ k+ k+ k+ k+ k+ k+ 70 | mg+2 mg+2 mg+2 mg+2 mg+2 mg+2 mg+2 71 | na+ na+ na+ na+ na+ na+ na+ 72 | o-2 o-2 o-2 o-2 o-2 o-2 o-2 73 | si+4 si+4 si+4 si+4 si+4 si+4 si+4 74 | ti+4 ti+4 ti+4 ti+4 ti+4 ti+4 ti+4 75 | 76 | ITEM END 77 | 78 | # Typing equivalences 79 | 80 | ITEM EQUIVALENCE 81 | 82 | # type pair incr bond angle torsion improper 83 | 84 | ? ? ? ? ? ? ? 85 | al+3 al+3 al+3 al+3 al+3 al+3 al+3 86 | ca+2 ca+2 ca+2 ca+2 ca+2 ca+2 ca+2 87 | fe+2 fe+2 fe+2 fe+2 fe+2 fe+2 fe+2 88 | fe+3 fe+3 fe+3 fe+3 fe+3 fe+3 fe+3 89 | k+ k+ k+ k+ k+ k+ k+ 90 | mg+2 mg+2 mg+2 mg+2 mg+2 mg+2 mg+2 91 | na+ na+ na+ na+ na+ na+ na+ 92 | o-2 o-2 o-2 o-2 o-2 o-2 o-2 93 | si+4 si+4 si+4 si+4 si+4 si+4 si+4 94 | ti+4 ti+4 ti+4 ti+4 ti+4 ti+4 ti+4 95 | 96 | ITEM END 97 | 98 | # Nonbonded parameters 99 | 100 | ITEM NONBOND 101 | 102 | # type1 type2 sigma rho a c d 103 | 104 | ? ? 0.0 0.0 0.0 0.0 0.0 105 | al+3 al+3 2.60707 0.172 0.172 797.385 0.0 106 | ca+2 ca+2 2.99388 0.178 0.178 974.534 0.0 107 | fe+2 fe+2 2.71208 0.190 0.190 0.0 0.0 108 | k+ k+ 3.51191 0.290 0.290 0.0 0.0 109 | mg+2 mg+2 2.71588 0.178 0.178 629.116 0.0 110 | na+ na+ 2.82334 0.170 0.170 0.0 0.0 111 | o-2 o-2 3.59702 0.265 0.265 1962.278 0.0 112 | si+4 si+4 2.54225 0.161 0.161 1067.655 0.0 113 | ti+4 ti+4 2.79218 0.178 0.178 1067.655 0.0 114 | 115 | ITEM END 116 | -------------------------------------------------------------------------------- /pyemc/emc/field/born/2016/guillot.top: -------------------------------------------------------------------------------- 1 | # 2 | # Born topology using guillot.define 3 | # converted by field.pl v1.0, May 21, 2016 by Pieter J. in 't Veld 4 | # to be used in conjuction with EMC v9.3.9 or higher 5 | # 6 | 7 | # Rule precedences 8 | 9 | ITEM PRECEDENCE 10 | 11 | (? 12 | (al+3) 13 | (ca+2) 14 | (fe+2) 15 | (fe+3) 16 | (k+) 17 | (mg+2) 18 | (na+) 19 | (o-2) 20 | (si+4) 21 | (ti+4) 22 | (?) 23 | ) 24 | 25 | ITEM END 26 | 27 | # Rules 28 | 29 | ITEM RULES 30 | 31 | # id type element index charge rule 32 | 33 | 0 ? ? 1 0 [DM] 34 | 1 al+3 Al 2 1.4175 [Al+3] 35 | 2 ca+2 Ca 3 0.945 [Ca+2] 36 | 3 fe+2 Fe 4 0.945 [Fe+2] 37 | 4 fe+3 Fe 5 1.4175 [Fe+3] 38 | 5 k+ K 6 0.4725 [K+] 39 | 6 mg+2 Mg 7 0.945 [Mg+2] 40 | 7 na+ Na 8 0.4725 [Na+] 41 | 8 o-2 O 11 -0.945 [O-2] 42 | 9 si+4 Si 9 1.89 [Si+4] 43 | 10 ti+4 Ti 10 1.89 [Ti+4] 44 | 45 | ITEM END 46 | -------------------------------------------------------------------------------- /pyemc/emc/field/born/2016/matsui.prm: -------------------------------------------------------------------------------- 1 | # 2 | # Born interaction parameters using matsui.define 3 | # converted by field.pl v1.0, May 21, 2016 by Pieter J. in 't Veld 4 | # to be used in conjuction with EMC v9.3.9 or higher 5 | # 6 | 7 | # Force field definition 8 | 9 | ITEM DEFINE 10 | 11 | FFMODE BORN 12 | FFTYPE ATOMISTIC 13 | FFDEPTH 4 14 | VERSION Jan 1998 15 | CREATED Oct 2019 16 | LENGTH ANGSTROM 17 | ENERGY KCAL/MOL 18 | DENSITY G/CC 19 | MIX BERTHELOT 20 | CUTOFF 10 21 | NBONDED 0 22 | PAIR14 EXCLUDE 23 | ANGLE ERROR 24 | TORSION ERROR 25 | 26 | ITEM END 27 | 28 | # Literature references 29 | 30 | ITEM REFERENCES 31 | 32 | # year volume page journal 33 | 34 | 1998 101 145 Geophys. Monograph 35 | 36 | ITEM END 37 | 38 | # Masses 39 | 40 | ITEM MASS 41 | 42 | # type mass element ncons charge comment 43 | 44 | ? 1 ? 0 0 Dummy 45 | al+3 26.982 Al 0 3 Aluminium 46 | ca+2 40.078 Ca 0 2 Calcium 47 | mg+2 24.305 Mg 0 2 Magnesium 48 | na+ 22.990 Na 0 1 Sodium 49 | o-2 15.9994 O 0 -2 Oxygen 50 | si+4 28.085 Si 0 4 Silicon 51 | 52 | ITEM END 53 | 54 | # Typing equivalences 55 | 56 | ITEM EQUIVALENCE_AUTO 57 | 58 | # type pair incr bond angle torsion improper 59 | 60 | ? ? ? ? ? ? ? 61 | al+3 al+3 al+3 al+3 al+3 al+3 al+3 62 | ca+2 ca+2 ca+2 ca+2 ca+2 ca+2 ca+2 63 | mg+2 mg+2 mg+2 mg+2 mg+2 mg+2 mg+2 64 | na+ na+ na+ na+ na+ na+ na+ 65 | o-2 o-2 o-2 o-2 o-2 o-2 o-2 66 | si+4 si+4 si+4 si+4 si+4 si+4 si+4 67 | 68 | ITEM END 69 | 70 | # Typing equivalences 71 | 72 | ITEM EQUIVALENCE 73 | 74 | # type pair incr bond angle torsion improper 75 | 76 | ? ? ? ? ? ? ? 77 | al+3 al+3 al+3 al+3 al+3 al+3 al+3 78 | ca+2 ca+2 ca+2 ca+2 ca+2 ca+2 ca+2 79 | mg+2 mg+2 mg+2 mg+2 mg+2 mg+2 mg+2 80 | na+ na+ na+ na+ na+ na+ na+ 81 | o-2 o-2 o-2 o-2 o-2 o-2 o-2 82 | si+4 si+4 si+4 si+4 si+4 si+4 si+4 83 | 84 | ITEM END 85 | 86 | # Nonbonded parameters 87 | 88 | ITEM NONBOND 89 | 90 | # type1 type2 sigma rho a c d 91 | 92 | ? ? 0.0 0.0 0.0 0.0 0.0 93 | al+3 al+3 1.5704 0.068 0.068 324.023 0.0 94 | ca+2 ca+2 2.3440 0.080 0.080 483.987 0.0 95 | mg+2 mg+2 1.7880 0.080 0.080 201.698 0.0 96 | na+ na+ 2.3200 0.080 0.080 400.007 0.0 97 | o-2 o-2 3.6430 0.276 0.276 1962.278 0.0 98 | si+4 si+4 1.4408 0.046 0.046 580.901 0.0 99 | 100 | ITEM END 101 | -------------------------------------------------------------------------------- /pyemc/emc/field/born/2016/matsui.top: -------------------------------------------------------------------------------- 1 | # 2 | # Born topology using matsui.define 3 | # converted by field.pl v1.0, May 21, 2016 by Pieter J. in 't Veld 4 | # to be used in conjuction with EMC v9.3.9 or higher 5 | # 6 | 7 | # Rule precedences 8 | 9 | ITEM PRECEDENCE 10 | 11 | (? 12 | (al+3) 13 | (ca+2) 14 | (mg+2) 15 | (na+) 16 | (o-2) 17 | (si+4) 18 | (?) 19 | ) 20 | 21 | ITEM END 22 | 23 | # Rules 24 | 25 | ITEM RULES 26 | 27 | # id type element index charge rule 28 | 29 | 0 ? ? 1 0 [DM] 30 | 1 al+3 Al 2 1.4175 [Al+3] 31 | 2 ca+2 Ca 3 0.945 [Ca+2] 32 | 3 mg+2 Mg 4 0.945 [Mg+2] 33 | 4 na+ Na 5 0.4725 [Na+] 34 | 5 o-2 O 7 -0.945 [O-2] 35 | 6 si+4 Si 6 1.890 [Si+4] 36 | 37 | ITEM END 38 | -------------------------------------------------------------------------------- /pyemc/emc/field/cff/al2o3_templates.dat: -------------------------------------------------------------------------------- 1 | ! al2o3_templates.dat 2 | ! 3 | ! Template file of potential type assignment templates for the CFF forcefield 4 | ! 5 | ! ************************************************************************** 6 | ! * * 7 | ! * THIS PROGRAM AND ALL SUBROUTINES, DATA, AND FILES USED BY IT * 8 | ! * ARE PROTECTED BY COPYRIGHT AND HENCE MAY NOT BE USED, COPIED, * 9 | ! * MODIFIED, TRANSMITTED, INSPECTED, OR EXECUTED BY ANY MEANS INCLUDING * 10 | ! * THE USE OF ELECTRONIC DATA PROCESSING EQUIPMENT, XEROGRAPHY, OR * 11 | ! * ANY OTHER METHODS WITHOUT THE EXPRESS WRITTEN PERMISSION OF THE * 12 | ! * COPYRIGHT HOLDER. * 13 | ! * * 14 | ! * Copyright (C) 2020 BASF SE, All Rights Reserved * 15 | ! * * 16 | ! ************************************************************************** 17 | ! 18 | ! Revision History: 19 | ! PJV 04/29/2020 Aluminium oxide surface 20 | 21 | type: ? 22 | ! anything 23 | template: (>*) 24 | end_type 25 | 26 | ! 27 | ! Aluminium 28 | ! 29 | 30 | type: al4o 31 | ! surface hydrogen 32 | template: [>Al(-O)(-O)(-O)(-O)] 33 | end_type 34 | 35 | type: al6o 36 | ! surface hydrogen 37 | template: [>Al(-O)(-O)(-O)(-O)(-O)(-O)] 38 | end_type 39 | 40 | ! 41 | ! Hydrogen 42 | ! 43 | 44 | type: h1al 45 | ! surface hydrogen 46 | template: [>H(-O(-Al))] 47 | end_type 48 | 49 | ! 50 | ! Oxygen 51 | ! 52 | 53 | type: o1al 54 | ! surface oxygen 55 | template: [>O(-Al)] 56 | atom_test:1 57 | formal_charge:-1 58 | end_test 59 | end_type 60 | 61 | type: o2al 62 | ! surface oxygen 63 | template: [>O(-Al)(-H)] 64 | end_type 65 | 66 | type: o4al 67 | ! surface oxygen 68 | template: [>O(-Al)(-Al)(-Al)(-Al)] 69 | end_type 70 | 71 | type: o4al 72 | ! surface oxygen 73 | template: [>O(-Al)(-Al)(-Al)(-H)] 74 | end_type 75 | 76 | ! 77 | ! Precedences 78 | ! 79 | 80 | precedence: 81 | (? 82 | (al4o) 83 | (al6o) 84 | (h1al) 85 | (o1al) 86 | (o2al) 87 | (o4al) 88 | ) 89 | end_precedence 90 | 91 | -------------------------------------------------------------------------------- /pyemc/emc/field/cff/c3s_templates.dat: -------------------------------------------------------------------------------- 1 | ! c3s_templates.dat 2 | ! 3 | ! Template file of potential type assignment templates for the CFF forcefield 4 | ! 5 | ! ************************************************************************** 6 | ! * * 7 | ! * THIS PROGRAM AND ALL SUBROUTINES, DATA, AND FILES USED BY IT * 8 | ! * ARE PROTECTED BY COPYRIGHT AND HENCE MAY NOT BE USED, COPIED, * 9 | ! * MODIFIED, TRANSMITTED, INSPECTED, OR EXECUTED BY ANY MEANS INCLUDING * 10 | ! * THE USE OF ELECTRONIC DATA PROCESSING EQUIPMENT, XEROGRAPHY, OR * 11 | ! * ANY OTHER METHODS WITHOUT THE EXPRESS WRITTEN PERMISSION OF THE * 12 | ! * COPYRIGHT HOLDER. * 13 | ! * * 14 | ! * Copyright (C) 2021 BASF SE, All Rights Reserved * 15 | ! * * 16 | ! ************************************************************************** 17 | ! 18 | ! Revision History: 19 | ! RKM 03/03/2021 Creation of rules 20 | ! PJV 03/25/2021 Change of rules and precedences to correctly 21 | ! distinguish between different types 22 | 23 | type: ? 24 | ! anything 25 | template: (>*) 26 | end_type 27 | 28 | 29 | ! 30 | ! Silicate in C3S 31 | ! 32 | 33 | type: o1si 34 | ! single bonded oxygen in charged silicate ion 35 | template: [>O[~Si]] 36 | ! atom_test:1 37 | ! formal charge: -2 38 | ! end_test 39 | end_type 40 | 41 | 42 | type: si4s 43 | ! central silicon 44 | template: [>Si(~O)(~O)(~O)(~O)] 45 | ! atom_test:1 46 | ! formal_charge:4 47 | ! end_test 48 | end_type 49 | 50 | 51 | ! 52 | ! Silanol group in C3S 53 | ! 54 | 55 | type:h1os 56 | ! hydrogen bonded to oxygen 57 | template: (>H(-O(Si))) 58 | ! atom_test:2 59 | ! end_test 60 | end_type 61 | 62 | 63 | type: o2sl 64 | ! oxygen in surface 65 | template (>O(-Si)(-H)) 66 | end_type 67 | 68 | 69 | ! 70 | ! Hydroxyl ion in C3S 71 | ! 72 | 73 | type:h1oh 74 | ! hydrogen bonded to oxygen 75 | template: (>H(-O)) 76 | atom_test:2 77 | formal_charge:-1 78 | end_test 79 | end_type 80 | 81 | 82 | type: o1ho 83 | ! oxygen in hydroxyl ion 84 | template (>O(-H)) 85 | end_type 86 | 87 | ! 88 | ! Ca ion in C3S 89 | ! 90 | 91 | type: ca3s 92 | ! calcium ion 93 | template: [>Ca] 94 | ! atom_test: 1 95 | ! formal_charge: 2 96 | ! end_test 97 | end_type 98 | 99 | 100 | ! 101 | ! Oxide ion in C3S 102 | ! 103 | 104 | type: oc3s 105 | ! oxide ion 106 | template: [>O] 107 | ! atom_test: 1 108 | ! formal_charge: -2 109 | ! end_test 110 | end_type 111 | 112 | 113 | ! 114 | ! Precedences 115 | ! 116 | 117 | precedence: 118 | (? 119 | (ca3s) 120 | (h1oh) 121 | (h1os) 122 | (oc3s 123 | (o1si) (o1ho) (o2sl) ) 124 | (si4s) 125 | ) 126 | end_precedence 127 | 128 | -------------------------------------------------------------------------------- /pyemc/emc/field/cff/caso4_templates.dat: -------------------------------------------------------------------------------- 1 | ! caso4_templates.dat 2 | ! 3 | ! Template file of potential type assignment templates for the CFF forcefield 4 | ! 5 | ! ************************************************************************** 6 | ! * * 7 | ! * THIS PROGRAM AND ALL SUBROUTINES, DATA, AND FILES USED BY IT * 8 | ! * ARE PROTECTED BY COPYRIGHT AND HENCE MAY NOT BE USED, COPIED, * 9 | ! * MODIFIED, TRANSMITTED, INSPECTED, OR EXECUTED BY ANY MEANS INCLUDING * 10 | ! * THE USE OF ELECTRONIC DATA PROCESSING EQUIPMENT, XEROGRAPHY, OR * 11 | ! * ANY OTHER METHODS WITHOUT THE EXPRESS WRITTEN PERMISSION OF THE * 12 | ! * COPYRIGHT HOLDER. * 13 | ! * * 14 | ! * Copyright (C) 2020 BASF SE, All Rights Reserved * 15 | ! * * 16 | ! ************************************************************************** 17 | ! 18 | ! Revision History: 19 | ! PJV 07/09/2020 Creation of template 20 | 21 | type: ? 22 | ! anything 23 | template: (>*) 24 | end_type 25 | 26 | 27 | ! 28 | ! Gypsum sulfate 29 | ! 30 | 31 | type: o1sg 32 | ! single bonded oxygen in charged sulfate ion 33 | template: [>O[~S]] 34 | ! atom_test:1 35 | ! formal charge: -2 36 | ! end_test 37 | end_type 38 | 39 | 40 | type: s4og 41 | ! central sulfur 42 | template: [>S(~O)(~O)(~O)(~O)] 43 | ! atom_test:1 44 | ! formal_charge:6 45 | ! end_test 46 | end_type 47 | 48 | 49 | ! 50 | ! Gypsum crystalline water 51 | ! 52 | 53 | type:h1og 54 | ! hydrogen bonded to oxygen 55 | template: (>H(-O)) 56 | ! atom_test:2 57 | ! end_test 58 | end_type 59 | 60 | 61 | type: o2hg 62 | ! oxygen in water 63 | template (>O(-H)(-H)) 64 | end_type 65 | 66 | 67 | ! 68 | ! Gypsum calcium 69 | ! 70 | 71 | type: ca+g 72 | ! calcium ion 73 | template: [>Ca] 74 | ! atom_test: 1 75 | ! formal_charge: 2 76 | ! end_test 77 | end_type 78 | 79 | 80 | ! 81 | ! Precedences 82 | ! 83 | 84 | precedence: 85 | (? 86 | (o1sg) 87 | (s4og) 88 | (h1og) 89 | (o2hg) 90 | (ca+g) 91 | ) 92 | end_precedence 93 | 94 | -------------------------------------------------------------------------------- /pyemc/emc/field/cff/sio2_templates.dat: -------------------------------------------------------------------------------- 1 | ! sio2_templates.dat 2 | ! 3 | ! Template file of potential type assignment templates for the CFF forcefield 4 | ! 5 | ! ************************************************************************** 6 | ! * * 7 | ! * THIS PROGRAM AND ALL SUBROUTINES, DATA, AND FILES USED BY IT * 8 | ! * ARE PROTECTED BY COPYRIGHT AND HENCE MAY NOT BE USED, COPIED, * 9 | ! * MODIFIED, TRANSMITTED, INSPECTED, OR EXECUTED BY ANY MEANS INCLUDING * 10 | ! * THE USE OF ELECTRONIC DATA PROCESSING EQUIPMENT, XEROGRAPHY, OR * 11 | ! * ANY OTHER METHODS WITHOUT THE EXPRESS WRITTEN PERMISSION OF THE * 12 | ! * COPYRIGHT HOLDER. * 13 | ! * * 14 | ! * Copyright (C) 2023 BASF SE, All Rights Reserved * 15 | ! * * 16 | ! ************************************************************************** 17 | ! 18 | ! Revision History: 19 | ! PJV 05/03/2020 Silicon oxide surface 20 | ! PJV 10/11/2023 Added rules for deprotonated surface oxygen 21 | 22 | type: ? 23 | ! anything 24 | template: (>*) 25 | end_type 26 | 27 | ! 28 | ! Hydrogen 29 | ! 30 | 31 | type:h1sw 32 | ! generic hydrogen 33 | template: [>H (-*)] 34 | atom_test:1 35 | mass_number:1 36 | end_test 37 | end_type 38 | 39 | 40 | type: h1si 41 | ! central silicon 42 | template: [>H(-O(-Si))] 43 | atom_test:1 44 | formal_charge:0 45 | end_test 46 | end_type 47 | 48 | ! 49 | ! Oxygen 50 | ! 51 | 52 | type: o1si 53 | ! central silicon 54 | template: [>O(-Si)] 55 | atom_test:1 56 | ! formal_charge:-1 57 | end_test 58 | end_type 59 | 60 | !type: o1si 61 | ! ! central silicon 62 | ! template: [>O(-Si)(-Null)] 63 | !end_type 64 | 65 | type: o2sh 66 | ! central silicon 67 | template: [>O(-Si)(-H)] 68 | ! atom_test:1 69 | ! formal_charge:0 70 | ! end_test 71 | end_type 72 | 73 | type: o2si 74 | ! central silicon 75 | template: [>O(-Si)(-Si)] 76 | ! atom_test:1 77 | ! formal_charge:0 78 | ! end_test 79 | end_type 80 | 81 | type: o2sw 82 | ! water oxygen 83 | template [>O[-H][-H]] 84 | atom_test:1 85 | aromaticity:NON_AROMATIC 86 | formal_charge:0 87 | end_test 88 | end_type 89 | 90 | ! 91 | ! Silica 92 | ! 93 | 94 | type: si4o 95 | ! central silicon 96 | template: [>Si(-O)(-O)(-O)(-O)] 97 | ! atom_test:1 98 | ! formal_charge:0 99 | ! end_test 100 | end_type 101 | 102 | type: si4o 103 | ! central silicon 104 | template: [>Si(-O)(-O)(-O)(-O)] 105 | atom_test:2 106 | formal_charge:-1 107 | end_test 108 | end_type 109 | 110 | type: si4o 111 | ! central silicon 112 | template: [>Si(-O)(-O)(-O)(-O)] 113 | atom_test:2 114 | formal_charge:-1 115 | end_test 116 | atom_test:3 117 | formal_charge:-1 118 | end_test 119 | end_type 120 | 121 | ! 122 | ! Precedences 123 | ! 124 | 125 | precedence: 126 | (? 127 | (h1si) 128 | (h1sw) 129 | (o2sw) 130 | (o2sh) 131 | (o2si) 132 | (o1si) 133 | (si4o) 134 | ) 135 | end_precedence 136 | 137 | -------------------------------------------------------------------------------- /pyemc/emc/field/cff/template_templates.dat: -------------------------------------------------------------------------------- 1 | ! compass_templates.dat 2 | ! 3 | ! Template file of potential type assignment templates for the CFF forcefield 4 | ! 5 | ! ************************************************************************** 6 | ! * * 7 | ! * THIS PROGRAM AND ALL SUBROUTINES, DATA, AND FILES USED BY IT * 8 | ! * ARE PROTECTED BY COPYRIGHT AND HENCE MAY NOT BE USED, COPIED, * 9 | ! * MODIFIED, TRANSMITTED, INSPECTED, OR EXECUTED BY ANY MEANS INCLUDING * 10 | ! * THE USE OF ELECTRONIC DATA PROCESSING EQUIPMENT, XEROGRAPHY, OR * 11 | ! * ANY OTHER METHODS WITHOUT THE EXPRESS WRITTEN PERMISSION OF THE * 12 | ! * COPYRIGHT HOLDER. * 13 | ! * * 14 | ! * Copyright (C) 2020 BASF SE, All Rights Reserved * 15 | ! * * 16 | ! ************************************************************************** 17 | ! 18 | ! Revision History: 19 | ! PJV 02/05/2020 Zinc oxide surface 20 | 21 | type: ? 22 | ! anything 23 | template: (>*) 24 | end_type 25 | 26 | type: h1zn 27 | ! surface hydrogen 28 | template: [>H(-O(-Zn))] 29 | end_type 30 | 31 | type: o1zn 32 | ! surface oxygen 33 | template: [>O(-Zn)] 34 | atom_test:1 35 | formal_charge:-1 36 | end_test 37 | end_type 38 | 39 | 40 | precedence: 41 | (? 42 | (h1zn) 43 | ) 44 | end_precedence 45 | 46 | -------------------------------------------------------------------------------- /pyemc/emc/field/cff/zno_templates.dat: -------------------------------------------------------------------------------- 1 | ! zno_templates.dat 2 | ! 3 | ! Template file of potential type assignment templates for the CFF forcefield 4 | ! 5 | ! ************************************************************************** 6 | ! * * 7 | ! * THIS PROGRAM AND ALL SUBROUTINES, DATA, AND FILES USED BY IT * 8 | ! * ARE PROTECTED BY COPYRIGHT AND HENCE MAY NOT BE USED, COPIED, * 9 | ! * MODIFIED, TRANSMITTED, INSPECTED, OR EXECUTED BY ANY MEANS INCLUDING * 10 | ! * THE USE OF ELECTRONIC DATA PROCESSING EQUIPMENT, XEROGRAPHY, OR * 11 | ! * ANY OTHER METHODS WITHOUT THE EXPRESS WRITTEN PERMISSION OF THE * 12 | ! * COPYRIGHT HOLDER. * 13 | ! * * 14 | ! * Copyright (C) 2020 BASF SE, All Rights Reserved * 15 | ! * * 16 | ! ************************************************************************** 17 | ! 18 | ! Revision History: 19 | ! PJV 02/05/2020 Zinc oxide surface 20 | 21 | type: ? 22 | ! anything 23 | template: (>*) 24 | end_type 25 | 26 | ! 27 | ! Hydrogen 28 | ! 29 | 30 | type: h1zn 31 | ! surface hydrogen 32 | template: [>H(-O(-Zn))] 33 | end_type 34 | 35 | ! 36 | ! Oxygen 37 | ! 38 | 39 | type: o1zn 40 | ! surface oxygen 41 | template: [>O(-Zn)] 42 | atom_test:1 43 | formal_charge:-1 44 | end_test 45 | end_type 46 | 47 | type: o2zn 48 | ! surface oxygen 49 | template: [>O(-Zn)(-H)] 50 | end_type 51 | 52 | type: o4zh 53 | ! surface oxygen 54 | template: [>O(-Zn)(-Zn)(-Zn)(-H)) 55 | ! atom_test:1 56 | ! formal_charge:-2 57 | ! end_test 58 | end_type 59 | 60 | type: o4zn 61 | ! central oxygen 62 | template: [>O(-Zn)(-Zn)(-Zn)(-Zn)) 63 | ! atom_test:1 64 | ! formal_charge:-2 65 | ! end_test 66 | end_type 67 | 68 | ! 69 | ! Zinc 70 | ! 71 | 72 | type: zn2o 73 | ! surface zinc 74 | template: [>Zn(-O)(-O)] 75 | ! atom_test:1 76 | ! formal_charge:2 77 | ! end_test 78 | end_type 79 | 80 | type: zn4o 81 | ! central zinc 82 | template: [>Zn(-O)(-O)(-O)(-O)] 83 | ! atom_test:1 84 | ! formal_charge:2 85 | ! end_test 86 | end_type 87 | 88 | type: zn4s 89 | ! surface zinc 90 | template: [>Zn(-O(-H))(-O)(-O)(-O)] 91 | ! atom_test:1 92 | ! formal_charge:2 93 | ! end_test 94 | end_type 95 | 96 | ! 97 | ! Precedences 98 | ! 99 | 100 | precedence: 101 | (? 102 | (h1zn) 103 | (o1zn) 104 | (o2zn) 105 | (o4zh) 106 | (o4zn) 107 | (zn2o) 108 | (zn4s) 109 | (zn4o) 110 | ) 111 | end_precedence 112 | 113 | -------------------------------------------------------------------------------- /pyemc/emc/field/charmm.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinshen56714/emc-pypi/f32daee3b5d8e372a9b719c1b79ac37b81e3a6f3/pyemc/emc/field/charmm.tgz -------------------------------------------------------------------------------- /pyemc/emc/field/charmm/c36a/ethers.top: -------------------------------------------------------------------------------- 1 | #EMC/FIELD/CHARMM/v34. 2 | # 3 | # CHARMM topology using ethers force field files, 4 | # converted by emc_charmm.pl 4.0, January 11, 2023 by Pieter J. in 't Veld, 5 | # to be used in conjuction with EMC v9.4.4 or higher, 6 | # and created on Mon Mar 06 14:44:44 CET 2023. 7 | # 8 | 9 | # Rule precedences 10 | 11 | ITEM PRECEDENCE 12 | 13 | (? 14 | (CC326A) 15 | (CC325A) 16 | (CC325B) 17 | (CT1) 18 | (CT2) 19 | (CT3) 20 | (HA1) 21 | (HA3) 22 | (HA2) 23 | (HCA25A) 24 | (OC305A) 25 | (OC30A) 26 | ) 27 | 28 | ITEM END 29 | 30 | # Rules 31 | 32 | ITEM RULES 33 | 34 | # id type element residue atom charge rule 35 | 36 | 0 ? ? UNK UNK 0 * 37 | 1 CC325A C CPEN C1 0 ^5C(H)(H)(^5C(H)(H)(^5C))(^5C(H)(H)(^5C)) 38 | 2 CC325B C TF2M C1 0 ^5C(C)(H)(^5C)(^5O) 39 | 3 CC325B C TF2M C2 0 ^5C(H)(H)(^5C(C)(H)(^5O))(^5C(H)(H)(^5C)) 40 | 4 CC325B C TF2M C3 0 ^5C(H)(H)(^5C(H)(H)(^5C))(^5C(H)(H)(^5O)) 41 | 5 CC325B C TF2M C4 0 ^5C(H)(H)(^5C)(^5O) 42 | 6 CC326A C THP C1 0 ^6C(H)(H)(O)(^6C) 43 | 7 CC326A C THP C2 0 ^6C(H)(H)(^6C)(^6C) 44 | 8 CT1 C NEOP CT 0 C(C)(C)(C)(C) 45 | 9 CT1 C IBUT CT 0 C(C)(C)(C)(H) 46 | 10 CT2 C BUTA C2 0 C(C)(C)(H)(H) 47 | 11 CT2 C DEET C2 0 C(C)(H)(H)(O) 48 | 12 CT3 C BUTA C1 0 C(C)(H)(H)(H) 49 | 13 CT3 C DME C1 0 C(H)(H)(H)(O) 50 | 14 CT3 C TF2M C5 0 C(H)(H)(H)(^5C) 51 | 15 HA1 H IBUT HT 0 H(C(C)(C)(C)) 52 | 16 HA2 H BUTA H21 0 H(C(C)(C)(H)) 53 | 17 HA2 H DEET H21 0 H(C(C)(H)(O)) 54 | 18 HA2 H THP H1A 0 H(^6C) 55 | 19 HA3 H BUTA H11 0 H(C(C)(H)(H)) 56 | 20 HA3 H DME H11 0 H(C(H)(H)(O)) 57 | 21 HA3 H TF2M H5A 0 H(C(H)(H)(^5C)) 58 | 22 HCA25A H CPEN H1A 0 H(^5C) 59 | 23 OC305A O TF2M O1 0 ^5O(^5C)(^5C) 60 | 24 OC30A O DEET O3 0 O(C)(C) 61 | 25 OC30A O THP O1 0 O(^6C)(^6C) 62 | 63 | ITEM END 64 | 65 | # Templates 66 | 67 | ITEM TEMPLATES 68 | 69 | # name smiles 70 | 71 | BUTA HCCCC 72 | CHEX C1CCCCC1 73 | CPEN C1CCCC1 74 | DECA CCCCCCCCCC 75 | DEET CCOCC 76 | DME COCCOC 77 | DMET COC 78 | EPET CCOCCC 79 | ETHA HCC 80 | HEPT CCCCCCC 81 | HEXA CCCCCC 82 | IBUT C(C)(C)C 83 | MBET COCCCC 84 | MEET CCOC 85 | MPET COCCC 86 | NEOP C(C)(C)(C)C 87 | OCT CCCCCCCC 88 | OCTD CCCCCCCCCCCCCCCCCC 89 | PEND CCCCCCCCCCCCCCC 90 | PENT CCCCC 91 | PROP HCCC 92 | TF2M O1C(C)CCC1 93 | THF O1CCCC1 94 | THP O1CCCCC1 95 | 96 | ITEM END 97 | -------------------------------------------------------------------------------- /pyemc/emc/field/charmm/c36a/water_ions.top: -------------------------------------------------------------------------------- 1 | #EMC/FIELD/CHARMM/unknown 2 | # 3 | # CHARMM topology using water_ions force field files, 4 | # converted by emc_charmm.pl 4.0, January 11, 2023 by Pieter J. in 't Veld, 5 | # to be used in conjuction with EMC v9.4.4 or higher, 6 | # and created on Mon Jan 15 20:37:18 CET 2024. 7 | # 8 | 9 | # Rule precedences 10 | 11 | ITEM PRECEDENCE 12 | 13 | (? 14 | (BAR) 15 | (CAL) 16 | (CAD) 17 | (CLA) 18 | (CES) 19 | (HP) 20 | (HT) 21 | (HX) 22 | (POT) 23 | (LIT) 24 | (LP) 25 | (MG) 26 | (SOD) 27 | (OP) 28 | (OT) 29 | (OX) 30 | (RUB) 31 | (ZN) 32 | ) 33 | 34 | ITEM END 35 | 36 | # Rules 37 | 38 | ITEM RULES 39 | 40 | # id type element residue atom charge rule 41 | 42 | 0 ? ? UNK UNK 0 * 43 | 1 BAR Ba BAR BAR 2 [Ba+2] 44 | 2 CAL Ca CAL CAL 2 [Ca+2] 45 | 3 CAD Cd CD2 CD 2 [Cd+2] 46 | 4 CLA Cl CLA CLA -1 [Cl-] 47 | 5 CES Cs CES CES 1 [Cs+] 48 | 6 HP H OPCW H1 0 H(O(H)([Lp])) 49 | 7 HT H TIP3 H1 0 H(H)(O) 50 | 8 HT H TP3M H1 0 H(O(H)) 51 | 9 HX H OH H1 0 H([O-]) 52 | 10 POT K POT POT 1 [K+] 53 | 11 LIT Li LIT LIT 1 [Li+] 54 | 12 LP Lp OPCW LP 0 [Lp](O) 55 | 13 MG Mg MG MG 2 [Mg+2] 56 | 14 SOD Na SOD SOD 1 [Na+] 57 | 15 OP O OPCW O 0 O(H)(H)([Lp]) 58 | 16 OT O TIP3 OH2 0 O(H)(H) 59 | 17 OX O OH O1 0 [O-](H) 60 | 18 RUB Rb RUB RUB 1 [Rb+] 61 | 19 ZN Zn ZN2 ZN 2 [Zn+2] 62 | 63 | ITEM END 64 | 65 | # Templates 66 | 67 | ITEM TEMPLATES 68 | 69 | # name smiles 70 | 71 | BAR [Ba+2] 72 | CAL [Ca+2] 73 | CD2 [Cd+2] 74 | CES [Cs+] 75 | CLA [Cl-] 76 | LIT [Li+] 77 | MG [Mg+2] 78 | OH [O-] 79 | OPCW O[Lp] 80 | POT [K+] 81 | RUB [Rb+] 82 | SOD [Na+] 83 | TIP3 O1 84 | TP3M O 85 | ZN2 [Zn+2] 86 | 87 | ITEM END 88 | -------------------------------------------------------------------------------- /pyemc/emc/field/dpd/general.prm: -------------------------------------------------------------------------------- 1 | # 2 | # DPD interaction parameters 3 | # to be used in conjuction with EMC v9.3.7 or higher 4 | # 5 | 6 | # Force field definition 7 | 8 | ITEM DEFINE 9 | 10 | FFMODE DPD 11 | FFTYPE COARSE 12 | VERSION V0.1beta 13 | CREATED Mar 2014 14 | MIX NONE 15 | DENSITY REDUCED 16 | ENERGY REDUCED 17 | LENGTH REDUCED 18 | NBONDED 0 19 | CUTOFF 1.0 20 | GAMMA 4.5 21 | DEFAULT 25.0 22 | ANGLE IGNORE 23 | TORSION IGNORE 24 | IMPROP IGNORE 25 | 26 | ITEM END 27 | 28 | # Masses 29 | 30 | ITEM MASS 31 | 32 | # type mass name ncons charge comment 33 | 34 | * 1 * 2 0 anything 35 | 36 | ITEM END 37 | 38 | # Typing equivalences 39 | 40 | ITEM EQUIVALENCE 41 | 42 | # type pair incr bond angle torsion improper 43 | 44 | ITEM END 45 | 46 | # Nonbonded parameters 47 | 48 | ITEM NONBOND_AUTO 49 | 50 | # type1 type2 a cutoff gamma 51 | 52 | * * 25 1 4.5 53 | 54 | ITEM END 55 | 56 | # Bond wildcard parameters 57 | 58 | ITEM BOND_AUTO 59 | 60 | # type1 type2 k l0 61 | 62 | * * 25 1 63 | 64 | ITEM END 65 | 66 | # Angle wildcard parameters 67 | 68 | ITEM ANGLE_AUTO 69 | 70 | # type1 type2 type3 k theta0 71 | 72 | #* * * 4 180 73 | 74 | ITEM END 75 | 76 | # Templates 77 | 78 | ITEM TEMPLATES 79 | 80 | # name smiles 81 | 82 | ITEM END 83 | -------------------------------------------------------------------------------- /pyemc/emc/field/dpd/srp.prm: -------------------------------------------------------------------------------- 1 | # 2 | # DPD interaction parameters 3 | # to be used in conjuction with EMC v9.3.7 or higher 4 | # 5 | 6 | # Force field definition 7 | 8 | ITEM DEFINE 9 | 10 | FFMODE DPD 11 | FFTYPE COARSE 12 | VERSION V0.1beta 13 | CREATED Mar 2014 14 | MIX NONE 15 | DENSITY REDUCED 16 | ENERGY REDUCED 17 | LENGTH REDUCED 18 | NBONDED 0 19 | CUTOFF 1.0 20 | GAMMA 4.5 21 | DEFAULT 25.0 22 | ANGLE IGNORE 23 | TORSION IGNORE 24 | IMPROP IGNORE 25 | 26 | ITEM END 27 | 28 | # Masses 29 | 30 | ITEM MASS 31 | 32 | # type mass rule ncons charge comment 33 | 34 | * 1 * 2 0 anything 35 | 36 | ITEM END 37 | 38 | # Typing equivalences 39 | 40 | ITEM EQUIVALENCE 41 | 42 | # type pair bond angle torsion improper 43 | 44 | ITEM END 45 | 46 | # Nonbonded parameters 47 | 48 | ITEM NONBOND_AUTO 49 | 50 | # type1 type2 a cutoff gamma 51 | 52 | * * 25 1 4.5 53 | 54 | ITEM END 55 | 56 | # Bond wildcard parameters 57 | 58 | ITEM BOND_AUTO 59 | 60 | # type1 type2 k l0 61 | 62 | * * 450 0.87 # first peak in RDF 63 | 64 | ITEM END 65 | 66 | # Templates 67 | 68 | ITEM TEMPLATES 69 | 70 | # name smiles 71 | 72 | ITEM END 73 | -------------------------------------------------------------------------------- /pyemc/emc/field/gauss/general.prm: -------------------------------------------------------------------------------- 1 | # 2 | # DPD interaction parameters 3 | # to be used in conjuction with EMC v9.3.7 or higher 4 | # 5 | 6 | # Force field definition 7 | 8 | ITEM DEFINE 9 | 10 | FFMODE GAUSS 11 | FFTYPE COARSE 12 | VERSION V0.1beta 13 | CREATED Feb 2022 14 | MIX NONE 15 | DENSITY REDUCED 16 | ENERGY REDUCED 17 | LENGTH REDUCED 18 | NBONDED 0 19 | CUTOFF 7.0 20 | DEFAULT 1.0 21 | ANGLE IGNORE 22 | TORSION IGNORE 23 | IMPROP IGNORE 24 | 25 | ITEM END 26 | 27 | # Masses 28 | 29 | ITEM MASS 30 | 31 | # type mass name ncons charge comment 32 | 33 | * 1 * 2 0 anything 34 | 35 | ITEM END 36 | 37 | # Typing equivalences 38 | 39 | ITEM EQUIVALENCE 40 | 41 | # type pair bond angle torsion improper 42 | 43 | ITEM END 44 | 45 | # Nonbonded parameters 46 | 47 | ITEM NONBOND_AUTO 48 | 49 | # type1 type2 v a 50 | 51 | * * 1 1 52 | 53 | ITEM END 54 | 55 | # Bond wildcard parameters 56 | 57 | ITEM BOND_AUTO 58 | 59 | # type1 type2 k l0 60 | 61 | * * 0.3125 0 62 | 63 | ITEM END 64 | 65 | # Angle wildcard parameters 66 | 67 | ITEM ANGLE_AUTO 68 | 69 | # type1 type2 type3 k theta0 70 | 71 | #* * * 4 180 72 | 73 | ITEM END 74 | 75 | # Templates 76 | 77 | ITEM TEMPLATES 78 | 79 | # name smiles 80 | 81 | ITEM END 82 | -------------------------------------------------------------------------------- /pyemc/emc/field/martini/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinshen56714/emc-pypi/f32daee3b5d8e372a9b719c1b79ac37b81e3a6f3/pyemc/emc/field/martini/.DS_Store -------------------------------------------------------------------------------- /pyemc/emc/field/martini/v2.0/convert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | src=.; 4 | home=$(pwd); 5 | if [ -d src ]; then src=src; fi; 6 | cd $src; 7 | files=($(find * -name '*.itp' -and -not -name martini.itp -exec sh -c 'echo "$(basename {} .itp)"' \;)); 8 | cd $home; 9 | 10 | for file in ${files[@]}; do 11 | emc_martini.pl -ffapply=GROUPS -source=$src -output=$file $file; 12 | done; 13 | emc_martini.pl -ffapply=ALL -source=$src -output=martini ${files[@]}; 14 | 15 | -------------------------------------------------------------------------------- /pyemc/emc/field/martini/v2.0/file.prm: -------------------------------------------------------------------------------- 1 | # 2 | # Martini interaction parameters using file.itp 3 | # converted by martini.pl v1.1, August 1, 2013 by Pieter J. in 't Veld 4 | # to be used in conjuction with EMC v9.3.6 or higher 5 | # 6 | 7 | # Force field definition 8 | 9 | ITEM DEFINE 10 | 11 | FFMODE MARTINI 12 | FFTYPE COARSE 13 | VERSION 2011 14 | CREATED Aug 2013 15 | LENGTH NANOMETER 16 | ENERGY KJ/MOL 17 | DENSITY G/CC 18 | MIX NONE 19 | NBONDED 1 20 | INNER 0.9 21 | CUTOFF 1.2 22 | PAIR14 OFF 23 | ANGLE WARN 24 | TORSION IGNORE 25 | 26 | ITEM END 27 | -------------------------------------------------------------------------------- /pyemc/emc/field/martini/v2.0/ions.prm: -------------------------------------------------------------------------------- 1 | # 2 | # Martini interaction parameters using martini.21338.tmp 3 | # converted by emc_martini.pl v2.0, March 21, 2021 by Pieter J. in 't Veld 4 | # to be used in conjuction with EMC v9.4.4 or higher 5 | # 6 | 7 | # Force field definition 8 | 9 | ITEM DEFINE 10 | 11 | FFMODE MARTINI 12 | FFTYPE COARSE 13 | FFAPPLY GROUPS 14 | VERSION 2011 15 | CREATED Mar 2021 16 | LENGTH NANOMETER 17 | ENERGY KJ/MOL 18 | DENSITY G/CC 19 | MIX NONE 20 | NBONDED 1 21 | INNER 0.9 22 | CUTOFF 1.2 23 | PAIR14 OFF 24 | ANGLE WARN 25 | TORSION IGNORE 26 | 27 | ITEM END 28 | 29 | # Masses 30 | 31 | ITEM MASS 32 | 33 | # type mass element ncons charge comment 34 | 35 | Q0 72 Q0 2 1 charged 36 | Qa 72 Qa 2 -1 charged 37 | Qd 72 Qd 2 1 charged 38 | 39 | ITEM END 40 | 41 | # Typing equivalences 42 | 43 | ITEM EQUIVALENCE 44 | 45 | # type pair incr bond angle torsion improper 46 | 47 | Q0 Q0 Q0 Q0 Q0 Q0 Q0 48 | Qa Qa Qa Qa Qa Qa Qa 49 | Qd Qd Qd Qd Qd Qd Qd 50 | 51 | ITEM END 52 | 53 | # Nonbonded parameters 54 | 55 | ITEM NONBOND 56 | 57 | # type1 type2 sigma epsilon 58 | 59 | Q0 Q0 0.47 3.5 60 | Q0 Qa 0.47 4.5 61 | Q0 Qd 0.47 4.5 62 | Qa Qa 0.47 5 63 | Qa Qd 0.47 5.6 64 | Qd Qd 0.47 5 65 | 66 | ITEM END 67 | 68 | # Bond wildcard parameters 69 | 70 | ITEM BOND_AUTO 71 | 72 | # type1 type2 k l0 73 | 74 | * * 1250 0.47 75 | 76 | ITEM END 77 | 78 | # Templates 79 | 80 | ITEM TEMPLATES 81 | 82 | # name smiles 83 | 84 | CA+ [Qd+2] 85 | CL- [Qa-1] 86 | NA+ [Qd+1] 87 | NC3+ [Q0+1] 88 | 89 | ITEM END 90 | -------------------------------------------------------------------------------- /pyemc/emc/field/martini/v2.0/src/ions.itp: -------------------------------------------------------------------------------- 1 | ;;; IONS 2 | ; 3 | ; note, ions are not to be taken too seriously using a CG presentation. 4 | ; long range electrostatic interactions are absent, and for small ions 5 | ; the first hydration shell is considered an implicit part of the CG ion. 6 | 7 | ;;;;;; HYDRATED SODIUM ION 8 | ; 9 | ; same particle type would represent HYDRATED POTASSIUM 10 | 11 | [moleculetype] 12 | ; molname nrexcl 13 | NA+ 1 14 | 15 | [atoms] 16 | ;id type resnr residu atom cgnr charge 17 | 1 Qd 1 ION NA+ 1 1.0 18 | 19 | 20 | ;;;;;; HYDRATED CHLORIDE ION 21 | 22 | [moleculetype] 23 | ; molname nrexcl 24 | CL- 1 25 | 26 | [atoms] 27 | ;id type resnr residu atom cgnr charge 28 | 1 Qa 1 ION CL- 1 -1.0 29 | 30 | 31 | ;;;;;; CHOLINE ION 32 | 33 | [moleculetype] 34 | ; molname nrexcl 35 | NC3+ 1 36 | 37 | [atoms] 38 | ;id type resnr residu atom cgnr charge 39 | 1 Q0 1 ION NC3 1 1.0 40 | 41 | 42 | ;;;;;; HYDRATED CALCIUM ION 43 | ; 44 | ; Warning: this is untested, and likely not very realistic description of 45 | ; a calcium ion. For a proper description of calcium, the solvation free 46 | ; energy should be increased. This could be achieved in an ad-hoc manner 47 | ; through increasing of the LJ well depth for water-calcium interactions. 48 | 49 | [moleculetype] 50 | ; molname nrexcl 51 | CA+ 1 52 | 53 | [atoms] 54 | ;id type resnr residu atom cgnr charge 55 | 1 Qd 1 ION CA+ 1 2.0 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /pyemc/emc/field/martini/v2.0/src/xemium.itp: -------------------------------------------------------------------------------- 1 | ;;;;;; XEMIUM (BAS 700F) 2 | 3 | [moleculetype] 4 | ; molname nrexcl 5 | XEM 1 6 | 7 | [atoms] 8 | ; id type resnr residu atom cgnr charge 9 | 1 Na 1 XEM FCF 1 0 10 | 2 SP1 1 XEM NC 2 0 11 | 3 SP2 1 XEM CNC 3 0 12 | 4 SP5 1 XEM CON 4 0 13 | 5 SC4 1 XEM C1 5 0 14 | 6 SC4 1 XEM C2 5 0 15 | 7 SC4 1 XEM C3 5 0 16 | 8 SC4 1 XEM R1 6 0 17 | 9 SC4 1 XEM R2 6 0 18 | 10 SC4 1 XEM R3 6 0 19 | 11 Na 1 XEM F3 7 0 20 | 21 | [ bonds ] 22 | ;1 2 1 0.270 1250 ; 23 | 4 5 1 0.470 1250 ; 24 | 7 8 1 0.470 1250 ; 25 | ;10 11 1 0.270 1250 ; 26 | 27 | [constraints] 28 | ; i j funct length 29 | 1 2 1 0.27 30 | 10 11 1 0.27 31 | 2 3 1 0.27 32 | 3 4 1 0.27 33 | 2 4 1 0.27 34 | 5 6 1 0.27 35 | 5 7 1 0.27 36 | 6 7 1 0.27 37 | 8 9 1 0.27 38 | 8 10 1 0.27 39 | 9 10 1 0.27 40 | 41 | [angles] 42 | 1 2 4 1 150.00 180 ; 43 | 1 2 3 1 150.00 180 ; 44 | 2 4 5 1 150.00 180 ; 45 | 3 4 5 1 150.00 180 ; 46 | 4 5 6 1 180.00 180 ; 47 | 4 5 7 1 120.00 180 ; 48 | 5 7 8 1 140.00 180 ; 49 | 6 7 8 1 160.00 180 ; 50 | 7 8 9 1 150.00 180 ; 51 | 7 8 10 1 150.00 180 ; 52 | 8 10 11 1 150.00 180 ; 53 | 9 10 11 1 150.00 180 ; 54 | 55 | [dihedrals] 56 | 2 1 3 4 2 0.00 5.0 1 57 | 7 6 5 8 2 0.00 5.0 1 58 | 8 7 9 10 2 0.00 5.0 1 59 | 10 8 9 11 2 0.00 5.0 1 60 | 1 2 4 5 1 180 5.0 1 61 | 2 4 5 6 1 180 5.0 1 62 | 2 4 5 7 1 0 5.0 1 63 | 3 4 5 6 1 0 5.0 1 64 | 3 4 5 7 1 180 5.0 1 65 | 4 5 7 8 1 180 5.0 1 66 | 5 7 8 9 1 270 5.0 1 67 | 5 7 8 10 1 90 5.0 1 68 | 6 7 8 9 1 90 5.0 1 69 | 5 7 8 10 1 270 5.0 1 70 | 7 8 10 11 1 180 5.0 1 71 | 72 | -------------------------------------------------------------------------------- /pyemc/emc/field/martini/v3.0/convert.out: -------------------------------------------------------------------------------- 1 | EMC GROMACS v1.0 (May 4, 2024), (c) 2004-2024 Pieter J. in 't Veld 2 | 3 | Info: reading gromacs field from './src/martini.itp' 4 | Info: writing field to 'martini.prm.gz' 5 | 6 | EMC GROMACS v1.0 (May 4, 2024), (c) 2004-2024 Pieter J. in 't Veld 7 | 8 | Info: reading gromacs field from './src/ions.itp' 9 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = C1 10 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = C1 11 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = TN2q 12 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = TN2q 13 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = TC3 14 | Info: writing field to 'ions.prm.gz' 15 | 16 | EMC GROMACS v1.0 (May 4, 2024), (c) 2004-2024 Pieter J. in 't Veld 17 | 18 | Info: reading gromacs field from './src/solvents.itp' 19 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = C1 20 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = SC2 21 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = SC2 22 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = SC2 23 | Info: writing field to 'solvents.prm.gz' 24 | 25 | EMC GROMACS v1.0 (May 4, 2024), (c) 2004-2024 Pieter J. in 't Veld 26 | 27 | Info: reading gromacs field from './src/phospholipids.itp' 28 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = C1 29 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = C1 30 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = C4h 31 | Info: writing field to 'phospholipids.prm.gz' 32 | 33 | EMC GROMACS v1.0 (May 4, 2024), (c) 2004-2024 Pieter J. in 't Veld 34 | 35 | Info: reading gromacs field from './src/sugars.itp' 36 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = SP3 37 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = SP3 38 | Info: writing field to 'sugars.prm.gz' 39 | 40 | EMC GROMACS v1.0 (May 4, 2024), (c) 2004-2024 Pieter J. in 't Veld 41 | 42 | Info: reading gromacs field from './src/ions.itp' 43 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = C1 44 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = C1 45 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = TN2q 46 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = TN2q 47 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = TC3 48 | Info: reading gromacs field from './src/martini.itp' 49 | Info: reading gromacs field from './src/phospholipids.itp' 50 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = C1 51 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = C1 52 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = C4h 53 | Info: reading gromacs field from './src/solvents.itp' 54 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = C1 55 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = SC2 56 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = SC2 57 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = SC2 58 | Info: reading gromacs field from './src/sugars.itp' 59 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = SP3 60 | /Users/veld/emc/v9.4.4/scripts/modules/EMC/GROMACS.pm:973: change[1] = SP3 61 | Info: writing field to 'full.prm.gz' 62 | 63 | -------------------------------------------------------------------------------- /pyemc/emc/field/martini/v3.0/convert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd src; 4 | files=$(ls *.itp); 5 | files=(martini.itp ions.itp solvents.itp phospholipids.itp sugars.itp); 6 | cd ..; 7 | # for file in ${files[@]}; do 8 | # emc_gromacs.pl -compress=1 -output=$(basename $file .itp) $file; 9 | # done; 10 | 11 | emc_gromacs.pl -compress=1 -output=martini ${files[@]} 12 | -------------------------------------------------------------------------------- /pyemc/emc/field/martini/v3.0/martini.prm.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinshen56714/emc-pypi/f32daee3b5d8e372a9b719c1b79ac37b81e3a6f3/pyemc/emc/field/martini/v3.0/martini.prm.gz -------------------------------------------------------------------------------- /pyemc/emc/field/martini/v3.0/src/sugars.itp: -------------------------------------------------------------------------------- 1 | ;;;;; Martini 3 - Database of sugars 2 | ;;;;; 3 | ;;;;; File updated on 2021-03-29 4 | ;;;;; 5 | ;;;;; Version: 3.0.0_v1 6 | ;;;;; 7 | ;;;;; This collection contains the models included as part of the Martini 3 publication: 8 | ;;;;; PCT Souza, et al., Nat. Methods, 2021. DOI: 10.1038/s41592-021-01098-3 9 | 10 | ;;;; GLUCOSE - MANNOSE - GALACTOSE 11 | 12 | [ moleculetype ] 13 | ;molname exclusions 14 | GMY 3 15 | 16 | [ atoms ] 17 | 1 SP3 1 GMY SX1 1 0.000 18 | 2 SP3 1 GMY SX2 2 0.000 19 | 3 SP2 1 GMY SX3 3 0.000 20 | 21 | [ constraints ] 22 | ; sugar-central bonds 23 | ; 24 | 1 2 1 0.385 25 | 2 3 1 0.398 26 | 1 3 1 0.432 27 | 28 | ;;;; RIBOSE 29 | 30 | [ moleculetype ] 31 | ;molname exclusions 32 | RIB 3 33 | 34 | [ atoms ] 35 | 1 TP1 1 RIB SX1 1 0.000 36 | 2 SP2 1 RIB SX2 2 0.000 37 | 3 SP3 1 RIB SX3 3 0.000 38 | 39 | [ constraints ] 40 | ; sugar-central bonds 41 | ; 42 | 1 2 1 0.398 43 | 2 3 1 0.355 44 | 1 3 1 0.345 45 | -------------------------------------------------------------------------------- /pyemc/emc/field/opls/2012/convert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | emc_opls.pl -source=src/oplsaa opls-aa $@ 4 | emc_opls.pl -source=src/oplsaa opls-ua $@ 5 | 6 | -------------------------------------------------------------------------------- /pyemc/emc/field/opls/2012/src/add.txt: -------------------------------------------------------------------------------- 1 | One could ostensibly add types and entries through opls-ua.{top|prm}, but I normally use opls-aa.define, which is a front-end for defining rules and extra types. With respect to OPLS: 2 | 3 | OPLS_ROOT=$EMC_ROOT/field/opls/2012 4 | 5 | This directory contains a convert.sh script, which converts both UA and AA force fields using data in $OPLS_ROOT/src. These files use numbers as indices, which are referred to in the .define files, e.g. extra entries for isocyanates: 6 | 7 | ITEM EXTRA 8 | 9 | # index basis type charge 10 | 11 | 150.1 c= c= 0.785 # RCNCO through similarities; pjv 20170203 12 | 251.2 n= n= -0.724 # ditto 13 | 253.1 o o -0.45 # ditto 14 | 256.1 ct ct 0.209 # OCN-CH3 15 | 257.1 ct ct 0.269 # OCN-CH2-R 16 | 258.1 ct ct 0.329 # OCN-CH-R 17 | 259.1 ct ct 0.389 # OCN-C-R 18 | 19 | ITEM END 20 | 21 | For instance, carbon in C=N=O is based on an existing type c= with index entry 150 from $OPLS_ROOT/src/oplsaa.par, 22 | 23 | 150 06 C= -0.115 3.550 0.076 diene =CH-CH=; see 178 also 24 | 25 | but has a new partial charge of 0.785. The .1 in 150.1 makes sure, that the new index is unique. This new index is referred to under a new rule for C=N=O, i.e. 26 | 27 | ITEM RULES 28 | 29 | # Isocyanates 30 | 31 | 150.1 C(=N(C))(=O) 32 | 251.2 N(=C(=O))(C) 33 | 253.1 O(=C(=N(C))) 34 | 256.1 C(N(=C(=O)))(H)(H)(H) 35 | 257.1 C(N(=C(=O)))(H)(H)(C) 36 | 258.1 C(N(=C(=O)))(H)(C)(C) 37 | 259.1 C(N(=C(=O)))(C)(C)(C) 38 | 39 | ITEM END 40 | 41 | New types can also be defined, but are always based on existing types, 42 | 43 | ITEM EXTRA 44 | 45 | 237 n n_1 - 63 65 46 | 238 n n_1 - 47 | 239 n n_1 - 48 | 49 | ITEM END 50 | 51 | The type n_1 assures the specific use of dihedral entries 63 and 65. All types have the have an entry in the MASSES paragraph, 52 | 53 | ITEM MASSES 54 | 55 | c= 12.0110 C 3 0 C in dialkenes 56 | ct 12.0110 C 3 0 SP3 carbon 57 | n 14.0067 N 3 0 N in imides and ureas 58 | n_1 14.0067 N 3 0 N in amides 59 | n= 14.0067 N 2 0 N in cyanates 60 | o 15.9994 O 1 0 SP2 oxygen in acids, ketones, esters 61 | 62 | ITEM END 63 | 64 | Indices are used to access parameter entries in $OPLS_ROOT/src/oplsaa.par. 65 | 66 | -------------------------------------------------------------------------------- /pyemc/emc/field/opls/2012/src/reoplsff.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinshen56714/emc-pypi/f32daee3b5d8e372a9b719c1b79ac37b81e3a6f3/pyemc/emc/field/opls/2012/src/reoplsff.zip -------------------------------------------------------------------------------- /pyemc/emc/field/opls/2012/src/trim.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | { 4 | foreach (<>) { 5 | chop(); 6 | $_ =~ s/^\s+|\s+$//g; 7 | print("$_\n"); 8 | break; 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /pyemc/emc/field/pcff/pcff.rlb: -------------------------------------------------------------------------------- 1 | VERSION 2 | elib 3 | -------------------------------------------------------------------------------- /pyemc/emc/field/polystyrene/README: -------------------------------------------------------------------------------- 1 | Inverse Boltzmann Force Field 2 | distance in meters 3 | energy in kT 4 | -------------------------------------------------------------------------------- /pyemc/emc/field/sdk/v1.0/convert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | emc_sdk.pl -output=sdk.prm -define=sdk.define src/*.dat 4 | 5 | -------------------------------------------------------------------------------- /pyemc/emc/field/sdk/v1.0/sdk.define: -------------------------------------------------------------------------------- 1 | # 2 | # SDK interaction parameters using cgtools1.0 force field files, 3 | # converted by sdk.pl v0.2beta, August 1, 2013 by Pieter J. in 't Veld, 4 | # to be used in conjuction with EMC v9.3.7 or higher, 5 | # and created on Wed Nov 6 17:03:51 2013. 6 | # 7 | 8 | # Force field definition 9 | 10 | ITEM DEFINE 11 | 12 | FFNAME SDK 13 | FFTYPE COARSE 14 | FFDEPTH 3 15 | VERSION 1.0 16 | CREATED Oct 2014 17 | LENGTH ANGSTROM 18 | ENERGY KCAL/MOL 19 | DENSITY G/CC 20 | MIX BERTHELOT 21 | NBONDED 1 22 | CUTOFF 15 23 | ANGLE ERROR 24 | PAIR13 INCLUDE 25 | TORSION IGNORE 26 | 27 | ITEM END 28 | 29 | # Literature references 30 | 31 | ITEM REFERENCES 32 | 33 | # year volume page journal 34 | 35 | 2007 33 27 [1] Mol. Sim. 36 | 2009 5 2115 [2] J. Chem. Theory Comput. 37 | 2010 114 6386 [3] J. Phys. Chem. B 38 | 2010 114 16364 [5] J. Phys. Chem. B 39 | 2010 487 71 [6] Chem. Phys. Lett. 40 | 2010 328 1009 [7] Science 41 | 2008 4 2454 [-] Soft Matter 42 | 2011 7 6178 [-] Soft Matter 43 | 44 | ITEM END 45 | 46 | # Masses 47 | 48 | ITEM MASSES 49 | 50 | # type mass ncons charge cite comment 51 | 52 | ITEM END 53 | 54 | # Typing equivalences 55 | 56 | ITEM EQUIVALENCE_AUTO 57 | 58 | # type pair incr bond angle torsion improper 59 | 60 | ITEM END 61 | 62 | # Typing equivalences 63 | 64 | ITEM EQUIVALENCE 65 | 66 | # type pair incr bond angle torsion improper 67 | 68 | ITEM END 69 | 70 | # Nonbonded parameters 71 | 72 | ITEM NONBOND 73 | 74 | # type1 type2 epsilon sigma m n 75 | 76 | #CM PHR 0 0 9 6 77 | #CM XYR 0 0 9 6 78 | #CT2 PHR 0 0 9 6 79 | #CT2 XYR 0 0 9 6 80 | 81 | ITEM END 82 | 83 | # Bond parameters 84 | 85 | ITEM BOND 86 | 87 | # type1 type2 k l0 88 | 89 | #ABB GBB 0 0 90 | #GBB GBB 0 0 91 | #GBB SC* 0 0 92 | 93 | ITEM END 94 | 95 | # Angle parameters 96 | 97 | ITEM ANGLE 98 | 99 | # type1 type2 type3 k theta0 100 | 101 | #GBB GBB side 0 0 102 | 103 | ITEM END 104 | 105 | # Torsion parameters 106 | 107 | ITEM TORSION 108 | 109 | # type1 type2 type3 type4 k n delta [...] 110 | 111 | ITEM END 112 | 113 | # Improper wildcard parameters 114 | 115 | ITEM IMPROPER_AUTO 116 | 117 | # type1 type2 type3 type4 k psi0 118 | 119 | ITEM END 120 | 121 | # Improper parameters 122 | 123 | ITEM IMPROPER 124 | 125 | # type1 type2 type3 type4 k psi0 126 | 127 | ITEM END 128 | -------------------------------------------------------------------------------- /pyemc/emc/field/sdk/v1.0/src/bond.dat: -------------------------------------------------------------------------------- 1 | # type1 type2 k l0 ref 2 | bond ANI ANI 25 4.7 7 3 | bond ANI CM 6.16 3.64 7 4 | bond BEN ANI 25 3.61 7 5 | bond BER BER 40 2 3 6 | bond BER PHER 40 2.6 3 7 | bond BER XYR 40 2.6 3 8 | bond CAM CAM 345 1.91 6 9 | bond CAM CM3 9.4 2.96 6 10 | bond CAM CMT 92.5 2.392 6 11 | bond CAM CMY 92.5 2.39 6 12 | bond CAM CT2 92 2.416 6 13 | bond CAM CT3 8.03 3 6 14 | bond CAM CT4 6 3.535 6 15 | bond CAM CTY 108 2.445 6 16 | bond CAT CAM 190 1.947 6 17 | bond CAT CAT 106.5 1.985 6 18 | bond CAX CAM 190 2.485 6 19 | bond CAX CAT 92.6 2.524 6 20 | bond CAX CAX 81 3.06 6 21 | bond CH PHE 4.8 4.25 DB 22 | bond CM CM 6.16 3.64 1 23 | bond CM CT 6.16 3.65 1 24 | bond CM EO 7.1 3.56 1 25 | bond CM EOC 7.1 3.56 DB 26 | bond CM EOH 5.2 3.62 DB 27 | bond CM OA 7.5 3.01 1 28 | bond CM2 OA 17.8 2.6 7 29 | bond CM3 CM3 6.2 3.651 6 30 | bond CM3 CMT 6 3.55 6 31 | bond CM4 CM3 6 3.57 6 32 | bond CM4 CT2 5 3.552 6 33 | bond CM4 CT3 3.78 4.109 6 34 | bond CM4 CTB 8.75 2.794 6 35 | bond CM4 CTC 6.8 3.403 6 36 | bond CMD2 CM 8 3.03 4 37 | bond CME CT 6.16 3.65 DB 38 | bond CMT CT2 8.7 3.071 6 39 | bond CMT CT3 6.02 3.637 6 40 | bond CMT CT4 4.8 4.16 6 41 | bond CMT CTB 34 2.524 6 42 | bond CMT CTC 18 3.136 6 43 | bond CMT CTY 59.4 2.5 6 44 | bond CMY CM3 6 3.58 6 45 | bond CMY CMY 58 2.43 6 46 | bond CMY CT2 9.75 3.06 6 47 | bond CMY CT3 6.5 3.65 6 48 | bond CMY CTB 36.5 2.525 6 49 | bond CMY CTC 19.85 3.1 6 50 | bond CT CMD2 8 3.09 4 51 | bond CT CT 6.955 3.71 1 52 | bond CT EO 7.1 3.61 1 53 | bond CT EOH 5.2 3.66 DB 54 | bond CT OA 6.955 3.05 1 55 | bond CT2 CM 9 3.13 1 56 | bond CT2 CM3 9.6 3.13 6 57 | bond CT2 CMD2 60 2.54 DB 58 | bond CT2 CT3 9.5 3.16 6 59 | bond CT2 EO 10 3.07 1 60 | bond CT2 OA 14 2.53 1 61 | bond CT3 CM3 6.2 3.691 6 62 | bond CT3 CT3 6.955 3.71 6 63 | bond CT4 CM3 5 4.23 6 64 | bond CT4 CT2 6 3.72 6 65 | bond CT4 CT3 4.5 4.27 6 66 | bond CT4 CT4 3.4 4.785 6 67 | bond CTY CM3 20 3.13 6 68 | bond CTY CT2 39 2.552 6 69 | bond CTY CT3 18 3.16 6 70 | bond CTY CT4 12 3.73 6 71 | bond CTY CTY 42.1 2.565 6 72 | bond EO EO 4.9 3.28 1 73 | bond EO EOC 4.9 3.28 DB 74 | bond EO OA 15 2.79 1 75 | bond EOH EOH 3.5 3.62 DB 76 | bond EOT EO 5.4 3.34 1 77 | bond EOT EOT 5.5 3.33 1 78 | bond EST BEN 6.16 2.5 7 79 | bond EST CM 4.3 3.62 DB 80 | bond EST CM2 6.16 2.5 7 81 | bond EST CME 5.5 3.38 DB 82 | bond EST CT 4.3 3.62 DB 83 | bond EST CT2 6.5 3.13 DB 84 | bond EST CTE 5.5 3.4 DB 85 | bond EST1 CM 4.7 3.55 4 86 | bond EST2 CM 5.1 3.61 DB 87 | #bond GBB ABB ?? ?? 88 | #bond GBB GBB ?? ?? 89 | bond GBB ILE 3.22 5 2 90 | bond GBB LEU 3.87 5 2 91 | #bond GBB SC* ?? ?? 92 | bond GL EST1 30 2.88 4 93 | bond GL EST2 8.4 3.48 4 94 | bond NC PHE 4.8 4.25 4 95 | bond NC4 CM 13 3.8 DB 96 | bond NEP EST 6.16 3.64 7 97 | bond NH PHE 9.4 3.6 4 98 | bond OA OA 63 2.16 1 99 | bond PHE CM 12 3.69 4 100 | bond PHE GL 8.9 3.52 4 101 | bond PHE1 PHE2 2.5 150 2 102 | bond SO3 CAM 138.5 2.522 6 103 | bond SO3 CM3 11 3.065 6 104 | bond SO4 CM 11 3.63 DB 105 | bond TR1 TR2 2.5 150 2 106 | bond TR1 TR3 2.5 150 2 107 | bond TR2 TR3 2.5 150 2 108 | bond TYR1 TYR2 2.9 150 2 109 | -------------------------------------------------------------------------------- /pyemc/emc/field/sdk/v1.0/src/convert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for i in *.dat; do dos2unix $i; done; 4 | 5 | -------------------------------------------------------------------------------- /pyemc/emc/field/sdk/v1.0/src/mass.dat: -------------------------------------------------------------------------------- 1 | # type mass nconnect charge ref comment C N O P S H 2 | mass ABB 71.0786 2 0 2 >NC(C)C(=O)< 3 1 1 0 0 5 3 | mass ACA 59.0676 0 0 2 CC(=O)N 2 1 1 0 0 5 4 | mass ALL 56.0871 0 0 2 C=CCN 3 1 0 0 0 6 5 | mass ARG1 42.0804 2 0 2 >CCC< 3 0 0 0 0 6 6 | mass ARG2 58.0627 1 1 2 >NC(=N)N 1 3 0 0 0 4 7 | mass ASN 58.0597 1 0 2 >CC(=O)N 2 1 1 0 0 4 8 | mass ASP 58.0366 1 -1 2 >CC(=O)O 2 0 2 0 0 2 9 | mass BEN 39.0567 2 0 2 >ccc< 3 0 0 0 0 3 10 | mass BER 19.5284 2 0 3 >cc< 1.5 0 0 0 0 1.5 11 | mass CAM 39.0567 3 0 6 >ccc< 3 0 0 0 0 3 12 | mass CAT 54.0914 2 0 6 >cc(C)c< 4 0 0 0 0 6 13 | mass CAX 38.0488 2 0 6 >ccCCC< 3 0 0 0 0 6 15 | mass CM3 42.0804 2 0 6 >CCC< 3 0 0 0 0 6 16 | mass CM4 56.1072 2 0 6 >CCCC< 4 0 0 0 0 8 17 | mass CMD2 26.0378 2 0 4 >\C=C/< 2 0 0 0 0 2 18 | mass CMT 41.0725 3 0 6 >CCCCCCC 3 0 0 0 0 7 23 | mass CT4 57.1151 1 0 6 >CCCC 4 0 0 0 0 9 24 | mass CTB 29.0615 1 0 6 >CC 2 0 0 0 0 5 25 | mass CTC 43.0883 1 0 6 >CCC 3 0 0 0 0 7 26 | mass CTY 44.0962 1 0 6 >C(C)C 3 0 0 0 0 8 27 | mass CYD 46.0928 2 0 2 >CS< 1 0 0 0 1 2 28 | mass CYS 47.1007 1 0 2 >CS 1 0 0 0 1 3 29 | mass EO 44.053 2 0 1 >COC< 2 0 1 0 0 4 30 | mass EOT 45.0609 1 0 1 COC< 2 0 1 0 0 5 31 | mass EST1 58.0366 2 0 4 >CC(=O)O< 2 0 2 0 0 2 32 | mass EST2 58.0366 2 0 4 >CC(=O)O< 2 0 2 0 0 2 33 | mass ETOH 46.0688 0 0 2 CCO 2 0 1 0 0 6 34 | mass GBB 57.0518 2 0 2 >NCC(=O)< 2 1 1 0 0 3 35 | mass GL 41.0725 3 0 4 >CCCCC(=O)N 3 1 1 0 0 6 37 | mass GLU 72.0634 1 -1 2 >CCC(=O)O 3 0 2 0 0 4 38 | mass HIS 81.0969 1 0 2 >Cc1cncn1 4 2 0 0 0 5 39 | mass IBU 58.123 0 0 2 CC(C)C 4 0 0 0 0 10 40 | mass ILE 67.1103 1 0 2 >C(C)CC(C) 5 0 0 0 0 7 41 | mass LEU 57.1151 1 0 2 >CC(C)(C) 4 0 0 0 0 9 42 | mass LYS1 42.0804 2 0 2 >CCC< 3 0 0 0 0 6 43 | mass LYS2 30.0493 1 1 2 >CN 1 1 0 0 0 4 44 | mass MEETS 76.1622 0 0 2 CCSC 3 0 0 0 1 8 45 | mass MEOH 32.042 0 0 2 CO 1 0 1 0 0 4 46 | mass MES 48.1086 0 0 2 CS 1 0 0 0 1 4 47 | mass MET 75.1543 1 0 2 >CCSC 3 0 0 0 1 7 48 | mass NC 87.1644 1 1 4 >CCN(C)(C)C 5 1 0 0 0 13 49 | mass NH 44.0761 1 1 4 >CCN 2 1 0 0 0 6 50 | mass OA 31.0341 1 0 1 OC< 1 0 1 0 0 3 51 | mass PH 94.9716 2 -1 4 >OP(O)(O)O< 0 0 4 1 0 0 52 | mass PH1 52.0756 3 0 2 >Cc(c<)c< 4 0 0 0 0 4 53 | mass PH2 39.0567 2 0 2 >ccc< 3 0 0 0 0 3 54 | mass PHE 94.9716 2 -1 4 >OP(O)(O)O< 0 0 4 1 0 0 55 | mass PHR 35.7797 2 0 3 >c(O)c< 1.5 0 1 0 0 1.75 56 | mass PIA 73.0944 0 0 2 CCC(=O)N 3 1 1 0 0 7 57 | mass PPE 42.0804 0 0 2 C=CC 3 0 0 0 0 6 58 | mass PRO 42.0804 2 0 2 >CCC< 3 0 0 0 0 6 59 | mass SER 31.0341 1 0 2 >CO 1 0 1 0 0 3 60 | mass THR 45.0609 1 0 2 >CCO 2 0 1 0 0 5 61 | mass TR1 39.0567 3 0 2 >Ccccc< 3 0 0 0 0 3 63 | mass TR3 53.0634 3 0 2 >c[NH]cCc(c<)c< 4 0 0 0 0 4 65 | mass TYR2 55.0561 2 0 2 >cc(O)c< 3 0 1 0 0 3 66 | mass VAL 43.0883 1 0 2 >C(C)(C) 3 0 0 0 0 7 67 | mass W 54.0456 0 0 1 O.O.O 0 0 3 0 0 6 68 | mass XYL 39.0567 3 0 2 >Ccc(C)c< 2.5 0 0 0 0 3.75 70 | -------------------------------------------------------------------------------- /pyemc/emc/field/sdk/v1.0/src/sdk.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinshen56714/emc-pypi/f32daee3b5d8e372a9b719c1b79ac37b81e3a6f3/pyemc/emc/field/sdk/v1.0/src/sdk.xlsx -------------------------------------------------------------------------------- /pyemc/emc/field/sdk/v1.0/src/torsion.dat: -------------------------------------------------------------------------------- 1 | # type1 type2 type3 type4 k n delta ref 2 | torsion * BER BER * 60 1 180 3 3 | torsion * PHR BER * 60 1 180 3 4 | torsion * PHR XYR * 60 1 180 3 5 | torsion * XYR BER * 60 1 180 3 6 | -------------------------------------------------------------------------------- /pyemc/emc/field/trappe/2014/convert.emc: -------------------------------------------------------------------------------- 1 | (* EMC: Script *) 2 | 3 | variables = { 4 | name -> "trappe-ua" 5 | }; 6 | 7 | field = { 8 | mode -> trappe, 9 | name -> {name+".prm", name+".top"} 10 | }; 11 | 12 | field = { 13 | mode -> put, 14 | name -> name 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /pyemc/emc/field/trappe/2014/convert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root=$EMC_ROOT; 4 | 5 | $root/scripts/emc_trappe.pl trappe-ua 6 | $root/scripts/emc.sh convert 7 | 8 | -------------------------------------------------------------------------------- /pyemc/emc/field/trappe/2014/e2k.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # functions 4 | 5 | calc () { 6 | perl -e 'printf "%5.3f\n",'$1';' 7 | } 8 | 9 | 10 | convert() { 11 | for i in $@; do 12 | echo -en $(calc "$i") "\t->\t" $(calc "$i/0.00198720425864083") "\n"; 13 | done; 14 | } 15 | 16 | 17 | # main 18 | 19 | { 20 | if [ "$1" == "" ]; then 21 | echo "usage: e2k.sh energy [...]"; 22 | echo "converts energy from kcal/mol to K"; 23 | exit; 24 | fi; 25 | 26 | convert $@; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /pyemc/emc/field/trappe/2014/list.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | { 4 | # init 5 | 6 | my %nargs = ( 7 | nonbond => 2, increment => 2, bond => 2, angle => 3, torsion => 4, 8 | improper => 4 9 | ); 10 | my @arg = @ARGV; 11 | my $mode = lc(shift(@arg)); 12 | 13 | if (!defined($nargs{$mode})) { 14 | print("usage: list.pl mode type type [...]\n\n"); 15 | exit(-1); 16 | } 17 | if (scalar(@arg)!=$nargs{$mode}) { 18 | print("incorrect number of types for '$mode'\n\n"); 19 | exit(-1); 20 | } 21 | 22 | # setup 23 | 24 | my @types = (); 25 | foreach (@arg) { 26 | $_ = lc($_); 27 | my $i = index($_, "*"); 28 | push(@types, $i<0 ? [$i, $_] : [$i, substr($_,0,$i)]); 29 | }; 30 | my $ntypes = scalar(@types); 31 | 32 | # interpretation 33 | 34 | my $i; for ($i=0; $i<=$ntypes; ++$i) { shift(@ARGV); } 35 | foreach(<>) { 36 | chop(); 37 | @arg = split(" ", lc($_)); 38 | next if (!scalar(@arg)); 39 | if (!$read) { 40 | next if (@arg[0] ne "item"); 41 | next if ((@arg[1] ne $mode)&&(@arg[1] ne $mode."_auto")); 42 | $read = 1; 43 | next; 44 | } 45 | if (join(" ", @arg[0,1]) eq "item end") { 46 | $read = 0; 47 | next; 48 | } 49 | next if (substr(@arg[0],0,1) eq "#"); 50 | my $flag = 1; $i = 0; foreach (@types) { 51 | if (@{$_}[1] ne (@{$_}[0]<0 ? @arg[$i] : substr(@arg[$i],0,@{$_}[0]))) { 52 | $flag = 0; last; 53 | } 54 | ++$i; 55 | } 56 | if (!$flag) { 57 | $flag = 1; $i = 0; foreach (reverse(@types)) { 58 | if (@{$_}[1] ne (@{$_}[0]<0 ? @arg[$i] : substr(@arg[$i],0,@{$_}[0]))) { 59 | $flag = 0; last; 60 | } 61 | ++$i; 62 | } 63 | } 64 | next if (!$flag); 65 | print("$_\n"); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /pyemc/emc/field/trappe/2014/torsions.txt: -------------------------------------------------------------------------------- 1 | # type1 type2 type3 type3 k0 k1 k2 k3 2 | 3 | c* c* c3ho o 2035.58 -736.9 57.84 -293.23 4 | c* c* c3mo o 2035.58 -736.9 57.84 -293.23 5 | c* c* c3o o 2035.58 -736.9 57.84 -293.23 6 | c4* c* n3* hn 352.2 47.8 -105 -105 7 | c* c* os c* 0 725.35 -163.75 558.20 8 | c3* c3* c3o o 823.03 -47.91 -773.13 1.99 9 | c3* c3* c3o os 436.47 49.4025 386.565 0.4975 10 | c3* c3* c3o os 823.03 47.91 -773.13 -1.99 11 | c3* c3* os c4* 895.2 417.41 1373.14 30.19 12 | c* c3h c3h c* 0 127 6540 -127 13 | c* c3h c4* ca* 0 0 167 0 14 | c3* c3h c4h2 c* 688.5 86.36 -109.77 -282.24 15 | n3* c3mo c4* c* 221.34 481 -150 -115 16 | n3* c3mo c4* hc 221.34 481 -150 -115 17 | o c3mo c4* c* 221.34 481 -150 -115 18 | o c3mo c4* hc 221.34 481 -150 -115 19 | o c3mo n3* hn 1119 -163 629 0 20 | c* c3o os c4* 1820.74 417.41 -1373.14 0 21 | c4* c3o os c3h -14.48 993.1 520.7 -138.5 22 | o c3o os c3* 4716 2194 2059 -153.4 23 | o c3o os c4* 1820.74 -417.41 -1373.14 0 24 | c* c4 c4h2 c* 0 0 0 461.29 25 | s* c4 c4h2 c* 0 0 0 461.29 26 | c* c4 oh ho 0 0 0 163.56 27 | c4* c4* c4* n3* 221.34 481 -150 -115 28 | hc c4* c4* c* 0 0 0 854 29 | hc c4* c4* n3* 221.34 481 -150 -115 30 | hc c4* c4* no 454.32 -219 -63.7 4.98 31 | ca* c4* c4h2 c* 0 0 131 0 32 | c* c4* n3* c4* 6443.6 -2188 -1381 -890 33 | hc c4* n3* c4* 357.78 -37 -4.69 -142 34 | hc c4* n3* hn 422.74 -109 -12.5 -102 35 | c* c4* no on 127.09 -41.4 14.5 -19.1 36 | hc c4* no on 260.72 -40.8 -80.4 -41. 37 | c4* c4* os c3* 665.84 -751.83 538.95 -22.1 38 | c* c4* sc c4* 0 367.6 -270.18 581.64 39 | c* c4h c4h c* -251.06 428.73 -111.85 441.27 40 | c* c4h c4h2 c* -251.06 428.73 -111.85 441.27 41 | s* c4h c4h2 c* -251.06 428.73 -111.85 441.27 42 | c* c4h oh ho 215.96 197.33 31.46 -173.92 43 | c4h3 c4h sh hs 0 0 0 400 44 | c* c4h2 c4h2 c* 0 355.03 -68.19 791.32 45 | c* c4h2 c4h2 oh 0 176.62 -53.34 769.93 46 | c* c4h2 c4h2 os 0 176.62 -53.34 769.93 47 | oh c4h2 c4h2 oh 503.24 0 -251.62 1006.47 48 | os c4h2 c4h2 oh 503.24 0 -251.62 1006.47 49 | os c4h2 c4h2 os 503.24 0 -251.62 1006.47 50 | c* c4h2 oh ho 0 209.82 -29.17 187.93 51 | c* c4h2 sh hs 52.88 -52.05 18.46 306.36 52 | ca* ca* ca* ca* 0 0 1560.07 0 53 | m ca* ca* ca* 0 0 1560.07 0 54 | ca* ca* m m 0 0 1560.07 0 55 | c* sc sc c* 1763.9 398 -2181.6 505.25 56 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinshen56714/emc-pypi/f32daee3b5d8e372a9b719c1b79ac37b81e3a6f3/pyemc/emc/scripts/.DS_Store -------------------------------------------------------------------------------- /pyemc/emc/scripts/analyze/sample/bond.emc: -------------------------------------------------------------------------------- 1 | (* EMC: Script *) 2 | 3 | variables = { 4 | input -> "default", 5 | output -> "default", 6 | traject -> input, 7 | target -> "", 8 | start -> 0, 9 | end -> -1, 10 | frequency -> 1, 11 | binsize -> 0 12 | }; 13 | 14 | get = {name -> input, work -> target}; 15 | 16 | sample = { 17 | bond -> { 18 | frequency -> 1, 19 | active -> true, 20 | binsize -> binsize 21 | } 22 | }; 23 | 24 | traject = { 25 | mode -> sample, 26 | name -> traject, 27 | start -> start, 28 | end -> end, 29 | frequency -> frequency 30 | }; 31 | 32 | force = {style -> init, message -> raw}; 33 | 34 | export = { 35 | sample -> {name -> output, type -> distance, style -> math}, 36 | sample -> {name -> output, type -> distance, style -> csv} 37 | }; 38 | 39 | 40 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/analyze/sample/cavity.emc: -------------------------------------------------------------------------------- 1 | (* EMC: Script *) 2 | 3 | variables = { 4 | input -> "default", 5 | output -> "default", 6 | traject -> input, 7 | target -> "", 8 | record -> "", 9 | binsize -> 0.01, 10 | niterations -> 1000, 11 | ntrials -> 200, 12 | start -> 0, 13 | end -> -1, 14 | frequency -> 1, 15 | zero -> true 16 | }; 17 | 18 | get = {name -> input, work -> target}; 19 | 20 | sample = { 21 | cavity -> { 22 | frequency -> 1, 23 | active -> true, 24 | solver -> newton, 25 | record -> record, 26 | binsize -> binsize, 27 | ninserts -> ninserts, 28 | niterations -> niterations, 29 | zero -> eval(zero) 30 | } 31 | }; 32 | 33 | traject = { 34 | mode -> sample, 35 | name -> traject, 36 | start -> start, 37 | end -> end, 38 | frequency -> frequency 39 | }; 40 | 41 | force = {style -> init, message -> raw}; 42 | 43 | export = { 44 | sample -> {name -> output, type -> cavity, style -> math}, 45 | sample -> {name -> output, type -> cavity, style -> csv} 46 | }; 47 | 48 | 49 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/analyze/sample/distance.emc: -------------------------------------------------------------------------------- 1 | (* EMC: Script *) 2 | 3 | variables = { 4 | input -> "default", 5 | output -> "default", 6 | traject -> input, 7 | target -> "", 8 | start -> 0, 9 | end -> -1, 10 | frequency -> 1 11 | }; 12 | 13 | get = {name -> input, work -> target}; 14 | 15 | sample = { 16 | distance -> { 17 | frequency -> 1, 18 | active -> true 19 | } 20 | }; 21 | 22 | traject = { 23 | mode -> sample, 24 | name -> traject, 25 | start -> start, 26 | end -> end, 27 | frequency -> frequency 28 | }; 29 | 30 | force = {style -> init, message -> raw}; 31 | 32 | export = { 33 | sample -> {name -> output, type -> distance, style -> math}, 34 | sample -> {name -> output, type -> distance, style -> csv} 35 | }; 36 | 37 | 38 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/analyze/sample/gr.emc: -------------------------------------------------------------------------------- 1 | (* EMC: Script *) 2 | 3 | variables = { 4 | input -> "default", 5 | output -> "default", 6 | traject -> input, 7 | target -> "", 8 | binsize -> 1, 9 | cutoff -> 1, 10 | start -> 0, 11 | end -> -1, 12 | frequency -> 1 13 | }; 14 | 15 | get = {name -> input, work -> target}; 16 | 17 | sample = { 18 | gr -> { 19 | frequency -> 1, 20 | active -> true, 21 | binsize -> binsize, 22 | cutoff -> cutoff 23 | } 24 | }; 25 | 26 | traject = { 27 | mode -> sample, 28 | name -> traject, 29 | start -> start, 30 | end -> end, 31 | frequency -> frequency 32 | }; 33 | 34 | force = {style -> init, message -> raw}; 35 | 36 | export = { 37 | sample -> {name -> output, type -> gr, style -> math}, 38 | sample -> {name -> output, type -> gr, style -> csv} 39 | }; 40 | 41 | 42 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/analyze/sample/gyration.emc: -------------------------------------------------------------------------------- 1 | (* EMC: Script *) 2 | 3 | variables = { 4 | input -> "default", 5 | output -> "default", 6 | traject -> input, 7 | targter -> "", 8 | binsize -> 1, 9 | start -> 0, 10 | end -> -1, 11 | frequency -> 1 12 | }; 13 | 14 | get = {name -> input, work -> target}; 15 | 16 | sample = { 17 | gyration -> { 18 | frequency -> 1, 19 | active -> true, 20 | binsize -> binsize 21 | } 22 | }; 23 | 24 | traject = { 25 | mode -> sample, 26 | name -> traject, 27 | start -> start, 28 | end -> end, 29 | frequency -> frequency 30 | }; 31 | 32 | force = {style -> init, message -> raw}; 33 | 34 | export = { 35 | sample -> {name -> output, type -> gyration, style -> math}, 36 | sample -> {name -> output, type -> gyration, style -> csv} 37 | }; 38 | 39 | 40 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/avg_error.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # 3 | # program: average.pl 4 | # author: Pieter J. in 't Veld 5 | # date: October 22, 2018. 6 | # purpose: Repair of LAMMPS time-averaged output; part of EMC distribution 7 | # 8 | # Copyright (c) 2004-2024 Pieter J. in 't Veld 9 | # Distributed under GNU Public License as stated in LICENSE file in EMC root 10 | # directory 11 | # 12 | # notes: 13 | # 20181022 Conception 14 | # 15 | 16 | # functions 17 | 18 | sub scan { 19 | my $name = shift(@_); 20 | my $error = 0; 21 | my $skip = 2; 22 | my $stream; 23 | my $line; 24 | 25 | open($stream, "<$name"); 26 | foreach (<$stream>) { 27 | ++$line; 28 | my @arg = split(" "); 29 | if ($skip) { 30 | push(@output, join(" ", @arg)); 31 | if ($skip==1) { 32 | $ntarget = scalar(@arg)-1; 33 | } 34 | --$skip; 35 | next; 36 | } 37 | if (scalar(@arg)!=$ntarget) { 38 | $error = 1; 39 | next; 40 | } 41 | push(@output, join(" ", @arg)); 42 | } 43 | close($stream); 44 | return 0 if (!$error); 45 | print("$name\n"); 46 | return 1; 47 | } 48 | 49 | 50 | # main 51 | 52 | { 53 | my $stream; 54 | 55 | foreach (@ARGV) { 56 | @output = (); 57 | next if (!scan($_)); 58 | open($stream, ">$_.correct"); 59 | foreach(@output) { 60 | print($stream "$_\n"); 61 | } 62 | close($stream); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/change.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | run() { 4 | echo "$@"; 5 | "$@"; 6 | } 7 | 8 | names=( 9 | Type Round Commands Notes Script Root Phases Densities Root Convert Project 10 | Focus CheckExist Verbatim Trials Loop XRef Profile Cluster Chemistries 11 | Fractions MolMass MolVolume Groups Group Import Polymer Extra Set Bonds 12 | Angles Torsions Impropers Loop Cutoff InverseType Sites Variables 13 | ); 14 | 15 | for name in ${names[@]}; do 16 | run replace.pl -q "$name" "::$name" emc_setup.pl 17 | done; 18 | 19 | run replace.pl N::Clusters ::NClusters 20 | 21 | exit; 22 | 23 | flags=( 24 | CenterFlag InfoFlag DebugFlag WarnFlag ChiFlag AssumeFlag ChargeFlag 25 | EwaldFlag HexadecimalFlag MassFlag MassEntryFlag MolFlag NumberFlag 26 | MSDFlag OmitFlag VolumeFlag AtomisticFlag ReducedFlag ShakeFlag PairFlag 27 | CrossFlag BondFlag AngleFlag PressureFlag EnvironmentFlag 28 | ); 29 | 30 | newflags=( 31 | center info debug warn chi assume charge 32 | ewald hexadecimal mass mass_entry mol number 33 | msd omit volume atomistic reduced shake pair 34 | cross bond angle pressure environment 35 | ); 36 | 37 | results=(); 38 | for i in ${!flags[@]}; do 39 | value=($(grep ${flags[$i]} emc_setup.pl | head -1)); 40 | results+=("${newflags[$i]} => ${value[@]: -1}"); 41 | done; 42 | 43 | IFS=$'\n'; sorted=($(sort <<<"${results[*]}")); unset IFS; 44 | echo "${sorted[@]}"; 45 | 46 | for i in ${!flags[*]}; do 47 | run replace.pl -q "${flags[$i]}" "Flag{${newflags[$i]}}" emc_setup.pl 48 | done; 49 | 50 | 51 | cutoffs=( 52 | ChargeCutOff GhostCutOff InnerCutOff 53 | ); 54 | 55 | newcutoffs=( 56 | charge ghost inner 57 | ); 58 | 59 | for i in ${!cutoffs[*]}; do 60 | run replace.pl -q "${cutoffs[$i]}" "CutOff{${newcutoffs[$i]}}" emc_setup.pl 61 | done; 62 | 63 | names=( 64 | OSType Version Date Year pi Extension EMCVersion Record Dielectric Gamma 65 | Kappa NPhases Seed Shape Core Radius NRelax Depth Grace Precision Timestep 66 | ShapeDefault NTotal Build Host Columns NCores NChains Flag 67 | ImportNParallel PairConstants BondConstants AngleConstants Increment 68 | Temperature BinSize Pressure Density NAv Analyze Chemistry ClusterFlag 69 | CutOff Deform Direction EMC Field FieldFlag FieldFlags FieldNames Fields 70 | Lammps OptionsFlag Parameters PDBFlag ProfileFlag Reference Replace Region 71 | RunTime RunQueue RunName SampleFlag Shake Shear System 72 | ); 73 | 74 | for name in ${names[@]}; do 75 | run replace.pl -q "$name" "::$name" emc_setup.pl 76 | done; 77 | 78 | run replace.pl -q "N::Cores" "::NCores" emc_setup.pl 79 | 80 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/change_header.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # 3 | # Copyright (c) 2004-2024 Pieter J. in 't Veld 4 | # Distributed under GNU Public License as stated in LICENSE file in EMC root 5 | # directory 6 | # 7 | 8 | if (scalar(@ARGV)<1) 9 | { 10 | printf("usage: replace.pl [-q] file ...\n\n"); 11 | exit(-1); 12 | } 13 | $screen = 1; 14 | if ($search eq "-q") { $screen = 0; $search = shift(@ARGV); } 15 | foreach (@ARGV) 16 | { 17 | $name = $_; 18 | $found = 0; 19 | $nlines = 0; 20 | $nchanges = 0; 21 | @output = (); 22 | open($file, "<".$name); 23 | while (<$file>) 24 | { 25 | ++$nlines; 26 | if (m/\t\tEMC directory.\*\//) { 27 | $line = "\t\tEMC directory.\n*/\n"; 28 | printf("%s:%s: %s", $name, $nlines, $line) if ($screen); 29 | ++$nchanges; 30 | } else { 31 | $line = $_; 32 | } 33 | push(@output, $line); 34 | } 35 | close($file); 36 | next if ($nchanges<1); 37 | open($file, ">".$name); 38 | foreach (@output) { printf($file "%s", $_); } 39 | close($file); 40 | printf("%s: changed %s line%s.\n", 41 | $name, $nchanges, $nchanges!=1 ? "s" : "") if ($screen); 42 | } 43 | 44 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/clean_restart.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | foreach (split("\n", `find . -name '*.restart1'`)) 4 | { 5 | next if (! -f $_); 6 | next if (! -f ($file = substr($_, 0, length($_)-1))."2"); 7 | @f1 = stat($file."1"); 8 | @f2 = stat($file."2"); 9 | $ext = @f1[7]>@f2[7] ? "1" : 10 | @f1[7]<@f2[7] ? "2" : 11 | @f1[9]>@f2[9] ? "1" : "2"; 12 | printf( 13 | "%10d %10d %10d %10d %d %s\n", 14 | @f1[7], @f2[7], @f1[9], @f2[9], $ext, $file); 15 | `gzip $file$ext`; 16 | unlink $file.($ext eq "1" ? "2" : "1"); 17 | } 18 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/coding/cpmoddir.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # file: cpmoddir.sh 4 | # author: Pieter J. in 't Veld 5 | # date: March 10, 2006, April 14, 2007, September 30, 2010. 6 | # purpose: copy module directories; part of EMC distribution 7 | # 8 | # Copyright (c) 2004-2022 Pieter J. in 't Veld 9 | # Distributed under GNU Public License as stated in LICENSE file in EMC root 10 | # directory 11 | # 12 | 13 | # globals 14 | 15 | script=$(basename $0); 16 | version=0.1beta; 17 | 18 | # functions 19 | 20 | help() { 21 | echo "usage: $script source_dir destination_dir"; 22 | echo; 23 | exit; 24 | } 25 | 26 | info() { 27 | echo "info: $@"; 28 | } 29 | 30 | error() { 31 | echo "error: $@"; 32 | echo; 33 | exit; 34 | } 35 | 36 | # main 37 | 38 | echo "### $script $version"; 39 | echo; 40 | 41 | if [ "$2" = "" ]; then help; fi ; 42 | if [ ! -d $1 ]; then error "$1 is not a directory."; fi; 43 | if [ ! -e $2 ]; then info "creating $2"; mkdir -p $2; 44 | elif [ ! -d $2 ]; then error "$2 is not a directory."; fi; 45 | 46 | src=$1; dest=$2; flag=false; 47 | 48 | for i in $src/*.c; do 49 | file=$(basename $i .c); 50 | if [ ! -e $dest/$file.c ]; then 51 | info "copying $src/$file to $dest/$file"; 52 | cpmod.pl $src/$file $dest/$file; 53 | flag=true; 54 | fi; 55 | done; 56 | cd $dest; 57 | if [ ! -e core ]; then 58 | info "linking $dest/core to ../core"; 59 | ln -s ../core; 60 | flag=true; 61 | fi; 62 | 63 | if [ $flag = false ]; then info "nothing to be done"; fi; 64 | 65 | echo; 66 | 67 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/coding/emc_comments.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # 3 | # program: emc_comments.pl 4 | # author: Pieter J. in 't Veld 5 | # date: May 14, 2020. 6 | # purpose: Generate comment and function list of perl script source 7 | # 8 | # Copyright (c) 2004-2022 Pieter J. in 't Veld 9 | # Distributed under GNU Public License as stated in LICENSE file in EMC root 10 | # directory 11 | # 12 | # notes: 13 | # 20200514 Inception 14 | # 15 | 16 | # main 17 | 18 | { 19 | foreach (<>) { 20 | ++$line; 21 | $flag = 0; 22 | $flag = 1 if (substr($_,0,2) eq "# "); 23 | $flag = 2 if (substr($_,0,4) eq "sub "); 24 | $flag = 0 if (substr($_,0,3) eq "# "); 25 | $flag = 0 if ($_ =~ m/:/); 26 | next if (!$flag); 27 | $_ = " - ".(split(" "))[1]."\n" if ($flag == 2); 28 | print($_); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/coding/emc_parse_oper.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | # main 4 | 5 | { 6 | my $i = 0; 7 | my $template = shift(@ARGV); 8 | my $command = shift(@ARGV); 9 | my @tmp; foreach (split("_", $template)) { push(@tmp, ucfirst(lc($_))); } 10 | my $Template = join("", @tmp); 11 | 12 | print("// parse transcriptions\n\n"); 13 | print("#define\tPARSE_OPER_LIST \\\n"); 14 | foreach (@ARGV) { 15 | printf("%s PARSE_OPER($command, %s, %s, %s, 1, &)", $i++ ? " \\\n" : "", uc($_), lc($_), lc($_)); 16 | } 17 | print("\n\n"); 18 | print("#define\tPARSE_OPER(Oper, VAR, var, string, nvars, ampersand) PARSE_##VAR,\n"); 19 | print("enum{PARSE_OPER_LIST PARSE_NVARS};\n"); 20 | print("#undef\tPARSE_OPER\n\n"); 21 | 22 | print(" 23 | // struct i/o 24 | 25 | #define PARSE_OPER(Oper, VAR, var, string, nvars, amp) nvars, 26 | static long parse_n[] = {PARSE_OPER_LIST 0}; 27 | #undef PARSE_OPER 28 | 29 | #define PARSE_OPER(Oper, VAR, var, string, nvars, amp) #string, 30 | static char *parse_name[] = {PARSE_OPER_LIST NULL}; 31 | #undef PARSE_OPER 32 | 33 | static struct parse 34 | parse = {PARSE_NVARS, parse_n, parse_name, NULL, NULL}; 35 | 36 | 37 | // struct read 38 | 39 | #define PARSE_OPER(Oper, VAR, var, string, nvars, amp) Oper##Read, 40 | static fparse parse_read[] = {PARSE_OPER_LIST NULL}; 41 | #undef PARSE_OPER 42 | 43 | long ".$Template."Read(struct format *format, struct $template *ptr, long i) 44 | { 45 | ptr += i; 46 | #define PARSE_OPER(Oper, VAR, var, string, nvars, amp) amp ptr->var, 47 | const void 48 | *var[] = {PARSE_OPER_LIST NULL}; 49 | #undef PARSE_OPER 50 | 51 | ++format->target; 52 | parse.variable = var; 53 | parse.function = parse_read; 54 | return ParseRead(format, &parse); 55 | } 56 | 57 | 58 | // struct write 59 | 60 | #define PARSE_OPER(Oper, VAR, var, string, nvars, amp) Oper##Write, 61 | static fparse parse_write[] = {PARSE_OPER_LIST NULL}; 62 | #undef PARSE_OPER 63 | 64 | long ".$Template."Write(struct format *format, struct $template *ptr, long i) 65 | { 66 | ptr += i; 67 | #define PARSE_OPER(Oper, VAR, var, string, nvars, amp) amp ptr->var, 68 | const void 69 | *var[] = {PARSE_OPER_LIST NULL}; 70 | #undef PARSE_OPER 71 | 72 | ++format->target; 73 | parse.variable = var; 74 | parse.function = parse_write; 75 | if (format->bin) return ParseWrite(format, &parse); 76 | FormatWrite(format, \"%s{\", format->buffer); 77 | i = ParseWrite(format, &parse); 78 | strcat(format->buffer, \"}\"); 79 | return i; 80 | } 81 | "); 82 | } 83 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/coding/hold.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # File: hold.sh 4 | # Author: Pieter J. in 't Veld 5 | # Date: May 15, 2004 6 | # Purpose: Swap files between active and hold directories; part of EMC 7 | # distribution 8 | # 9 | # Copyright (c) 2004-2022 Pieter J. in 't Veld 10 | # Distributed under GNU Public License as stated in LICENSE file in EMC root 11 | # directory 12 | # 13 | 14 | function hold() 15 | { 16 | local dir=$(perl -e '@arg=split("core", "'$(pwd)'"); print("$arg[-1]\n");'); 17 | local home=$(perl -e '@arg=split("core", "'$(pwd)'"); print("$arg[0]\n");'); 18 | 19 | if [ "$dir" == "$home" ]; then dir=""; fi; 20 | mkdir -p "$home/hold/$dir"; 21 | for file in $@; do 22 | if [ ! -e "$file" ]; then continue; fi; 23 | if [ -e "$home/hold/$dir/$file" ]; then 24 | mv "$file" "$file.tmp"; 25 | mv "$home/hold/$dir/$file" .; 26 | mv "$file.tmp" "$home/hold/$dir/$file"; 27 | else 28 | cp "$file" "$home/hold/$dir/$file"; 29 | fi; 30 | done; 31 | } 32 | 33 | # main 34 | 35 | hold $@; 36 | 37 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/coding/scrape.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # 3 | # program: header.pl 4 | # author: Pieter J. in 't Veld 5 | # date: May 18, 2019. 6 | # purpose: Create continuous list of file names and line number as 7 | # produced by grep 8 | # 9 | # Copyright (c) 2004-2022 Pieter J. in 't Veld 10 | # Distributed under GNU Public License as stated in LICENSE file in EMC root 11 | # directory 12 | # 13 | 14 | # main 15 | 16 | { 17 | foreach(<>) { 18 | push(@a, join(":",(split(":"))[0,1])); 19 | } 20 | print(join(" ", sort(@a))); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/emc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # script: emc.sh 4 | # author: Pieter J. in 't Veld 5 | # date: February 19, November 3, 2018, July 24, 2023. 6 | # purpose: Wrapper around EMC for starting correct executable 7 | # 8 | # Copyright (c) 2004-2024 Pieter J. in 't Veld 9 | # Distributed under GNU Public License as stated in LICENSE file in EMC root 10 | # directory 11 | # 12 | # notes: 13 | # 20180218 Creation date 14 | # 20181103 Addition of version flag 15 | # 20230724 Addition of aarch64 and source checking 16 | # 17 | 18 | # variables 19 | 20 | emc_root="$(cd "$(dirname $0)/.."; pwd)"; 21 | emc_version=9.4.4; 22 | 23 | 24 | # functions 25 | 26 | function init() { 27 | local dir; 28 | local host; 29 | 30 | if [ "$HOST" = "" ]; then 31 | dir=$(dirname "$0"); 32 | host=$(/bin/hostname 2>&1 || sed -e 's/\..*$//'); 33 | if [ -e "${dir}/emc_${host}" ]; then 34 | HOST=${host}; 35 | else 36 | case "${OSTYPE}" in 37 | darwin*) HOST="macos";; 38 | linux*) if [ "$(uname -m)" = "x86_64" ]; then 39 | HOST="linux_x86_64"; 40 | elif [ "$(uname -m)" = "aarch64" ]; then 41 | HOST="linux_aarch64"; 42 | else 43 | HOST="linux"; 44 | fi;; 45 | msys*) HOST="win32";; 46 | *) echo "ERROR: unsupported OS '${OSTYPE}'"; exit -1;; 47 | esac; 48 | fi; 49 | fi; 50 | } 51 | 52 | 53 | # main 54 | 55 | init "$@"; 56 | if [ -e "$(which emc_${HOST})" ]; then 57 | emc_${HOST} "$@"; 58 | elif [ -e "${EMC_ROOT}/bin/emc_${HOST}" ]; then 59 | "${EMC_ROOT}/bin/emc_${HOST}" "$@"; 60 | elif [ -e "${emc_root}/bin/emc_${HOST}" ]; then 61 | "${emc_root}/bin/emc_${HOST}" "$@"; 62 | else 63 | echo "ERROR: cannot find EMC executable"; 64 | echo "ERROR:" 65 | echo "ERROR: set HOST and/or add EMC bin and scripts directories to your PATH"; 66 | echo "ERROR: alternatively set EMC_ROOT"; 67 | echo "ERROR: EMC_ROOT=\"${EMC_ROOT}\""; 68 | echo "ERROR: HOST=\"${HOST}\""; 69 | fi; 70 | 71 | 72 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/emc2emc.emc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.sh 2 | (* EMC: Script *) 3 | 4 | variables = { 5 | input -> $arg0, 6 | output -> $arg1, 7 | traject -> input, 8 | compress -> false, 9 | unwrap -> true, 10 | parameters -> true, 11 | types -> false, 12 | shake -> "auto", 13 | source -> ".", 14 | target -> "." 15 | }; 16 | 17 | get = {name -> source+"/"+input}; 18 | 19 | put = {name -> output}; 20 | 21 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/emc2energy.emc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.sh 2 | (* EMC: Script *) 3 | 4 | variables = { 5 | input -> $arg0, 6 | message -> "raw" 7 | }; 8 | 9 | get = {name -> input}; 10 | 11 | force = {style -> none, message -> message}; 12 | force = {style -> init, message -> message}; 13 | 14 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/emc2insight.emc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.sh 2 | (* EMC: Script *) 3 | 4 | variables = { 5 | input -> $arg0, 6 | output -> $arg1, 7 | traject -> input, 8 | compress -> false, 9 | map -> false, 10 | unwrap -> true, 11 | pbc -> true, 12 | cut -> false, 13 | source -> ".", 14 | target -> "." 15 | }; 16 | 17 | get = {name -> source+"/"+input}; 18 | 19 | insight = {name -> output, compress -> compress, map -> map, 20 | unwrap -> unwrap, pbc -> pbc, cut -> cut}; 21 | 22 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/emc2lammps.emc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.sh 2 | (* EMC: Script *) 3 | 4 | variables = { 5 | input -> $arg0, 6 | output -> $arg1, 7 | traject -> input, 8 | compress -> false, 9 | map -> true, 10 | unwrap -> true, 11 | parameters -> true, 12 | ewald -> true, 13 | types -> false, 14 | shake -> "auto", 15 | source -> ".", 16 | target -> "." 17 | }; 18 | 19 | get = {name -> source+"/"+input}; 20 | 21 | lammps = {name -> output, compress -> compress, map -> map, 22 | unwrap -> unwrap, parameters -> parameters, types -> types, 23 | shake -> shake, ewald -> ewald}; 24 | 25 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/emc2pdb.emc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.sh 2 | (* EMC: Script *) 3 | 4 | variables = { 5 | input -> $arg0, 6 | output -> $arg1, 7 | traject -> input, 8 | system -> 0, 9 | compress -> true, 10 | map -> true, 11 | unwrap -> true, 12 | pbc -> true, 13 | extend -> true, 14 | vdw -> false, 15 | cut -> false, 16 | connect -> false, 17 | parameters -> false, 18 | source -> ".", 19 | target -> "." 20 | }; 21 | 22 | get = {name -> source+"/"+input}; 23 | 24 | pdb = {name -> output, compress -> compress, system -> system, 25 | map -> map, unwrap -> unwrap, pbc -> pbc, vdw -> vdw, 26 | cut -> cut, extend -> extend, connectivity -> connect, 27 | parameters -> parameters}; 28 | 29 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/emc2volume.emc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.sh 2 | (* EMC: Script *) 3 | 4 | variables = { 5 | input -> $arg0, 6 | output -> $arg0, 7 | select -> "{mode -> 0}", 8 | traject -> input, 9 | compress -> false, 10 | unwrap -> true, 11 | vdw -> false, 12 | frequency -> 1e2, 13 | ntrials -> 1e4, 14 | binsize -> 0.1, 15 | style -> "math", 16 | source -> ".", 17 | target -> ".", 18 | frequency -> 1 19 | }; 20 | 21 | get = {name -> source+"/"+input}; 22 | 23 | sample = { 24 | volume -> { 25 | id -> 0, 26 | active -> true, 27 | frequency -> frequency, 28 | ntrials -> ntrials, 29 | binsize -> binsize, 30 | select -> select 31 | } 32 | }; 33 | 34 | traject = {mode -> sample, name -> traject}; 35 | 36 | export = { 37 | sample -> { 38 | name -> target+"/"+output+"_volume", 39 | type -> volume, 40 | style -> style 41 | } 42 | }; 43 | 44 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/emc2xyz.emc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.sh 2 | (* EMC: Script *) 3 | 4 | variables = { 5 | input -> $arg0, 6 | output -> $arg1, 7 | compress -> false, 8 | map -> false, 9 | unwrap -> true, 10 | source -> ".", 11 | target -> "." 12 | }; 13 | 14 | get = {name -> source+"/"+input}; 15 | 16 | xyz = {name -> output, compress -> compress, map -> map, 17 | unwrap -> unwrap}; 18 | 19 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/emc_clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # script: emc_error.sh 4 | # author: Pieter J. in 't Veld 5 | # date: July 10, 2019 6 | # purpose: Clean directory by removing all project.esh related files 7 | # 8 | # notes: 9 | # 20190710 Creation date 10 | # 11 | 12 | clean() { 13 | local file; 14 | local script; 15 | local project; 16 | 17 | for script in "$@"; do 18 | if [ ! -e "${script}" ]; then continue; fi; 19 | project=$(basename ${script} .esh); 20 | for trial in ${project}.*; do 21 | if [ "${trial}" == "${project}.esh" ]; then continue; fi; 22 | rm ${trial}; 23 | done; 24 | done; 25 | rm -f build.*; 26 | } 27 | 28 | # main 29 | 30 | if [ "$1" == "" ]; then 31 | clean *.esh; 32 | else 33 | clean "$@"; 34 | fi; 35 | 36 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/hold.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # File: hold.sh 4 | # Author: Pieter J. in 't Veld 5 | # Date: May 15, 2004 6 | # Purpose: Swap files between active and hold directories; part of EMC 7 | # distribution 8 | # 9 | # Copyright (c) 2004-2019 Pieter J. in 't Veld 10 | # Distributed under GNU Public License as stated in LICENSE file in EMC root 11 | # directory 12 | # 13 | 14 | function hold() 15 | { 16 | local dir=$(perl -e '@arg=split("core", "'$(pwd)'"); print("$arg[-1]\n");'); 17 | local home=$(perl -e '@arg=split("core", "'$(pwd)'"); print("$arg[0]\n");'); 18 | 19 | if [ "$dir" == "$home" ]; then dir=""; fi; 20 | mkdir -p "$home/hold/$dir"; 21 | for file in $@; do 22 | if [ ! -e "$file" ]; then continue; fi; 23 | if [ -e "$home/hold/$dir/$file" ]; then 24 | mv "$file" "$file.tmp"; 25 | mv "$home/hold/$dir/$file" .; 26 | mv "$file.tmp" "$home/hold/$dir/$file"; 27 | else 28 | cp "$file" "$home/hold/$dir/$file"; 29 | fi; 30 | done; 31 | } 32 | 33 | # main 34 | 35 | hold $@; 36 | 37 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/lammps2emc.emc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.sh 2 | (* EMC: Script *) 3 | 4 | variables = { 5 | input -> $arg0, 6 | output -> $arg1, 7 | traject -> input, 8 | compress -> false, 9 | start -> "last", 10 | end -> "last", 11 | source -> ".", 12 | target -> "." 13 | }; 14 | 15 | get = {name -> source+"/"+input, work -> target}; 16 | 17 | traject = {mode -> get, name -> traject, start -> start, end -> end}; 18 | 19 | put = {name -> output, compress -> compress}; 20 | 21 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/lammps2lammps.emc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.sh 2 | (* EMC: Script *) 3 | 4 | variables = { 5 | input -> $arg0, 6 | output -> $arg1, 7 | traject -> input, 8 | compress -> false, 9 | start -> "last", 10 | end -> "last", 11 | source -> ".", 12 | target -> "." 13 | }; 14 | 15 | get = {name -> source+"/"+input, work -> target}; 16 | 17 | traject = {mode -> get, name -> traject, start -> start, end -> end}; 18 | 19 | lammps = {name -> output, mode -> put, forcefield -> auto, 20 | parameters -> true, types -> false, unwrap -> true, 21 | charges -> true, ewald -> true}; 22 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/lammps2pdb.emc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.sh 2 | (* EMC: Script *) 3 | 4 | variables = { 5 | input -> $arg0, 6 | output -> $arg1, 7 | traject -> input, 8 | compress -> false, 9 | start -> 0, 10 | end -> "last", 11 | frequency -> 1, 12 | cut -> false, 13 | pbc -> true, 14 | vdw -> false, 15 | rank -> false, 16 | unwrap -> true, 17 | source -> ".", 18 | target -> "." 19 | }; 20 | 21 | files = { 22 | delete -> {output+".vmd", output+".pdb", output+".pdb.gz", 23 | output+".psf", output+".psf.gz"} 24 | }; 25 | 26 | get = {name -> source+"/"+input, work -> target}; 27 | 28 | sample = { 29 | script -> { 30 | active -> true, 31 | frequency -> 1, 32 | script -> { 33 | pdb -> {name -> output, compress -> compress, mode -> append, 34 | unwrap -> unwrap, vdw -> vdw, cut -> cut, rank -> rank, 35 | pbc -> pbc} 36 | } 37 | } 38 | }; 39 | 40 | traject = {mode -> sample, name -> traject, 41 | start -> start, end -> end, frequency -> frequency}; 42 | 43 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/pack.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$2" == "" ]; then 4 | echo "usage: "$(basename $0)" dir ext"; 5 | echo; 6 | exit; 7 | fi; 8 | 9 | dir="$1"; shift; 10 | ext="$1"; shift; 11 | 12 | for file in $(find "$dir" -name "*$ext" | sort); do 13 | echo $file; 14 | gzip $file; 15 | done; 16 | 17 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/pdb.emc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.sh 2 | (* EMC: Script *) 3 | 4 | variables = { 5 | input -> $arg0, 6 | output -> $arg1, 7 | target -> ".", 8 | unwrap -> true, 9 | pbc -> true, 10 | cut -> false, 11 | length -> 0 12 | }; 13 | 14 | get = {name -> input, work -> target}; 15 | 16 | pdb = {name -> output, unwrap -> unwrap, pbc -> pbc, cut -> cut, 17 | length -> length}; 18 | 19 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/prm_duplicate.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # 3 | # program: prm_duplicate.pl 4 | # author: Pieter J. in 't Veld 5 | # date: May 2, 2012. 6 | # purpose: duplicate exisiting parameters; part of EMC distribution 7 | # 8 | # Copyright (c) 2004-2024 Pieter J. in 't Veld 9 | # Distributed under GNU Public License as stated in LICENSE file in EMC root 10 | # directory 11 | # 12 | 13 | if (scalar(@ARGV)<3) { 14 | print("usage: duplicate_parm.pl source target parm.csv\n\n"); 15 | exit; 16 | } 17 | $source = shift(@ARGV); 18 | $target = shift(@ARGV); 19 | foreach (<>) { 20 | chop(); 21 | if ($header eq "") { 22 | $header = $_; next; 23 | } 24 | push(@data, $_); 25 | my $flag = 0; 26 | my @arg = split(","); 27 | if ($arg[0] eq $source) { 28 | $flag = 1; 29 | $arg[0] = $target; 30 | } 31 | if ($arg[1] eq $source) { 32 | $flag = 1; 33 | $arg[1] = $target; 34 | } 35 | if ($arg[1]<$arg[0]) { 36 | my $t = $arg[0]; $arg[0] = $arg[1]; $arg[1] = $t; 37 | } 38 | push(@data,join(",", @arg)) if ($flag); 39 | } 40 | sort(@data); 41 | print("$header\n"); 42 | foreach(@data) { 43 | print("$_\n"); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/prm_extract.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # script: prm_extract.sh 4 | # author: Pieter J. in 't Veld 5 | # date: April 2, August 2, 2021 6 | # purpose: Extract and reduce DPD parameters using an EMC Setup project 7 | # 8 | # notes: 9 | # 20210402 Creation date 10 | # 20210802 Expanded application area include 'includes' and 'structures' 11 | # 12 | 13 | # settings 14 | 15 | version=0.2; 16 | date="August 2, 2021"; 17 | script=$(basename "$0"); 18 | 19 | # functions 20 | 21 | error() { 22 | echo $@; 23 | echo; 24 | exit -1; 25 | } 26 | 27 | expand() { 28 | local home="$(pwd - L)"; 29 | cd "$1"; 30 | pwd -L; 31 | cd "$home"; 32 | } 33 | 34 | psf_types() { 35 | perl -e ' 36 | foreach (<>) { 37 | @a = split(" "); 38 | if (!$read) { 39 | next if (@a[1] ne "!NATOM"); 40 | $n = @a[0]; next; 41 | } 42 | next if (!$n); 43 | ++$t{@a[5]}; 44 | --$n; 45 | } 46 | print(join(" ", sort(keys(%t))), "\n");; 47 | ' $@; 48 | } 49 | 50 | list_unique() { 51 | perl -e ' 52 | foreach (@ARGV) { $a{$_} = 1; }; print(join(" ", sort(keys(%a))), "\n"); 53 | ' $@; 54 | } 55 | 56 | # main 57 | 58 | { 59 | if [ "$2" == "" ]; then 60 | error "usage: extract.sh chemistry_dir field_dir"; 61 | fi; 62 | 63 | field="$(expand "$2")"; 64 | chemistry="$(expand "$1")"; 65 | 66 | #echo "field = $field"; 67 | #echo "chemistry = $chemistry"; 68 | 69 | if [ ! -d "$field" ]; then 70 | error "'$field' is not a directory"; 71 | fi; 72 | if [ ! -d "$chemistry" ]; then 73 | error "'$chemistry' is not a directory"; 74 | fi; 75 | 76 | cd "$chemistry"; 77 | tmp=$(mktemp); 78 | if [ -d stages ]; then 79 | stages=($(find stages -name '*.esh' -type f)); 80 | if [ "${#stages[@]}" == "0" ]; then 81 | error "no EMC scripts in chemistry directory"; 82 | fi; 83 | #echo "stages = ${stages[@]}"; 84 | cat "${stages[@]}" >$tmp; 85 | else 86 | error "directory 'stages' is missing in chemistry directory"; 87 | fi; 88 | if [ -d groups ]; then 89 | groups=($(find groups -name '*.dat' -type f)); 90 | if [ "${#groups[@]}" != "0" ]; then 91 | #echo "groups = ${groups[@]}"; 92 | data=$(cat "${groups[@]}"); 93 | replace.pl -q "@GROUPS" "$data" $tmp; 94 | fi; 95 | fi; 96 | if [ -d include ]; then 97 | include=($(find include -name '*' -type f)); 98 | if [ "${#include[@]}" != "0" ]; then 99 | cat "${include[@]}" >>$tmp; 100 | fi 101 | fi; 102 | 103 | types=($(prm_list_types.pl -list $tmp)); 104 | rm $tmp; 105 | 106 | if [ -d structures ]; then 107 | psf=($(find structures -name '*.psf' -type f)); 108 | if [ "${#psf[@]}" != "0" ]; then 109 | types=(${types[@]} $(psf_types ${psf[@]})); 110 | fi; 111 | psf=($(find structures -name '*.psf.gz' -type f)); 112 | if [ "${#psf[@]}" != "0" ]; then 113 | for file in ${psf[@]}; do 114 | types=(${types[@]} $(gunzip -c $file | psf_types)); 115 | done; 116 | fi; 117 | fi; 118 | 119 | mkdir -p field; 120 | types=($(list_unique ${types[@]})); 121 | prm_reduce.pl -source_dir="$field" -target_dir="field" "${types[@]}" 122 | } 123 | 124 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/prm_reduce.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # script: prm_reduce.sh 4 | # author: Pieter J. in 't Veld 5 | # date: April 9, 2019 6 | # purpose: Reduce DPD parameters using EMC Setup script 7 | # 8 | # notes: 9 | # 20190409 Creation date 10 | # 11 | 12 | # settings 13 | 14 | version=1.0; 15 | date="April 9, 2019"; 16 | script=$(basename "$0"); 17 | 18 | # main 19 | 20 | { 21 | if [ "$2" = "" ]; then 22 | echo "usage: prm_reduce.sh field_dir setup"; 23 | echo; 24 | exit; 25 | fi; 26 | 27 | field="$1"; 28 | setup="$2"; 29 | if [ ! -d "$field" ]; then 30 | echo "ERROR: '$field' is not a directory"; 31 | echo; 32 | exit; 33 | fi; 34 | if [ ! -e "$setup" ]; then 35 | echo "ERROR: '$setup' not found"; 36 | echo; 37 | exit; 38 | fi; 39 | 40 | prm_reduce.pl -source_dir="$field" $(prm_list_types.pl -list "$setup"); 41 | } 42 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/psf_charge.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # 3 | # script: psf_charge.pl 4 | # author: Pieter J. in 't Veld 5 | # date: August 30, 2018 6 | # purpose: Determine charge of PSF file 7 | # 8 | # Copyright (c) 2004-2024 Pieter J. in 't Veld 9 | # Distributed under GNU Public License as stated in LICENSE file in EMC root 10 | # directory 11 | # 12 | 13 | use File::Basename; 14 | 15 | $Script = basename($0); 16 | $Version = "1.0"; 17 | $Year = "2018"; 18 | 19 | 20 | # functions 21 | 22 | sub set_commands { 23 | %Commands = ( 24 | "help" => "this message" 25 | ); 26 | @Notes = ( 27 | "* Calculates the total charge of one or more PSF files" 28 | ); 29 | } 30 | 31 | 32 | sub init { 33 | my @arg; 34 | 35 | foreach (@ARGV) { 36 | if (substr($_,0,1) eq "-") { 37 | my @a = split("="); 38 | my $value = eval(@a[1]); 39 | my $flag = @a[1] eq "true" ? 1 : @a[1] eq "" ? 1 : $value ? 1 : 0; 40 | if (@a[0] eq "-help") { 41 | help(); 42 | } else { 43 | help(); 44 | } 45 | } else { 46 | push(@arg, $_); 47 | } 48 | } 49 | #help() if (scalar(@arg)<1); 50 | } 51 | 52 | 53 | sub header { 54 | print("$Script v$Version (c)$Year by Pieter J. in 't Veld\n\n"); 55 | } 56 | 57 | 58 | sub help { 59 | my $key; 60 | 61 | header(); 62 | set_commands(); 63 | print("Usage:\n $Script [-command] PSF [...]\n\n"); 64 | print("Commands:\n"); 65 | foreach $key (sort(keys %Commands)) { 66 | printf(" -%-12.12s %s\n", $key, $Commands{$key}); 67 | } 68 | if (scalar(@Notes)) { 69 | print("\nNotes:\n"); 70 | foreach (@Notes) { printf(" %s\n", $_); } 71 | } 72 | printf("\n"); 73 | exit(-1); 74 | } 75 | 76 | 77 | # main 78 | 79 | init(); 80 | header(); 81 | foreach(<>) { 82 | chop(); 83 | @arg = split(" "); 84 | if (!$n) { 85 | $n = $ntotal = @arg[0] if (@arg[1] eq "!NATOM"); 86 | next; 87 | } 88 | ++$ncharged if (eval(@arg[6]) != 0); 89 | $charge += @arg[6]; 90 | last if (!--$n); 91 | } 92 | printf( 93 | "total charge = %f (%f%% charged)\n\n", 94 | $charge, $ntotal ? $ncharged/$ntotal*100 : 0.0); 95 | 96 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/qjobs: -------------------------------------------------------------------------------- 1 | myjobs.pl -------------------------------------------------------------------------------- /pyemc/emc/scripts/run_analyze.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # name: run_host.sh 4 | # author: Pieter J. in 't Veld 5 | # date: February 20, March 4, 2017. 6 | # purpose: start analysis script remotely and transfer data back; part of 7 | # EMC distribution 8 | # 9 | # Copyright (c) 2004-2024 Pieter J. in 't Veld 10 | # Distributed under GNU Public License as stated in LICENSE file in EMC root 11 | # directory 12 | # 13 | 14 | 15 | if [ "$2" == "" ]; then 16 | echo "usage: run_analyze.sh [user@]host script [...]"; 17 | echo; 18 | exit; 19 | fi; 20 | 21 | . ~/.bashrc; 22 | 23 | host=$1; shift; 24 | for file in $@; do 25 | run_host.sh $host $file; 26 | scp -p $host:$(here)/data.tgz .; 27 | tar -zxvf data.tgz; 28 | done; 29 | 30 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/run_stat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # script: run.sh 4 | # author: Pieter J. in 't Veld 5 | # date: May 30, October 29, 2018. 6 | # purpose: submit parallel jobs to LSF, PBS, or Slurm queues; calls itself 7 | # as submit script 8 | # 9 | # Copyright (c) 2004-2024 Pieter J. in 't Veld 10 | # Distributed under GNU Public License as stated in LICENSE file in EMC root 11 | # directory 12 | # 13 | # notes: 14 | # 20180530 Creation date 15 | # 20181028 Addition of queueing system recognition 16 | # 17 | 18 | # Functions 19 | 20 | local_which() { 21 | local output="$(which $1 2>&1)"; 22 | 23 | if [ "${output}" != "" ]; then 24 | if [ "$(echo "${output}" | grep "no $1")" == "" ]; then echo $1; fi; 25 | fi; 26 | } 27 | 28 | 29 | system_queue() { 30 | if [ "$(local_which bsub)" != "" ]; then echo lsf; 31 | elif [ "$(local_which qsub)" != "" ]; then echo pbs; 32 | elif [ "$(local_which sbatch)" != "" ]; then echo slurm; fi; 33 | } 34 | 35 | 36 | lsf_stat() { 37 | local name="$1"; 38 | } 39 | 40 | 41 | pbs_stat() { 42 | qstat -f $1 2>&1 | grep job_state | perl -e ' 43 | foreach(<>) { @a=split(" "); } print(@a[-1]);'; 44 | } 45 | 46 | 47 | slurm_stat() { 48 | local result=$( \ 49 | squeue -j $1 2>&1 | grep $1 | perl -e ' 50 | foreach(<>) { @a=split(" "); } print(@a[4]);'); 51 | 52 | if [ "${result}" == "R" ]; then echo "R"; 53 | elif [ "${result}" == "PD" ]; then echo "Q"; 54 | elif [ "${result}" == "CG" ]; then echo "F"; 55 | else echo "U"; fi; 56 | } 57 | 58 | 59 | stat() { 60 | local queue=$(system_queue); 61 | 62 | if [ "${queue}" == "lsf" ]; then lsf_stat; 63 | elif [ "${queue}" == "pbs" ]; then lsf_stat; 64 | elif [ "${queue}" == "slurm" ]; then lsf_stat; fi; 65 | } 66 | 67 | 68 | # main 69 | 70 | current="U"; 71 | while [ "$1" != "" ]; do 72 | stat=$(stat $1); 73 | case "$stat" in 74 | R) current="R";; 75 | Q) if [ "$current" != "R" ]; then current="Q"; fi;; 76 | F) if [ "$current" != "R" -a "$current" != "Q" ]; then current="F"; fi;; 77 | esac; 78 | shift; 79 | done; 80 | echo $current; 81 | 82 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/template.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # 3 | # program: template.pl 4 | # author: Pieter J. in 't Veld 5 | # date: October 31, 2007 6 | # purpose: Creation of modules from templates; part of EMC distribution 7 | # 8 | # notes: 9 | # 20071031 Creation date; usage: template.pl template file .ext 10 | # 11 | # Copyright (c) 2004-2024 Pieter J. in 't Veld 12 | # Distributed under GNU Public License as stated in LICENSE file in EMC root 13 | # directory 14 | # 15 | 16 | sub replace { 17 | my $template=shift; 18 | my $name=shift; 19 | my $Name=ucfirst($name); 20 | my $NAME=uc($name); 21 | my $ext=shift; 22 | my @lines=split("\n", `cat $template$ext`); 23 | 24 | open(FILE, ">", $name.$ext); 25 | foreach (@lines) 26 | { 27 | $tmp=$_; 28 | $tmp=~s/template/$name/g; 29 | $tmp=~s/Template/$Name/g; 30 | $tmp=~s/TEMPLATE/$NAME/g; 31 | print(FILE $tmp."\n"); 32 | } 33 | print(FILE "\n"); 34 | close(FILE); 35 | } 36 | 37 | replace(@ARGV); 38 | 39 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/traject2pdb.emc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.sh 2 | (* EMC: Script *) 3 | 4 | variables = { 5 | input -> $arg0, 6 | output -> $arg1, 7 | traject -> input, 8 | compress -> true, 9 | unwrap -> true, 10 | vdw -> false, 11 | source -> ".", 12 | target -> ".", 13 | frequency -> 1 14 | }; 15 | 16 | output = { 17 | debug -> false, 18 | exit -> true, 19 | info -> true, 20 | warning -> true 21 | }; 22 | 23 | shell = {"rm -f "+output+(compress ? ".pdb.gz" : ".pdb")}; 24 | shell = {"rm -f "+output+(compress ? ".psf.gz" : ".psf")}; 25 | 26 | get = {name -> source+"/"+input}; 27 | 28 | sample = { 29 | script -> { 30 | id -> 0, 31 | active -> true, 32 | frequency -> frequency, 33 | quiet -> true, 34 | script -> { 35 | pdb -> {name -> output, compress -> compress, unwrap -> unwrap, 36 | vdw -> vdw, mode -> append} 37 | } 38 | } 39 | }; 40 | 41 | traject = {mode -> sample, name -> traject}; 42 | 43 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/try.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # File: try.sh 4 | # Author: Pieter J. in 't Veld 5 | # Date: May 15, 2004 6 | # Purpose: Try compilation of single modules; part of EMC distribution 7 | # 8 | # Copyright (c) 2004-2024 Pieter J. in 't Veld 9 | # Distributed under GNU Public License as stated in LICENSE file in EMC root 10 | # directory 11 | # 12 | 13 | function try () { 14 | local command="-g -O3 -Wall"; 15 | local last=""; 16 | local dir=""; 17 | while [ ! "$1" = "" ]; do 18 | if [ ! "$last" = "" ]; then command="$command $last"; fi; 19 | last=$1; shift; 20 | done; 21 | if [ "$last" = "" ]; then 22 | echo "usage: try [options] file[.c|.cpp]"; return; 23 | fi; 24 | dir=$(dirname "$last"); 25 | if [ "$dir" = "." ]; then dir=""; else dir="$dir/"; fi; 26 | last=$dir$(basename "$last" .cpp); 27 | dir=$(dirname "$last"); 28 | if [ "$dir" = "." ]; then dir=""; else dir="$dir/"; fi; 29 | last=$dir$(basename "$last" .c); 30 | if [ -e "$last".cpp ]; then 31 | echo g++ $command -c -o "$last.o" "$last.cpp"; 32 | g++ $command -c -o "$last.o" "$last.cpp"; 33 | else 34 | echo gcc $command -c -o "$last.o" "$last.c"; 35 | gcc $command -c -o "$last.o" "$last.c"; 36 | fi; 37 | rm -f "$last.o"; 38 | } 39 | 40 | # main 41 | 42 | try $@; 43 | 44 | -------------------------------------------------------------------------------- /pyemc/emc/scripts/xyz.emc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.sh 2 | (* EMC: Script *) 3 | 4 | variables = { 5 | input -> $arg0, 6 | output -> $arg1, 7 | target -> ".", 8 | unwrap -> true, 9 | pbc -> true, 10 | cut -> false 11 | }; 12 | 13 | get = {name -> input, work -> target}; 14 | 15 | xyz = {name -> output, unwrap -> unwrap, pbc -> pbc, cut -> cut}; 16 | 17 | -------------------------------------------------------------------------------- /pyemc/emc/templates/chemistry.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # script: chemistry.esh 4 | # author: Pieter J. in 't Veld 5 | # date: @{DATE} 6 | # purpose: Example for using EMC setup chemistry mode 7 | # 8 | 9 | # Options section 10 | 11 | ITEM OPTIONS 12 | 13 | replace true 14 | field charmm/c36a/cgenff 15 | ntotal 1000 16 | #density 0.1 17 | #number true 18 | focus true 19 | emc_execute true 20 | 21 | ITEM END # OPTIONS 22 | 23 | # Shorthand section 24 | 25 | ITEM SHORTHAND 26 | 27 | molecule C1OC1C,1 28 | 29 | ITEM END # SHORTHAND 30 | -------------------------------------------------------------------------------- /pyemc/emc/templates/cluster.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # script: polymer.esh 4 | # author: Pieter J. in 't Veld 5 | # date: @{DATE} 6 | # purpose: Example for clusters using EMC setup chemistry mode 7 | # 8 | 9 | # Options section 10 | 11 | ITEM OPTIONS 12 | 13 | replace true 14 | field charmm/c36a/cgenff 15 | number false 16 | mass true 17 | ntotal 1000 18 | density 1.0 19 | emc_execute true 20 | 21 | ITEM END # OPTIONS 22 | 23 | # Groups section 24 | 25 | ITEM GROUPS 26 | 27 | group1 CCO 28 | group2 O 29 | 30 | ITEM END # GROUPS 31 | 32 | # Clusters section 33 | 34 | ITEM CLUSTERS 35 | 36 | molecule1 group1,10 37 | molecule2 group2,90 38 | 39 | ITEM END # CLUSTERS 40 | -------------------------------------------------------------------------------- /pyemc/emc/templates/environment.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # script: environment.esh 4 | # author: Pieter J. in 't Veld 5 | # date: @{DATE} 6 | # purpose: Example for using EMC setup environment mode 7 | # 8 | 9 | # Environment section 10 | 11 | ITEM ENVIRONMENT 12 | 13 | project dpd 14 | replace true 15 | queue_build default 16 | queue_run default 17 | queue_analyze default 18 | time_build 00:20:00 19 | time_run 24:00:00 20 | time_analyze 00:20:00 21 | analyze_window 10 22 | ncores 8 23 | 24 | ITEM END # ENVIRONMENT 25 | 26 | # Loops section 27 | 28 | ITEM LOOPS 29 | 30 | stage 00 31 | trial 00 32 | 33 | ITEM END # LOOPS 34 | 35 | # 36 | # STAGE 00 37 | # 38 | 39 | ITEM STAGE 00 40 | 41 | # Template section 42 | 43 | ITEM TEMPLATE # TEMPLATE 44 | 45 | # Options section 46 | 47 | ITEM OPTIONS 48 | 49 | replace true 50 | ntotal 100000 51 | field charmm 52 | mass true 53 | dtdump 10000 54 | shape 1 55 | emc_execute true 56 | 57 | ITEM END # OPTIONS 58 | 59 | # Groups section 60 | 61 | ITEM GROUPS 62 | 63 | @{GROUPS} 64 | 65 | ITEM END # GROUPS 66 | 67 | # Clusters section 68 | 69 | ITEM CLUSTERS 70 | 71 | @{CLUSTERS} 72 | 73 | ITEM END # CLUSTERS 74 | 75 | # Polymers section 76 | 77 | ITEM POLYMERS 78 | 79 | @{POLYMERS} 80 | 81 | ITEM END # POLYMERS 82 | 83 | ITEM END # TEMPLATE END 84 | 85 | # 86 | # TRIAL 00 87 | # 88 | 89 | ITEM TRIAL 00 90 | 91 | # Groups section 92 | 93 | ITEM GROUPS 94 | 95 | ITEM END # GROUPS 96 | 97 | # Clusters section 98 | 99 | ITEM CLUSTERS 100 | 101 | ITEM END # CLUSTERS 102 | 103 | # Polymers section 104 | 105 | ITEM POLYMERS 106 | 107 | ITEM END # POLYMERS 108 | -------------------------------------------------------------------------------- /pyemc/emc/templates/field.define: -------------------------------------------------------------------------------- 1 | # 2 | # file: field.define 3 | # author: Pieter J. in 't Veld 4 | # date: May 21, 2016 5 | # purpose: Force field template 6 | # version: 0.1beta 7 | # 8 | # rule keys: 9 | # ~ any bond 10 | # - single bond 11 | # : partial bond 12 | # = double bond 13 | # # triple bond 14 | # X any halogen 15 | # * wildcard, specified number of bonds 16 | # ? wildcard, unspecified number of bonds 17 | # [..] unspecified number of connecting atoms 18 | # 19 | # template keys: 20 | # . skipped index 21 | # 22 | # Empty lines are skipped 23 | # 24 | # notes: 25 | # 20160521 - Creation date, v0.1beta 26 | # 27 | 28 | # Definitions 29 | 30 | ITEM DEFINE 31 | 32 | FFNAME FIELD 33 | FFTYPE ATOMISTIC 34 | FFDEPTH 4 35 | VERSION May 2016 36 | LENGTH ANGSTROM 37 | ENERGY KJ/MOL 38 | DENSITY G/CC 39 | MIX NONE 40 | CUTOFF 14 41 | NBONDED 0 42 | PAIR14 EXCLUDE 43 | ANGLE ERROR 44 | TORSION ERROR 45 | 46 | ITEM END 47 | 48 | # Literature references 49 | 50 | ITEM REFERENCES 51 | 52 | # year volume page journal 53 | 54 | ITEM END 55 | 56 | # Masses 57 | 58 | ITEM MASSES 59 | 60 | # type mass element ncons charge comment 61 | 62 | ? 1 ? 0 0 Dummy 63 | 64 | ITEM END 65 | 66 | # Precedences 67 | 68 | ITEM PRECEDENCE 69 | (? 70 | () 71 | ) 72 | 73 | ITEM END 74 | 75 | # Typing rules 76 | 77 | ITEM RULES 78 | 79 | # type charge rule(s) 80 | 81 | # United-atom force field connectivity 82 | 83 | # Dummy 84 | 85 | ? 0 [DM] 86 | 87 | ITEM END 88 | 89 | # Equivalences 90 | 91 | ITEM EQUIVALENCE 92 | 93 | # type pair bonded 94 | 95 | ? ? ? 96 | 97 | ITEM END 98 | 99 | # Nonbond parameters 100 | 101 | ITEM NONBOND 102 | 103 | # sigma in [A] 104 | # epsilon in [ENERGY] 105 | 106 | # type1 type2 sigma eps 107 | 108 | ? ? 0 0 109 | 110 | ITEM END 111 | 112 | # Bond parameters 113 | 114 | ITEM BOND 115 | 116 | # 0.5*k*(l-l0)^2 117 | # 118 | # k in [ENERGY/A^2] 119 | # l0 in [A] 120 | 121 | # type1 type2 k l0 122 | 123 | ITEM END 124 | 125 | # Angle parameters 126 | 127 | ITEM ANGLE 128 | 129 | # 0.5*k*(theta-theta0)^2 130 | # 131 | # k in [ENERGY/rad^2] 132 | # theta0 in [degree] 133 | 134 | # type1 type2 type3 k theta0 135 | 136 | 137 | ITEM END 138 | 139 | # Torsion parameters 140 | 141 | ITEM TORSION 142 | 143 | # k in [ENERGY] 144 | 145 | # type1 type2 type3 type3 k n delta [...] 146 | 147 | 148 | ITEM END 149 | 150 | # Improper parameters 151 | 152 | ITEM IMPROPER 153 | 154 | # type1 type2 type3 type4 k psi0 155 | 156 | ITEM END 157 | 158 | -------------------------------------------------------------------------------- /pyemc/emc/templates/field.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # script: field.esh 4 | # author: Pieter J. in 't Veld 5 | # date: @{DATE} 6 | # purpose: Example for using EMC Setup with a user field definition 7 | # 8 | 9 | # Options section 10 | 11 | ITEM OPTIONS 12 | 13 | replace true 14 | field_id standard 15 | field_type standard 16 | field_name field 17 | field_location . 18 | build_dir . 19 | charge false 20 | number true 21 | density 0.7 22 | temperature 1 23 | units reduced 24 | emc_execute true 25 | 26 | ITEM END # OPTIONS 27 | 28 | # Shorthand section 29 | 30 | ITEM SHORTHAND 31 | 32 | lj ([lj])4,256*8/4 33 | 34 | ITEM END # SHORTHAND 35 | 36 | # 37 | # Generic LJ force field definition 38 | # 39 | 40 | # Field section 41 | 42 | ITEM FIELD 43 | 44 | # Define section 45 | 46 | ITEM DEFINE 47 | 48 | ffmode standard 49 | 50 | ITEM END # DEFINE 51 | 52 | # Mass section 53 | 54 | ITEM MASS 55 | 56 | # type mass name ncons charge comment 57 | 58 | * * 1 * 2 0 anything 59 | 60 | ITEM END # MASS 61 | 62 | # Nonbond section 63 | 64 | ITEM NONBOND 65 | 66 | # type1 type2 sigma epsilon 67 | 68 | * * * 1 1 69 | 70 | ITEM END # NONBOND 71 | 72 | # Bond section 73 | 74 | ITEM BOND 75 | 76 | # type1 type2 k l0 77 | 78 | * * * 20 1 79 | 80 | ITEM END # BOND 81 | 82 | # Angle section 83 | 84 | ITEM ANGLE 85 | 86 | # type1 type2 type3 k theta0 87 | 88 | * * * * 4 180 89 | 90 | ITEM END # ANGLE 91 | 92 | ITEM END # FIELD 93 | -------------------------------------------------------------------------------- /pyemc/emc/templates/import.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # script: import.esh 4 | # author: Pieter J. in 't Veld 5 | # date: @{DATE} 6 | # purpose: Example for importing structures using EMC setup chemistry mode 7 | # 8 | 9 | # Options section 10 | 11 | ITEM OPTIONS 12 | 13 | replace true 14 | field charmm/c36a/cgenff 15 | number true 16 | ntotal 10 17 | density 0.1 18 | emc_execute true 19 | 20 | ITEM END # OPTIONS 21 | 22 | # Clusters section 23 | 24 | ITEM CLUSTERS 25 | 26 | molecule import,name="mol1",type=structure,mode=pdb,tighten=3 27 | 28 | ITEM END # CLUSTERS 29 | -------------------------------------------------------------------------------- /pyemc/emc/templates/polymer.esh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emc.pl 2 | # 3 | # script: polymer.esh 4 | # author: Pieter J. in 't Veld 5 | # date: @{DATE} 6 | # purpose: Example for polymers using EMC setup chemistry mode 7 | # 8 | 9 | # Options section 10 | 11 | ITEM OPTIONS 12 | 13 | replace true 14 | field charmm/c36a/cgenff 15 | number false 16 | ntotal 1000 17 | density 0.85 18 | emc_execute true 19 | 20 | ITEM END # OPTIONS 21 | 22 | # Groups section 23 | 24 | ITEM GROUPS 25 | 26 | monomer *CC*,1,monomer:2 27 | terminator *C,1,monomer:1,1,monomer:2 28 | 29 | ITEM END # GROUPS 30 | 31 | # Clusters section 32 | 33 | ITEM CLUSTERS 34 | 35 | polymer alternate,1 36 | 37 | ITEM END # CLUSTERS 38 | 39 | # Polymers section 40 | 41 | ITEM POLYMERS 42 | 43 | polymer 44 | 1 monomer,10,terminator,2 45 | 46 | ITEM END # POLYMERS 47 | -------------------------------------------------------------------------------- /pyemc/emc/templates/restart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # script: run_restart.sh 4 | # author: Pieter J. in 't Veld 5 | # date: April 11, 2018 6 | # purpose: Restart crashed LAMMPS jobs 7 | # 8 | 9 | # settings 10 | 11 | version=0.1; 12 | date="April 11, 2018"; 13 | script=$(basename "$0"); 14 | queue=default; 15 | walltime=24:00:00; 16 | 17 | # functions 18 | 19 | help() { 20 | echo "LAMMPS restart script v$version ($date)"; 21 | echo; 22 | echo "Usage:"; 23 | echo " $script -n nprocs [-option value] project"; 24 | echo; 25 | echo "Options:" 26 | echo -e " -help\t\tthis message"; 27 | echo -e " -n\t\tset number of processors"; 28 | echo -e " -walltime\tset total wall time [$walltime]"; 29 | echo; 30 | exit -1; 31 | } 32 | 33 | 34 | error() { 35 | echo "ERROR: $1"; 36 | echo; 37 | exit -1; 38 | } 39 | 40 | 41 | init() { 42 | local error; 43 | 44 | n=""; 45 | project=""; 46 | while [ "$1" != "" ]; do 47 | case "$1" in 48 | -n) shift; n=$1;; 49 | -walltime) shift; walltime=$1;; 50 | -queue) shift; queue=$1;; 51 | -help) help;; 52 | *) if [ "${project}" == "" ]; then project="$1"; fi;; 53 | esac; 54 | shift; 55 | done; 56 | if [ "${n}" == "" ]; then error "n not set"; fi; 57 | if [ "${project}" == "" ]; then error "project not set"; fi; 58 | } 59 | 60 | 61 | candidates() { 62 | for file in $(find * -name ${project}.out); do 63 | if [ "$(grep ERROR "${file}")" == "" ]; then continue; fi; 64 | echo $(basename $file ${project}.out); 65 | done; 66 | } 67 | 68 | 69 | # main 70 | 71 | init $@; 72 | candidates; 73 | 74 | -------------------------------------------------------------------------------- /pyemc/emc/vmd/README: -------------------------------------------------------------------------------- 1 | EMC: VMD Extensions 2 | ------------------- 3 | 4 | EMC offers a plug-in for VMD as a graphical front end to EMC setup. This 5 | graphical interface is not exhaustive and therefore does not offer all the 6 | possibilities that EMC setup offers. It is suggested to set the environment 7 | variable EMC_ROOT to the root directory of the active EMC version. With this 8 | environment variable, packages can be automatically included during VMD start 9 | up by adding the following line to the users' ~/.vmdrc 10 | 11 | source $::env(EMC_ROOT)/vmd/packages.tcl 12 | 13 | Replace $::env(EMC_ROOT) by an absolute path, if an independent depency is not 14 | wanted. Unfortunately, this solution does not apply to the Microsoft Windows 15 | environment. 16 | 17 | -------------------------------------------------------------------------------- /pyemc/emc/vmd/packages.tcl: -------------------------------------------------------------------------------- 1 | # 2 | # program: packages.tcl 3 | # author: Pieter J. in 't Veld 4 | # date: January 2, 2017 5 | # purpose: Front end for loading VMD packages; called from .vmdrc; 6 | # packages appear in Extensions/EMC menu 7 | # 8 | 9 | source $::env(EMC_ROOT)/vmd/packages/gui.tcl 10 | source $::env(EMC_ROOT)/vmd/packages/textview.tcl 11 | 12 | -------------------------------------------------------------------------------- /pyemc/runner.py: -------------------------------------------------------------------------------- 1 | import os 2 | import platform 3 | import subprocess 4 | import sys 5 | 6 | 7 | def _get_exec() -> None: 8 | '''Method to get executable file path 9 | 10 | Attributes: 11 | None 12 | 13 | Returns: 14 | None 15 | ''' 16 | if sys.platform == 'linux' or sys.platform == 'linux2': 17 | arch = platform.machine() 18 | if arch == 'x86_64': 19 | emc_exec = 'emc_linux_x86_64' 20 | elif arch == 'aarch64': 21 | emc_exec = 'emc_linux_aarch64' 22 | else: 23 | raise Exception(f'Unsupported Linux architecture: {arch}') 24 | elif sys.platform == 'darwin': 25 | emc_exec = 'emc_macos' 26 | elif sys.platform == 'win32': 27 | emc_exec = 'emc_win32.exe' 28 | try: 29 | subprocess.run(['perl', '-v'], shell=True, check=True) 30 | except subprocess.CalledProcessError: 31 | raise Exception('You need to install Perl first, ' 32 | 'see: https://www.perl.org/get.html') 33 | return emc_exec 34 | 35 | 36 | def _get_path() -> str: 37 | '''Method to get the module path 38 | 39 | Attributes: 40 | None 41 | 42 | Returns: 43 | module_path (str): the path of the module 44 | ''' 45 | return os.path.dirname(__file__) 46 | 47 | 48 | def setup(esh_file: str, *args): 49 | '''Method to run emc.pl of EMC 50 | 51 | Attributes: 52 | esh_file (str): emc.pl input file 53 | 54 | Returns: 55 | None 56 | ''' 57 | emc_setup_file = os.path.join(_get_path(), 'emc', 'scripts', 'emc.pl') 58 | 59 | command = ['perl', str(emc_setup_file), esh_file] 60 | for arg in args: 61 | command.append(arg) 62 | subprocess.run(command) 63 | 64 | 65 | def build(build_file: str): 66 | '''Method to run EMC executable 67 | 68 | Attributes: 69 | build_file (str): EMC executable input file 70 | 71 | Returns: 72 | None 73 | ''' 74 | emc_bin_file = os.path.join(_get_path(), 'emc', 'bin', _get_exec()) 75 | 76 | subprocess.run([str(emc_bin_file), build_file]) 77 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from setuptools import find_packages, setup 4 | 5 | # Read the contents of your README file 6 | PACKAGE_DIR = os.path.abspath(os.path.dirname(__file__)) 7 | with open(os.path.join(PACKAGE_DIR, 'README.md'), encoding='utf-8') as f: 8 | LONG_DESCRIPTION = f.read() 9 | 10 | 11 | def package_files(directory): 12 | paths = [] 13 | for (path, directories, filenames) in os.walk(directory): 14 | for filename in filenames: 15 | paths.append(os.path.join('..', path, filename)) 16 | return paths 17 | 18 | 19 | extra_files = package_files('pyemc/emc') 20 | 21 | setup( 22 | name='emc-pypi', 23 | version='2024.8.1-1', 24 | long_description=LONG_DESCRIPTION, 25 | long_description_content_type='text/markdown', 26 | description='Python interface for the Enhanced Monte Carlo (EMC) package', 27 | keywords=['EMC', 'Molecular Dynamics', 'LAMMPS', 'SMILES', 'Simulation'], 28 | url='https://github.com/kevinshen56714/emc-pypi', 29 | author='Kuan-Hsuan (Kevin) Shen', 30 | author_email='kevinshen56714@gmail.com', 31 | classifiers=[ 32 | "Programming Language :: Python :: 3", 33 | "Programming Language :: Python :: 3.7", 34 | "Programming Language :: Python :: 3.8", 35 | "Programming Language :: Python :: 3.9", 36 | "Programming Language :: Python :: 3.10", 37 | "Programming Language :: Python :: 3.11", 38 | "Operating System :: OS Independent", 39 | "Topic :: Software Development", 40 | "Topic :: Utilities", 41 | ], 42 | packages=find_packages(), 43 | package_data={'': extra_files}, 44 | zip_safe=False) 45 | --------------------------------------------------------------------------------