Skip to main content

CLUMP

Description

CLUMP is a collection of scripts to generate multi-sphere particles of overlapping or non-overlapping spheres, which approximate target geometries. Multi-spheres (a.k.a. clumps) are popular in numerical simulations using the Discrete Element Method (DEM), but these geometric object can find applications in a wider perspective, past numerical modelling. The motivation behind developing CLUMP stemmed from the need to compare different clump-generation techniques, both in terms of particle morphology and mechanical performance using the DEM. To this end, CLUMP offers two existing and well established clump-generation techniques and proposes a new one. The generated clumps can be exported in various formats, compatible with some of the most prominent DEM codes. Last, the surface of each generated clump can be extracted as a triangulated mesh and saved as an stl file, allowing for a full characterisation of particle morphology, using tools like SHAPE or 3D-printing of physical particle replicas. CLUMP was initially developed in MATLAB and has now been fully translated in Python. Both implementations will continue to be developed in parallel as the software evolves.

Architectural Features

CLUMP performs the following functions:

  • GenerateClump

    • Favier et al (1999)
    • Ferellec and McDowell (2010)
    • Euclidean 3D (2021) and Extended Euclidean 3D (proposed in this code)
  • ExportClump

    • YADE
    • MercuryDPM
    • LAMMPS
    • EDEM
    • PFC3D
  • CharacteriseClump

    • Surface extraction

Installation

Running the following code in the terminal (for Linux and macOS) or in the Command Prompt (for Windows) will automatically set up the module along with its corresponding dependencies.

pip install clump-python

Quick Start

After the installation using pip install clump-python, CLUMP can easily be imported as

import CLUMP

This following examples demonstrate different approaches to generate clumps for the different target geometry. The variables below are documented within each function.

from CLUMP.examples import Example_Euclidean_3D
from CLUMP.examples import Example_Euclidean_3D_Extended
from CLUMP.examples import Example_Ferellec_McDowell
from CLUMP.examples import Example_Favier

The following example demonstrates the surface extraction method.

from CLUMP.examples import Example_ExtractSurface

Simple Examples

Here is an example of generating a clump from an STL file using Euclidean Distance Transform method.

from CLUMP import GenerateClump_Euclidean_3D  
  
inputGeom = "path_of_STL.stl"  
N = 21  
rMin = 0  
div = 102  
overlap = 0.6  
output = 'path_of_clump_output.txt'  
outputVTK = 'path_of_clump_vtk.vtk'  
visualise = True  
  
GenerateClump_Euclidean_3D(inputGeom, N, rMin, div, overlap, output=output, outputVTK=outputVTK, visualise=visualise)

To run the Extended Euclidean Transform, one needs to specify the maximum sphere radius which will trigger the extended version. The example is as follows:

from CLUMP import GenerateClump_Euclidean_3D  
  
inputGeom = "path_of_STL.stl"  
N = 21  
rMin = 0  
div = 102  
overlap = 0.6  
output = 'path_of_clump_output.txt'  
outputVTK = 'path_of_clump_vtk.vtk'  
visualise = True
rMax_ratio = 0.3 # Parameter to trigger the Extended Euclidean method
  
GenerateClump_Euclidean_3D(inputGeom, N, rMin, div, overlap, output=output, outputVTK=outputVTK, visualise=visualise, rMax_ratio=rMax_ratio)

Here is an example for the Ferellec-McDowell clump generation method:

from CLUMP import GenerateClump_Ferellec_McDowell

inputGeom = "path_of_STL.stl"  
dmin = 0.1  
rmin = 0.01  
rstep = 0.01  
pmax = 1.0  
seed = 5  
output = 'path_of_clump_output.txt'  
outputVTK = 'path_of_clump_vtk.vtk'  
visualise = True  
  
mesh,clump=GenerateClump_Ferellec_McDowell(inputGeom=inputGeom, dmin=dmin, rmin=rmin, rstep=rstep, pmax=pmax, seed=seed, output=output, outputVTK=outputVTK, visualise=visualise)

To generate a clump using the Favier method, you can use the following example:

from CLUMP import GenerateClump_Favier

inputGeom = "path_of_STL.stl"  
N = 10  
chooseDistance = 'min'  
output = 'path_of_clump_output.txt'  
outputVTK = 'path_of_clump_vtk.vtk'  
visualise = True  
  
mesh,clump=GenerateClump_Favier(inputGeom=inputGeom, N=N, chooseDistance=chooseDistance, output=output, outputVTK=outputVTK, visualise=visualise)

Consider a clump defined as follows:

import numpy as np

clump = np.array([[1, 0, 0, 1.1],  
                  [2, 1, 0, 1.1],  
                  [3, 0, 0, 1.2],  
                  [1, 0, 1, 1.2]])

To extract the surface of the clump, you can use ExtractSurface function as follows:

from CLUMP import ExtractSurface

N_sphere = 200  
N_circle = 100  
visualise = True  
  
faces, vertices = ExtractSurface(clump, N_sphere, N_circle, visualise)

BYOS (Bring Your Own Scripts)!

If you enjoy using CLUMP, you are welcome to require the implementation of new clump-generation approaches and features or even better contribute and share your implementations. CLUMP was created to provide a comparison of different methods, by collecting them in one place and we share this tool hoping that members of the community will find it useful. So, feel free to expand the code, propose improvements and report issues.

Metadata

Release files for clump-python 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clump-python 0.3.3
File Size Uploaded
clump-python-0.3.3.tar.gz 1.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for clump-python 0.3.3
File Interpreter ABI Platform
clump_python-0.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 3.7 MB

Release files / clump-python-0.3.3.tar.gz

Download URL clump-python-0.3.3.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
e17e5c9fb5da1ae18f10087b871a1ff3a801320a5a278030d88acef37fc414c4
BLAKE2b-256 checksum
How to use checksums
52706405e2eab81a5d391ae0d2f2b59941929cec75f12cd6aaa8f643af5eb009
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.6

Release files / clump_python-0.3.3-py3-none-any.whl

Download URL clump_python-0.3.3-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ab03bcb40bd873f7ff8f38e2c492329f45e82c6d368960b53840873e59837177
BLAKE2b-256 checksum
How to use checksums
b9d6c2c8724e8d8e6a3bd33f2cf23308132a54a3ab151fca537e90e976494629
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.6

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page