2025-11-15 08:05:19 -05:00
# Atomizer
2025-11-15 07:56:35 -05:00
2025-11-15 14:34:16 -05:00
> Advanced LLM-native optimization platform for Siemens NX Simcenter
2025-11-15 07:56:35 -05:00
[](https://www.python.org/downloads/)
[](LICENSE)
[](https://github.com)
## Overview
2025-11-15 14:34:16 -05:00
Atomizer is an **LLM-native optimization framework ** for Siemens NX Simcenter that transforms how engineers interact with optimization workflows. Instead of manual JSON configuration and scripting, Atomizer uses AI as a collaborative engineering assistant.
2025-11-15 07:56:35 -05:00
2025-11-15 14:34:16 -05:00
### Core Philosophy
Atomizer enables engineers to:
- **Describe optimizations in natural language** instead of writing configuration files
- **Generate custom analysis functions on-the-fly** (RSS metrics, weighted objectives, constraints)
- **Get intelligent recommendations** based on optimization results and surrogate models
- **Generate comprehensive reports** with AI-written insights and visualizations
- **Extend the framework autonomously** through LLM-driven code generation
### Key Features
- **LLM-Driven Workflow**: Natural language study creation, configuration, and analysis
- **Advanced Optimization**: Optuna-powered TPE, Gaussian Process surrogates, multi-objective Pareto fronts
- **Dynamic Code Generation**: AI writes custom Python functions and NX journal scripts during optimization
- **Intelligent Decision Support**: Surrogate quality assessment, sensitivity analysis, engineering recommendations
- **Real-Time Monitoring**: Interactive web dashboard with live progress tracking
- **Extensible Architecture**: Plugin system with hooks for pre/post mesh, solve, and extraction phases
- **Self-Improving**: Feature registry that learns from user workflows and expands capabilities
2025-11-17 08:29:30 -05:00
---
📘 **For Developers ** : See [DEVELOPMENT_GUIDANCE.md ](DEVELOPMENT_GUIDANCE.md ) for comprehensive status report, current priorities, and strategic direction.
📘 **Vision & Roadmap ** : See [DEVELOPMENT_ROADMAP.md ](DEVELOPMENT_ROADMAP.md ) for the long-term vision and phase-by-phase implementation plan.
📘 **Development Status ** : See [DEVELOPMENT.md ](DEVELOPMENT.md ) for detailed task tracking and completed work.
2025-11-15 07:56:35 -05:00
## Architecture
```
┌─────────────────────────────────────────────────────────┐
2025-11-15 14:34:16 -05:00
│ LLM Interface Layer │
│ Claude Skill + Natural Language Parser + Workflow Mgr │
2025-11-15 07:56:35 -05:00
└─────────────────────────────────────────────────────────┘
↕
┌─────────────────────────────────────────────────────────┐
2025-11-15 14:34:16 -05:00
│ Optimization Engine Core │
│ Plugin System + Feature Registry + Code Generator │
2025-11-15 07:56:35 -05:00
└─────────────────────────────────────────────────────────┘
↕
┌─────────────────────────────────────────────────────────┐
│ Execution Layer │
2025-11-15 14:34:16 -05:00
│ NX Solver (via Journals) + Optuna + Result Extractors │
└─────────────────────────────────────────────────────────┘
↕
┌─────────────────────────────────────────────────────────┐
│ Analysis & Reporting │
│ Surrogate Quality + Sensitivity + Report Generator │
2025-11-15 07:56:35 -05:00
└─────────────────────────────────────────────────────────┘
```
## Quick Start
### Prerequisites
2025-11-15 08:12:32 -05:00
- **Siemens NX 2412** with NX Nastran solver
2025-11-15 07:56:35 -05:00
- **Python 3.10+** (recommend Anaconda)
2025-11-15 14:34:16 -05:00
- **Git** for version control
2025-11-15 07:56:35 -05:00
### Installation
1. **Clone the repository ** :
```bash
2025-11-15 14:34:16 -05:00
git clone https://github.com/yourusername/Atomizer.git
2025-11-15 08:05:19 -05:00
cd Atomizer
2025-11-15 07:56:35 -05:00
```
2. **Create Python environment ** :
```bash
2025-11-15 08:05:19 -05:00
conda create -n atomizer python=3.10
conda activate atomizer
2025-11-15 07:56:35 -05:00
```
3. **Install dependencies ** :
```bash
2025-11-15 14:34:16 -05:00
pip install -r requirements.txt
2025-11-15 07:56:35 -05:00
```
2025-11-15 14:34:16 -05:00
4. **Configure NX path ** (edit if needed):
- Default NX path: `C:\Program Files\Siemens\Simcenter3D_2412\NXBIN\run_journal.exe`
- Update in `optimization_engine/nx_solver.py` if different
2025-11-15 07:56:35 -05:00
### Basic Usage
2025-11-15 14:34:16 -05:00
#### Example 1: Natural Language Optimization (Future - Phase 2)
2025-11-15 07:56:35 -05:00
```
2025-11-15 14:34:16 -05:00
User: "Let's create a new study to minimize stress on my bracket"
2025-11-15 07:56:35 -05:00
2025-11-15 14:34:16 -05:00
LLM: "Study created! Please drop your .sim file into the study folder,
then I'll explore it to find available design parameters."
2025-11-15 07:56:35 -05:00
2025-11-15 14:34:16 -05:00
User: "Done. I want to vary wall_thickness between 3-8mm"
2025-11-15 07:56:35 -05:00
2025-11-15 14:34:16 -05:00
LLM: "Perfect! I've configured:
- Objective: Minimize max von Mises stress
- Design variable: wall_thickness (3.0 - 8.0 mm)
- Sampler: TPE with 50 trials
2025-11-15 07:56:35 -05:00
2025-11-15 14:34:16 -05:00
Ready to start?"
2025-11-15 07:56:35 -05:00
2025-11-15 14:34:16 -05:00
User: "Yes, go!"
2025-11-15 07:56:35 -05:00
2025-11-15 14:34:16 -05:00
LLM: "Optimization running! View progress at http://localhost:8080"
2025-11-15 07:56:35 -05:00
```
2025-11-15 14:34:16 -05:00
#### Example 2: Current JSON Configuration
2025-11-15 07:56:35 -05:00
2025-11-16 13:35:41 -05:00
Create `studies/my_study/config.json` :
2025-11-15 07:56:35 -05:00
```json
{
2025-11-16 13:35:41 -05:00
"sim_file": "studies/bracket_stress_minimization/model/Bracket_sim1.sim",
2025-11-15 14:34:16 -05:00
"design_variables": [
{
"name": "wall_thickness",
"expression_name": "wall_thickness",
"min": 3.0,
"max": 8.0,
"units": "mm"
2025-11-15 07:56:35 -05:00
}
2025-11-15 14:34:16 -05:00
],
"objectives": [
{
"name": "max_stress",
"extractor": "stress_extractor",
"metric": "max_von_mises",
"direction": "minimize",
"weight": 1.0,
"units": "MPa"
2025-11-15 07:56:35 -05:00
}
2025-11-15 14:34:16 -05:00
],
"optimization_settings": {
"n_trials": 50,
"sampler": "TPE",
"n_startup_trials": 20
2025-11-15 07:56:35 -05:00
}
}
```
Run optimization:
```bash
2025-11-16 13:35:41 -05:00
python tests/test_journal_optimization.py
# Or use the quick 5-trial test:
python run_5trial_test.py
2025-11-15 07:56:35 -05:00
```
2025-11-16 13:35:41 -05:00
## Features
2025-11-15 07:56:35 -05:00
2025-11-16 13:35:41 -05:00
- **Intelligent Optimization**: Optuna-powered TPE sampler with multi-objective support
- **NX Integration**: Seamless journal-based control of Siemens NX Simcenter
- **Smart Logging**: Detailed per-trial logs + high-level optimization progress tracking
- **Plugin System**: Extensible hooks at pre-solve, post-solve, and post-extraction points
- **Study Management**: Isolated study folders with automatic result organization
2025-11-16 21:29:54 -05:00
- **Substudy System**: NX-like hierarchical studies with shared models and independent configurations
- **Live History Tracking**: Real-time incremental JSON updates for monitoring progress
2025-11-16 13:35:41 -05:00
- **Resume Capability**: Interrupt and resume optimizations without data loss
- **Web Dashboard**: Real-time monitoring and configuration UI
2025-11-16 21:29:54 -05:00
- **Example Study**: Bracket displacement maximization with full substudy workflow
2025-11-15 07:56:35 -05:00
2025-11-17 08:29:30 -05:00
## Current Status
**Development Phase**: Alpha - 75-85% Complete
- ✅ **Phase 1 (Plugin System) ** : 100% Complete & Production Ready
- ✅ **Phases 2.5-3.1 (LLM Intelligence) ** : 85% Complete - Components built and tested
- 🎯 **Phase 3.2 (Integration) ** : **TOP PRIORITY ** - Connect LLM features to production workflow
- 🔬 **Phase 3.4 (NXOpen Docs) ** : Research & investigation phase
**What's Working**:
- Complete optimization engine with Optuna + NX Simcenter
- Substudy system with live history tracking
- LLM components (workflow analyzer, code generators, research agent) - tested individually
- 20-trial optimization validated with real results
**Current Focus**: Integrating LLM components into production runner for end-to-end workflow.
2025-11-15 07:56:35 -05:00
2025-11-17 08:29:30 -05:00
See [DEVELOPMENT_GUIDANCE.md ](DEVELOPMENT_GUIDANCE.md ) for comprehensive status and priorities.
2025-11-15 07:56:35 -05:00
## Project Structure
```
2025-11-15 08:05:19 -05:00
Atomizer/
2025-11-15 14:34:16 -05:00
├── optimization_engine/ # Core optimization logic
2025-11-16 13:35:41 -05:00
│ ├── runner.py # Main optimization runner
2025-11-15 14:34:16 -05:00
│ ├── nx_solver.py # NX journal execution
2025-11-16 13:35:41 -05:00
│ ├── nx_updater.py # NX model parameter updates
2025-11-16 16:33:48 -05:00
│ ├── pynastran_research_agent.py # Phase 3: Auto OP2 code gen ✅
│ ├── hook_generator.py # Phase 2.9: Auto hook generation ✅
2025-11-15 14:34:16 -05:00
│ ├── result_extractors/ # OP2/F06 parsers
2025-11-16 13:35:41 -05:00
│ │ └── extractors.py # Stress, displacement extractors
│ └── plugins/ # Plugin system (Phase 1 ✅)
│ ├── hook_manager.py # Hook registration & execution
2025-11-16 16:33:48 -05:00
│ ├── hooks.py # HookPoint enum, Hook dataclass
2025-11-16 13:35:41 -05:00
│ ├── pre_solve/ # Pre-solve lifecycle hooks
│ │ ├── detailed_logger.py
│ │ └── optimization_logger.py
│ ├── post_solve/ # Post-solve lifecycle hooks
│ │ └── log_solve_complete.py
2025-11-16 16:33:48 -05:00
│ ├── post_extraction/ # Post-extraction lifecycle hooks
│ │ ├── log_results.py
│ │ └── optimization_logger_results.py
│ └── post_calculation/ # Post-calculation hooks (Phase 2.9 ✅)
│ ├── weighted_objective_test.py
│ ├── safety_factor_hook.py
│ └── min_to_avg_ratio_hook.py
2025-11-15 14:34:16 -05:00
├── dashboard/ # Web UI
│ ├── api/ # Flask backend
│ ├── frontend/ # HTML/CSS/JS
│ └── scripts/ # NX expression extraction
2025-11-16 13:35:41 -05:00
├── studies/ # Optimization studies
│ ├── README.md # Comprehensive studies guide
2025-11-16 21:29:54 -05:00
│ └── bracket_displacement_maximizing/ # Example study with substudies
2025-11-16 13:35:41 -05:00
│ ├── README.md # Study documentation
2025-11-16 21:29:54 -05:00
│ ├── SUBSTUDIES_README.md # Substudy system guide
│ ├── model/ # Shared FEA model files (.prt, .sim, .fem)
│ ├── config/ # Substudy configuration templates
│ ├── substudies/ # Independent substudy results
│ │ ├── coarse_exploration/ # Fast 20-trial coarse search
│ │ │ ├── config.json
│ │ │ ├── optimization_history_incremental.json # Live updates
│ │ │ └── best_design.json
│ │ └── fine_tuning/ # Refined 50-trial optimization
│ ├── run_substudy.py # Substudy runner with continuation support
│ └── run_optimization.py # Standalone optimization runner
2025-11-15 14:34:16 -05:00
├── tests/ # Unit and integration tests
2025-11-16 13:35:41 -05:00
│ ├── test_hooks_with_bracket.py
│ ├── run_5trial_test.py
│ └── test_journal_optimization.py
2025-11-15 14:34:16 -05:00
├── docs/ # Documentation
2025-11-16 13:35:41 -05:00
├── atomizer_paths.py # Intelligent path resolution
2025-11-15 14:34:16 -05:00
├── DEVELOPMENT_ROADMAP.md # Future vision and phases
└── README.md # This file
2025-11-15 07:56:35 -05:00
```
2025-11-16 21:29:54 -05:00
## Example: Bracket Displacement Maximization with Substudies
2025-11-15 07:56:35 -05:00
2025-11-16 21:29:54 -05:00
A complete working example is in `studies/bracket_displacement_maximizing/` :
2025-11-15 07:56:35 -05:00
2025-11-15 14:34:16 -05:00
```bash
2025-11-16 21:29:54 -05:00
# Run standalone optimization (20 trials)
cd studies/bracket_displacement_maximizing
python run_optimization.py
2025-11-15 07:56:35 -05:00
2025-11-16 21:29:54 -05:00
# Or run a substudy (hierarchical organization)
python run_substudy.py coarse_exploration # 20-trial coarse search
python run_substudy.py fine_tuning # 50-trial refinement with continuation
# View live progress
cat substudies/coarse_exploration/optimization_history_incremental.json
2025-11-15 14:34:16 -05:00
```
**What it does**:
2025-11-16 21:29:54 -05:00
1. Loads `Bracket_sim1.sim` with parametric geometry
2. Varies `tip_thickness` (15-25mm) and `support_angle` (20-40°)
3. Runs FEA solve for each trial using NX journal mode
4. Extracts displacement and stress from OP2 files
5. Maximizes displacement while maintaining safety factor >= 4.0
**Substudy System**:
- **Shared Models**: All substudies use the same model files
- **Independent Configs**: Each substudy has its own parameter bounds and settings
- **Continuation Support**: Fine-tuning substudy continues from coarse exploration results
- **Live History**: Real-time JSON updates for monitoring progress
2025-11-15 14:34:16 -05:00
**Results** (typical):
- Best thickness: ~4.2mm
- Stress reduction: 15-20% vs. baseline
- Convergence: ~30 trials to plateau
2025-11-15 07:56:35 -05:00
2025-11-15 14:34:16 -05:00
## Dashboard Usage
2025-11-15 07:56:35 -05:00
2025-11-15 14:34:16 -05:00
Start the dashboard:
2025-11-15 07:56:35 -05:00
```bash
2025-11-15 14:34:16 -05:00
python dashboard/start_dashboard.py
2025-11-15 07:56:35 -05:00
```
2025-11-15 14:34:16 -05:00
Features:
- **Create studies** with folder structure (sim/, results/, config.json)
- **Drop .sim/.prt files** into study folders
- **Explore .sim files** to extract expressions via NX
- **Configure optimization** with 5-step wizard:
1. Simulation files
2. Design variables
3. Objectives
4. Constraints
5. Optimization settings
- **Monitor progress** with real-time charts
- **View results** with trial history and best parameters
## Vision: LLM-Native Engineering Assistant
Atomizer is evolving into a comprehensive AI-powered engineering platform. See [DEVELOPMENT_ROADMAP.md ](DEVELOPMENT_ROADMAP.md ) for details on:
- **Phase 1-7 development plan** with timelines and deliverables
- **Example use cases** demonstrating natural language workflows
- **Architecture diagrams** showing plugin system and LLM integration
- **Success metrics** for each phase
### Future Capabilities
2025-11-15 07:56:35 -05:00
```
2025-11-15 14:34:16 -05:00
User: "Add RSS function combining stress and displacement"
→ LLM: Writes Python function, validates, registers as custom objective
2025-11-15 07:56:35 -05:00
2025-11-15 14:34:16 -05:00
User: "Use surrogate to predict these 10 parameter sets"
→ LLM: Checks surrogate R² > 0.9, runs predictions with confidence intervals
2025-11-15 07:56:35 -05:00
2025-11-15 14:34:16 -05:00
User: "Make an optimization report"
→ LLM: Generates HTML with plots, insights, recommendations (30 seconds)
User: "Why did trial #34 perform best?"
→ LLM: "Trial #34 had optimal stress distribution due to thickness 4.2mm
creating uniform load paths. Fillet radius 3.1mm reduced stress
concentration by 18%. This combination is Pareto-optimal."
2025-11-15 07:56:35 -05:00
```
2025-11-16 13:35:41 -05:00
## Development Status
### Completed Phases
- [x] **Phase 1 ** : Core optimization engine & Plugin system ✅
- NX journal integration
- Web dashboard
- Lifecycle hooks (pre-solve, post-solve, post-extraction)
- [x] **Phase 2.5 ** : Intelligent Codebase-Aware Gap Detection ✅
- Scans existing capabilities before requesting examples
- Matches workflow steps to implemented features
- 80-90% accuracy on complex optimization requests
- [x] **Phase 2.6 ** : Intelligent Step Classification ✅
- Distinguishes engineering features from inline calculations
- Identifies post-processing hooks vs FEA operations
- Foundation for smart code generation
- [x] **Phase 2.7 ** : LLM-Powered Workflow Intelligence ✅
- Replaces static regex with Claude AI analysis
- Detects ALL intermediate calculation steps
- Understands engineering context (PCOMP, CBAR, element forces, etc.)
- 95%+ expected accuracy with full nuance detection
2025-11-16 16:33:48 -05:00
- [x] **Phase 2.8 ** : Inline Code Generation ✅
2025-11-16 21:29:54 -05:00
- LLM-generates Python code for simple math operations
2025-11-16 16:33:48 -05:00
- Handles avg/min/max, normalization, percentage calculations
- Direct integration with Phase 2.7 LLM output
2025-11-16 21:29:54 -05:00
- Optional automated code generation for calculations
2025-11-16 16:33:48 -05:00
- [x] **Phase 2.9 ** : Post-Processing Hook Generation ✅
2025-11-16 21:29:54 -05:00
- LLM-generates standalone Python middleware scripts
2025-11-16 16:33:48 -05:00
- Integrated with Phase 1 lifecycle hook system
- Handles weighted objectives, custom formulas, constraints, comparisons
- Complete JSON-based I/O for optimization loops
2025-11-16 21:29:54 -05:00
- Optional automated scripting for post-processing operations
2025-11-16 16:33:48 -05:00
- [x] **Phase 3 ** : pyNastran Documentation Integration ✅
2025-11-16 21:29:54 -05:00
- LLM-enhanced OP2 extraction code generation
2025-11-16 16:33:48 -05:00
- Documentation research via WebFetch
- 3 core extraction patterns (displacement, stress, force)
- Knowledge base for learned patterns
- Successfully tested on real OP2 files
2025-11-16 21:29:54 -05:00
- Optional automated code generation for result extraction!
2025-11-16 16:33:48 -05:00
2025-11-16 21:29:54 -05:00
- [x] **Phase 3.1 ** : LLM-Enhanced Automation Pipeline ✅
2025-11-16 19:39:04 -05:00
- Extractor orchestrator integrates Phase 2.7 + Phase 3.0
2025-11-16 21:29:54 -05:00
- Optional automatic extractor generation from LLM output
2025-11-16 19:39:04 -05:00
- Dynamic loading and execution on real OP2 files
- End-to-end test passed: Request → Code → Execution → Objective
2025-11-16 21:29:54 -05:00
- LLM-enhanced workflow with user flexibility achieved!
2025-11-16 19:39:04 -05:00
2025-11-16 13:35:41 -05:00
### Next Priorities
2025-11-15 07:56:35 -05:00
2025-11-16 19:39:04 -05:00
- [ ] **Phase 3.2 ** : Optimization runner integration with orchestrator
2025-11-16 16:33:48 -05:00
- [ ] **Phase 3.5 ** : NXOpen introspection & pattern curation
2025-11-16 13:35:41 -05:00
- [ ] **Phase 4 ** : Code generation for complex FEA features
- [ ] **Phase 5 ** : Analysis & decision support
- [ ] **Phase 6 ** : Automated reporting
2025-11-15 07:56:35 -05:00
2025-11-16 13:35:41 -05:00
**For Developers**:
- [DEVELOPMENT.md ](DEVELOPMENT.md ) - Current status, todos, and active development
- [DEVELOPMENT_ROADMAP.md ](DEVELOPMENT_ROADMAP.md ) - Strategic vision and long-term plan
- [CHANGELOG.md ](CHANGELOG.md ) - Version history and changes
2025-11-15 07:56:35 -05:00
## License
Proprietary - Atomaste © 2025
## Support
- **Documentation**: [docs/ ](docs/ )
2025-11-16 13:35:41 -05:00
- **Studies**: [studies/ ](studies/ ) - Optimization study templates and examples
2025-11-15 14:34:16 -05:00
- **Development Roadmap**: [DEVELOPMENT_ROADMAP.md ](DEVELOPMENT_ROADMAP.md )
- **Email**: antoine@atomaste .com
2025-11-15 07:56:35 -05:00
2025-11-15 08:10:05 -05:00
## Resources
### NXOpen References
2025-11-15 14:34:16 -05:00
- **Official API Docs**: [Siemens NXOpen Documentation ](https://docs.sw.siemens.com/en-US/doc/209349590/ )
- **NXOpenTSE**: [The Scripting Engineer's Guide ](https://nxopentsedocumentation.thescriptingengineer.com/ )
2025-11-15 08:10:05 -05:00
- **Our Guide**: [NXOpen Resources ](docs/NXOPEN_RESOURCES.md )
### Optimization
- **Optuna Documentation**: [optuna.readthedocs.io ](https://optuna.readthedocs.io/ )
- **pyNastran**: [github.com/SteveDoyle2/pyNastran ](https://github.com/SteveDoyle2/pyNastran )
2025-11-15 07:56:35 -05:00
---
**Built with ❤️ by Atomaste** | Powered by Optuna, NXOpen, and Claude