Code Monkey home page Code Monkey logo

aggregate's Introduction

aggregate

Some python codes to generate various aggregate particles (e.g. ballistic particle cluster, and cluster-cluster) and characterise them in a variety of ways. Note that this is not done via dynamic simulation, but takes a ray-tracing approach.

Installation

A conda environment file is provided, so after checking out the repo you can install all dependencies with:

conda env create

Note that currently simulation.show() can use either matplotlib or mayavi, but the inclusion of mayavi holds back various packages (e.g. scipy).

Usage

The builder package contains routines to build different aggregate types. Currently BPCA (particle-cluster) and BCCA (cluster-cluster) aggregates are implemented. Future improvements will include:

  • polydisperse monomers (using a variety of distributions)
  • mixed models where either single monomers or clusters can be added

The returned simulation object has a variety of methods to calculate aggregate properties, including:

  • centre of mass
  • radius of gyration
  • characteristic radius
  • porosity
  • density
  • fractal dimension (various methods)

There are also methods to display or write the simulation data to various formats:

  • show - displays the aggregate in 3D using mayavi or matplotlib
  • projection - calculates a 2D projection of the aggregate in a given direction
  • to_csv - output to a simple comma separated value file
  • `to_vtk' - output to a VTK file (uses evtk!)
  • to_afm - calculates a simulated AFM image assuming an infinite tip
  • to_gsf - uses to_afm and outputs data to a Gwyddion simple file format
  • to_liggghts - writes a data file that can be read by LIGGGHTS

The most simple usage is as shown below:

In [1]: from aggregate import builder
In [2]: agg = builder.build_bpca()
Generating particle 1024 of 1024
In [3]: agg.porosity_gyro()
Out[3]: 0.6464342819868891
In [4]: agg.com()
Out[4]: array([-0.29366738, -0.84070369,  0.81448045])
In [5]: agg.show(using='mpl')```

aggregate's People

Contributors

msbentley 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.