Code Monkey home page Code Monkey logo

icenumerics's Introduction

Ice Numerics

This is a numerics library for simulations and data processing of colloidal ice. It is very experimental, not very extensivelly tested and unfortunatelly not richly documented. I'll try to improve that over time.

Getting Started

You can see a walktrhough here.

Prerequisites

You will need numpy 1.11.3, scipy 0.18.1 and matplotlib 2.0.0. Many things are built to use Jupyter. You might be able to do them in matplotlib, but I haven't tested it.

Installing

There is no pip instaler or anything like that (yet). You need to download the files from the git repository and place them wherever you want to run your script.

The library runs many things in Python, but the brownian dynamics is done in a modified version of LAMMPS. I included LAMMPS compiled binaries for serial execution in Windows and Mac. If these don't work, or you want to use another system (for example, most linux distributions) you will need to compile the LAMMPS.

Contributing

I don't know. Contact me probably.

Authors

  • Antonio Ortiz-Ambriz

License

This project is licensed under the GPL License. In fact, most of the code is licenced under MIT licence, but LAMMPS is GPL.

icenumerics's People

Contributors

aortiza avatar crodriga avatar anne-le-cunuder avatar

Watchers

James Cloos avatar

icenumerics's Issues

pint version

with pint 0.11 the following error appears; to solve it try
conda install -c conda-forge pint=0.9


TypeError Traceback (most recent call last)
in
1 col.run_simulation()
----> 2 col.load_simulation()

~\Desktop\Tutorial\icenumerics\icenumerics\colloidalice.py in load_simulation(self, sl)
372 self.trj = self.sim.load(read_trj = True, sl = sl)
373 self.frames = self.trj.index.get_level_values("frame").unique()
--> 374 self.set_state_from_frame(frame = -1)
375
376 def set_state_from_frame(self, frame):

~\Desktop\Tutorial\icenumerics\icenumerics\colloidalice.py in set_state_from_frame(self, frame)
380 for i,c in enumerate(self):
381 c.colloid = self.trj.loc[idx[frame,i+1],["x","y","z"]].values*ureg.um - c.center
--> 382 c.direction = c.direction * np.sign(np.dot(c.colloid,c.direction))
383
384 return self

TypeError: operand type(s) all returned NotImplemented from array_ufunc(<ufunc 'sign'>, 'call', <Quantity(5.296799659729004, 'micrometer')>): 'Quantity'

Null direction at the end of a simulation.

Occasionally, at the end of a simulation, a colloid can be found at the exact center of the trap. That results in a null direction for the colloid.
This situation raises an error when passing colloids to vertices in "vertices.py".

Vertex classification does not work properly in multitrap branch

In the multitrap branch, traps could have different lengths and center positions, thus traps are not in the same lattice and do not have the same trap separation. Due to that, vertices in the last dataframe are not properly classified.

I have patch the issue by chaenging a bit the function from_neighbors_get_nearest_neighbors() in line 85 of vertices.py file:

def from_neighbors_get_nearest_neighbors(NeighborPairs):
    # This function takes a list of Delaunay Neighbor Pairs and returns only those which are close to the minimum distance.
    NeighborPairs['Distance']=np.around(NeighborPairs['Distance'],decimals=4)
    #print(NeighborPairs['Distance'])
    #NeighborPairs = NeighborPairs[NeighborPairs['Distance']<=np.min(NeighborPairs['Distance'])*1.1]
    NeighborPairs = NeighborPairs[NeighborPairs['Distance']<=21.2132*1.1]
    
    return NeighborPairs

I just printed the Neighborpairs['Distance'] and manually choose the one that maps the inner vertices.

Error for Periodic Boundary

In get_ice_trj, when particles jump from one side to the other, they are assigned an incorrect trap. In fact, it appears that two particles are assigned to a single trap.

To fix this, distances could be calculated in a periodic space.

The ordered states of the honeycomb don't result in the correct states.

Using the Ordering option in the Spins.HoneycombSpinIce function calls one of the functions in the file HoneycombSpinIceGeometry.py.

However, the name of the functions and the resulting states do not match. Could you assign the correct names @Anne-le-cunuder? It could also be useful to add some documentation in the functions Spins.HoneycombSpinIce() and HoneycombSpinIceCalculateGeometry() to briefly explain what are the options of ordered states that we have, and how should they look.

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.