Git Product home page Git Product logo

bola's Introduction


Collection of sphere packing and meshing algorithms.

Installation

pip3 install bola

The c++ code requires the math library Eigen3 to be installed and a dependency of the python gmsh package is libglu. So, you may need to run (debian/ubuntu-based):

sudo apt update
sudo apt -y install libeigen3-dev libglu1

Alternatively, you can follow the steps of the CI.

Examples

Particle size according to bola.psd.GradingCurve (sieve lines):

gc = bola.psd.GradingCurves.fuller(d_min=4., d_max=16)
box = (32.0, 32.0, 32.0)
radii = psd.sample_grading_curve(gc, V=0.5 * np.prod(box))


Initial packing using bola.packing.rsa (random sequential addition)

spheres = bola.packing.rsa(radii, box)


Maximize particle distance using bola.packing.edmd (event-driven molecular-dynamics)

sim = bola.packing.edmd(box, spheres, growth_rate=0.1)
while sim.t() < 10.0:
    sim.process(100 * len(radii))
    sim.synchronize(True)
    print(packing.stats_string(sim))
distant_spheres = sim.spheres()
distant_spheres[:, 3] = radii # new centers, old radii


Mesh via gmsh using bola.mesh

bola.mesh.create(
    box, new_spheres, bola.mesh.GmshOptions(
        mesh_size_matrix=2.0, mesh_size_aggregates=2.0, out="mesh.xdmf")
)


bola's People

Contributors

ttitscher avatar

Watchers

 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.