Skip to main content

geoparticle

A Python package for geometry construction in particle-based simulation.

I mainly use this package for geometry construction in LAMMPS, with some examples provided in the repository; of course, it can also be used for other software.

Docs Status pypi

Installation

Installing from pypi

pip install geoparticle

Installing from the source code

Download and enter the source code directory, then

pip install .

Documentation

The documentation is hosted on Read the Docs.

Background

Particles of specified geometries are typically created by the lattice command in LAMMPS, which can lead to rough surfaces when the particle spacing is not small enough. However, too small spacing can result in too many particles and thus increase the computational cost.

The case is the same when one creates atoms based on an external STL file (an example STL file exported by COMSOL is shown below):

Features

To resolve this problem, I developed this package for easy construction of geometries where smooth surfaces are required. Miscellaneous geometries are provided, including 1D geometries (lines and curves):

2D geometries (rectangles and circles):

3D geometries (blocks, cylinders, tori, and spheres):

all of which can be surface, thick shells, or filled bodies.

Diverse operations are also provided, including translation, mirror, rotation, stack, clipping, union, intersection, and subtraction.

Some utility functions are also provided.

Quick start

examples/gallery.py provided detailed scripts to yield the geometries above.

Two more examples are given to shown how to couple geoparticle with LAMMPS. The first example is the 2D gas-liquid dam break, while the second is a 3D intestine connected with an inlet and an outlet.

See the documentation for details.

Limitations

The particle spacings may be not exactly as specified in order to create a smooth surface.

Resultant geometries of boolean operations can have more particles than expected in some cases, because

  • For intersection and subtraction, only particles with distances smaller than rmax will be identified the same. Users should align particles of different geometries to get the expected results.
  • For union, particles of all the given geometries will be collected to yield the union. Users should ensure no particles are overlapped.

Metadata

Release files for geoparticle 1.0.4

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

Source distribution (sdist)

Source distribution for geoparticle 1.0.4
File Size Uploaded
geoparticle-1.0.4.tar.gz 23.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for geoparticle 1.0.4
File Interpreter ABI Platform
geoparticle-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 48.1 kB

Release files / geoparticle-1.0.4.tar.gz

Download URL geoparticle-1.0.4.tar.gz
Size 23.6 kB
Tags Source
SHA-256 checksum
How to use checksums
57a41407252103f8d9182218453501bbcfa1560ba0e8def518de52d24db6a914
BLAKE2b-256 checksum
How to use checksums
085d5c01a9a9a1481e97d4d6dd0d5a90c91e6d797e2383c79a7fab582d281121
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2025.

Transparency log

Release files / geoparticle-1.0.4-py3-none-any.whl

Download URL geoparticle-1.0.4-py3-none-any.whl
Size 24.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
649e0599422fc182e537aa2157f8f2e3f3c42fa5ee0e5a4e0c0ca674aa5a7088
BLAKE2b-256 checksum
How to use checksums
150372eaf6e8df717251add42a8a1d87bb46c6e955d4b46d86f33c48486b099f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

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