SkillAgentSearch skills...

Pizza3

πŸ• Toolkit for multiscale modeling with LAMMPS in Python 3.x. It integrates with LAMMPS-GUI and leverages Large Language Models for rapid prototyping.

Install / Use

/learn @ovitrac/Pizza3

README

πŸ• PizzaΒ³

<div align="center">

| Generative Simulation | This project is part of the <br />Generative Simulation demonstrators | Say it.<br />Simulate it with AI. | | ----------------------------------------- | ------------------------------------------------------------ | --------------------------------- |

</div>
<a href="https://deepwiki.com/ovitrac/Pizza3" title="Detailed manual of Pizza3" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/badge/DeepWiki-Pizza3-1f6feb?style=flat&logo=bookstack&logoColor=white&labelColor=0d1117"> <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/badge/DeepWiki-Pizza3-0969da?style=flat&logo=bookstack&logoColor=white&labelColor=f6f8fa"> <img alt="DeepWiki: Pizza3" src="https://img.shields.io/badge/DeepWiki-Pizza3-0969da?style=flat&logo=bookstack&logoColor=white"> </picture> </a>

Toolkit for multiscale modeling with LAMMPS in Python 3.x. It integrates with LAMMPS-GUI and leverages Large Language Models for rapid prototyping.


πŸ“š Resources


πŸ“‘ Table of Contents

<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->

🧠 Part I | Overview

<kbd>Pizza3</kbd> began as a fork and extension of the Pizza.py toolkit for LAMMPS, rewritten in Python 3.x to modernize the original Python 2.x framework. Over time, it has evolved into a flexible and loosely integrated toolkit designed for LAMMPS users, regardless of the simulation style. <kbd>Pizza3</kbd> empowers users to facilitate multiscale modeling and seamlessly connect results across different scales and levels of coarse-graining.

All objects in <kbd>Pizza3</kbd> have scripting and static compiling capabilities, and can be converted into LAMMPS instructions through mathematical operators (e.g., +, |, *) or by calling methods like <kbd>script()</kbd> or <kbd>do()</kbd>. This design philosophy ensures that complex workflows remain accessible, flexible, and modular.

Work in Progress: The toolkit evolves regularly. Come back often for improved capabilities. Newer versions add more classes, dynamic scripting (pizza.dscript(), pizza.dforcefield()), and better integration with large language models via intermediate DSCRIPT SAVE FILE formats.

πŸ“Œ Key Features:

  • πŸ› οΈ Fully object-oriented architecture
  • 🌐 Compatibility with modern Python standards
  • πŸ“¦ Extensible classes for custom workflows
  • 🎯 Focus on multiscale and multiphysics modeling
  • πŸš€ Advanced 2D/3D design capabilities

πŸ“Œ Key Components:

  • 🌟 Design reusable templates with scripting classes like pizza.script(), pizza.dscript(), pizza.forcefield(), pizza.dforcefield(), pizza.group().
  • πŸš€ Dynamic design of complex 2D and 3D shapes with pizza.raster(), pizza.region().
  • 🧩 Combine simulation components via mathematical operators (+, |, *,&).
  • πŸ“œ Generate input/output scripts and dumps using classes like pizza.data() and pizza.dump().
  • πŸ”¬ Perform advanced spatial/temporal analysis using the MATLAB/Octave-based library in the post/ folder.

<details> <summary>Workshops and Examples (click to expand)</summary>

πŸ—οΈ Part II | Illustrations (Workshops and Examples)

πŸŽ“Scope

Our main goal is to achieve a set of tools that facilitate multiscale modeling in LAMMPS: connecting results across scales with different levels of detail. Below we highlight the current achievements and show how <kbd>Pizza3</kbd> integrates with LAMMPS.

In the latest versions of <kbd>Pizza3</kbd>:

  • πŸš€ Almost all 3D design capabilities of LAMMPS have been implemented, particularly via new classes like pizza.region() and pizza.group().
  • πŸ§ͺ 2D algorithms can be tested via pizza.raster() at lower computational cost without losing generality.

The class <kbd>pizza.script()</kbd> is central for coding LAMMPS instructions from Python "codelets" and handling TEMPLATES. Dynamic scripting concepts via pizza.dscript() and pizza.dforcefield() make it easy to transform existing LAMMPS code into reusable templates.

I/O Management:
pizza.data() and pizza.dump() objects streamline frame manipulation, output-to-input conversions (like restart files), and advanced spatial/temporal analysis.

Forcefields:
Forcefields can be managed through inheritance, and a user library can be built by overriding existing definitions. It's recommended to implement user rules with <kbd>pizza.generic()</kbd> or <kbd>pizza.dforcefield()</kbd>.

Visualization and Post-Processing:
Some examples of visualization are proposed in 2D and 3D in Python. The post/ folder includes advanced analysis tools integrated with MATLAB/Octave. Users are encouraged to combine LAMMPS-GUI with OVITO for rapid prototyping.

Integration with Large Language Models:
The DSCRIPT SAVE FILE format has been designed for AI text generators and facilitating the maintenance of a large library of codelets. The use of this new text format or language is not mandatory, but it enables code generation with almost zero Python.


πŸ“ŠTable 1: Overview of Legacy Classes

| Workshops<br>(workable demos) | Main classes<br/>and subclasses | Low-level<br/> classes | | :---------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | | class: ==workshop1== | 2D drawing class: pizza.raster | generic struct class Γ  la Matlab: pizza.private.mstruct() | | class: ==workshop2== | as above (with advanced features: time-steps, region of interest, salting) | as above | | script: geometry | class to read/write input files: pizza.data3.data | self-evaluable struct with scripting/alias: pizza.private.param() | | script: assembly | manage dump files: pizza.dump3.dump | | | | advanced scripting: pizza.script.script, pizza.script.datascript, pizza.script.scriptobject, pizza.script.scriptobjectgroup, pizza.script.pipescript | | | | forcefields: pizza.forcefield.forcefield, pizza.forcefield.smd, pizza.forcefield.tlsph, pizza.forcefield.ulsph, pizza.forcefield.none, pizza.forcefield.water, pizza.forcefield.solidfood, pizza.forcefield.rigidwall | |


πŸ“Key Steps

Workshop1 illustrates the main steps to design, run, and analyze a LAMMPS project from Python 3.x.

graph TD;
    G[geometry] --> R
    R[raster] --> F[data.write]
    W[workshop1] --> A
    F --> A
    A[assembly] --> D[dump]

πŸ“Overview of workshop1 Classes

Workshop1 involves 7 main steps and codes, as shown below:

# initizalization of the scheme 
bead_kernel_radius = 0.0015
init = initialization(neighbor =[bead_kernel_radius,"bin"])
    
# scriptobject handles bead interactions
FLUID = scriptdata(
        rho = 1000,
        c0 = 100.0,
        q1 = 1.0,
        contact_stiffness = 10000000
    )    
SOLID = scriptdata(
        rho = 2000,
        c0 = 200.0,
        sigma_yield = '0.1*${E}',
        contact_stiffness = 10000000
    )
WALL = scriptdata(
        rho = 3000,
        c0 = 200.0,
        contact_stiffness = 10000000,
        contact_scale = 1.5
    )
b1 = scriptobject(name="bead 1",
                  group = ["rigid", "solid"],
                  filename='./raster_2_types.lmp',
                  forcefield=rigidwall(USER=WALL))
b2 = scriptobject(name="bead 2",
  
View on GitHub
GitHub Stars5
CategoryDevelopment
Updated3mo ago
Forks3

Languages

HTML

Security Score

87/100

Audited on Dec 19, 2025

No findings