Git Product home page Git Product logo

raspa2's Introduction

RASPA2

A general purpose classical simulation package that can be used for the simulation of molecules in gases, fluids, zeolites, aluminosilicates, metal-organic frameworks, carbon nanotubes and external fields.

Installation

Like any other software library, RASPA2 should be installed through a package manager. This can be done through pip.

pip install RASPA2

If you want to stay on the cutting edge of RASPA2 development, you can also install directly from this git repo with pip install git+https://github.com/numat/RASPA2.

If you are unfamiliar with package managers, read the For New Coders section of the RASPA2 wiki.

Usage

There are currently two ways to use RASPA: through configuration files in the command line, or through Python functions.

###Command Line

This approach uses RASPA script files and a set of directories to load structures, gases, and forcefield files. It outputs a set of folders and files which contain data about the simulation run. This is the original designed use of RASPA, and can be used in conjunction with shell scripts for small sets of long-running simulations. To see the help, type:

simulate -h

To write and configure simulation input files, read Docs/raspa.pdf.

###Python

The previous approach is useful for long-running jobs, but can become cumbersome when you want to manage a large number of simulations. In this use case, the Python wrapper provides a streamlined workflow.

RASPA's full functionality can be accessed in a Python script, which enables simulation runs to be "glued" together with auxiliary workflow steps. For example, to run a set of simulations across a logarithmic range of pressures, parse the outputs for uptake data, and plot the results, use:

import RASPA2

# Set up
gas = "CO2"
pressures = [1e4 * 10**(0.1 * i) for i in range(21)]

# Run
results = [RASPA2.run(my_structure, gas, temperature=298, pressure=pressure)
           for pressure in pressures]

# Parse
uptakes = [r["Number of molecules"][gas]
            ["Average loading absolute [cm^3 (STP)/cm^3 framework]"][0]
           for r in results]

# Plot
plot(pressures, uptakes)

When used in conjunction with supercomputer interfaces such as the IPython Notebook and chemical data handling libraries such as open babel, it is possible to completely automate job distribution, cif formatting, charge estimation, and more in a single script.

For more examples, read the workflow wiki.

Accessing Configuration Files

In order to edit the RASPA forcefields, you need to access the associated .def files. The current path of the .def files can be discovered by typing raspa-dir into a terminal. In order to change your terminal directory to this, you can chain commands:

cd `raspa-dir`

Edit the files here, and then re-run your simulations. If you make any improvements to the existing force fields, molecules, or structures, you should consider contributing them back to RASPA by issuing a pull request.

raspa2's People

Contributors

daviddubbeldam avatar patrickfuller avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.