Giter Site home page Giter Site logo

aiida-porousmaterials's People

Contributors

ezpzbz avatar

Watchers

 avatar  avatar  avatar

aiida-porousmaterials's Issues

Writing simple calculation plugin

The aim is writing a calculation plugin which can create the PorousMaterials template which I was using for Voronoi Energy calculations outside the AiiDA.
The input file for Julia calculation should like:

#Loading necessary modules
using PorousMaterials

PorousMaterials.set_path_to_data("/storage/brno9-ceitec/home/pezhman/projects/noble_gas_epfl/xe_kr/data")
path = PorousMaterials.PATH_TO_DATA

# Loading General Setting like LJForceField, Framework, and replication
ljff = LJForceField("UFF.csv", cutoffradius=12.5, mixing_rules="Lorentz-Berthelot")
framework = Framework("AMIMEP_clean.cssr")
rep_factor = replication_factors(framework.box, ljff)
framework = replicate(framework, rep_factor)

# Generating associated result file
result = open("Ev_AMIMEP_clean.csv","w")
write(result, "Ev(kJ/mol),Rv(A),x,y,z,Framework,Adsorbate,Accuracy\n")

# Iterating over Adsorbates
for i in ["Xe","Kr"]
        for j in ["S50"]
        posfile = open(path*"/zeopp/Voronoi/AMIMEP_clean_voro_"*i*"_acc_"*j*".xyz")
        lines = readlines(posfile)
        n_nodes = parse(Int, lines[1])

# Iterating over nodes, calculating the Voronoi energy, and saving results.
                for k = 1:n_nodes
                        xyz = split(lines[2+k])[2:4]
                        r = split(lines[2+k])[5]
                        x = parse.(Float64, xyz)
                        molecule = Molecule(i)
                        set_fractional_coords!(molecule, framework.box)
                        translate_to!(molecule,framework.box.c_to_f * x)
                        energy = (vdw_energy(framework, molecule, ljff)) * 0.00831441001625545
                        saveresults = energy, r, x[1], x[2], x[3], "AMIMEP_clean", i, j
                        write(result, join(saveresults,","), "\n")
                end
                close(posfile)
        end
end
close(result)

Therefore, the current inputs should be provided to each calculation:

  • Forcefield: It is provided as a csvfile and therefore needs aSinglefileData` object.
  • Structure: SinglefileData in the format of cif or cssr
  • Parameters: The can contain cutoff, mixing rules, adsorbate name/symbol, zeo++ accuracy level
  • 'FolderData`: It serve to keep the needed files for running calculations.
  • Output: The output is being written in csv file and therefore, a SinglefileData object should be defined for it.

Writing the parser

The output of calculation is a csv file with the following header:

Ev(kJ/mol),Rv(A),x,y,z,Framework,Adsorbate,Accuracy
-20.922297115210764,2.310,2.04,8.432,17.478,AMIMEP_clean,Xe,S50
-13.294986262533834,3.039,1.829,8.651,16.396,AMIMEP_clean,Xe,S50
-20.795105692170782,2.333,2.037,8.441,17.444,AMIMEP_clean,Xe,S50
-18.52121794539584,2.205,1.663,7.812,16.878,AMIMEP_clean,Xe,S50
.
.
.
-22.245109724646177,1.913,2.048,2.809,2.002,AMIMEP_clean,Kr,S50
-21.513764289691064,1.867,2.116,2.813,1.929,AMIMEP_clean,Kr,S50
-21.89122001822926,1.914,3.259,1.931,3.089,AMIMEP_clean,Kr,S50
-21.281570222909348,1.877,2.818,1.73,3.231,AMIMEP_clean,Kr,S50
-22.721536697668167,1.934,2.519,2.819,2.213,AMIMEP_clean,Kr,S50

Each file contains information for a framework and at a certain zeo++ accuracy level for different adsorbates.
The parsing should be simple while it is informative by doing the following tasks:

  • Calculating the maximum/minimum Voronoi energy for each adsorbate and include the node property (coordinates and radius) for that particular node.
  • Calculating the average Voronoi energy for each adsorbate.
  • Taking a list of desired percentiles as input like [5,10,50] and calculates the average Voronoi energy for nodes that their Voronoi energy falls into to the required percentile.

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.