diff --git a/.claude/settings.local.json b/.claude/settings.local.json index ff16419e..c77aab7f 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -31,7 +31,24 @@ "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\" tests/test_step_classifier.py)", "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\" tests/test_cbar_genetic_algorithm.py)", "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\" -m pip install anthropic --quiet)", - "Bash(\"c:/Users/antoi/anaconda3/envs/atomizer/python.exe\" -m pip install anthropic --quiet)" + "Bash(\"c:/Users/antoi/anaconda3/envs/atomizer/python.exe\" -m pip install anthropic --quiet)", + "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\" optimization_engine/hook_generator.py)", + "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\" hook_weighted_objective_norm_stress_norm_disp.py test_input.json)", + "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\" optimization_engine/pynastran_research_agent.py)", + "Bash(git init:*)", + "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\" optimization_engine/extractor_orchestrator.py)", + "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\" tests/test_phase_3_1_integration.py)", + "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\" tests/test_bracket_llm_runner.py)", + "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\":*)", + "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\" tests/test_bracket_full_optimization.py)", + "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\" tests/interactive_optimization_setup.py)", + "Bash(tee:*)", + "Bash(tree:*)", + "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\" tests/test_timestamp_verification.py)", + "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\" run_optimization.py)", + "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\" studies/bracket_displacement_maximizing/test_fix.py)", + "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\" run_substudy.py coarse_exploration)", + "Bash(\"c:/Users/antoi/anaconda3/envs/test_env/python.exe\" -c \"import json; h = json.load(open(''c:/Users/antoi/Documents/Atomaste/Atomizer/studies/bracket_displacement_maximizing/substudies/coarse_exploration/optimization_history_incremental.json'')); best = min(h, key=lambda x: x[''objective'']); print(f''Best Trial: {best[\"\"trial_number\"\"]}''); print(f''Parameters: tip={best[\"\"design_variables\"\"][\"\"tip_thickness\"\"]:.2f}mm, angle={best[\"\"design_variables\"\"][\"\"support_angle\"\"]:.2f}°''); print(f''Max Displacement: {best[\"\"results\"\"][\"\"max_displacement\"\"]:.6f}mm''); print(f''Objective: {best[\"\"objective\"\"]:.6f}'')\")" ], "deny": [], "ask": [] diff --git a/.gitignore b/.gitignore index 18e4a80a..694401a9 100644 --- a/.gitignore +++ b/.gitignore @@ -57,8 +57,6 @@ env/ *.dat *.html *.png -*_i.prt -*.prt.test # Optimization Results (generated during runs - do not commit) optuna_study.db diff --git a/README.md b/README.md index 2843f37a..64c0f5bc 100644 --- a/README.md +++ b/README.md @@ -158,9 +158,11 @@ python run_5trial_test.py - **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 +- **Substudy System**: NX-like hierarchical studies with shared models and independent configurations +- **Live History Tracking**: Real-time incremental JSON updates for monitoring progress - **Resume Capability**: Interrupt and resume optimizations without data loss - **Web Dashboard**: Real-time monitoring and configuration UI -- **Example Study**: Bracket stress minimization with full documentation +- **Example Study**: Bracket displacement maximization with full substudy workflow **🚀 What's Next**: Natural language optimization configuration via LLM interface (Phase 2) @@ -200,15 +202,19 @@ Atomizer/ │ └── scripts/ # NX expression extraction ├── studies/ # Optimization studies │ ├── README.md # Comprehensive studies guide -│ └── bracket_stress_minimization/ # Example study +│ └── bracket_displacement_maximizing/ # Example study with substudies │ ├── README.md # Study documentation -│ ├── model/ # FEA model files (.prt, .sim, .fem) -│ ├── optimization_config_stress_displacement.json -│ └── optimization_results/ # Generated results (gitignored) -│ ├── optimization.log # High-level progress log -│ ├── trial_logs/ # Detailed per-trial logs -│ ├── history.json # Complete optimization history -│ └── study_*.db # Optuna database +│ ├── 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 ├── tests/ # Unit and integration tests │ ├── test_hooks_with_bracket.py │ ├── run_5trial_test.py @@ -219,25 +225,35 @@ Atomizer/ └── README.md # This file ``` -## Example: Bracket Stress Minimization +## Example: Bracket Displacement Maximization with Substudies -A complete working example is in `studies/bracket_stress_minimization/`: +A complete working example is in `studies/bracket_displacement_maximizing/`: ```bash -# Run the bracket optimization (50 trials, TPE sampler) -python tests/test_journal_optimization.py +# Run standalone optimization (20 trials) +cd studies/bracket_displacement_maximizing +python run_optimization.py -# View results -python dashboard/start_dashboard.py -# Open http://localhost:8080 in browser +# 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 ``` **What it does**: -1. Loads `Bracket_sim1.sim` with wall thickness = 5mm -2. Varies thickness from 3-8mm over 50 trials -3. Runs FEA solve for each trial -4. Extracts max stress and displacement from OP2 -5. Finds optimal thickness that minimizes stress +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 **Results** (typical): - Best thickness: ~4.2mm @@ -317,32 +333,32 @@ User: "Why did trial #34 perform best?" - 95%+ expected accuracy with full nuance detection - [x] **Phase 2.8**: Inline Code Generation ✅ - - Auto-generates Python code for simple math operations + - LLM-generates Python code for simple math operations - Handles avg/min/max, normalization, percentage calculations - Direct integration with Phase 2.7 LLM output - - Zero manual coding for trivial operations + - Optional automated code generation for calculations - [x] **Phase 2.9**: Post-Processing Hook Generation ✅ - - Auto-generates standalone Python middleware scripts + - LLM-generates standalone Python middleware scripts - Integrated with Phase 1 lifecycle hook system - Handles weighted objectives, custom formulas, constraints, comparisons - Complete JSON-based I/O for optimization loops - - Zero manual scripting for post-processing operations + - Optional automated scripting for post-processing operations - [x] **Phase 3**: pyNastran Documentation Integration ✅ - - Automated OP2 extraction code generation + - LLM-enhanced OP2 extraction code generation - Documentation research via WebFetch - 3 core extraction patterns (displacement, stress, force) - Knowledge base for learned patterns - Successfully tested on real OP2 files - - Zero manual coding for result extraction! + - Optional automated code generation for result extraction! -- [x] **Phase 3.1**: Complete Automation Pipeline ✅ +- [x] **Phase 3.1**: LLM-Enhanced Automation Pipeline ✅ - Extractor orchestrator integrates Phase 2.7 + Phase 3.0 - - Automatic extractor generation from LLM output + - Optional automatic extractor generation from LLM output - Dynamic loading and execution on real OP2 files - End-to-end test passed: Request → Code → Execution → Objective - - ZERO MANUAL CODING - Complete automation achieved! + - LLM-enhanced workflow with user flexibility achieved! ### Next Priorities diff --git a/docs/SESSION_SUMMARY_PHASE_3.md b/docs/SESSION_SUMMARY_PHASE_3.md index 4bc40198..867d4d42 100644 --- a/docs/SESSION_SUMMARY_PHASE_3.md +++ b/docs/SESSION_SUMMARY_PHASE_3.md @@ -6,13 +6,13 @@ ## Overview -Phase 3 implements **automated research and code generation** for OP2 result extraction using pyNastran. The system can: +Phase 3 implements **LLM-enhanced research and code generation** for OP2 result extraction using pyNastran. The system can: 1. Research pyNastran documentation to find appropriate APIs 2. Generate complete, executable Python extraction code 3. Store learned patterns in a knowledge base 4. Auto-generate extractors from Phase 2.7 LLM output -This completes the **zero-manual-coding vision**: Users describe optimization goals in natural language → System generates all required code automatically. +This enables **LLM-enhanced optimization workflows**: Users can describe goals in natural language and optionally have the system generate code automatically, or write custom extractors manually as needed. ## Objectives Achieved @@ -287,7 +287,7 @@ def min_to_avg_ratio_hook(context): return {'min_to_avg_ratio': result, 'objective': result} ``` -**Result**: Complete optimization setup from natural language → Zero manual coding! 🚀 +**Result**: LLM-enhanced optimization setup from natural language with flexible automation! 🚀 ## Testing @@ -483,13 +483,13 @@ Phase 3 successfully implements **automated OP2 extraction code generation** usi - ✅ Knowledge base architecture - ✅ 3 core extraction patterns (displacement, stress, force) -This completes the **zero-manual-coding pipeline**: +This enables the **LLM-enhanced automation pipeline**: - Phase 2.7: LLM analyzes natural language → engineering features -- Phase 2.8: Inline calculation code generation -- Phase 2.9: Post-processing hook generation -- **Phase 3: OP2 extraction code generation** +- Phase 2.8: Inline calculation code generation (optional) +- Phase 2.9: Post-processing hook generation (optional) +- **Phase 3: OP2 extraction code generation (optional)** -Users can now describe optimization goals in natural language and the system generates ALL required code automatically! 🎉 +Users can describe optimization goals in natural language and choose to leverage automated code generation, manual coding, or a hybrid approach! 🎉 ## Related Documentation diff --git a/docs/SESSION_SUMMARY_PHASE_3_1.md b/docs/SESSION_SUMMARY_PHASE_3_1.md index b2e5fed6..eb5956c0 100644 --- a/docs/SESSION_SUMMARY_PHASE_3_1.md +++ b/docs/SESSION_SUMMARY_PHASE_3_1.md @@ -6,19 +6,19 @@ ## Overview -Phase 3.1 completes the **zero-manual-coding automation pipeline** by integrating: +Phase 3.1 completes the **LLM-enhanced automation pipeline** by integrating: - **Phase 2.7**: LLM workflow analysis - **Phase 3.0**: pyNastran research agent - **Phase 2.8**: Inline code generation - **Phase 2.9**: Post-processing hook generation -The result: Users describe optimization goals in natural language → System automatically generates ALL required code from request to execution! +The result: Users can describe optimization goals in natural language and choose to leverage automatic code generation, manual coding, or a hybrid approach! ## Objectives Achieved -### ✅ Complete Automation Pipeline +### ✅ LLM-Enhanced Automation Pipeline -**From User Request to Execution - Zero Manual Coding:** +**From User Request to Execution - Flexible LLM-Assisted Workflow:** ``` User Natural Language Request @@ -298,7 +298,7 @@ Trial N completed Objective value: 0.072357 ``` -**ZERO manual coding from user request to Optuna trial!** 🚀 +**LLM-enhanced workflow with optional automation from user request to Optuna trial!** 🚀 ## Key Integration Points @@ -429,9 +429,9 @@ Result: PASSED! ## Benefits -### 1. Complete Automation +### 1. LLM-Enhanced Flexibility -**Before** (Manual workflow): +**Traditional Manual Workflow**: ``` 1. User describes optimization 2. Engineer manually writes OP2 extractor @@ -441,32 +441,33 @@ Result: PASSED! Time: Hours to days ``` -**After** (Automated workflow): +**LLM-Enhanced Workflow**: ``` 1. User describes optimization in natural language -2. System generates ALL code automatically -Time: Seconds +2. System offers to generate code automatically OR user writes custom code +3. Hybrid approach: mix automated and manual components as needed +Time: Seconds to minutes (user choice) ``` -### 2. Zero Learning Curve +### 2. Reduced Learning Curve -Users don't need to know: -- ❌ pyNastran API -- ❌ OP2 file structure -- ❌ Python coding -- ❌ Optimization framework +LLM assistance helps users who are unfamiliar with: +- pyNastran API (can still write custom extractors if desired) +- OP2 file structure (LLM provides templates) +- Python coding best practices (LLM generates examples) +- Optimization framework patterns (LLM suggests approaches) -They only need to describe **what they want** in natural language! +Users can describe goals in natural language and choose their preferred level of automation! -### 3. Correct by Construction +### 3. Quality LLM-Generated Code -Generated code uses: +When using automated generation, code uses: - ✅ Proven extraction patterns from research agent - ✅ Correct API paths from documentation - ✅ Proper data structure access - ✅ Error handling and validation -No manual bugs! +Users can review, modify, or replace generated code as needed! ### 4. Extensible @@ -570,10 +571,10 @@ None - Phase 3.1 is purely additive! ## Summary -Phase 3.1 successfully completes the **zero-manual-coding automation pipeline**: +Phase 3.1 successfully completes the **LLM-enhanced automation pipeline**: - ✅ Orchestrator integrates Phase 2.7 + Phase 3.0 -- ✅ Automatic extractor generation from LLM output +- ✅ Optional automatic extractor generation from LLM output - ✅ Dynamic loading and execution on real OP2 files - ✅ Smart parameter filtering per pattern type - ✅ Multi-extractor support @@ -581,28 +582,28 @@ Phase 3.1 successfully completes the **zero-manual-coding automation pipeline**: - ✅ Extraction successful: max_disp=0.361783mm - ✅ Normalized objective calculated: 0.072357 -**Complete Automation Verified:** +**LLM-Enhanced Workflow Verified:** ``` Natural Language Request ↓ Phase 2.7 LLM → Engineering Features ↓ -Phase 3.1 Orchestrator → Generated Extractors +Phase 3.1 Orchestrator → Generated Extractors (or manual extractors) ↓ -Phase 3.0 Research Agent → OP2 Extraction Code +Phase 3.0 Research Agent → OP2 Extraction Code (optional) ↓ Execution on Real OP2 → Results ↓ -Phase 2.8 Inline Calc → Calculations +Phase 2.8 Inline Calc → Calculations (optional) ↓ -Phase 2.9 Hooks → Objective Value +Phase 2.9 Hooks → Objective Value (optional) ↓ Optuna Trial Complete -ZERO MANUAL CODING! 🚀 +LLM-ENHANCED WITH USER FLEXIBILITY! 🚀 ``` -Users can now describe optimization goals in natural language and the system automatically generates and executes ALL required code from request to final objective value! +Users can describe optimization goals in natural language and choose to leverage automated code generation, write custom code, or use a hybrid approach as needed! ## Related Documentation diff --git a/interactive_setup_output.txt b/interactive_setup_output.txt new file mode 100644 index 00000000..2c973581 --- /dev/null +++ b/interactive_setup_output.txt @@ -0,0 +1,530 @@ +fatal: not a git repository (or any of the parent directories): .git + +================================================================================ + ATOMIZER - INTERACTIVE OPTIMIZATION SETUP +================================================================================ + + +[Atomizer] Welcome to Atomizer! I'll help you set up your optimization. + + +[Atomizer] First, I need to know about your model files. + + +[User] I have a bracket model: + + - Part file: tests\Bracket.prt + - Simulation file: tests\Bracket_sim1.sim + +[Atomizer] Great! Let me initialize the Setup Wizard to analyze your model... + + +================================================================================ + STEP 1: MODEL INTROSPECTION +================================================================================ + + +[Atomizer] I'm reading your NX model to find available design parameters... + + +[Atomizer] Found 4 expressions in your model: + + - support_angle: 32.0 degrees + - tip_thickness: 24.0 mm + - p3: 10.0 mm + - support_blend_radius: 10.0 mm + +[Atomizer] Which parameters would you like to use as design variables? + + +[User] I want to optimize tip_thickness and support_angle + + +[Atomizer] Perfect! Now, what's your optimization goal? + + +[User] I want to maximize displacement while keeping stress below + + a safety factor of 4. The material is Aluminum 6061-T6. + +================================================================================ + STEP 2: BASELINE SIMULATION +================================================================================ + + +[Atomizer] To validate your setup, I need to run ONE baseline simulation. + + +[Atomizer] This will generate an OP2 file that I can analyze to ensure + + +[Atomizer] the extraction pipeline will work correctly. + + +[Atomizer] + + +[Atomizer] Running baseline simulation with current parameter values... + + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: tests + Mode: Journal + Deleted 3 old result file(s) to force fresh solve +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 20:33:59 *** + Starting Nastran Exporter + + *** 20:33:59 *** + Writing file + c:\Users\antoi\Documents\Atomaste\Atomizer\tests\bracket_sim1-solution_1.dat + + *** 20:33:59 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 20:33:59 *** + Writing Nastran System section + + *** 20:33:59 *** + Writing File Management section + + *** 20:33:59 *** + Writing Executive Control section + + *** 20:33:59 *** + Writing Case Control section + + *** 20:33:59 *** + Writing Bulk Data section + + *** 20:33:59 *** + Writing Nodes + + *** 20:33:59 *** + Writing Elements + + *** 20:33:59 *** + Writing Physical Properties + + *** 20:33:59 *** + Writing Materials + + *** 20:33:59 *** + Writing Degree-of-Freedom Sets + + *** 20:33:59 *** + Writing Loads and Constraints + + *** 20:33:59 *** + Writing Coordinate Systems + + *** 20:33:59 *** + Validating Solution Setup + + *** 20:33:59 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 20:33:59 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1779619210 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: 1218183744 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for c:\Users\antoi\Documents\Atomaste\Atomizer\tests\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\tests\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Output files detected after 0.5s +[NX SOLVER] Complete in 4.3s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 + +[Atomizer] Baseline simulation complete! OP2 file: bracket_sim1-solution_1.op2 + + +================================================================================ + STEP 3: OP2 INTROSPECTION +================================================================================ + + +[Atomizer] Now I'll analyze the OP2 file to see what's actually in there... + +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +[Atomizer] Here's what I found in your OP2 file: + + - Element types with stress: CHEXA, CPENTA + - Available results: displacement, stress + - Number of elements: 0 + - Number of nodes: 0 + +================================================================================ + STEP 4: LLM-GUIDED CONFIGURATION +================================================================================ + + +[Atomizer] Based on your goal and the OP2 contents, here's what I recommend: + + +[Atomizer] + + +[Atomizer] OBJECTIVE: + + +[Atomizer] - Maximize displacement (minimize negative displacement) + + +[Atomizer] + + +[Atomizer] EXTRACTIONS: + + +[Atomizer] - Extract displacement from OP2 + + +[Atomizer] - Extract stress from CHEXA elements + + +[Atomizer] (I detected these element types in your model) + + +[Atomizer] + + +[Atomizer] CALCULATIONS: + + +[Atomizer] - Calculate safety factor: SF = 276 MPa / max_stress + + +[Atomizer] - Negate displacement for minimization + + +[Atomizer] + + +[Atomizer] CONSTRAINT: + + +[Atomizer] - Enforce SF >= 4.0 with penalty + + +[Atomizer] + + +[Atomizer] DESIGN VARIABLES: + + +[Atomizer] - tip_thickness: 24.0 mm (suggest range: 15-25 mm) + + +[Atomizer] - support_angle: 32.0 degrees (suggest range: 20-40 deg) + + +[User] That looks good! Let's use those ranges. + + +================================================================================ + STEP 5: PIPELINE VALIDATION (DRY RUN) +================================================================================ + + +[Atomizer] Before running 20-30 optimization trials, let me validate that + + +[Atomizer] EVERYTHING works correctly with your baseline OP2 file... + + +[Atomizer] + + +[Atomizer] Running dry-run validation... + +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +Extraction failed: extract_solid_stress - No ctetra stress results in OP2 + \u274c extract_solid_stress: No ctetra stress results in OP2 + \u274c calculate_safety_factor: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress + \u26a0\ufe0f No explicit objective, using: max_displacement +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +[Wizard] VALIDATION RESULTS: +[Wizard] [OK] extractor: ['max_displacement', 'max_disp_node', 'max_disp_x', 'max_disp_y', 'max_disp_z'] +[Wizard] [FAIL] extractor: No ctetra stress results in OP2 +[Wizard] [FAIL] calculation: name 'max_von_mises' is not defined +[Wizard] [OK] calculation: Created ['neg_displacement'] +[Wizard] [OK] hook: 3 results +[Wizard] [OK] objective: 0.36178338527679443 + + +================================================================================ + VALIDATION FAILED! +================================================================================ + + +[Atomizer] The validation found issues that need to be fixed: + + +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\tests\interactive_optimization_setup.py", line 324, in + main() + File "c:\Users\antoi\Documents\Atomaste\Atomizer\tests\interactive_optimization_setup.py", line 316, in main + print(f" [ERROR] {result.message}") + File "C:\Users\antoi\anaconda3\envs\test_env\Lib\encodings\cp1252.py", line 19, in encode + return codecs.charmap_encode(input,self.errors,encoding_table)[0] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +UnicodeEncodeError: 'charmap' codec can't encode character '\u274c' in position 19: character maps to diff --git a/optimization_engine/llm_optimization_runner.py b/optimization_engine/llm_optimization_runner.py new file mode 100644 index 00000000..2c8039b9 --- /dev/null +++ b/optimization_engine/llm_optimization_runner.py @@ -0,0 +1,528 @@ +""" +LLM-Enhanced Optimization Runner - Phase 3.2 + +Flexible LLM-enhanced optimization runner that integrates: +- Phase 2.7: LLM workflow analysis +- Phase 2.8: Inline code generation (optional) +- Phase 2.9: Post-processing hook generation (optional) +- Phase 3.0: pyNastran research agent (optional) +- Phase 3.1: Extractor orchestration (optional) + +This runner enables users to describe optimization goals in natural language +and choose to leverage automated code generation, manual coding, or a hybrid approach. + +Author: Atomizer Development Team +Version: 0.1.0 (Phase 3.2) +Last Updated: 2025-01-16 +""" + +from pathlib import Path +from typing import Dict, Any, List, Optional +import json +import logging +import optuna +from datetime import datetime + +from optimization_engine.extractor_orchestrator import ExtractorOrchestrator +from optimization_engine.inline_code_generator import InlineCodeGenerator +from optimization_engine.hook_generator import HookGenerator +from optimization_engine.plugins.hook_manager import HookManager + +logger = logging.getLogger(__name__) + + +class LLMOptimizationRunner: + """ + LLM-enhanced optimization runner with flexible automation options. + + This runner empowers users to leverage LLM-assisted code generation for: + - OP2 result extractors (Phase 3.1) - optional + - Inline calculations (Phase 2.8) - optional + - Post-processing hooks (Phase 2.9) - optional + + Users can describe goals in natural language and choose automated generation, + manual coding, or a hybrid approach based on their needs. + """ + + def __init__(self, + llm_workflow: Dict[str, Any], + model_updater: callable, + simulation_runner: callable, + study_name: str = "llm_optimization", + output_dir: Optional[Path] = None): + """ + Initialize LLM-driven optimization runner. + + Args: + llm_workflow: Output from Phase 2.7 LLM analysis with: + - engineering_features: List of FEA operations + - inline_calculations: List of simple math operations + - post_processing_hooks: List of custom calculations + - optimization: Dict with algorithm, design_variables, etc. + model_updater: Function(design_vars: Dict) -> None + simulation_runner: Function() -> Path (returns OP2 file path) + study_name: Name for Optuna study + output_dir: Directory for results + """ + self.llm_workflow = llm_workflow + self.model_updater = model_updater + self.simulation_runner = simulation_runner + self.study_name = study_name + + if output_dir is None: + output_dir = Path.cwd() / "optimization_results" / study_name + self.output_dir = Path(output_dir) + self.output_dir.mkdir(parents=True, exist_ok=True) + + # Initialize automation components + self._initialize_automation() + + # Optuna study + self.study = None + self.history = [] + + logger.info(f"LLMOptimizationRunner initialized for study: {study_name}") + + def _initialize_automation(self): + """Initialize all automation components from LLM workflow.""" + logger.info("Initializing automation components...") + + # Phase 3.1: Extractor Orchestrator + logger.info(" - Phase 3.1: Extractor Orchestrator") + self.orchestrator = ExtractorOrchestrator( + extractors_dir=self.output_dir / "generated_extractors" + ) + + # Generate extractors from LLM workflow + self.extractors = self.orchestrator.process_llm_workflow(self.llm_workflow) + logger.info(f" Generated {len(self.extractors)} extractor(s)") + + # Phase 2.8: Inline Code Generator + logger.info(" - Phase 2.8: Inline Code Generator") + self.inline_generator = InlineCodeGenerator() + self.inline_code = [] + + for calc in self.llm_workflow.get('inline_calculations', []): + generated = self.inline_generator.generate_from_llm_output(calc) + self.inline_code.append(generated.code) + + logger.info(f" Generated {len(self.inline_code)} inline calculation(s)") + + # Phase 2.9: Hook Generator + logger.info(" - Phase 2.9: Hook Generator") + self.hook_generator = HookGenerator() + + # Generate lifecycle hooks from post_processing_hooks + hook_dir = self.output_dir / "generated_hooks" + hook_dir.mkdir(exist_ok=True) + + for hook_spec in self.llm_workflow.get('post_processing_hooks', []): + hook_content = self.hook_generator.generate_lifecycle_hook( + hook_spec, + hook_point='post_calculation' + ) + + # Save hook + hook_name = hook_spec.get('action', 'custom_hook') + hook_file = hook_dir / f"{hook_name}.py" + with open(hook_file, 'w') as f: + f.write(hook_content) + + logger.info(f" Generated hook: {hook_name}") + + # Phase 1: Hook Manager + logger.info(" - Phase 1: Hook Manager") + self.hook_manager = HookManager() + + # Load generated hooks + if hook_dir.exists(): + self.hook_manager.load_plugins_from_directory(hook_dir) + + # Load system hooks + system_hooks_dir = Path(__file__).parent / 'plugins' + if system_hooks_dir.exists(): + self.hook_manager.load_plugins_from_directory(system_hooks_dir) + + summary = self.hook_manager.get_summary() + logger.info(f" Loaded {summary['enabled_hooks']} hook(s)") + + logger.info("Automation components initialized successfully!") + + def _create_optuna_study(self) -> optuna.Study: + """Create Optuna study from LLM workflow optimization settings.""" + opt_config = self.llm_workflow.get('optimization', {}) + + # Determine direction (minimize or maximize) + direction = opt_config.get('direction', 'minimize') + + # Create study + study = optuna.create_study( + study_name=self.study_name, + direction=direction, + storage=f"sqlite:///{self.output_dir / f'{self.study_name}.db'}", + load_if_exists=True + ) + + logger.info(f"Created Optuna study: {self.study_name} (direction: {direction})") + return study + + def _objective(self, trial: optuna.Trial) -> float: + """ + Optuna objective function - LLM-enhanced with flexible automation! + + This function leverages LLM workflow analysis with user-configurable automation: + 1. Suggests design variables from LLM analysis + 2. Updates model + 3. Runs simulation + 4. Extracts results (using generated or manual extractors) + 5. Executes inline calculations (generated or manual) + 6. Executes post-calculation hooks (generated or manual) + 7. Returns objective value + + Args: + trial: Optuna trial + + Returns: + Objective value + """ + trial_number = trial.number + logger.info(f"\n{'='*80}") + logger.info(f"Trial {trial_number} starting...") + logger.info(f"{'='*80}") + + # ==================================================================== + # STEP 1: Suggest Design Variables + # ==================================================================== + design_vars_config = self.llm_workflow.get('optimization', {}).get('design_variables', []) + + design_vars = {} + for var_config in design_vars_config: + var_name = var_config['parameter'] + var_min = var_config.get('min', 0.0) + var_max = var_config.get('max', 1.0) + + # Suggest value using Optuna + design_vars[var_name] = trial.suggest_float(var_name, var_min, var_max) + + logger.info(f"Design variables: {design_vars}") + + # Execute pre-solve hooks + self.hook_manager.execute_hooks('pre_solve', { + 'trial_number': trial_number, + 'design_variables': design_vars + }) + + # ==================================================================== + # STEP 2: Update Model + # ==================================================================== + logger.info("Updating model...") + self.model_updater(design_vars) + + # ==================================================================== + # STEP 3: Run Simulation + # ==================================================================== + logger.info("Running simulation...") + # Pass design_vars to simulation_runner so NX journal can update expressions + op2_file = self.simulation_runner(design_vars) + logger.info(f"Simulation complete: {op2_file}") + + # Execute post-solve hooks + self.hook_manager.execute_hooks('post_solve', { + 'trial_number': trial_number, + 'op2_file': op2_file + }) + + # ==================================================================== + # STEP 4: Extract Results (Phase 3.1 - Auto-Generated Extractors) + # ==================================================================== + logger.info("Extracting results...") + + results = {} + for extractor in self.extractors: + try: + extraction_result = self.orchestrator.execute_extractor( + extractor.name, + Path(op2_file), + subcase=1 + ) + results.update(extraction_result) + logger.info(f" {extractor.name}: {list(extraction_result.keys())}") + except Exception as e: + logger.error(f"Extraction failed for {extractor.name}: {e}") + # Continue with other extractors + + # Execute post-extraction hooks + self.hook_manager.execute_hooks('post_extraction', { + 'trial_number': trial_number, + 'results': results + }) + + # ==================================================================== + # STEP 5: Inline Calculations (Phase 2.8 - Auto-Generated Code) + # ==================================================================== + logger.info("Executing inline calculations...") + + calculations = {} + calc_namespace = {**results, **calculations} # Make results available + + for calc_code in self.inline_code: + try: + exec(calc_code, calc_namespace) + # Extract newly created variables + for key, value in calc_namespace.items(): + if key not in results and not key.startswith('_'): + calculations[key] = value + + logger.info(f" Executed: {calc_code[:50]}...") + except Exception as e: + logger.error(f"Inline calculation failed: {e}") + + logger.info(f"Calculations: {calculations}") + + # ==================================================================== + # STEP 6: Post-Calculation Hooks (Phase 2.9 - Auto-Generated Hooks) + # ==================================================================== + logger.info("Executing post-calculation hooks...") + + hook_results = self.hook_manager.execute_hooks('post_calculation', { + 'trial_number': trial_number, + 'design_variables': design_vars, + 'results': results, + 'calculations': calculations + }) + + # Merge hook results + final_context = {**results, **calculations} + for hook_result in hook_results: + if hook_result: + final_context.update(hook_result) + + logger.info(f"Hook results: {hook_results}") + + # ==================================================================== + # STEP 7: Extract Objective Value + # ==================================================================== + + # Try to get objective from hooks first + objective = None + + # Check hook results for 'objective' or 'weighted_objective' + for hook_result in hook_results: + if hook_result: + if 'objective' in hook_result: + objective = hook_result['objective'] + break + elif 'weighted_objective' in hook_result: + objective = hook_result['weighted_objective'] + break + + # Fallback: use first extracted result + if objective is None: + # Try common objective names + for key in ['max_displacement', 'max_stress', 'max_von_mises']: + if key in final_context: + objective = final_context[key] + logger.warning(f"No explicit objective found, using: {key}") + break + + if objective is None: + raise ValueError("Could not determine objective value from results/calculations/hooks") + + logger.info(f"Objective value: {objective}") + + # Save trial history + trial_data = { + 'trial_number': trial_number, + 'design_variables': design_vars, + 'results': results, + 'calculations': calculations, + 'objective': objective + } + self.history.append(trial_data) + + # Incremental save - write history after each trial + # This allows monitoring progress in real-time + self._save_incremental_history() + + return float(objective) + + def run_optimization(self, n_trials: int = 50) -> Dict[str, Any]: + """ + Run LLM-enhanced optimization with flexible automation. + + Args: + n_trials: Number of optimization trials + + Returns: + Dict with: + - best_params: Best design variable values + - best_value: Best objective value + - history: Complete trial history + """ + logger.info(f"\n{'='*80}") + logger.info(f"Starting LLM-Driven Optimization") + logger.info(f"{'='*80}") + logger.info(f"Study: {self.study_name}") + logger.info(f"Trials: {n_trials}") + logger.info(f"Output: {self.output_dir}") + logger.info(f"{'='*80}\n") + + # Create study + self.study = self._create_optuna_study() + + # Run optimization + self.study.optimize(self._objective, n_trials=n_trials) + + # Get results + best_trial = self.study.best_trial + + results = { + 'best_params': best_trial.params, + 'best_value': best_trial.value, + 'best_trial_number': best_trial.number, + 'history': self.history + } + + # Save results + self._save_results(results) + + logger.info(f"\n{'='*80}") + logger.info("Optimization Complete!") + logger.info(f"{'='*80}") + logger.info(f"Best value: {results['best_value']}") + logger.info(f"Best params: {results['best_params']}") + logger.info(f"Results saved to: {self.output_dir}") + logger.info(f"{'='*80}\n") + + return results + + def _save_incremental_history(self): + """ + Save trial history incrementally after each trial. + This allows real-time monitoring of optimization progress. + """ + history_file = self.output_dir / "optimization_history_incremental.json" + + # Convert history to JSON-serializable format + serializable_history = [] + for trial in self.history: + trial_copy = trial.copy() + # Convert any numpy types to native Python types + for key in ['results', 'calculations', 'design_variables']: + if key in trial_copy: + trial_copy[key] = {k: float(v) if isinstance(v, (int, float)) else v + for k, v in trial_copy[key].items()} + if 'objective' in trial_copy: + trial_copy['objective'] = float(trial_copy['objective']) + serializable_history.append(trial_copy) + + # Write to file + with open(history_file, 'w') as f: + json.dump(serializable_history, f, indent=2, default=str) + + def _save_results(self, results: Dict[str, Any]): + """Save optimization results to file.""" + results_file = self.output_dir / "optimization_results.json" + + # Make history JSON serializable + serializable_results = { + 'best_params': results['best_params'], + 'best_value': results['best_value'], + 'best_trial_number': results['best_trial_number'], + 'timestamp': datetime.now().isoformat(), + 'study_name': self.study_name, + 'n_trials': len(results['history']) + } + + with open(results_file, 'w') as f: + json.dump(serializable_results, f, indent=2) + + logger.info(f"Results saved to: {results_file}") + + +def main(): + """Test LLM-driven optimization runner.""" + print("=" * 80) + print("Phase 3.2: LLM-Driven Optimization Runner Test") + print("=" * 80) + print() + + # Example LLM workflow (from Phase 2.7) + llm_workflow = { + "engineering_features": [ + { + "action": "extract_displacement", + "domain": "result_extraction", + "description": "Extract displacement from OP2", + "params": {"result_type": "displacement"} + } + ], + "inline_calculations": [ + { + "action": "normalize", + "params": { + "input": "max_displacement", + "reference": "max_allowed_disp", + "value": 5.0 + }, + "code_hint": "norm_disp = max_displacement / 5.0" + } + ], + "post_processing_hooks": [ + { + "action": "weighted_objective", + "params": { + "inputs": ["norm_disp"], + "weights": [1.0], + "objective": "minimize" + } + } + ], + "optimization": { + "algorithm": "TPE", + "direction": "minimize", + "design_variables": [ + { + "parameter": "wall_thickness", + "min": 3.0, + "max": 8.0, + "type": "continuous" + } + ] + } + } + + print("LLM Workflow Configuration:") + print(f" Engineering features: {len(llm_workflow['engineering_features'])}") + print(f" Inline calculations: {len(llm_workflow['inline_calculations'])}") + print(f" Post-processing hooks: {len(llm_workflow['post_processing_hooks'])}") + print(f" Design variables: {len(llm_workflow['optimization']['design_variables'])}") + print() + + # Dummy functions for testing + def dummy_model_updater(design_vars): + print(f" [Dummy] Updating model with: {design_vars}") + + def dummy_simulation_runner(): + print(" [Dummy] Running simulation...") + # Return path to test OP2 + return Path("tests/bracket_sim1-solution_1.op2") + + # Initialize runner + print("Initializing LLM-driven optimization runner...") + runner = LLMOptimizationRunner( + llm_workflow=llm_workflow, + model_updater=dummy_model_updater, + simulation_runner=dummy_simulation_runner, + study_name="test_llm_optimization" + ) + + print() + print("=" * 80) + print("Runner initialized successfully!") + print("Ready to run optimization with auto-generated code!") + print("=" * 80) + + +if __name__ == '__main__': + main() diff --git a/optimization_engine/nx_solver.py b/optimization_engine/nx_solver.py index 3fe0216c..75096080 100644 --- a/optimization_engine/nx_solver.py +++ b/optimization_engine/nx_solver.py @@ -194,22 +194,16 @@ class NXSolver: print(f" Working dir: {working_dir}") print(f" Mode: {'Journal' if self.use_journal else 'Direct'}") - # Delete old result files (.op2, .log, .f06) to force fresh solve - # (.dat file is needed by NX, don't delete it!) - # (Otherwise NX may reuse cached results) - files_to_delete = [op2_file, log_file, f06_file] + # Record timestamps of old files BEFORE solving + # We'll verify files are regenerated by checking timestamps AFTER solve + # This is more reliable than deleting (which can fail due to file locking on Windows) + old_op2_time = op2_file.stat().st_mtime if op2_file.exists() else None + old_f06_time = f06_file.stat().st_mtime if f06_file.exists() else None + old_log_time = log_file.stat().st_mtime if log_file.exists() else None - deleted_count = 0 - for old_file in files_to_delete: - if old_file.exists(): - try: - old_file.unlink() - deleted_count += 1 - except Exception as e: - print(f" Warning: Could not delete {old_file.name}: {e}") - - if deleted_count > 0: - print(f" Deleted {deleted_count} old result file(s) to force fresh solve") + if old_op2_time: + print(f" Found existing OP2 (modified: {time.ctime(old_op2_time)})") + print(f" Will verify NX regenerates it with newer timestamp") # Build command based on mode if self.use_journal and sim_file.suffix == '.sim': @@ -308,19 +302,41 @@ sys.argv = ['', {argv_str}] # Set argv for the main function for line in result.stderr.strip().split('\n')[:5]: print(f" {line}") - # Wait for output files to appear (journal mode runs solve in background) + # Wait for output files to appear AND be regenerated (journal mode runs solve in background) if self.use_journal: max_wait = 30 # seconds - background solves can take time wait_start = time.time() print("[NX SOLVER] Waiting for solve to complete...") - while not (f06_file.exists() and op2_file.exists()) and (time.time() - wait_start) < max_wait: + + # Wait for files to exist AND have newer timestamps than before + while (time.time() - wait_start) < max_wait: + files_exist = f06_file.exists() and op2_file.exists() + + if files_exist: + # Verify files were regenerated (newer timestamps) + new_op2_time = op2_file.stat().st_mtime + new_f06_time = f06_file.stat().st_mtime + + # If no old files, or new files are newer, we're done! + if (old_op2_time is None or new_op2_time > old_op2_time) and \ + (old_f06_time is None or new_f06_time > old_f06_time): + elapsed = time.time() - wait_start + print(f"[NX SOLVER] Fresh output files detected after {elapsed:.1f}s") + if old_op2_time: + print(f" OP2 regenerated: {time.ctime(old_op2_time)} -> {time.ctime(new_op2_time)}") + break + time.sleep(0.5) if (time.time() - wait_start) % 2 < 0.5: # Print every 2 seconds elapsed = time.time() - wait_start - print(f" Waiting... ({elapsed:.0f}s)") + print(f" Waiting for fresh results... ({elapsed:.0f}s)") - if f06_file.exists() and op2_file.exists(): - print(f"[NX SOLVER] Output files detected after {time.time() - wait_start:.1f}s") + # Final check - warn if files weren't regenerated + if op2_file.exists(): + current_op2_time = op2_file.stat().st_mtime + if old_op2_time and current_op2_time <= old_op2_time: + print(f" WARNING: OP2 file was NOT regenerated! (Still has old timestamp)") + print(f" Old: {time.ctime(old_op2_time)}, Current: {time.ctime(current_op2_time)}") # Check for completion success = self._check_solution_success(f06_file, log_file) diff --git a/optimization_engine/nx_updater.py b/optimization_engine/nx_updater.py index c7a850ee..3410bf91 100644 --- a/optimization_engine/nx_updater.py +++ b/optimization_engine/nx_updater.py @@ -88,6 +88,24 @@ class NXParameterUpdater: return expressions + def get_all_expressions(self) -> Dict[str, Dict[str, any]]: + """ + Get all expressions as a dictionary. + + Returns: + Dict mapping expression name to info dict with 'value', 'units', 'type' + """ + expressions_list = self.find_expressions() + return { + expr['name']: { + 'value': expr['value'], + 'units': expr['units'], + 'type': expr['type'], + 'formula': None # Binary .prt files don't have formulas accessible + } + for expr in expressions_list + } + def update_expression(self, name: str, new_value: float) -> bool: """ Update a single expression value. diff --git a/optimization_engine/optimization_setup_wizard.py b/optimization_engine/optimization_setup_wizard.py new file mode 100644 index 00000000..217a8a8f --- /dev/null +++ b/optimization_engine/optimization_setup_wizard.py @@ -0,0 +1,575 @@ +""" +Optimization Setup Wizard - Phase 3.3 + +Interactive wizard that validates the complete optimization pipeline BEFORE running trials: +1. Introspect NX model for available expressions +2. Run baseline simulation to generate OP2 +3. Introspect OP2 file to detect element types and available results +4. LLM-guided configuration based on actual model contents +5. Dry-run pipeline validation with baseline OP2 +6. Report success/failure before starting optimization + +This prevents wasted time running optimizations that will fail! + +Author: Atomizer Development Team +Version: 0.1.0 (Phase 3.3) +Last Updated: 2025-01-16 +""" + +from pathlib import Path +from typing import Dict, Any, List, Optional, Tuple +import logging +from dataclasses import dataclass + +from optimization_engine.nx_updater import NXParameterUpdater +from optimization_engine.nx_solver import NXSolver +from optimization_engine.extractor_orchestrator import ExtractorOrchestrator +from optimization_engine.inline_code_generator import InlineCodeGenerator +from optimization_engine.plugins.hook_manager import HookManager + +logger = logging.getLogger(__name__) + + +@dataclass +class ModelIntrospection: + """Results from NX model introspection.""" + expressions: Dict[str, Any] # {name: {'value': float, 'formula': str}} + prt_file: Path + sim_file: Path + + +@dataclass +class OP2Introspection: + """Results from OP2 file introspection.""" + element_types: List[str] # e.g., ['CHEXA', 'CPENTA', 'CTETRA'] + result_types: List[str] # e.g., ['displacement', 'stress'] + subcases: List[int] # e.g., [1] + node_count: int + element_count: int + op2_file: Path + + +@dataclass +class ValidationResult: + """Result from pipeline validation.""" + success: bool + component: str # 'extractor', 'calculation', 'hook', 'objective' + message: str + data: Optional[Dict[str, Any]] = None + + +class OptimizationSetupWizard: + """ + Interactive wizard for validating optimization setup before running trials. + + This wizard prevents common mistakes by: + - Checking model expressions exist + - Validating OP2 file contains expected results + - Testing extractors on real data + - Confirming calculations work + - Verifying complete pipeline before optimization + """ + + def __init__(self, prt_file: Path, sim_file: Path, output_dir: Optional[Path] = None): + """ + Initialize optimization setup wizard. + + Args: + prt_file: Path to NX part file (.prt) + sim_file: Path to NX simulation file (.sim) + output_dir: Directory for validation outputs + """ + self.prt_file = Path(prt_file) + self.sim_file = Path(sim_file) + + if output_dir is None: + output_dir = Path.cwd() / "optimization_validation" + self.output_dir = Path(output_dir) + self.output_dir.mkdir(parents=True, exist_ok=True) + + self.model_info: Optional[ModelIntrospection] = None + self.op2_info: Optional[OP2Introspection] = None + self.baseline_op2: Optional[Path] = None + + logger.info(f"OptimizationSetupWizard initialized") + logger.info(f" Part: {self.prt_file}") + logger.info(f" Sim: {self.sim_file}") + logger.info(f" Output: {self.output_dir}") + + # ========================================================================= + # STEP 1: Model Introspection + # ========================================================================= + + def introspect_model(self) -> ModelIntrospection: + """ + Introspect NX model to find available expressions. + + Returns: + ModelIntrospection with all expressions found + """ + logger.info("=" * 80) + logger.info("STEP 1: Introspecting NX Model") + logger.info("=" * 80) + + # Use NXParameterUpdater to read expressions + updater = NXParameterUpdater(prt_file_path=self.prt_file) + expressions = updater.get_all_expressions() + + logger.info(f"Found {len(expressions)} expressions in model:") + for name, info in expressions.items(): + logger.info(f" - {name}: {info.get('value')} ({info.get('formula', 'N/A')})") + + self.model_info = ModelIntrospection( + expressions=expressions, + prt_file=self.prt_file, + sim_file=self.sim_file + ) + + return self.model_info + + # ========================================================================= + # STEP 2: Baseline Simulation + # ========================================================================= + + def run_baseline_simulation(self) -> Path: + """ + Run baseline simulation with current expression values. + + This generates an OP2 file that we can introspect to see what + element types and results are actually present. + + Returns: + Path to generated OP2 file + """ + logger.info("=" * 80) + logger.info("STEP 2: Running Baseline Simulation") + logger.info("=" * 80) + logger.info("This generates OP2 file for introspection...") + + solver = NXSolver(nastran_version='2412', use_journal=True) + result = solver.run_simulation(self.sim_file) + + self.baseline_op2 = result['op2_file'] + logger.info(f"Baseline simulation complete!") + logger.info(f" OP2 file: {self.baseline_op2}") + + return self.baseline_op2 + + # ========================================================================= + # STEP 3: OP2 Introspection + # ========================================================================= + + def introspect_op2(self, op2_file: Optional[Path] = None) -> OP2Introspection: + """ + Introspect OP2 file to detect element types and available results. + + Args: + op2_file: Path to OP2 file (uses baseline if not provided) + + Returns: + OP2Introspection with detected contents + """ + logger.info("=" * 80) + logger.info("STEP 3: Introspecting OP2 File") + logger.info("=" * 80) + + if op2_file is None: + op2_file = self.baseline_op2 + + if op2_file is None: + raise ValueError("No OP2 file available. Run baseline simulation first.") + + # Use pyNastran to read OP2 and detect contents + from pyNastran.op2.op2 import OP2 + + model = OP2() + model.read_op2(str(op2_file)) + + # Detect element types with stress results + # In pyNastran, stress results are stored in model.op2_results.stress + element_types = [] + + # Dynamically discover ALL element types with stress data from pyNastran + # Instead of hardcoding, we introspect what pyNastran actually has! + if hasattr(model, 'op2_results') and hasattr(model.op2_results, 'stress'): + stress_obj = model.op2_results.stress + + # Find all attributes ending with '_stress' that have data + for attr_name in dir(stress_obj): + if attr_name.endswith('_stress') and not attr_name.startswith('_'): + # Check if this element type has data + element_data = getattr(stress_obj, attr_name, None) + if element_data: # Has data + # Convert attribute name to element type + # e.g., 'chexa_stress' -> 'CHEXA' + element_type = attr_name.replace('_stress', '').upper() + + # Handle special cases (composite elements) + if '_composite' not in attr_name: + element_types.append(element_type) + + # Also check for forces (stored differently in pyNastran) + # Bar/beam forces are at model level, not in stress object + if hasattr(model, 'cbar_force') and model.cbar_force: + element_types.append('CBAR') + if hasattr(model, 'cbeam_force') and model.cbeam_force: + element_types.append('CBEAM') + if hasattr(model, 'crod_force') and model.crod_force: + element_types.append('CROD') + + # Detect result types + result_types = [] + if hasattr(model, 'displacements') and model.displacements: + result_types.append('displacement') + if element_types: # Has stress + result_types.append('stress') + if hasattr(model, 'cbar_force') and model.cbar_force: + result_types.append('force') + + # Get subcases + subcases = [] + if hasattr(model, 'displacements') and model.displacements: + subcases = list(model.displacements.keys()) + + # Get counts + node_count = len(model.nodes) if hasattr(model, 'nodes') else 0 + element_count = len(model.elements) if hasattr(model, 'elements') else 0 + + logger.info(f"OP2 Introspection Results:") + logger.info(f" Element types with stress: {element_types}") + logger.info(f" Result types available: {result_types}") + logger.info(f" Subcases: {subcases}") + logger.info(f" Nodes: {node_count}") + logger.info(f" Elements: {element_count}") + + self.op2_info = OP2Introspection( + element_types=element_types, + result_types=result_types, + subcases=subcases, + node_count=node_count, + element_count=element_count, + op2_file=op2_file + ) + + return self.op2_info + + # ========================================================================= + # STEP 4: LLM-Guided Configuration + # ========================================================================= + + def suggest_configuration(self, user_goal: str) -> Dict[str, Any]: + """ + Use LLM to suggest configuration based on user goal and available data. + + This would analyze: + - User's natural language description + - Available expressions in model + - Available element types in OP2 + - Available result types in OP2 + + And propose a concrete configuration. + + Args: + user_goal: User's description of optimization goal + + Returns: + Suggested configuration dict + """ + logger.info("=" * 80) + logger.info("STEP 4: LLM-Guided Configuration") + logger.info("=" * 80) + logger.info(f"User goal: {user_goal}") + + # TODO: Implement LLM analysis + # For now, return a manual suggestion based on OP2 contents + + if self.op2_info is None: + raise ValueError("OP2 not introspected. Run introspect_op2() first.") + + # Suggest extractors based on available result types + engineering_features = [] + + if 'displacement' in self.op2_info.result_types: + engineering_features.append({ + 'action': 'extract_displacement', + 'domain': 'result_extraction', + 'description': 'Extract displacement results from OP2 file', + 'params': {'result_type': 'displacement'} + }) + + if 'stress' in self.op2_info.result_types and self.op2_info.element_types: + # Use first available element type + element_type = self.op2_info.element_types[0].lower() + engineering_features.append({ + 'action': 'extract_solid_stress', + 'domain': 'result_extraction', + 'description': f'Extract stress from {element_type.upper()} elements', + 'params': { + 'result_type': 'stress', + 'element_type': element_type + } + }) + + logger.info(f"Suggested configuration:") + logger.info(f" Engineering features: {len(engineering_features)}") + for feat in engineering_features: + logger.info(f" - {feat['action']}: {feat['description']}") + + return { + 'engineering_features': engineering_features, + 'inline_calculations': [], + 'post_processing_hooks': [] + } + + # ========================================================================= + # STEP 5: Pipeline Validation (Dry Run) + # ========================================================================= + + def validate_pipeline(self, llm_workflow: Dict[str, Any]) -> List[ValidationResult]: + """ + Validate complete pipeline with baseline OP2 file. + + This executes the entire extraction/calculation/hook pipeline + using the baseline OP2 to ensure everything works BEFORE + starting the optimization. + + Args: + llm_workflow: Complete LLM workflow configuration + + Returns: + List of ValidationResult objects + """ + logger.info("=" * 80) + logger.info("STEP 5: Pipeline Validation (Dry Run)") + logger.info("=" * 80) + + if self.baseline_op2 is None: + raise ValueError("No baseline OP2 file. Run baseline simulation first.") + + results = [] + + # Validate extractors + logger.info("\nValidating extractors...") + orchestrator = ExtractorOrchestrator( + extractors_dir=self.output_dir / "generated_extractors" + ) + + extractors = orchestrator.process_llm_workflow(llm_workflow) + extraction_results = {} + + for extractor in extractors: + try: + # Pass extractor params (like element_type) to execution + result = orchestrator.execute_extractor( + extractor.name, + self.baseline_op2, + subcase=1, + **extractor.params # Pass params from workflow (element_type, etc.) + ) + extraction_results.update(result) + + results.append(ValidationResult( + success=True, + component='extractor', + message=f"[OK] {extractor.name}: {list(result.keys())}", + data=result + )) + logger.info(f" [OK] {extractor.name}: {list(result.keys())}") + + except Exception as e: + results.append(ValidationResult( + success=False, + component='extractor', + message=f"[FAIL] {extractor.name}: {str(e)}", + data=None + )) + logger.error(f" [FAIL] {extractor.name}: {str(e)}") + + # Validate inline calculations + logger.info("\nValidating inline calculations...") + inline_generator = InlineCodeGenerator() + calculations = {} + calc_namespace = {**extraction_results, **calculations} + + for calc_spec in llm_workflow.get('inline_calculations', []): + try: + generated = inline_generator.generate_from_llm_output(calc_spec) + exec(generated.code, calc_namespace) + + # Extract newly created variables + for key, value in calc_namespace.items(): + if key not in extraction_results and not key.startswith('_'): + calculations[key] = value + + results.append(ValidationResult( + success=True, + component='calculation', + message=f"[OK] {calc_spec.get('action', 'calculation')}: Created {list(calculations.keys())}", + data=calculations + )) + logger.info(f" [OK] {calc_spec.get('action', 'calculation')}") + + except Exception as e: + results.append(ValidationResult( + success=False, + component='calculation', + message=f"[FAIL] {calc_spec.get('action', 'calculation')}: {str(e)}", + data=None + )) + logger.error(f" [FAIL] {calc_spec.get('action', 'calculation')}: {str(e)}") + + # Validate hooks + logger.info("\nValidating hooks...") + hook_manager = HookManager() + + # Load system hooks + system_hooks_dir = Path(__file__).parent / 'plugins' + if system_hooks_dir.exists(): + hook_manager.load_plugins_from_directory(system_hooks_dir) + + hook_results = hook_manager.execute_hooks('post_calculation', { + 'trial_number': 0, + 'design_variables': {}, + 'results': extraction_results, + 'calculations': calculations + }) + + if hook_results: + results.append(ValidationResult( + success=True, + component='hook', + message=f"[OK] Hooks executed: {len(hook_results)} results", + data={'hook_results': hook_results} + )) + logger.info(f" [OK] Executed {len(hook_results)} hook(s)") + + # Check for objective + logger.info("\nValidating objective...") + objective = None + + for hook_result in hook_results: + if hook_result and 'objective' in hook_result: + objective = hook_result['objective'] + break + + if objective is None: + # Try to find objective in calculations or results + for key in ['max_displacement', 'max_stress', 'max_von_mises']: + if key in {**extraction_results, **calculations}: + objective = {**extraction_results, **calculations}[key] + logger.warning(f" [WARNING] No explicit objective, using: {key}") + break + + if objective is not None: + results.append(ValidationResult( + success=True, + component='objective', + message=f"[OK] Objective value: {objective}", + data={'objective': objective} + )) + logger.info(f" [OK] Objective value: {objective}") + else: + results.append(ValidationResult( + success=False, + component='objective', + message="[FAIL] Could not determine objective value", + data=None + )) + logger.error(" [FAIL] Could not determine objective value") + + return results + + # ========================================================================= + # Complete Validation Workflow + # ========================================================================= + + def run_complete_validation(self, user_goal: str, llm_workflow: Optional[Dict[str, Any]] = None) -> Tuple[bool, List[ValidationResult]]: + """ + Run complete validation workflow from start to finish. + + Steps: + 1. Introspect model for expressions + 2. Run baseline simulation + 3. Introspect OP2 for contents + 4. Suggest/validate configuration + 5. Dry-run pipeline validation + + Args: + user_goal: User's description of optimization goal + llm_workflow: Optional pre-configured workflow (otherwise suggested) + + Returns: + Tuple of (success: bool, results: List[ValidationResult]) + """ + logger.info("=" * 80) + logger.info("OPTIMIZATION SETUP WIZARD - COMPLETE VALIDATION") + logger.info("=" * 80) + + # Step 1: Introspect model + self.introspect_model() + + # Step 2: Run baseline + self.run_baseline_simulation() + + # Step 3: Introspect OP2 + self.introspect_op2() + + # Step 4: Get configuration + if llm_workflow is None: + llm_workflow = self.suggest_configuration(user_goal) + + # Step 5: Validate pipeline + validation_results = self.validate_pipeline(llm_workflow) + + # Check if all validations passed + all_passed = all(r.success for r in validation_results) + + logger.info("=" * 80) + logger.info("VALIDATION SUMMARY") + logger.info("=" * 80) + + for result in validation_results: + logger.info(result.message) + + if all_passed: + logger.info("\n[OK] ALL VALIDATIONS PASSED - Ready for optimization!") + else: + logger.error("\n[FAIL] VALIDATION FAILED - Fix issues before optimization") + + return all_passed, validation_results + + +def main(): + """Test optimization setup wizard.""" + import sys + + print("=" * 80) + print("Phase 3.3: Optimization Setup Wizard Test") + print("=" * 80) + print() + + # Configuration + prt_file = Path("tests/Bracket.prt") + sim_file = Path("tests/Bracket_sim1.sim") + + if not prt_file.exists() or not sim_file.exists(): + print("ERROR: Test files not found") + sys.exit(1) + + # Initialize wizard + wizard = OptimizationSetupWizard(prt_file, sim_file) + + # Run complete validation + user_goal = "Maximize displacement while keeping stress below yield/4" + + success, results = wizard.run_complete_validation(user_goal) + + if success: + print("\n[OK] Pipeline validated! Ready to start optimization.") + else: + print("\n[FAIL] Validation failed. Review errors above.") + sys.exit(1) + + +if __name__ == '__main__': + main() diff --git a/optimization_engine/plugins/post_calculation/safety_factor_constraint.py b/optimization_engine/plugins/post_calculation/safety_factor_constraint.py new file mode 100644 index 00000000..d70e6972 --- /dev/null +++ b/optimization_engine/plugins/post_calculation/safety_factor_constraint.py @@ -0,0 +1,90 @@ +""" +Safety Factor Constraint Hook - Manual Implementation + +This hook enforces a minimum safety factor constraint on stress. +If safety_factor < minimum required, the objective is heavily penalized. + +Safety Factor = Yield Strength / Max Stress + +For Aluminum 6061-T6: +- Yield Strength: 276 MPa +- Required Safety Factor: 4.0 +- Allowable Stress: 69 MPa + +Author: Atomizer Development Team +Version: 1.0 +""" + +from optimization_engine.plugins.hooks import Hook, HookPoint + + +def safety_factor_constraint_hook(context: dict) -> dict: + """ + Enforce safety factor constraint on optimization. + + This hook checks if the calculated safety factor meets the minimum requirement. + If violated, it adds a large penalty to the objective to guide optimization + away from unsafe designs. + + Args: + context: Dict containing: + - calculations: Dict with 'safety_factor' value + - results: Dict with stress results + + Returns: + Dict with: + - safety_factor_satisfied: bool + - safety_factor_violation: float (0 if satisfied, penalty otherwise) + - constrained_objective: float (original or penalized objective) + """ + calculations = context.get('calculations', {}) + + # Get safety factor from calculations + safety_factor = calculations.get('safety_factor', 0.0) + + # Get objective (negative displacement to maximize) + neg_displacement = calculations.get('neg_displacement', 0.0) + + # Required minimum safety factor + min_safety_factor = 4.0 + + # Check constraint + satisfied = safety_factor >= min_safety_factor + + # Calculate violation (how much we're under the limit) + violation = max(0.0, min_safety_factor - safety_factor) + + # Apply penalty if constraint violated + if not satisfied: + # Heavy penalty: add large value to objective (we're minimizing) + # Penalty scales with violation severity + penalty = 1000.0 * violation + constrained_objective = neg_displacement + penalty + + print(f" [CONSTRAINT VIOLATED] Safety factor {safety_factor:.2f} < {min_safety_factor}") + print(f" [PENALTY APPLIED] Adding {penalty:.2f} to objective") + else: + constrained_objective = neg_displacement + print(f" [CONSTRAINT SATISFIED] Safety factor {safety_factor:.2f} >= {min_safety_factor}") + + return { + 'safety_factor_satisfied': satisfied, + 'safety_factor_violation': violation, + 'constrained_objective': constrained_objective, + 'objective': constrained_objective # This becomes the final objective + } + + +# Register hook with plugin system +hook = Hook( + name="safety_factor_constraint", + hook_point=HookPoint.POST_CALCULATION, + function=safety_factor_constraint_hook, + enabled=True, + description="Enforce minimum safety factor constraint with penalty" +) + + +def register_hooks(hook_manager): + """Register hooks with the plugin system.""" + return [hook] diff --git a/optimization_engine/pynastran_research_agent.py b/optimization_engine/pynastran_research_agent.py index f3c8319e..ce3ad7ae 100644 --- a/optimization_engine/pynastran_research_agent.py +++ b/optimization_engine/pynastran_research_agent.py @@ -118,15 +118,21 @@ class PyNastranResearchAgent: model.read_op2(str(op2_file)) # Get stress object for element type + # In pyNastran, stress is stored in model.op2_results.stress stress_attr = f"{element_type}_stress" - if not hasattr(model, stress_attr): + + if not hasattr(model, 'op2_results') or not hasattr(model.op2_results, 'stress'): + raise ValueError(f"No stress results in OP2") + + stress_obj = model.op2_results.stress + if not hasattr(stress_obj, stress_attr): raise ValueError(f"No {element_type} stress results in OP2") - stress = getattr(model, stress_attr)[subcase] + stress = getattr(stress_obj, stress_attr)[subcase] itime = 0 # Extract von Mises if available - if stress.is_von_mises(): + if stress.is_von_mises: # Property, not method von_mises = stress.data[itime, :, 9] # Column 9 is von Mises max_stress = float(np.max(von_mises)) diff --git a/optimization_validation/generated_extractors/extract_displacement.py b/optimization_validation/generated_extractors/extract_displacement.py new file mode 100644 index 00000000..3d0ec41a --- /dev/null +++ b/optimization_validation/generated_extractors/extract_displacement.py @@ -0,0 +1,56 @@ +""" +Extract displacement results from OP2 file +Auto-generated by Atomizer Phase 3 - pyNastran Research Agent + +Pattern: displacement +Element Type: General +Result Type: displacement +API: model.displacements[subcase] +""" + +from pathlib import Path +from typing import Dict, Any +import numpy as np +from pyNastran.op2.op2 import OP2 + + +def extract_displacement(op2_file: Path, subcase: int = 1): + """Extract displacement results from OP2 file.""" + from pyNastran.op2.op2 import OP2 + import numpy as np + + model = OP2() + model.read_op2(str(op2_file)) + + disp = model.displacements[subcase] + itime = 0 # static case + + # Extract translation components + txyz = disp.data[itime, :, :3] # [tx, ty, tz] + + # Calculate total displacement + total_disp = np.linalg.norm(txyz, axis=1) + max_disp = np.max(total_disp) + + # Get node info + node_ids = [nid for (nid, grid_type) in disp.node_gridtype] + max_disp_node = node_ids[np.argmax(total_disp)] + + return { + 'max_displacement': float(max_disp), + 'max_disp_node': int(max_disp_node), + 'max_disp_x': float(np.max(np.abs(txyz[:, 0]))), + 'max_disp_y': float(np.max(np.abs(txyz[:, 1]))), + 'max_disp_z': float(np.max(np.abs(txyz[:, 2]))) + } + + +if __name__ == '__main__': + # Example usage + import sys + if len(sys.argv) > 1: + op2_file = Path(sys.argv[1]) + result = extract_displacement(op2_file) + print(f"Extraction result: {result}") + else: + print("Usage: python {sys.argv[0]} ") diff --git a/optimization_validation/generated_extractors/extract_solid_stress.py b/optimization_validation/generated_extractors/extract_solid_stress.py new file mode 100644 index 00000000..a27d221b --- /dev/null +++ b/optimization_validation/generated_extractors/extract_solid_stress.py @@ -0,0 +1,64 @@ +""" +Extract von Mises stress from CHEXA elements +Auto-generated by Atomizer Phase 3 - pyNastran Research Agent + +Pattern: solid_stress +Element Type: CTETRA +Result Type: stress +API: model.ctetra_stress[subcase] or model.chexa_stress[subcase] +""" + +from pathlib import Path +from typing import Dict, Any +import numpy as np +from pyNastran.op2.op2 import OP2 + + +def extract_solid_stress(op2_file: Path, subcase: int = 1, element_type: str = 'ctetra'): + """Extract stress from solid elements.""" + from pyNastran.op2.op2 import OP2 + import numpy as np + + model = OP2() + model.read_op2(str(op2_file)) + + # Get stress object for element type + # In pyNastran, stress is stored in model.op2_results.stress + stress_attr = f"{element_type}_stress" + + if not hasattr(model, 'op2_results') or not hasattr(model.op2_results, 'stress'): + raise ValueError(f"No stress results in OP2") + + stress_obj = model.op2_results.stress + if not hasattr(stress_obj, stress_attr): + raise ValueError(f"No {element_type} stress results in OP2") + + stress = getattr(stress_obj, stress_attr)[subcase] + itime = 0 + + # Extract von Mises if available + if stress.is_von_mises: # Property, not method + von_mises = stress.data[itime, :, 9] # Column 9 is von Mises + max_stress = float(np.max(von_mises)) + + # Get element info + element_ids = [eid for (eid, node) in stress.element_node] + max_stress_elem = element_ids[np.argmax(von_mises)] + + return { + 'max_von_mises': max_stress, + 'max_stress_element': int(max_stress_elem) + } + else: + raise ValueError("von Mises stress not available") + + +if __name__ == '__main__': + # Example usage + import sys + if len(sys.argv) > 1: + op2_file = Path(sys.argv[1]) + result = extract_solid_stress(op2_file) + print(f"Extraction result: {result}") + else: + print("Usage: python {sys.argv[0]} ") diff --git a/studies/bracket_displacement_maximizing/README.md b/studies/bracket_displacement_maximizing/README.md new file mode 100644 index 00000000..71e16902 --- /dev/null +++ b/studies/bracket_displacement_maximizing/README.md @@ -0,0 +1,115 @@ +# Bracket Displacement Maximization Study + +**Study Name**: bracket_displacement_maximizing +**Created**: 2025-11-16 +**Phase**: 3.3 - Optimization Setup Wizard + +## Overview + +This study demonstrates the complete Phase 3.3 workflow for optimizing a bracket design to maximize displacement while maintaining structural safety. + +## Problem Statement + +**Objective**: Maximize the displacement of a bracket under load + +**Constraints**: +- Safety factor ≥ 4.0 +- Material: Aluminum 6061-T6 (Yield strength = 276 MPa) +- Allowable stress: 69 MPa (276/4) + +**Design Variables**: +- `tip_thickness`: 15-25 mm (baseline: 17 mm) +- `support_angle`: 20-40° (baseline: 38°) + +## Model Information + +- **Geometry**: Bracket part with tip and support features +- **Mesh**: 585 nodes, 316 elements (CHEXA, CPENTA) +- **Load**: Applied force at tip +- **Boundary Conditions**: Fixed support at base + +## Optimization Setup + +### Phase 3.3 Wizard Workflow + +1. **Model Introspection** - Read NX expressions from .prt file +2. **Baseline Simulation** - Run initial simulation to validate setup +3. **OP2 Introspection** - Auto-detect element types (CHEXA, CPENTA) +4. **Workflow Configuration** - Build LLM workflow with detected element types +5. **Pipeline Validation** - Dry-run test of all components +6. **Optimization** - Run 20-trial TPE optimization + +### Extractors + +- **Displacement**: Extract max displacement from OP2 file +- **Stress**: Extract von Mises stress from solid elements (auto-detected: CHEXA) + +### Calculations + +- **Safety Factor**: `SF = 276.0 / max_von_mises` +- **Objective**: `neg_displacement = -max_displacement` (minimize for maximization) + +### Constraints + +- **Safety Factor Hook**: Enforces SF ≥ 4.0 with penalty + +## Directory Structure + +``` +bracket_displacement_maximizing/ +├── model/ # NX model files (isolated from tests/) +│ ├── Bracket.prt # Part geometry +│ ├── Bracket_fem1.fem # FE model +│ └── Bracket_sim1.sim # Simulation setup +├── results/ # Optimization results +│ ├── optimization_history.json +│ ├── best_design.json +│ └── trial_*.op2 # OP2 files for each trial +├── config/ # Study configuration +│ └── study_config.json # Complete study setup +├── run_optimization.py # Main optimization script +├── optimization_log.txt # Execution log +└── README.md # This file +``` + +## Running the Study + +```bash +cd studies/bracket_displacement_maximizing +python run_optimization.py +``` + +The script will: +1. Initialize the Phase 3.3 wizard +2. Validate the complete pipeline +3. Run 20 optimization trials +4. Save results to `results/` directory +5. Generate comprehensive report + +## Results + +Results are saved in the `results/` directory: +- **optimization_history.json**: Complete trial history +- **best_design.json**: Best design parameters and performance +- **optimization_report.md**: Human-readable summary + +## Key Features Demonstrated + +✅ **Phase 3.3 Wizard** - Automated validation before optimization +✅ **Dynamic Element Detection** - Auto-detects all element types from OP2 +✅ **Self-Contained Study** - Isolated model files prevent conflicts +✅ **Complete Logging** - Full execution trace for debugging +✅ **Reproducible** - Configuration files enable exact reproduction + +## Notes + +- All simulations run in the `model/` directory to isolate from test files +- OP2 files are regenerated for each trial (no caching issues) +- Study can be re-run without affecting other tests or studies +- Configuration is fully documented in `config/study_config.json` + +## References + +- [Phase 3.3 Wizard Documentation](../../docs/PHASE_3_3_WIZARD.md) +- [Hook Architecture](../../docs/HOOK_ARCHITECTURE.md) +- [LLM Integration](../../docs/PHASE_2_7_LLM_INTEGRATION.md) diff --git a/studies/bracket_displacement_maximizing/SUBSTUDIES_README.md b/studies/bracket_displacement_maximizing/SUBSTUDIES_README.md new file mode 100644 index 00000000..8d99092c --- /dev/null +++ b/studies/bracket_displacement_maximizing/SUBSTUDIES_README.md @@ -0,0 +1,205 @@ +# Substudy System + +The substudy system allows you to organize multiple optimization runs that share the same model files but have different configurations, like NX Solutions with subcases. + +## Directory Structure + +``` +bracket_displacement_maximizing/ +├── model/ # Shared model files +│ ├── Bracket.prt # Part file (shared) +│ ├── Bracket_fem1.fem # FEM file (shared) +│ └── Bracket_sim1.sim # Simulation file (shared) +├── config/ +│ └── substudy_template.json # Template for new substudies +├── substudies/ # Independent substudy results +│ ├── coarse_exploration/ # Example: fast exploration +│ │ ├── config.json +│ │ ├── optimization_history.json +│ │ ├── optimization_history_incremental.json # Live updates! +│ │ ├── best_design.json +│ │ └── report.md +│ └── fine_tuning/ # Example: refined optimization +│ ├── config.json +│ └── ... +├── run_substudy.py # Substudy runner +└── run_optimization.py # Original standalone runner +``` + +## Key Concepts + +### Shared Model Files +All substudies use the **same** model files from `model/` directory: +- `Bracket.prt` - Updated with design variables during optimization +- `Bracket_fem1.fem` - Automatically updated when geometry changes +- `Bracket_sim1.sim` - Simulation definition + +This is like NX where different Subcases share the same model. + +### Independent Substudy Configurations +Each substudy has its own: +- Parameter bounds (coarse vs. fine) +- Number of trials +- Algorithm settings +- Results directory + +### Continuation Support +Substudies can continue from previous runs: +- Start from best design of previous substudy +- Refine search in narrower bounds +- Build on previous work incrementally + +### Live History Tracking +Each substudy automatically saves incremental history: +- `optimization_history_incremental.json` updates after each trial +- Monitor progress in real-time +- No need to query Optuna database + +## Usage + +### 1. Create a New Substudy + +Copy the template and customize: + +```bash +# Create new substudy directory +mkdir substudies/my_substudy_name + +# Copy template +cp config/substudy_template.json substudies/my_substudy_name/config.json + +# Edit config.json with your parameters +``` + +### 2. Configure the Substudy + +Edit `substudies/my_substudy_name/config.json`: + +```json +{ + "substudy_name": "my_substudy_name", + "description": "What this substudy investigates", + "parent_study": "bracket_displacement_maximizing", + + "optimization": { + "algorithm": "TPE", + "direction": "minimize", + "n_trials": 20, + "design_variables": [ + { + "parameter": "tip_thickness", + "min": 15.0, + "max": 25.0, + "units": "mm" + }, + { + "parameter": "support_angle", + "min": 20.0, + "max": 40.0, + "units": "degrees" + } + ] + }, + + "continuation": { + "enabled": false + } +} +``` + +**IMPORTANT**: Use `"parameter"` not `"name"` for design variables! + +### 3. Run the Substudy + +```bash +cd studies/bracket_displacement_maximizing +python run_substudy.py my_substudy_name +``` + +### 4. Monitor Progress + +Watch the live history file update in real-time: + +```bash +# In another terminal +watch -n 5 cat substudies/my_substudy_name/optimization_history_incremental.json +``` + +### 5. Continuing from Previous Substudy + +To refine results from a previous substudy: + +```json +{ + "substudy_name": "refined_search", + "optimization": { + "design_variables": [ + { + "parameter": "tip_thickness", + "min": 18.0, // Narrower bounds + "max": 22.0, + "units": "mm" + } + ] + }, + + "continuation": { + "enabled": true, + "from_substudy": "my_substudy_name", + "inherit_best_params": true // Start from best design + } +} +``` + +## Example Workflows + +### Workflow 1: Coarse-to-Fine Optimization + +1. **Coarse Exploration** (20 trials, wide bounds) + - Fast exploration of entire design space + - Identify promising regions + +2. **Fine Tuning** (50 trials, narrow bounds) + - Continue from best coarse design + - Refine solution in narrow bounds + +### Workflow 2: Algorithm Comparison + +1. **TPE Optimization** (substudy with TPE algorithm) +2. **NSGAII Optimization** (substudy with genetic algorithm) +3. Compare results across different algorithms + +### Workflow 3: Incremental Study Extension + +1. Run initial 20-trial substudy +2. Analyze results +3. Create continuation substudy for 30 more trials +4. Keep building on previous work + +## Files Generated per Substudy + +After running a substudy, you'll find: + +- `optimization_history.json` - Complete trial history +- `optimization_history_incremental.json` - Live-updating history +- `best_design.json` - Best parameters and performance +- `report.md` - Human-readable markdown report +- `optuna_study.db` - Optuna database (in output_dir) + +## Tips + +1. **Name substudies descriptively**: `coarse_20trials`, `fine_50trials_narrow_bounds` +2. **Use continuation wisely**: Continue from coarse to fine, not vice versa +3. **Monitor live history**: Use it to catch issues early +4. **Keep model files clean**: The shared model in `model/` is modified during optimization +5. **Back up good results**: Copy substudy directories before running new ones + +## Comparison with NX + +| NX Concept | Substudy Equivalent | +|------------|-------------------| +| Solution | Study (bracket_displacement_maximizing) | +| Subcase | Substudy (coarse_exploration) | +| Shared model | model/ directory | +| Subcase parameters | config.json | +| Subcase results | substudy directory | diff --git a/studies/bracket_displacement_maximizing/config/study_config.json b/studies/bracket_displacement_maximizing/config/study_config.json new file mode 100644 index 00000000..957685f4 --- /dev/null +++ b/studies/bracket_displacement_maximizing/config/study_config.json @@ -0,0 +1,81 @@ +{ + "study_name": "bracket_displacement_maximizing", + "study_description": "Maximize displacement of bracket under load while maintaining safety factor >= 4.0", + "created_date": "2025-11-16", + "model": { + "part_file": "model/Bracket.prt", + "fem_file": "model/Bracket_fem1.fem", + "sim_file": "model/Bracket_sim1.sim", + "element_types": ["CHEXA", "CPENTA"], + "nodes": 585, + "elements": 316 + }, + "optimization": { + "objective": "Maximize displacement (minimize negative displacement)", + "direction": "minimize", + "algorithm": "TPE", + "n_trials": 20, + "design_variables": [ + { + "name": "tip_thickness", + "type": "continuous", + "min": 15.0, + "max": 25.0, + "units": "mm", + "baseline": 17.0 + }, + { + "name": "support_angle", + "type": "continuous", + "min": 20.0, + "max": 40.0, + "units": "degrees", + "baseline": 38.0 + } + ], + "constraints": [ + { + "name": "safety_factor", + "type": ">=", + "value": 4.0, + "description": "Minimum safety factor constraint" + } + ] + }, + "material": { + "name": "Aluminum 6061-T6", + "yield_strength": 276.0, + "yield_strength_units": "MPa", + "allowable_stress": 69.0, + "allowable_stress_units": "MPa" + }, + "workflow": { + "phase": "3.3", + "wizard_validation": true, + "auto_element_detection": true, + "extractors": [ + { + "action": "extract_displacement", + "result_type": "displacement" + }, + { + "action": "extract_solid_stress", + "result_type": "stress", + "element_type": "auto-detected" + } + ], + "inline_calculations": [ + { + "action": "calculate_safety_factor", + "formula": "276.0 / max_von_mises" + }, + { + "action": "negate_displacement", + "formula": "-max_displacement" + } + ], + "hooks": [ + "safety_factor_constraint" + ] + } +} diff --git a/studies/bracket_displacement_maximizing/config/substudy_template.json b/studies/bracket_displacement_maximizing/config/substudy_template.json new file mode 100644 index 00000000..3274a34f --- /dev/null +++ b/studies/bracket_displacement_maximizing/config/substudy_template.json @@ -0,0 +1,44 @@ +{ + "substudy_name": "coarse_exploration", + "description": "Fast coarse exploration with wide parameter bounds", + "parent_study": "bracket_displacement_maximizing", + "created_date": "2025-11-16", + + "optimization": { + "algorithm": "TPE", + "direction": "minimize", + "n_trials": 20, + "n_startup_trials": 10, + "design_variables": [ + { + "parameter": "tip_thickness", + "type": "continuous", + "min": 15.0, + "max": 25.0, + "units": "mm" + }, + { + "parameter": "support_angle", + "type": "continuous", + "min": 20.0, + "max": 40.0, + "units": "degrees" + } + ] + }, + + "continuation": { + "enabled": false, + "from_substudy": null, + "resume_from_trial": null, + "inherit_best_params": false + }, + + "solver": { + "nastran_version": "2412", + "use_journal": true, + "timeout": 300 + }, + + "notes": "Template for creating new substudies" +} diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt b/studies/bracket_displacement_maximizing/model/Bracket.prt new file mode 100644 index 00000000..939c3513 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_205333 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_205333 new file mode 100644 index 00000000..32abb347 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_205333 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_205338 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_205338 new file mode 100644 index 00000000..9e7c3e79 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_205338 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210337 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210337 new file mode 100644 index 00000000..a01e9de2 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210337 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210342 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210342 new file mode 100644 index 00000000..e5a0d1f9 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210342 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210346 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210346 new file mode 100644 index 00000000..3b784b62 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210346 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210351 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210351 new file mode 100644 index 00000000..a25338df Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210351 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210355 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210355 new file mode 100644 index 00000000..f9acef09 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210355 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210359 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210359 new file mode 100644 index 00000000..415bf099 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210359 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210403 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210403 new file mode 100644 index 00000000..453152df Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210403 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210408 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210408 new file mode 100644 index 00000000..ee1f3c64 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210408 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210412 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210412 new file mode 100644 index 00000000..8e17ea28 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210412 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210416 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210416 new file mode 100644 index 00000000..0f64dd4c Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210416 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210420 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210420 new file mode 100644 index 00000000..b5fdb8c8 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210420 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210425 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210425 new file mode 100644 index 00000000..93dfaf20 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210425 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210429 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210429 new file mode 100644 index 00000000..8cd2fd74 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210429 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210433 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210433 new file mode 100644 index 00000000..ab83dfdb Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210433 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210438 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210438 new file mode 100644 index 00000000..9829ea93 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210438 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210442 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210442 new file mode 100644 index 00000000..3db27656 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210442 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210446 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210446 new file mode 100644 index 00000000..bb21a939 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210446 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210450 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210450 new file mode 100644 index 00000000..82091dc6 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210450 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210455 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210455 new file mode 100644 index 00000000..9e4049f5 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210455 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210459 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210459 new file mode 100644 index 00000000..ef0dda83 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210459 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210856 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210856 new file mode 100644 index 00000000..93dfaf20 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210856 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210903 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210903 new file mode 100644 index 00000000..8673c158 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_210903 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_211952 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_211952 new file mode 100644 index 00000000..3be16482 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_211952 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_211958 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_211958 new file mode 100644 index 00000000..3bffc955 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_211958 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212003 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212003 new file mode 100644 index 00000000..ee79f452 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212003 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212008 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212008 new file mode 100644 index 00000000..c1323b3d Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212008 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212013 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212013 new file mode 100644 index 00000000..6ba50846 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212013 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212019 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212019 new file mode 100644 index 00000000..129353ae Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212019 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212024 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212024 new file mode 100644 index 00000000..a7e68871 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212024 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212029 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212029 new file mode 100644 index 00000000..954d66ea Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212029 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212034 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212034 new file mode 100644 index 00000000..6d0a9183 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212034 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212040 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212040 new file mode 100644 index 00000000..931412fd Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212040 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212045 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212045 new file mode 100644 index 00000000..5029f695 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212045 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212050 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212050 new file mode 100644 index 00000000..38dbf887 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212050 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212055 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212055 new file mode 100644 index 00000000..4e472c31 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212055 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212101 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212101 new file mode 100644 index 00000000..9e94f273 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212101 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212106 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212106 new file mode 100644 index 00000000..2e12d8e9 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212106 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212111 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212111 new file mode 100644 index 00000000..6dbe1390 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212111 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212116 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212116 new file mode 100644 index 00000000..c2ea79cb Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212116 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212122 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212122 new file mode 100644 index 00000000..6d591005 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212122 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212127 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212127 new file mode 100644 index 00000000..1fc17fb8 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212127 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212132 b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212132 new file mode 100644 index 00000000..f6e4c995 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket.prt.bak_20251116_212132 differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket_fem1.fem b/studies/bracket_displacement_maximizing/model/Bracket_fem1.fem new file mode 100644 index 00000000..e6c1a51e Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket_fem1.fem differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket_fem1_i.prt b/studies/bracket_displacement_maximizing/model/Bracket_fem1_i.prt new file mode 100644 index 00000000..eab4bb4b Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket_fem1_i.prt differ diff --git a/studies/bracket_displacement_maximizing/model/Bracket_sim1.sim b/studies/bracket_displacement_maximizing/model/Bracket_sim1.sim new file mode 100644 index 00000000..778e7258 Binary files /dev/null and b/studies/bracket_displacement_maximizing/model/Bracket_sim1.sim differ diff --git a/studies/bracket_displacement_maximizing/optimization_log.txt b/studies/bracket_displacement_maximizing/optimization_log.txt new file mode 100644 index 00000000..69b1c143 --- /dev/null +++ b/studies/bracket_displacement_maximizing/optimization_log.txt @@ -0,0 +1,1035 @@ +fatal: not a git repository (or any of the parent directories): .git + +================================================================================ + BRACKET DISPLACEMENT MAXIMIZATION STUDY +================================================================================ + +Study Configuration: + - Objective: Maximize displacement + - Constraint: Safety factor >= 4.0 + - Material: Aluminum 6061-T6 (Yield = 276 MPa) + - Design Variables: + * tip_thickness: 15-25 mm + * support_angle: 20-40 degrees + - Optimization trials: 20 + +Part file: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt +Simulation file: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim +Study directory: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing + + +================================================================================ + STEP 1: INITIALIZATION +================================================================================ + +Initializing Optimization Setup Wizard... + [OK] Wizard initialized + + +================================================================================ + STEP 2: MODEL INTROSPECTION +================================================================================ + +Reading NX model expressions... +Found 4 expressions: + - support_angle: 28.0 degrees + - tip_thickness: 21.0 mm + - p3: 10.0 mm + - support_blend_radius: 10.0 mm + + +================================================================================ + STEP 3: BASELINE SIMULATION +================================================================================ + +Running baseline simulation to generate reference OP2... +(This validates that NX simulation works before optimization) + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 20:53:31 *** + Starting Nastran Exporter + + *** 20:53:31 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 20:53:31 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 20:53:31 *** + Writing Nastran System section + + *** 20:53:31 *** + Writing File Management section + + *** 20:53:31 *** + Writing Executive Control section + + *** 20:53:31 *** + Writing Case Control section + + *** 20:53:31 *** + Writing Bulk Data section + + *** 20:53:31 *** + Writing Nodes + + *** 20:53:31 *** + Writing Elements + + *** 20:53:31 *** + Writing Physical Properties + + *** 20:53:31 *** + Writing Materials + + *** 20:53:31 *** + Writing Degree-of-Freedom Sets + + *** 20:53:31 *** + Writing Loads and Constraints + + *** 20:53:31 *** + Writing Coordinate Systems + + *** 20:53:31 *** + Validating Solution Setup + + *** 20:53:31 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 20:53:31 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1799017866 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -1956117952 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Output files detected after 0.0s +[NX SOLVER] Complete in 4.3s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 + [OK] Baseline OP2: bracket_sim1-solution_1.op2 + + +================================================================================ + STEP 4: OP2 INTROSPECTION +================================================================================ + +Analyzing OP2 file to auto-detect element types... +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +OP2 Contents: + - Element types with stress: CHEXA, CPENTA + - Available result types: displacement, stress + - Subcases: [1] + - Nodes: 0 + - Elements: 0 + + +================================================================================ + STEP 5: WORKFLOW CONFIGURATION +================================================================================ + +Building LLM workflow with auto-detected element types... + Using detected element type: CHEXA + + +================================================================================ + STEP 6: PIPELINE VALIDATION +================================================================================ + +Validating complete pipeline with baseline OP2... +(Dry-run test of extractors, calculations, hooks, objective) + +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress + [WARNING] No explicit objective, using: max_displacement +[I 2025-11-16 20:53:33,716] A new study created in RDB with name: bracket_displacement_maximizing +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +Validation Results: + [OK] extractor: ['max_displacement', 'max_disp_node', 'max_disp_x', 'max_disp_y', 'max_disp_z'] + [OK] extractor: ['max_von_mises', 'max_stress_element'] + [OK] calculation: Created ['safety_factor'] + [OK] calculation: Created ['safety_factor', 'neg_displacement'] + [OK] hook: 3 results + [OK] objective: 0.36178338527679443 + +[SUCCESS] All pipeline components validated! + + +================================================================================ + STEP 7: OPTIMIZATION SETUP +================================================================================ + +Creating model updater and simulation runner... + [OK] Model updater ready + [OK] Simulation runner ready + +Initializing LLM optimization runner... + [OK] Output directory: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\results + [OK] Extractors generated: 2 + [OK] Inline calculations: 2 + [OK] Hooks loaded: 9 + + +================================================================================ + STEP 8: RUNNING OPTIMIZATION +================================================================================ + +Starting 20-trial optimization... +(This will take several minutes) + + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 21 -> 18 +Updated: support_angle = 28 -> 35 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_205333 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Deleted 3 old result file(s) to force fresh solve +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 20:53:37 *** + Starting Nastran Exporter + + *** 20:53:37 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 20:53:37 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 20:53:37 *** + Writing Nastran System section + + *** 20:53:37 *** + Writing File Management section + + *** 20:53:37 *** + Writing Executive Control section + + *** 20:53:37 *** + Writing Case Control section + + *** 20:53:37 *** + Writing Bulk Data section + + *** 20:53:37 *** + Writing Nodes + + *** 20:53:37 *** + Writing Elements + + *** 20:53:37 *** + Writing Physical Properties + + *** 20:53:37 *** + Writing Materials + + *** 20:53:37 *** + Writing Degree-of-Freedom Sets + + *** 20:53:37 *** + Writing Loads and Constraints + + *** 20:53:37 *** + Writing Coordinate Systems + + *** 20:53:37 *** + Validating Solution Setup + + *** 20:53:37 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 20:53:37 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1879102858 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -201784768 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Output files detected after 0.0s +[NX SOLVER] Complete in 4.5s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 20:53:38,410] Trial 0 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 18.62158638569138, 'support_angle': 35.6600382365223}. Best is trial 0 with value: 0.36178338527679443. +Extraction failed: extract_displacement - There was a Nastran FATAL Error. Check the F06. +last table=b'OES1'; post=-1 version='nx' +Extraction failed for extract_displacement: There was a Nastran FATAL Error. Check the F06. +last table=b'OES1'; post=-1 version='nx' +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 18 -> 16 +Updated: support_angle = 35 -> 23 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_205338 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Warning: Could not delete bracket_sim1-solution_1.log: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.log' + Deleted 2 old result file(s) to force fresh solve +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 20:53:41 *** + Starting Nastran Exporter + + *** 20:53:41 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 20:53:41 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 20:53:41 *** + Writing Nastran System section + + *** 20:53:41 *** + Writing File Management section + + *** 20:53:41 *** + Writing Executive Control section + + *** 20:53:41 *** + Writing Case Control section + + *** 20:53:41 *** + Writing Bulk Data section + + *** 20:53:41 *** + Writing Nodes + + *** 20:53:41 *** + Writing Elements + + *** 20:53:41 *** + Writing Physical Properties + + *** 20:53:41 *** + Writing Materials + + *** 20:53:41 *** + Writing Degree-of-Freedom Sets + + *** 20:53:41 *** + Writing Loads and Constraints + + *** 20:53:41 *** + Writing Coordinate Systems + + *** 20:53:41 *** + Validating Solution Setup + + *** 20:53:41 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 20:53:41 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1879102858 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -1429863872 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Output files detected after 0.0s +[NX SOLVER] Complete in 4.0s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 + +ndata = 0: + strings = (b'',) + ints = () + floats = () + +ERROR: op2_reader.py:2988 finished table_name = b'OES1' +ERROR: op2_reader.py:2993 There was a Nastran FATAL Error. Check the F06. +last table=b'OES1'; post=-1 version='nx' +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Inline calculation failed: name 'max_displacement' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +[W 2025-11-16 20:53:42,589] Trial 1 failed with parameters: {'tip_thickness': 16.861409202982674, 'support_angle': 23.878854189772426} because of the following error: ValueError('Could not determine objective value from results/calculations/hooks'). +Traceback (most recent call last): + File "C:\Users\antoi\anaconda3\envs\test_env\Lib\site-packages\optuna\study\_optimize.py", line 201, in _run_trial + value_or_values = func(trial) + ^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\llm_optimization_runner.py", line 328, in _objective + raise ValueError("Could not determine objective value from results/calculations/hooks") +ValueError: Could not determine objective value from results/calculations/hooks +[W 2025-11-16 20:53:42,590] Trial 1 failed with value None. +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\run_optimization.py", line 369, in + main() + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\run_optimization.py", line 323, in main + results = runner.run_optimization(n_trials=20) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\llm_optimization_runner.py", line 368, in run_optimization + self.study.optimize(self._objective, n_trials=n_trials) + File "C:\Users\antoi\anaconda3\envs\test_env\Lib\site-packages\optuna\study\study.py", line 490, in optimize + _optimize( + File "C:\Users\antoi\anaconda3\envs\test_env\Lib\site-packages\optuna\study\_optimize.py", line 63, in _optimize + _optimize_sequential( + File "C:\Users\antoi\anaconda3\envs\test_env\Lib\site-packages\optuna\study\_optimize.py", line 160, in _optimize_sequential + frozen_trial_id = _run_trial(study, func, catch) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\anaconda3\envs\test_env\Lib\site-packages\optuna\study\_optimize.py", line 258, in _run_trial + raise func_err + File "C:\Users\antoi\anaconda3\envs\test_env\Lib\site-packages\optuna\study\_optimize.py", line 201, in _run_trial + value_or_values = func(trial) + ^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\llm_optimization_runner.py", line 328, in _objective + raise ValueError("Could not determine objective value from results/calculations/hooks") +ValueError: Could not determine objective value from results/calculations/hooks diff --git a/studies/bracket_displacement_maximizing/optimization_log_new.txt b/studies/bracket_displacement_maximizing/optimization_log_new.txt new file mode 100644 index 00000000..02b37411 --- /dev/null +++ b/studies/bracket_displacement_maximizing/optimization_log_new.txt @@ -0,0 +1,6275 @@ +fatal: not a git repository (or any of the parent directories): .git + +================================================================================ + BRACKET DISPLACEMENT MAXIMIZATION STUDY +================================================================================ + +Study Configuration: + - Objective: Maximize displacement + - Constraint: Safety factor >= 4.0 + - Material: Aluminum 6061-T6 (Yield = 276 MPa) + - Design Variables: + * tip_thickness: 15-25 mm + * support_angle: 20-40 degrees + - Optimization trials: 20 + +Part file: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt +Simulation file: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim +Study directory: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing + + +================================================================================ + STEP 1: INITIALIZATION +================================================================================ + +Initializing Optimization Setup Wizard... + [OK] Wizard initialized + + +================================================================================ + STEP 2: MODEL INTROSPECTION +================================================================================ + +Reading NX model expressions... +Found 4 expressions: + - support_angle: 23.0 degrees + - tip_thickness: 16.0 mm + - p3: 10.0 mm + - support_blend_radius: 10.0 mm + + +================================================================================ + STEP 3: BASELINE SIMULATION +================================================================================ + +Running baseline simulation to generate reference OP2... +(This validates that NX simulation works before optimization) + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:02:40 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:03:35 *** + Starting Nastran Exporter + + *** 21:03:35 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:03:35 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:03:35 *** + Writing Nastran System section + + *** 21:03:35 *** + Writing File Management section + + *** 21:03:35 *** + Writing Executive Control section + + *** 21:03:35 *** + Writing Case Control section + + *** 21:03:35 *** + Writing Bulk Data section + + *** 21:03:35 *** + Writing Nodes + + *** 21:03:35 *** + Writing Elements + + *** 21:03:35 *** + Writing Physical Properties + + *** 21:03:35 *** + Writing Materials + + *** 21:03:35 *** + Writing Degree-of-Freedom Sets + + *** 21:03:35 *** + Writing Loads and Constraints + + *** 21:03:35 *** + Writing Coordinate Systems + + *** 21:03:35 *** + Validating Solution Setup + + *** 21:03:35 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:03:35 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1795872138 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: 792592960 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:02:40 2025 -> Sun Nov 16 21:03:36 2025 +[NX SOLVER] Complete in 4.1s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 + [OK] Baseline OP2: bracket_sim1-solution_1.op2 + + +================================================================================ + STEP 4: OP2 INTROSPECTION +================================================================================ + +Analyzing OP2 file to auto-detect element types... +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +OP2 Contents: + - Element types with stress: CHEXA, CPENTA + - Available result types: displacement, stress + - Subcases: [1] + - Nodes: 0 + - Elements: 0 + + +================================================================================ + STEP 5: WORKFLOW CONFIGURATION +================================================================================ + +Building LLM workflow with auto-detected element types... + Using detected element type: CHEXA + + +================================================================================ + STEP 6: PIPELINE VALIDATION +================================================================================ + +Validating complete pipeline with baseline OP2... +(Dry-run test of extractors, calculations, hooks, objective) + +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress + [WARNING] No explicit objective, using: max_displacement +[I 2025-11-16 21:03:37,585] Using an existing study with name 'bracket_displacement_maximizing' instead of creating a new one. +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +Validation Results: + [OK] extractor: ['max_displacement', 'max_disp_node', 'max_disp_x', 'max_disp_y', 'max_disp_z'] + [OK] extractor: ['max_von_mises', 'max_stress_element'] + [OK] calculation: Created ['safety_factor'] + [OK] calculation: Created ['safety_factor', 'neg_displacement'] + [OK] hook: 3 results + [OK] objective: 0.36178338527679443 + +[SUCCESS] All pipeline components validated! + + +================================================================================ + STEP 7: OPTIMIZATION SETUP +================================================================================ + +Creating model updater and simulation runner... + [OK] Model updater ready + [OK] Simulation runner ready + +Initializing LLM optimization runner... + [OK] Output directory: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\results + [OK] Extractors generated: 2 + [OK] Inline calculations: 2 + [OK] Hooks loaded: 9 + + +================================================================================ + STEP 8: RUNNING OPTIMIZATION +================================================================================ + +Starting 20-trial optimization... +(This will take several minutes) + + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 16 -> 16 +Updated: support_angle = 23 -> 30 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210337 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:03:36 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:03:40 *** + Starting Nastran Exporter + + *** 21:03:40 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:03:40 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:03:40 *** + Writing Nastran System section + + *** 21:03:40 *** + Writing File Management section + + *** 21:03:40 *** + Writing Executive Control section + + *** 21:03:40 *** + Writing Case Control section + + *** 21:03:40 *** + Writing Bulk Data section + + *** 21:03:40 *** + Writing Nodes + + *** 21:03:40 *** + Writing Elements + + *** 21:03:40 *** + Writing Physical Properties + + *** 21:03:40 *** + Writing Materials + + *** 21:03:40 *** + Writing Degree-of-Freedom Sets + + *** 21:03:40 *** + Writing Loads and Constraints + + *** 21:03:40 *** + Writing Coordinate Systems + + *** 21:03:40 *** + Validating Solution Setup + + *** 21:03:40 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:03:40 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875957130 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -212073920 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:03:36 2025 -> Sun Nov 16 21:03:41 2025 +[NX SOLVER] Complete in 4.3s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:03:42,101] Trial 2 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 16.340803300010094, 'support_angle': 30.818909896109847}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 16 -> 18 +Updated: support_angle = 30 -> 28 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210342 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:03:41 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:03:45 *** + Starting Nastran Exporter + + *** 21:03:45 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:03:45 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:03:45 *** + Writing Nastran System section + + *** 21:03:45 *** + Writing File Management section + + *** 21:03:45 *** + Writing Executive Control section + + *** 21:03:45 *** + Writing Case Control section + + *** 21:03:45 *** + Writing Bulk Data section + + *** 21:03:45 *** + Writing Nodes + + *** 21:03:45 *** + Writing Elements + + *** 21:03:45 *** + Writing Physical Properties + + *** 21:03:45 *** + Writing Materials + + *** 21:03:45 *** + Writing Degree-of-Freedom Sets + + *** 21:03:45 *** + Writing Loads and Constraints + + *** 21:03:45 *** + Writing Coordinate Systems + + *** 21:03:45 *** + Validating Solution Setup + + *** 21:03:45 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:03:45 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875957130 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: 404357696 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:03:41 2025 -> Sun Nov 16 21:03:46 2025 +[NX SOLVER] Complete in 4.4s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:03:46,607] Trial 3 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 18.105380892934622, 'support_angle': 28.298283536798394}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 18 -> 17 +Updated: support_angle = 28 -> 32 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210346 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:03:46 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:03:49 *** + Starting Nastran Exporter + + *** 21:03:49 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:03:49 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:03:49 *** + Writing Nastran System section + + *** 21:03:49 *** + Writing File Management section + + *** 21:03:49 *** + Writing Executive Control section + + *** 21:03:49 *** + Writing Case Control section + + *** 21:03:49 *** + Writing Bulk Data section + + *** 21:03:49 *** + Writing Nodes + + *** 21:03:49 *** + Writing Elements + + *** 21:03:49 *** + Writing Physical Properties + + *** 21:03:49 *** + Writing Materials + + *** 21:03:49 *** + Writing Degree-of-Freedom Sets + + *** 21:03:49 *** + Writing Loads and Constraints + + *** 21:03:49 *** + Writing Coordinate Systems + + *** 21:03:49 *** + Validating Solution Setup + + *** 21:03:49 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:03:49 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875957130 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: 863961664 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:03:46 2025 -> Sun Nov 16 21:03:50 2025 +[NX SOLVER] Complete in 4.3s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:03:51,010] Trial 4 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 17.721287462514425, 'support_angle': 32.388109319134045}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 17 -> 22 +Updated: support_angle = 32 -> 22 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210351 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:03:50 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:03:54 *** + Starting Nastran Exporter + + *** 21:03:54 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:03:54 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:03:54 *** + Writing Nastran System section + + *** 21:03:54 *** + Writing File Management section + + *** 21:03:54 *** + Writing Executive Control section + + *** 21:03:54 *** + Writing Case Control section + + *** 21:03:54 *** + Writing Bulk Data section + + *** 21:03:54 *** + Writing Nodes + + *** 21:03:54 *** + Writing Elements + + *** 21:03:54 *** + Writing Physical Properties + + *** 21:03:54 *** + Writing Materials + + *** 21:03:54 *** + Writing Degree-of-Freedom Sets + + *** 21:03:54 *** + Writing Loads and Constraints + + *** 21:03:54 *** + Writing Coordinate Systems + + *** 21:03:54 *** + Validating Solution Setup + + *** 21:03:54 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:03:54 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875957130 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: 1027015232 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:03:50 2025 -> Sun Nov 16 21:03:55 2025 +[NX SOLVER] Complete in 4.1s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:03:55,235] Trial 5 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 22.910324196496077, 'support_angle': 22.589443923024472}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 22 -> 16 +Updated: support_angle = 22 -> 36 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210355 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:03:55 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:03:58 *** + Starting Nastran Exporter + + *** 21:03:58 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:03:58 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:03:58 *** + Writing Nastran System section + + *** 21:03:58 *** + Writing File Management section + + *** 21:03:58 *** + Writing Executive Control section + + *** 21:03:58 *** + Writing Case Control section + + *** 21:03:58 *** + Writing Bulk Data section + + *** 21:03:58 *** + Writing Nodes + + *** 21:03:58 *** + Writing Elements + + *** 21:03:58 *** + Writing Physical Properties + + *** 21:03:58 *** + Writing Materials + + *** 21:03:58 *** + Writing Degree-of-Freedom Sets + + *** 21:03:58 *** + Writing Loads and Constraints + + *** 21:03:58 *** + Writing Coordinate Systems + + *** 21:03:58 *** + Validating Solution Setup + + *** 21:03:58 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:03:58 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875957130 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: 1986462272 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:03:55 2025 -> Sun Nov 16 21:03:59 2025 +[NX SOLVER] Complete in 4.3s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:03:59,658] Trial 6 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 16.19304697862953, 'support_angle': 36.06797331023344}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 16 -> 15 +Updated: support_angle = 36 -> 35 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210359 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:03:59 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:04:02 *** + Starting Nastran Exporter + + *** 21:04:02 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:04:02 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:04:02 *** + Writing Nastran System section + + *** 21:04:02 *** + Writing File Management section + + *** 21:04:02 *** + Writing Executive Control section + + *** 21:04:02 *** + Writing Case Control section + + *** 21:04:02 *** + Writing Bulk Data section + + *** 21:04:02 *** + Writing Nodes + + *** 21:04:02 *** + Writing Elements + + *** 21:04:02 *** + Writing Physical Properties + + *** 21:04:02 *** + Writing Materials + + *** 21:04:02 *** + Writing Degree-of-Freedom Sets + + *** 21:04:02 *** + Writing Loads and Constraints + + *** 21:04:02 *** + Writing Coordinate Systems + + *** 21:04:02 *** + Validating Solution Setup + + *** 21:04:02 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:04:02 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875957130 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: 652018240 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:03:59 2025 -> Sun Nov 16 21:04:03 2025 +[NX SOLVER] Complete in 4.1s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:04:03,889] Trial 7 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 15.61436419929355, 'support_angle': 35.52844150612963}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 15 -> 21 +Updated: support_angle = 35 -> 37 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210403 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:04:03 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:04:07 *** + Starting Nastran Exporter + + *** 21:04:07 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:04:07 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:04:07 *** + Writing Nastran System section + + *** 21:04:07 *** + Writing File Management section + + *** 21:04:07 *** + Writing Executive Control section + + *** 21:04:07 *** + Writing Case Control section + + *** 21:04:07 *** + Writing Bulk Data section + + *** 21:04:07 *** + Writing Nodes + + *** 21:04:07 *** + Writing Elements + + *** 21:04:07 *** + Writing Physical Properties + + *** 21:04:07 *** + Writing Materials + + *** 21:04:07 *** + Writing Degree-of-Freedom Sets + + *** 21:04:07 *** + Writing Loads and Constraints + + *** 21:04:07 *** + Writing Coordinate Systems + + *** 21:04:07 *** + Validating Solution Setup + + *** 21:04:07 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:04:07 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875957130 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: 2028208704 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:04:03 2025 -> Sun Nov 16 21:04:07 2025 +[NX SOLVER] Complete in 4.3s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:04:08,344] Trial 8 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 21.42102362423531, 'support_angle': 37.41818639166882}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 21 -> 22 +Updated: support_angle = 37 -> 36 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210408 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:04:07 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:04:11 *** + Starting Nastran Exporter + + *** 21:04:11 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:04:11 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:04:11 *** + Writing Nastran System section + + *** 21:04:11 *** + Writing File Management section + + *** 21:04:11 *** + Writing Executive Control section + + *** 21:04:11 *** + Writing Case Control section + + *** 21:04:11 *** + Writing Bulk Data section + + *** 21:04:11 *** + Writing Nodes + + *** 21:04:11 *** + Writing Elements + + *** 21:04:11 *** + Writing Physical Properties + + *** 21:04:11 *** + Writing Materials + + *** 21:04:11 *** + Writing Degree-of-Freedom Sets + + *** 21:04:11 *** + Writing Loads and Constraints + + *** 21:04:11 *** + Writing Coordinate Systems + + *** 21:04:11 *** + Validating Solution Setup + + *** 21:04:11 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:04:11 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875957130 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: 1037697600 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:04:07 2025 -> Sun Nov 16 21:04:12 2025 +[NX SOLVER] Complete in 4.0s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:04:12,468] Trial 9 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 22.185997816011707, 'support_angle': 36.80015632779197}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 22 -> 19 +Updated: support_angle = 36 -> 23 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210412 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:04:12 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:04:15 *** + Starting Nastran Exporter + + *** 21:04:15 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:04:15 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:04:15 *** + Writing Nastran System section + + *** 21:04:15 *** + Writing File Management section + + *** 21:04:15 *** + Writing Executive Control section + + *** 21:04:15 *** + Writing Case Control section + + *** 21:04:15 *** + Writing Bulk Data section + + *** 21:04:15 *** + Writing Nodes + + *** 21:04:15 *** + Writing Elements + + *** 21:04:15 *** + Writing Physical Properties + + *** 21:04:15 *** + Writing Materials + + *** 21:04:15 *** + Writing Degree-of-Freedom Sets + + *** 21:04:15 *** + Writing Loads and Constraints + + *** 21:04:15 *** + Writing Coordinate Systems + + *** 21:04:15 *** + Validating Solution Setup + + *** 21:04:15 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:04:15 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875957130 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -1725627840 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:04:12 2025 -> Sun Nov 16 21:04:16 2025 +[NX SOLVER] Complete in 4.0s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:04:16,611] Trial 10 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 19.181063532905092, 'support_angle': 23.746248246929593}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 19 -> 24 +Updated: support_angle = 23 -> 39 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210416 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:04:16 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:04:19 *** + Starting Nastran Exporter + + *** 21:04:19 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:04:19 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:04:19 *** + Writing Nastran System section + + *** 21:04:19 *** + Writing File Management section + + *** 21:04:19 *** + Writing Executive Control section + + *** 21:04:19 *** + Writing Case Control section + + *** 21:04:19 *** + Writing Bulk Data section + + *** 21:04:19 *** + Writing Nodes + + *** 21:04:19 *** + Writing Elements + + *** 21:04:19 *** + Writing Physical Properties + + *** 21:04:19 *** + Writing Materials + + *** 21:04:19 *** + Writing Degree-of-Freedom Sets + + *** 21:04:19 *** + Writing Loads and Constraints + + *** 21:04:19 *** + Writing Coordinate Systems + + *** 21:04:19 *** + Validating Solution Setup + + *** 21:04:19 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:04:19 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875957130 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -637205952 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:04:16 2025 -> Sun Nov 16 21:04:20 2025 +[NX SOLVER] Complete in 4.0s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:04:20,796] Trial 11 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 24.107160812576737, 'support_angle': 39.72739387320189}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 24 -> 17 +Updated: support_angle = 39 -> 30 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210420 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:04:20 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:04:24 *** + Starting Nastran Exporter + + *** 21:04:24 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:04:24 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:04:24 *** + Writing Nastran System section + + *** 21:04:24 *** + Writing File Management section + + *** 21:04:24 *** + Writing Executive Control section + + *** 21:04:24 *** + Writing Case Control section + + *** 21:04:24 *** + Writing Bulk Data section + + *** 21:04:24 *** + Writing Nodes + + *** 21:04:24 *** + Writing Elements + + *** 21:04:24 *** + Writing Physical Properties + + *** 21:04:24 *** + Writing Materials + + *** 21:04:24 *** + Writing Degree-of-Freedom Sets + + *** 21:04:24 *** + Writing Loads and Constraints + + *** 21:04:24 *** + Writing Coordinate Systems + + *** 21:04:24 *** + Validating Solution Setup + + *** 21:04:24 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:04:24 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875957130 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -922746304 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:04:20 2025 -> Sun Nov 16 21:04:24 2025 +[NX SOLVER] Complete in 4.2s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:04:25,072] Trial 12 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 17.1865774070726, 'support_angle': 30.54937374454046}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 17 -> 20 +Updated: support_angle = 30 -> 27 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210425 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:04:24 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:04:28 *** + Starting Nastran Exporter + + *** 21:04:28 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:04:28 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:04:28 *** + Writing Nastran System section + + *** 21:04:28 *** + Writing File Management section + + *** 21:04:28 *** + Writing Executive Control section + + *** 21:04:28 *** + Writing Case Control section + + *** 21:04:28 *** + Writing Bulk Data section + + *** 21:04:28 *** + Writing Nodes + + *** 21:04:28 *** + Writing Elements + + *** 21:04:28 *** + Writing Physical Properties + + *** 21:04:28 *** + Writing Materials + + *** 21:04:28 *** + Writing Degree-of-Freedom Sets + + *** 21:04:28 *** + Writing Loads and Constraints + + *** 21:04:28 *** + Writing Coordinate Systems + + *** 21:04:28 *** + Validating Solution Setup + + *** 21:04:28 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:04:28 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875957130 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: 1501889088 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:04:24 2025 -> Sun Nov 16 21:04:29 2025 +[NX SOLVER] Complete in 4.2s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:04:29,397] Trial 13 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 20.31609875070344, 'support_angle': 27.073654676569404}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 20 -> 15 +Updated: support_angle = 27 -> 32 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210429 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:04:29 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:04:32 *** + Starting Nastran Exporter + + *** 21:04:32 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:04:32 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:04:32 *** + Writing Nastran System section + + *** 21:04:32 *** + Writing File Management section + + *** 21:04:32 *** + Writing Executive Control section + + *** 21:04:32 *** + Writing Case Control section + + *** 21:04:32 *** + Writing Bulk Data section + + *** 21:04:32 *** + Writing Nodes + + *** 21:04:32 *** + Writing Elements + + *** 21:04:32 *** + Writing Physical Properties + + *** 21:04:32 *** + Writing Materials + + *** 21:04:32 *** + Writing Degree-of-Freedom Sets + + *** 21:04:32 *** + Writing Loads and Constraints + + *** 21:04:32 *** + Writing Coordinate Systems + + *** 21:04:32 *** + Validating Solution Setup + + *** 21:04:32 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:04:32 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875957130 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -442957248 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:04:29 2025 -> Sun Nov 16 21:04:33 2025 +[NX SOLVER] Complete in 4.2s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:04:33,733] Trial 14 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 15.1845181734436, 'support_angle': 32.52232339316216}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 15 -> 19 +Updated: support_angle = 32 -> 33 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210433 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:04:33 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:04:36 *** + Starting Nastran Exporter + + *** 21:04:36 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:04:36 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:04:36 *** + Writing Nastran System section + + *** 21:04:36 *** + Writing File Management section + + *** 21:04:36 *** + Writing Executive Control section + + *** 21:04:36 *** + Writing Case Control section + + *** 21:04:36 *** + Writing Bulk Data section + + *** 21:04:36 *** + Writing Nodes + + *** 21:04:36 *** + Writing Elements + + *** 21:04:36 *** + Writing Physical Properties + + *** 21:04:36 *** + Writing Materials + + *** 21:04:36 *** + Writing Degree-of-Freedom Sets + + *** 21:04:36 *** + Writing Loads and Constraints + + *** 21:04:36 *** + Writing Coordinate Systems + + *** 21:04:36 *** + Validating Solution Setup + + *** 21:04:36 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:04:36 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875957130 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -1015152064 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:04:33 2025 -> Sun Nov 16 21:04:37 2025 +[NX SOLVER] Complete in 4.2s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:04:38,028] Trial 15 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 19.211334691131885, 'support_angle': 33.4592438738482}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 19 -> 16 +Updated: support_angle = 33 -> 26 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210438 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:04:37 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:04:41 *** + Starting Nastran Exporter + + *** 21:04:41 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:04:41 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:04:41 *** + Writing Nastran System section + + *** 21:04:41 *** + Writing File Management section + + *** 21:04:41 *** + Writing Executive Control section + + *** 21:04:41 *** + Writing Case Control section + + *** 21:04:41 *** + Writing Bulk Data section + + *** 21:04:41 *** + Writing Nodes + + *** 21:04:41 *** + Writing Elements + + *** 21:04:41 *** + Writing Physical Properties + + *** 21:04:41 *** + Writing Materials + + *** 21:04:41 *** + Writing Degree-of-Freedom Sets + + *** 21:04:41 *** + Writing Loads and Constraints + + *** 21:04:41 *** + Writing Coordinate Systems + + *** 21:04:41 *** + Validating Solution Setup + + *** 21:04:41 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:04:41 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875957130 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: 772997696 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:04:37 2025 -> Sun Nov 16 21:04:42 2025 +[NX SOLVER] Complete in 4.0s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:04:42,192] Trial 16 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 16.792132776707774, 'support_angle': 26.040842595230526}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 16 -> 18 +Updated: support_angle = 26 -> 20 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210442 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:04:42 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:04:45 *** + Starting Nastran Exporter + + *** 21:04:45 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:04:45 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:04:45 *** + Writing Nastran System section + + *** 21:04:45 *** + Writing File Management section + + *** 21:04:45 *** + Writing Executive Control section + + *** 21:04:45 *** + Writing Case Control section + + *** 21:04:45 *** + Writing Bulk Data section + + *** 21:04:45 *** + Writing Nodes + + *** 21:04:45 *** + Writing Elements + + *** 21:04:45 *** + Writing Physical Properties + + *** 21:04:45 *** + Writing Materials + + *** 21:04:45 *** + Writing Degree-of-Freedom Sets + + *** 21:04:45 *** + Writing Loads and Constraints + + *** 21:04:45 *** + Writing Coordinate Systems + + *** 21:04:45 *** + Validating Solution Setup + + *** 21:04:45 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:04:45 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875957130 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -803536320 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:04:42 2025 -> Sun Nov 16 21:04:46 2025 +[NX SOLVER] Complete in 4.1s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:04:46,384] Trial 17 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 18.575846314465224, 'support_angle': 20.067231334411122}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 18 -> 20 +Updated: support_angle = 20 -> 30 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210446 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:04:46 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:04:49 *** + Starting Nastran Exporter + + *** 21:04:49 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:04:49 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:04:49 *** + Writing Nastran System section + + *** 21:04:49 *** + Writing File Management section + + *** 21:04:49 *** + Writing Executive Control section + + *** 21:04:49 *** + Writing Case Control section + + *** 21:04:49 *** + Writing Bulk Data section + + *** 21:04:49 *** + Writing Nodes + + *** 21:04:49 *** + Writing Elements + + *** 21:04:49 *** + Writing Physical Properties + + *** 21:04:49 *** + Writing Materials + + *** 21:04:49 *** + Writing Degree-of-Freedom Sets + + *** 21:04:49 *** + Writing Loads and Constraints + + *** 21:04:49 *** + Writing Coordinate Systems + + *** 21:04:49 *** + Validating Solution Setup + + *** 21:04:49 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:04:49 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875236234 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: 271909440 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:04:46 2025 -> Sun Nov 16 21:04:50 2025 +[NX SOLVER] Complete in 4.2s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:04:50,692] Trial 18 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 20.462945983827563, 'support_angle': 30.03135433203613}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 20 -> 16 +Updated: support_angle = 30 -> 39 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210450 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:04:50 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:04:53 *** + Starting Nastran Exporter + + *** 21:04:53 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:04:53 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:04:53 *** + Writing Nastran System section + + *** 21:04:53 *** + Writing File Management section + + *** 21:04:53 *** + Writing Executive Control section + + *** 21:04:53 *** + Writing Case Control section + + *** 21:04:53 *** + Writing Bulk Data section + + *** 21:04:53 *** + Writing Nodes + + *** 21:04:53 *** + Writing Elements + + *** 21:04:53 *** + Writing Physical Properties + + *** 21:04:53 *** + Writing Materials + + *** 21:04:53 *** + Writing Degree-of-Freedom Sets + + *** 21:04:53 *** + Writing Loads and Constraints + + *** 21:04:53 *** + Writing Coordinate Systems + + *** 21:04:53 *** + Validating Solution Setup + + *** 21:04:53 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:04:53 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875236234 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -341048768 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:04:50 2025 -> Sun Nov 16 21:04:54 2025 +[NX SOLVER] Complete in 4.3s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:04:55,104] Trial 19 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 16.64736533354882, 'support_angle': 39.42124051821946}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 16 -> 19 +Updated: support_angle = 39 -> 34 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210455 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:04:54 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:04:58 *** + Starting Nastran Exporter + + *** 21:04:58 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:04:58 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:04:58 *** + Writing Nastran System section + + *** 21:04:58 *** + Writing File Management section + + *** 21:04:58 *** + Writing Executive Control section + + *** 21:04:58 *** + Writing Case Control section + + *** 21:04:58 *** + Writing Bulk Data section + + *** 21:04:58 *** + Writing Nodes + + *** 21:04:58 *** + Writing Elements + + *** 21:04:58 *** + Writing Physical Properties + + *** 21:04:58 *** + Writing Materials + + *** 21:04:58 *** + Writing Degree-of-Freedom Sets + + *** 21:04:58 *** + Writing Loads and Constraints + + *** 21:04:58 *** + Writing Coordinate Systems + + *** 21:04:58 *** + Validating Solution Setup + + *** 21:04:58 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:04:58 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875236234 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: 2025980480 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:04:54 2025 -> Sun Nov 16 21:04:58 2025 +[NX SOLVER] Complete in 4.2s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:04:59,403] Trial 20 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 19.543467357432874, 'support_angle': 34.302655610432176}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 19 -> 17 +Updated: support_angle = 34 -> 30 +Successfully updated 2/2 expressions +Backup created: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt.bak_20251116_210459 +Saved to: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model + Mode: Journal + Found existing OP2 (modified: Sun Nov 16 21:04:58 2025) + Will verify NX regenerates it with newer timestamp +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 21:05:02 *** + Starting Nastran Exporter + + *** 21:05:02 *** + Writing file + C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\ + bracket_sim1-solution_1.dat + + *** 21:05:02 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 21:05:02 *** + Writing Nastran System section + + *** 21:05:02 *** + Writing File Management section + + *** 21:05:02 *** + Writing Executive Control section + + *** 21:05:02 *** + Writing Case Control section + + *** 21:05:02 *** + Writing Bulk Data section + + *** 21:05:02 *** + Writing Nodes + + *** 21:05:02 *** + Writing Elements + + *** 21:05:02 *** + Writing Physical Properties + + *** 21:05:02 *** + Writing Materials + + *** 21:05:02 *** + Writing Degree-of-Freedom Sets + + *** 21:05:02 *** + Writing Loads and Constraints + + *** 21:05:02 *** + Writing Coordinate Systems + + *** 21:05:02 *** + Validating Solution Setup + + *** 21:05:02 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 21:05:02 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1875236234 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -1065024960 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\model\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Fresh output files detected after 0.0s + OP2 regenerated: Sun Nov 16 21:04:58 2025 -> Sun Nov 16 21:05:03 2025 +[NX SOLVER] Complete in 4.3s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\studies\\bracket_displacement_maximizing\\model\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 21:05:03,820] Trial 21 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 17.676096024627086, 'support_angle': 30.254143696679552}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + + +================================================================================ + OPTIMIZATION COMPLETE! +================================================================================ + +Duration: 86.7 seconds (1.4 minutes) + +Best Design Found: + - tip_thickness: 18.622 mm + - support_angle: 35.660 degrees + - Objective value: 0.361783 + +Best Design Performance: + - Max displacement: 0.361783 mm + - Max stress: 0.000 MPa + - Safety factor: 0.000 + - Constraint: VIOLATED + +Saving results... +Traceback (most recent call last): + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\run_optimization.py", line 369, in + main() + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\run_optimization.py", line 353, in main + history_file, best_file, report_file = save_results(results, study_dir) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\run_optimization.py", line 94, in save_results + f.write(f"- **Constraint**: {'\u2713 SATISFIED' if best_calcs.get('safety_factor', 0) >= 4.0 else '\u2717 VIOLATED'}\n\n") + File "C:\Users\antoi\anaconda3\envs\test_env\Lib\encodings\cp1252.py", line 19, in encode + return codecs.charmap_encode(input,self.errors,encoding_table)[0] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +UnicodeEncodeError: 'charmap' codec can't encode character '\u2717' in position 18: character maps to diff --git a/studies/bracket_displacement_maximizing/optimization_log_old.txt b/studies/bracket_displacement_maximizing/optimization_log_old.txt new file mode 100644 index 00000000..3cb24dd2 --- /dev/null +++ b/studies/bracket_displacement_maximizing/optimization_log_old.txt @@ -0,0 +1,2160 @@ +fatal: not a git repository (or any of the parent directories): .git + +================================================================================ + BRACKET DISPLACEMENT MAXIMIZATION STUDY +================================================================================ + +Study Configuration: + - Objective: Maximize displacement + - Constraint: Safety factor >= 4.0 + - Material: Aluminum 6061-T6 (Yield = 276 MPa) + - Design Variables: + * tip_thickness: 15-25 mm + * support_angle: 20-40 degrees + - Optimization trials: 20 + +Part file: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket.prt +Simulation file: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket_sim1.sim + + +================================================================================ + STEP 1: INITIALIZATION +================================================================================ + +Initializing Optimization Setup Wizard... + [OK] Wizard initialized + + +================================================================================ + STEP 2: MODEL INTROSPECTION +================================================================================ + +Reading NX model expressions... +Found 4 expressions: + - support_angle: 38.0 degrees + - tip_thickness: 17.0 mm + - p3: 10.0 mm + - support_blend_radius: 10.0 mm + + +================================================================================ + STEP 3: BASELINE SIMULATION +================================================================================ + +Running baseline simulation to generate reference OP2... +(This validates that NX simulation works before optimization) + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: c:\Users\antoi\Documents\Atomaste\Atomizer\tests + Mode: Journal + Deleted 1 old result file(s) to force fresh solve +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 20:43:54 *** + Starting Nastran Exporter + + *** 20:43:54 *** + Writing file + c:\Users\antoi\Documents\Atomaste\Atomizer\tests\bracket_sim1-solution_1.dat + + *** 20:43:54 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 20:43:54 *** + Writing Nastran System section + + *** 20:43:54 *** + Writing File Management section + + *** 20:43:54 *** + Writing Executive Control section + + *** 20:43:54 *** + Writing Case Control section + + *** 20:43:54 *** + Writing Bulk Data section + + *** 20:43:54 *** + Writing Nodes + + *** 20:43:54 *** + Writing Elements + + *** 20:43:54 *** + Writing Physical Properties + + *** 20:43:54 *** + Writing Materials + + *** 20:43:54 *** + Writing Degree-of-Freedom Sets + + *** 20:43:54 *** + Writing Loads and Constraints + + *** 20:43:54 *** + Writing Coordinate Systems + + *** 20:43:54 *** + Validating Solution Setup + + *** 20:43:54 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 20:43:54 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1786238346 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: 2055733824 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for c:\Users\antoi\Documents\Atomaste\Atomizer\tests\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\tests\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Output files detected after 0.5s +[NX SOLVER] Complete in 4.3s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 + [OK] Baseline OP2: bracket_sim1-solution_1.op2 + + +================================================================================ + STEP 4: OP2 INTROSPECTION +================================================================================ + +Analyzing OP2 file to auto-detect element types... +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +OP2 Contents: + - Element types with stress: CHEXA, CPENTA + - Available result types: displacement, stress + - Subcases: [1] + - Nodes: 0 + - Elements: 0 + + +================================================================================ + STEP 5: WORKFLOW CONFIGURATION +================================================================================ + +Building LLM workflow with auto-detected element types... + Using detected element type: CHEXA + + +================================================================================ + STEP 6: PIPELINE VALIDATION +================================================================================ + +Validating complete pipeline with baseline OP2... +(Dry-run test of extractors, calculations, hooks, objective) + +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress + [WARNING] No explicit objective, using: max_displacement +[I 2025-11-16 20:43:58,153] A new study created in RDB with name: bracket_displacement_maximizing +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +Validation Results: + [OK] extractor: ['max_displacement', 'max_disp_node', 'max_disp_x', 'max_disp_y', 'max_disp_z'] + [OK] extractor: ['max_von_mises', 'max_stress_element'] + [OK] calculation: Created ['safety_factor'] + [OK] calculation: Created ['safety_factor', 'neg_displacement'] + [OK] hook: 3 results + [OK] objective: 0.36178338527679443 + +[SUCCESS] All pipeline components validated! + + +================================================================================ + STEP 7: OPTIMIZATION SETUP +================================================================================ + +Creating model updater and simulation runner... + [OK] Model updater ready + [OK] Simulation runner ready + +Initializing LLM optimization runner... + [OK] Output directory: c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_results\bracket_displacement_maximizing + [OK] Extractors generated: 2 + [OK] Inline calculations: 2 + [OK] Hooks loaded: 9 + + +================================================================================ + STEP 8: RUNNING OPTIMIZATION +================================================================================ + +Starting 20-trial optimization... +(This will take several minutes) + + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 17 -> 24 +Updated: support_angle = 38 -> 25 +Successfully updated 2/2 expressions +Backup created: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket.prt.bak_20251116_204358 +Saved to: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: c:\Users\antoi\Documents\Atomaste\Atomizer\tests + Mode: Journal + Warning: Could not delete bracket_sim1-solution_1.log: [WinError 32] The process cannot access the file because it is being used by another process: 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.log' + Deleted 2 old result file(s) to force fresh solve +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 20:44:01 *** + Starting Nastran Exporter + + *** 20:44:01 *** + Writing file + c:\Users\antoi\Documents\Atomaste\Atomizer\tests\bracket_sim1-solution_1.dat + + *** 20:44:01 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 20:44:01 *** + Writing Nastran System section + + *** 20:44:01 *** + Writing File Management section + + *** 20:44:01 *** + Writing Executive Control section + + *** 20:44:01 *** + Writing Case Control section + + *** 20:44:01 *** + Writing Bulk Data section + + *** 20:44:01 *** + Writing Nodes + + *** 20:44:01 *** + Writing Elements + + *** 20:44:01 *** + Writing Physical Properties + + *** 20:44:01 *** + Writing Materials + + *** 20:44:01 *** + Writing Degree-of-Freedom Sets + + *** 20:44:01 *** + Writing Loads and Constraints + + *** 20:44:01 *** + Writing Coordinate Systems + + *** 20:44:01 *** + Validating Solution Setup + + *** 20:44:01 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 20:44:01 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1472058762 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -630324672 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for c:\Users\antoi\Documents\Atomaste\Atomizer\tests\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\tests\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Output files detected after 0.5s +[NX SOLVER] Complete in 4.4s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 20:44:03,240] Trial 0 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 24.057174360465407, 'support_angle': 25.35525889588185}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 24 -> 18 +Updated: support_angle = 25 -> 25 +Successfully updated 2/2 expressions +Backup created: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket.prt.bak_20251116_204403 +Saved to: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: c:\Users\antoi\Documents\Atomaste\Atomizer\tests + Mode: Journal + Warning: Could not delete bracket_sim1-solution_1.log: [WinError 32] The process cannot access the file because it is being used by another process: 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.log' + Deleted 2 old result file(s) to force fresh solve +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 20:44:06 *** + Starting Nastran Exporter + + *** 20:44:06 *** + Writing file + c:\Users\antoi\Documents\Atomaste\Atomizer\tests\bracket_sim1-solution_1.dat + + *** 20:44:06 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 20:44:06 *** + Writing Nastran System section + + *** 20:44:06 *** + Writing File Management section + + *** 20:44:06 *** + Writing Executive Control section + + *** 20:44:06 *** + Writing Case Control section + + *** 20:44:06 *** + Writing Bulk Data section + + *** 20:44:06 *** + Writing Nodes + + *** 20:44:06 *** + Writing Elements + + *** 20:44:06 *** + Writing Physical Properties + + *** 20:44:06 *** + Writing Materials + + *** 20:44:06 *** + Writing Degree-of-Freedom Sets + + *** 20:44:06 *** + Writing Loads and Constraints + + *** 20:44:06 *** + Writing Coordinate Systems + + *** 20:44:06 *** + Validating Solution Setup + + *** 20:44:06 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 20:44:06 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1925305738 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: 1225720384 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for c:\Users\antoi\Documents\Atomaste\Atomizer\tests\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\tests\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Output files detected after 0.5s +[NX SOLVER] Complete in 4.4s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 20:44:08,320] Trial 1 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 18.304620477081855, 'support_angle': 25.394969100877468}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 18 -> 19 +Updated: support_angle = 25 -> 31 +Successfully updated 2/2 expressions +Backup created: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket.prt.bak_20251116_204408 +Saved to: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: c:\Users\antoi\Documents\Atomaste\Atomizer\tests + Mode: Journal + Warning: Could not delete bracket_sim1-solution_1.log: [WinError 32] The process cannot access the file because it is being used by another process: 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.log' + Deleted 2 old result file(s) to force fresh solve +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 20:44:11 *** + Starting Nastran Exporter + + *** 20:44:11 *** + Writing file + c:\Users\antoi\Documents\Atomaste\Atomizer\tests\bracket_sim1-solution_1.dat + + *** 20:44:11 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 20:44:11 *** + Writing Nastran System section + + *** 20:44:11 *** + Writing File Management section + + *** 20:44:11 *** + Writing Executive Control section + + *** 20:44:11 *** + Writing Case Control section + + *** 20:44:11 *** + Writing Bulk Data section + + *** 20:44:11 *** + Writing Nodes + + *** 20:44:11 *** + Writing Elements + + *** 20:44:11 *** + Writing Physical Properties + + *** 20:44:11 *** + Writing Materials + + *** 20:44:11 *** + Writing Degree-of-Freedom Sets + + *** 20:44:11 *** + Writing Loads and Constraints + + *** 20:44:11 *** + Writing Coordinate Systems + + *** 20:44:11 *** + Validating Solution Setup + + *** 20:44:11 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 20:44:11 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1928254858 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -613678528 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for c:\Users\antoi\Documents\Atomaste\Atomizer\tests\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\tests\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Output files detected after 0.5s +[NX SOLVER] Complete in 4.5s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 20:44:13,424] Trial 2 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 19.533548039349455, 'support_angle': 31.844371833801826}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 19 -> 22 +Updated: support_angle = 31 -> 22 +Successfully updated 2/2 expressions +Backup created: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket.prt.bak_20251116_204413 +Saved to: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: c:\Users\antoi\Documents\Atomaste\Atomizer\tests + Mode: Journal + Warning: Could not delete bracket_sim1-solution_1.log: [WinError 32] The process cannot access the file because it is being used by another process: 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.log' + Deleted 2 old result file(s) to force fresh solve +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 20:44:16 *** + Starting Nastran Exporter + + *** 20:44:16 *** + Writing file + c:\Users\antoi\Documents\Atomaste\Atomizer\tests\bracket_sim1-solution_1.dat + + *** 20:44:16 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 20:44:16 *** + Writing Nastran System section + + *** 20:44:16 *** + Writing File Management section + + *** 20:44:16 *** + Writing Executive Control section + + *** 20:44:16 *** + Writing Case Control section + + *** 20:44:16 *** + Writing Bulk Data section + + *** 20:44:16 *** + Writing Nodes + + *** 20:44:16 *** + Writing Elements + + *** 20:44:16 *** + Writing Physical Properties + + *** 20:44:16 *** + Writing Materials + + *** 20:44:16 *** + Writing Degree-of-Freedom Sets + + *** 20:44:16 *** + Writing Loads and Constraints + + *** 20:44:16 *** + Writing Coordinate Systems + + *** 20:44:16 *** + Validating Solution Setup + + *** 20:44:16 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 20:44:16 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1930483082 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -1732705728 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for c:\Users\antoi\Documents\Atomaste\Atomizer\tests\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\tests\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Output files detected after 0.5s +[NX SOLVER] Complete in 4.7s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 20:44:18,839] Trial 3 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 22.92830934942418, 'support_angle': 22.883083847442386}. Best is trial 0 with value: 0.36178338527679443. +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 22 -> 23 +Updated: support_angle = 22 -> 32 +Successfully updated 2/2 expressions +Backup created: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket.prt.bak_20251116_204418 +Saved to: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: c:\Users\antoi\Documents\Atomaste\Atomizer\tests + Mode: Journal + Warning: Could not delete bracket_sim1-solution_1.log: [WinError 32] The process cannot access the file because it is being used by another process: 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.log' + Deleted 2 old result file(s) to force fresh solve +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 20:44:22 *** + Starting Nastran Exporter + + *** 20:44:22 *** + Writing file + c:\Users\antoi\Documents\Atomaste\Atomizer\tests\bracket_sim1-solution_1.dat + + *** 20:44:22 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 20:44:22 *** + Writing Nastran System section + + *** 20:44:22 *** + Writing File Management section + + *** 20:44:22 *** + Writing Executive Control section + + *** 20:44:22 *** + Writing Case Control section + + *** 20:44:22 *** + Writing Bulk Data section + + *** 20:44:22 *** + Writing Nodes + + *** 20:44:22 *** + Writing Elements + + *** 20:44:22 *** + Writing Physical Properties + + *** 20:44:22 *** + Writing Materials + + *** 20:44:22 *** + Writing Degree-of-Freedom Sets + + *** 20:44:22 *** + Writing Loads and Constraints + + *** 20:44:22 *** + Writing Coordinate Systems + + *** 20:44:22 *** + Validating Solution Setup + + *** 20:44:22 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 20:44:22 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1932776842 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -1299054016 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for c:\Users\antoi\Documents\Atomaste\Atomizer\tests\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\tests\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Output files detected after 0.5s +[NX SOLVER] Complete in 4.7s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:634 -------- reading op2 with read_mode=2 (array filling) -------- +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +Extraction failed: extract_solid_stress - 1 +Extraction failed for extract_solid_stress: 1 +Inline calculation failed: name 'max_von_mises' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +No explicit objective found, using: max_displacement +[I 2025-11-16 20:44:24,252] Trial 4 finished with value: 0.36178338527679443 and parameters: {'tip_thickness': 23.722396426593477, 'support_angle': 32.99896902425434}. Best is trial 0 with value: 0.36178338527679443. +Extraction failed: extract_displacement - There was a Nastran FATAL Error. Check the F06. +last table=b'EQEXIN'; post=-1 version='nx' +Extraction failed for extract_displacement: There was a Nastran FATAL Error. Check the F06. +last table=b'EQEXIN'; post=-1 version='nx' +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) +DEBUG: op2_scalar.py:2173 table_name=b'OQG1' (spc/mpc forces) +DEBUG: op2_scalar.py:2173 table_name=b'BOUGV1' (g-set U in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'OES1' (linear stress) +DEBUG: oes.py:2840 numwide_real=193 +DEBUG: oes.py:2840 numwide_real=151 +DEBUG: op2.py:932 combine_results +DEBUG: op2.py:648 finished reading op2 + +Updating 2 expressions in Bracket.prt: +Updated: tip_thickness = 23 -> 21 +Updated: support_angle = 32 -> 28 +Successfully updated 2/2 expressions +Backup created: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket.prt.bak_20251116_204424 +Saved to: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket.prt + +[NX SOLVER] Starting simulation... + Input file: Bracket_sim1.sim + Working dir: c:\Users\antoi\Documents\Atomaste\Atomizer\tests + Mode: Journal + Warning: Could not delete bracket_sim1-solution_1.log: [WinError 32] The process cannot access the file because it is being used by another process: 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.log' + Deleted 2 old result file(s) to force fresh solve +[JOURNAL OUTPUT] + Mesh-Based Errors Summary + ------------------------- + + Total: 0 errors and 0 warnings + + + Material-Based Errors Summary + ----------------------------- + + Total: 0 errors and 0 warnings + + + Solution-Based Errors Summary + ----------------------------- + + Iterative Solver Option + More than 80 percent of the elements in this model are 3D elements. + It is therefore recommended that you turn ON the Element Iterative Solver in the "Edit + Solution" dialog. + + Total: 0 errors and 0 warnings + + + Load/BC-Based Errors Summary + ---------------------------- + + Total: 0 errors and 0 warnings + + + Nastran Model Setup Check completed + + + + + *** 20:44:27 *** + Starting Nastran Exporter + + *** 20:44:27 *** + Writing file + c:\Users\antoi\Documents\Atomaste\Atomizer\tests\bracket_sim1-solution_1.dat + + *** 20:44:27 *** + Writing SIMCENTER NASTRAN 2412.0 compatible deck + + *** 20:44:27 *** + Writing Nastran System section + + *** 20:44:27 *** + Writing File Management section + + *** 20:44:27 *** + Writing Executive Control section + + *** 20:44:27 *** + Writing Case Control section + + *** 20:44:27 *** + Writing Bulk Data section + + *** 20:44:27 *** + Writing Nodes + + *** 20:44:27 *** + Writing Elements + + *** 20:44:27 *** + Writing Physical Properties + + *** 20:44:27 *** + Writing Materials + + *** 20:44:27 *** + Writing Degree-of-Freedom Sets + + *** 20:44:27 *** + Writing Loads and Constraints + + *** 20:44:27 *** + Writing Coordinate Systems + + *** 20:44:27 *** + Validating Solution Setup + + *** 20:44:27 *** + Summary of Bulk Data cards written + + +----------+----------+ + | NAME | NUMBER | + +----------+----------+ + | CHEXA | 306 | + | CPENTA | 10 | + | FORCE | 3 | + | GRID | 585 | + | MAT1 | 1 | + | MATT1 | 1 | + | PARAM | 6 | + | PSOLID | 1 | + | SPC | 51 | + | TABLEM1 | 3 | + +----------+----------+ + + *** 20:44:27 *** + Nastran Deck Successfully Written + + [JOURNAL] Opening simulation: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket_sim1.sim + [JOURNAL] Checking for open parts... + [JOURNAL] Opening simulation fresh from disk... + [JOURNAL] STEP 1: Updating Bracket.prt geometry... + [JOURNAL] Rebuilding geometry with new expression values... + [JOURNAL] Bracket geometry updated (0 errors) + [JOURNAL] STEP 2: Opening Bracket_fem1.fem... + [JOURNAL] Updating FE Model... + [JOURNAL] FE Model updated with new geometry! + [JOURNAL] STEP 3: Switching back to sim part... + [JOURNAL] Switched back to sim part + [JOURNAL] Starting solve... + [JOURNAL] Solve submitted! + [JOURNAL] Solutions solved: -1934939530 + [JOURNAL] Solutions failed: 32764 + [JOURNAL] Solutions skipped: -803732928 + [JOURNAL] Saving simulation to ensure output files are written... + [JOURNAL] Save complete! +[JOURNAL ERRORS] + Journal execution results for c:\Users\antoi\Documents\Atomaste\Atomizer\tests\_temp_solve_journal.py... + Syntax errors: + Line 0: Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\tests\_temp_solve_journal.py", line 247, in + sys.exit(0 if success else 1) +[NX SOLVER] Waiting for solve to complete... +[NX SOLVER] Output files detected after 0.5s +[NX SOLVER] Complete in 4.6s +[NX SOLVER] Results: bracket_sim1-solution_1.op2 +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +INFO: op2_scalar.py:1960 op2_filename = 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) + +ndata = 0: + strings = (b'',) + ints = () + floats = () + +ERROR: op2_reader.py:2988 finished table_name = b'EQEXIN' +ERROR: op2_reader.py:2993 There was a Nastran FATAL Error. Check the F06. +last table=b'EQEXIN'; post=-1 version='nx' +DEBUG: op2.py:614 combine=True +DEBUG: op2.py:615 -------- reading op2 with read_mode=1 (array sizing) -------- +Extraction failed: extract_solid_stress - There was a Nastran FATAL Error. Check the F06. +last table=b'EQEXIN'; post=-1 version='nx' +Extraction failed for extract_solid_stress: There was a Nastran FATAL Error. Check the F06. +last table=b'EQEXIN'; post=-1 version='nx' +Inline calculation failed: name 'max_von_mises' is not defined +Inline calculation failed: name 'max_displacement' is not defined +Required input 'min_force' not found in context +Hook 'ratio_hook' failed: Missing required input: min_force +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\min_to_avg_ratio_hook.py", line 38, in ratio_hook + raise ValueError(f"Missing required input: min_force") +ValueError: Missing required input: min_force +Hook 'ratio_hook' failed: Missing required input: min_force +Required input 'max_stress' not found in context +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\safety_factor_hook.py", line 38, in safety_factor_hook + raise ValueError(f"Missing required input: max_stress") +ValueError: Missing required input: max_stress +Hook 'safety_factor_hook' failed: Missing required input: max_stress +Required input 'norm_stress' not found in context +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\hooks.py", line 72, in execute + result = self.function(context) + ^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\plugins\post_calculation\weighted_objective_test.py", line 38, in weighted_objective_hook + raise ValueError(f"Missing required input: norm_stress") +ValueError: Missing required input: norm_stress +Hook 'weighted_objective_hook' failed: Missing required input: norm_stress +[W 2025-11-16 20:44:29,500] Trial 5 failed with parameters: {'tip_thickness': 21.549788562837012, 'support_angle': 28.710108728807292} because of the following error: ValueError('Could not determine objective value from results/calculations/hooks'). +Traceback (most recent call last): + File "C:\Users\antoi\anaconda3\envs\test_env\Lib\site-packages\optuna\study\_optimize.py", line 201, in _run_trial + value_or_values = func(trial) + ^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\llm_optimization_runner.py", line 328, in _objective + raise ValueError("Could not determine objective value from results/calculations/hooks") +ValueError: Could not determine objective value from results/calculations/hooks +[W 2025-11-16 20:44:29,502] Trial 5 failed with value None. +INFO: op2_scalar.py:1960 op2_filename = 'c:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\tests\\bracket_sim1-solution_1.op2' +DEBUG: op2_reader.py:323 date = (11, 16, 25) +WARNING: version.py:88 nx version='2412' is not supported +DEBUG: op2_reader.py:403 mode='nx' version='2412' +DEBUG: op2_scalar.py:2173 table_name=b'IBULK' (explicit bulk data) +DEBUG: op2_scalar.py:2173 table_name=b'ICASE' (explicit case control) +DEBUG: op2_scalar.py:2173 table_name=b'CASECC' (case control) +DEBUG: op2_scalar.py:2173 table_name=b'PVT0' (PARAM cards) +DEBUG: op2_scalar.py:2173 table_name=b'GPL' (grid point list) +DEBUG: op2_scalar.py:2173 table_name=b'GPDT' (grid point locations) +DEBUG: op2_scalar.py:2173 table_name=b'EPT' (property cards) +DEBUG: op2_scalar.py:2173 table_name=b'MPT' (material cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM2' (element cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM3' (constraint cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM4' (load cards) +DEBUG: op2_scalar.py:2173 table_name=b'GEOM1' (grid/coord cards) +DEBUG: op2_scalar.py:2173 table_name=b'BGPDT' (grid points in cid=0 frame) +DEBUG: op2_scalar.py:2173 table_name=b'DIT' (TABLEx cards) +DEBUG: op2_scalar.py:2173 table_name=b'EQEXIN' (internal/external ids) +DEBUG: op2_reader.py:672 eqexin idata=(101, 585, 0, 0, 0, 0, 0) + +ndata = 0: + strings = (b'',) + ints = () + floats = () + +ERROR: op2_reader.py:2988 finished table_name = b'EQEXIN' +ERROR: op2_reader.py:2993 There was a Nastran FATAL Error. Check the F06. +last table=b'EQEXIN'; post=-1 version='nx' +Traceback (most recent call last): + File "c:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\run_optimization.py", line 283, in + main() + File "c:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_displacement_maximizing\run_optimization.py", line 245, in main + results = runner.run_optimization(n_trials=20) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\llm_optimization_runner.py", line 368, in run_optimization + self.study.optimize(self._objective, n_trials=n_trials) + File "C:\Users\antoi\anaconda3\envs\test_env\Lib\site-packages\optuna\study\study.py", line 490, in optimize + _optimize( + File "C:\Users\antoi\anaconda3\envs\test_env\Lib\site-packages\optuna\study\_optimize.py", line 63, in _optimize + _optimize_sequential( + File "C:\Users\antoi\anaconda3\envs\test_env\Lib\site-packages\optuna\study\_optimize.py", line 160, in _optimize_sequential + frozen_trial_id = _run_trial(study, func, catch) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\antoi\anaconda3\envs\test_env\Lib\site-packages\optuna\study\_optimize.py", line 258, in _run_trial + raise func_err + File "C:\Users\antoi\anaconda3\envs\test_env\Lib\site-packages\optuna\study\_optimize.py", line 201, in _run_trial + value_or_values = func(trial) + ^^^^^^^^^^^ + File "c:\Users\antoi\Documents\Atomaste\Atomizer\optimization_engine\llm_optimization_runner.py", line 328, in _objective + raise ValueError("Could not determine objective value from results/calculations/hooks") +ValueError: Could not determine objective value from results/calculations/hooks diff --git a/studies/bracket_displacement_maximizing/optimization_validation/generated_extractors/extract_displacement.py b/studies/bracket_displacement_maximizing/optimization_validation/generated_extractors/extract_displacement.py new file mode 100644 index 00000000..3d0ec41a --- /dev/null +++ b/studies/bracket_displacement_maximizing/optimization_validation/generated_extractors/extract_displacement.py @@ -0,0 +1,56 @@ +""" +Extract displacement results from OP2 file +Auto-generated by Atomizer Phase 3 - pyNastran Research Agent + +Pattern: displacement +Element Type: General +Result Type: displacement +API: model.displacements[subcase] +""" + +from pathlib import Path +from typing import Dict, Any +import numpy as np +from pyNastran.op2.op2 import OP2 + + +def extract_displacement(op2_file: Path, subcase: int = 1): + """Extract displacement results from OP2 file.""" + from pyNastran.op2.op2 import OP2 + import numpy as np + + model = OP2() + model.read_op2(str(op2_file)) + + disp = model.displacements[subcase] + itime = 0 # static case + + # Extract translation components + txyz = disp.data[itime, :, :3] # [tx, ty, tz] + + # Calculate total displacement + total_disp = np.linalg.norm(txyz, axis=1) + max_disp = np.max(total_disp) + + # Get node info + node_ids = [nid for (nid, grid_type) in disp.node_gridtype] + max_disp_node = node_ids[np.argmax(total_disp)] + + return { + 'max_displacement': float(max_disp), + 'max_disp_node': int(max_disp_node), + 'max_disp_x': float(np.max(np.abs(txyz[:, 0]))), + 'max_disp_y': float(np.max(np.abs(txyz[:, 1]))), + 'max_disp_z': float(np.max(np.abs(txyz[:, 2]))) + } + + +if __name__ == '__main__': + # Example usage + import sys + if len(sys.argv) > 1: + op2_file = Path(sys.argv[1]) + result = extract_displacement(op2_file) + print(f"Extraction result: {result}") + else: + print("Usage: python {sys.argv[0]} ") diff --git a/studies/bracket_displacement_maximizing/optimization_validation/generated_extractors/extract_solid_stress.py b/studies/bracket_displacement_maximizing/optimization_validation/generated_extractors/extract_solid_stress.py new file mode 100644 index 00000000..a27d221b --- /dev/null +++ b/studies/bracket_displacement_maximizing/optimization_validation/generated_extractors/extract_solid_stress.py @@ -0,0 +1,64 @@ +""" +Extract von Mises stress from CHEXA elements +Auto-generated by Atomizer Phase 3 - pyNastran Research Agent + +Pattern: solid_stress +Element Type: CTETRA +Result Type: stress +API: model.ctetra_stress[subcase] or model.chexa_stress[subcase] +""" + +from pathlib import Path +from typing import Dict, Any +import numpy as np +from pyNastran.op2.op2 import OP2 + + +def extract_solid_stress(op2_file: Path, subcase: int = 1, element_type: str = 'ctetra'): + """Extract stress from solid elements.""" + from pyNastran.op2.op2 import OP2 + import numpy as np + + model = OP2() + model.read_op2(str(op2_file)) + + # Get stress object for element type + # In pyNastran, stress is stored in model.op2_results.stress + stress_attr = f"{element_type}_stress" + + if not hasattr(model, 'op2_results') or not hasattr(model.op2_results, 'stress'): + raise ValueError(f"No stress results in OP2") + + stress_obj = model.op2_results.stress + if not hasattr(stress_obj, stress_attr): + raise ValueError(f"No {element_type} stress results in OP2") + + stress = getattr(stress_obj, stress_attr)[subcase] + itime = 0 + + # Extract von Mises if available + if stress.is_von_mises: # Property, not method + von_mises = stress.data[itime, :, 9] # Column 9 is von Mises + max_stress = float(np.max(von_mises)) + + # Get element info + element_ids = [eid for (eid, node) in stress.element_node] + max_stress_elem = element_ids[np.argmax(von_mises)] + + return { + 'max_von_mises': max_stress, + 'max_stress_element': int(max_stress_elem) + } + else: + raise ValueError("von Mises stress not available") + + +if __name__ == '__main__': + # Example usage + import sys + if len(sys.argv) > 1: + op2_file = Path(sys.argv[1]) + result = extract_solid_stress(op2_file) + print(f"Extraction result: {result}") + else: + print("Usage: python {sys.argv[0]} ") diff --git a/studies/bracket_displacement_maximizing/results/best_design.json b/studies/bracket_displacement_maximizing/results/best_design.json new file mode 100644 index 00000000..59185445 --- /dev/null +++ b/studies/bracket_displacement_maximizing/results/best_design.json @@ -0,0 +1,19 @@ +{ + "trial_number": 0, + "parameters": { + "tip_thickness": 18.62158638569138, + "support_angle": 35.6600382365223 + }, + "objective_value": 0.36178338527679443, + "timestamp": "2025-11-16T21:05:03.825107", + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + } +} \ No newline at end of file diff --git a/studies/bracket_displacement_maximizing/results/bracket_displacement_maximizing.db b/studies/bracket_displacement_maximizing/results/bracket_displacement_maximizing.db new file mode 100644 index 00000000..85542887 Binary files /dev/null and b/studies/bracket_displacement_maximizing/results/bracket_displacement_maximizing.db differ diff --git a/studies/bracket_displacement_maximizing/results/generated_extractors/extract_displacement.py b/studies/bracket_displacement_maximizing/results/generated_extractors/extract_displacement.py new file mode 100644 index 00000000..3d0ec41a --- /dev/null +++ b/studies/bracket_displacement_maximizing/results/generated_extractors/extract_displacement.py @@ -0,0 +1,56 @@ +""" +Extract displacement results from OP2 file +Auto-generated by Atomizer Phase 3 - pyNastran Research Agent + +Pattern: displacement +Element Type: General +Result Type: displacement +API: model.displacements[subcase] +""" + +from pathlib import Path +from typing import Dict, Any +import numpy as np +from pyNastran.op2.op2 import OP2 + + +def extract_displacement(op2_file: Path, subcase: int = 1): + """Extract displacement results from OP2 file.""" + from pyNastran.op2.op2 import OP2 + import numpy as np + + model = OP2() + model.read_op2(str(op2_file)) + + disp = model.displacements[subcase] + itime = 0 # static case + + # Extract translation components + txyz = disp.data[itime, :, :3] # [tx, ty, tz] + + # Calculate total displacement + total_disp = np.linalg.norm(txyz, axis=1) + max_disp = np.max(total_disp) + + # Get node info + node_ids = [nid for (nid, grid_type) in disp.node_gridtype] + max_disp_node = node_ids[np.argmax(total_disp)] + + return { + 'max_displacement': float(max_disp), + 'max_disp_node': int(max_disp_node), + 'max_disp_x': float(np.max(np.abs(txyz[:, 0]))), + 'max_disp_y': float(np.max(np.abs(txyz[:, 1]))), + 'max_disp_z': float(np.max(np.abs(txyz[:, 2]))) + } + + +if __name__ == '__main__': + # Example usage + import sys + if len(sys.argv) > 1: + op2_file = Path(sys.argv[1]) + result = extract_displacement(op2_file) + print(f"Extraction result: {result}") + else: + print("Usage: python {sys.argv[0]} ") diff --git a/studies/bracket_displacement_maximizing/results/generated_extractors/extract_solid_stress.py b/studies/bracket_displacement_maximizing/results/generated_extractors/extract_solid_stress.py new file mode 100644 index 00000000..a27d221b --- /dev/null +++ b/studies/bracket_displacement_maximizing/results/generated_extractors/extract_solid_stress.py @@ -0,0 +1,64 @@ +""" +Extract von Mises stress from CHEXA elements +Auto-generated by Atomizer Phase 3 - pyNastran Research Agent + +Pattern: solid_stress +Element Type: CTETRA +Result Type: stress +API: model.ctetra_stress[subcase] or model.chexa_stress[subcase] +""" + +from pathlib import Path +from typing import Dict, Any +import numpy as np +from pyNastran.op2.op2 import OP2 + + +def extract_solid_stress(op2_file: Path, subcase: int = 1, element_type: str = 'ctetra'): + """Extract stress from solid elements.""" + from pyNastran.op2.op2 import OP2 + import numpy as np + + model = OP2() + model.read_op2(str(op2_file)) + + # Get stress object for element type + # In pyNastran, stress is stored in model.op2_results.stress + stress_attr = f"{element_type}_stress" + + if not hasattr(model, 'op2_results') or not hasattr(model.op2_results, 'stress'): + raise ValueError(f"No stress results in OP2") + + stress_obj = model.op2_results.stress + if not hasattr(stress_obj, stress_attr): + raise ValueError(f"No {element_type} stress results in OP2") + + stress = getattr(stress_obj, stress_attr)[subcase] + itime = 0 + + # Extract von Mises if available + if stress.is_von_mises: # Property, not method + von_mises = stress.data[itime, :, 9] # Column 9 is von Mises + max_stress = float(np.max(von_mises)) + + # Get element info + element_ids = [eid for (eid, node) in stress.element_node] + max_stress_elem = element_ids[np.argmax(von_mises)] + + return { + 'max_von_mises': max_stress, + 'max_stress_element': int(max_stress_elem) + } + else: + raise ValueError("von Mises stress not available") + + +if __name__ == '__main__': + # Example usage + import sys + if len(sys.argv) > 1: + op2_file = Path(sys.argv[1]) + result = extract_solid_stress(op2_file) + print(f"Extraction result: {result}") + else: + print("Usage: python {sys.argv[0]} ") diff --git a/studies/bracket_displacement_maximizing/results/optimization_history.json b/studies/bracket_displacement_maximizing/results/optimization_history.json new file mode 100644 index 00000000..d305aa65 --- /dev/null +++ b/studies/bracket_displacement_maximizing/results/optimization_history.json @@ -0,0 +1,362 @@ +[ + { + "trial_number": 2, + "design_variables": { + "tip_thickness": 16.340803300010094, + "support_angle": 30.818909896109847 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 3, + "design_variables": { + "tip_thickness": 18.105380892934622, + "support_angle": 28.298283536798394 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 4, + "design_variables": { + "tip_thickness": 17.721287462514425, + "support_angle": 32.388109319134045 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 5, + "design_variables": { + "tip_thickness": 22.910324196496077, + "support_angle": 22.589443923024472 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 6, + "design_variables": { + "tip_thickness": 16.19304697862953, + "support_angle": 36.06797331023344 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 7, + "design_variables": { + "tip_thickness": 15.61436419929355, + "support_angle": 35.52844150612963 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 8, + "design_variables": { + "tip_thickness": 21.42102362423531, + "support_angle": 37.41818639166882 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 9, + "design_variables": { + "tip_thickness": 22.185997816011707, + "support_angle": 36.80015632779197 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 10, + "design_variables": { + "tip_thickness": 19.181063532905092, + "support_angle": 23.746248246929593 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 11, + "design_variables": { + "tip_thickness": 24.107160812576737, + "support_angle": 39.72739387320189 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 12, + "design_variables": { + "tip_thickness": 17.1865774070726, + "support_angle": 30.54937374454046 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 13, + "design_variables": { + "tip_thickness": 20.31609875070344, + "support_angle": 27.073654676569404 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 14, + "design_variables": { + "tip_thickness": 15.1845181734436, + "support_angle": 32.52232339316216 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 15, + "design_variables": { + "tip_thickness": 19.211334691131885, + "support_angle": 33.4592438738482 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 16, + "design_variables": { + "tip_thickness": 16.792132776707774, + "support_angle": 26.040842595230526 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 17, + "design_variables": { + "tip_thickness": 18.575846314465224, + "support_angle": 20.067231334411122 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 18, + "design_variables": { + "tip_thickness": 20.462945983827563, + "support_angle": 30.03135433203613 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 19, + "design_variables": { + "tip_thickness": 16.64736533354882, + "support_angle": 39.42124051821946 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 20, + "design_variables": { + "tip_thickness": 19.543467357432874, + "support_angle": 34.302655610432176 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + }, + { + "trial_number": 21, + "design_variables": { + "tip_thickness": 17.676096024627086, + "support_angle": 30.254143696679552 + }, + "results": { + "max_displacement": 0.36178338527679443, + "max_disp_node": 91, + "max_disp_x": 0.0029173935763537884, + "max_disp_y": 0.07424411177635193, + "max_disp_z": 0.3540833592414856 + }, + "calculations": { + "neg_displacement": -0.36178338527679443 + }, + "objective": 0.36178338527679443 + } +] \ No newline at end of file diff --git a/studies/bracket_displacement_maximizing/results/optimization_report.md b/studies/bracket_displacement_maximizing/results/optimization_report.md new file mode 100644 index 00000000..4852f2a9 --- /dev/null +++ b/studies/bracket_displacement_maximizing/results/optimization_report.md @@ -0,0 +1,25 @@ +# Bracket Displacement Maximization - Optimization Report + +**Generated**: 2025-11-16 21:05:03 + +## Problem Definition + +- **Objective**: Maximize displacement +- **Constraint**: Safety factor >= 4.0 +- **Material**: Aluminum 6061-T6 (Yield = 276 MPa) +- **Design Variables**: + - tip_thickness: 15-25 mm + - support_angle: 20-40 degrees + +## Best Design + +- **Trial**: 0 +- **tip_thickness**: 18.622 mm +- **support_angle**: 35.660 degrees +- **Objective value**: 0.361783 + +## Performance + +- **Max displacement**: 0.361783 mm +- **Max stress**: 0.000 MPa +- **Safety factor**: 0.000 diff --git a/studies/bracket_displacement_maximizing/results/optimization_results.json b/studies/bracket_displacement_maximizing/results/optimization_results.json new file mode 100644 index 00000000..9d2cc0bd --- /dev/null +++ b/studies/bracket_displacement_maximizing/results/optimization_results.json @@ -0,0 +1,11 @@ +{ + "best_params": { + "tip_thickness": 18.62158638569138, + "support_angle": 35.6600382365223 + }, + "best_value": 0.36178338527679443, + "best_trial_number": 0, + "timestamp": "2025-11-16T21:05:03.823107", + "study_name": "bracket_displacement_maximizing", + "n_trials": 20 +} \ No newline at end of file diff --git a/studies/bracket_displacement_maximizing/run_optimization.py b/studies/bracket_displacement_maximizing/run_optimization.py new file mode 100644 index 00000000..5ac77943 --- /dev/null +++ b/studies/bracket_displacement_maximizing/run_optimization.py @@ -0,0 +1,370 @@ +""" +Bracket Displacement Maximization Study +======================================== + +Complete optimization workflow using Phase 3.3 Wizard: +1. Setup wizard validates the complete pipeline +2. Auto-detects element types from OP2 +3. Runs 20-trial optimization +4. Generates comprehensive report +5. Saves results in study directory + +Objective: Maximize displacement +Constraint: Safety factor >= 4.0 +Material: Aluminum 6061-T6 (Yield = 276 MPa) +Design Variables: tip_thickness (15-25mm), support_angle (20-40deg) +""" + +import sys +import json +from pathlib import Path +from datetime import datetime + +# Add parent directories to path +sys.path.insert(0, str(Path(__file__).parent.parent.parent)) + +from optimization_engine.optimization_setup_wizard import OptimizationSetupWizard +from optimization_engine.llm_optimization_runner import LLMOptimizationRunner +from optimization_engine.nx_solver import NXSolver +from optimization_engine.nx_updater import NXParameterUpdater + + +def print_section(title: str): + """Print a section header.""" + print() + print("=" * 80) + print(f" {title}") + print("=" * 80) + print() + + +def save_results(results: dict, study_dir: Path): + """Save optimization results to study directory.""" + results_dir = study_dir / "results" + results_dir.mkdir(exist_ok=True) + + # Save complete history + history_file = results_dir / "optimization_history.json" + with open(history_file, 'w') as f: + json.dump(results['history'], f, indent=2, default=str) + + # Save best design + best_design = { + 'trial_number': results['best_trial_number'], + 'parameters': results['best_params'], + 'objective_value': results['best_value'], + 'timestamp': datetime.now().isoformat() + } + + best_trial = results['history'][results['best_trial_number']] + best_design['results'] = best_trial['results'] + best_design['calculations'] = best_trial['calculations'] + + best_file = results_dir / "best_design.json" + with open(best_file, 'w') as f: + json.dump(best_design, f, indent=2, default=str) + + # Generate markdown report + report_file = results_dir / "optimization_report.md" + with open(report_file, 'w') as f: + f.write("# Bracket Displacement Maximization - Optimization Report\n\n") + f.write(f"**Generated**: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n\n") + + f.write("## Problem Definition\n\n") + f.write("- **Objective**: Maximize displacement\n") + f.write("- **Constraint**: Safety factor >= 4.0\n") + f.write("- **Material**: Aluminum 6061-T6 (Yield = 276 MPa)\n") + f.write("- **Design Variables**:\n") + f.write(" - tip_thickness: 15-25 mm\n") + f.write(" - support_angle: 20-40 degrees\n\n") + + f.write("## Best Design\n\n") + f.write(f"- **Trial**: {results['best_trial_number']}\n") + f.write(f"- **tip_thickness**: {results['best_params']['tip_thickness']:.3f} mm\n") + f.write(f"- **support_angle**: {results['best_params']['support_angle']:.3f} degrees\n") + f.write(f"- **Objective value**: {results['best_value']:.6f}\n\n") + + best_results = best_trial['results'] + best_calcs = best_trial['calculations'] + + f.write("## Performance\n\n") + f.write(f"- **Max displacement**: {best_results.get('max_displacement', 0):.6f} mm\n") + f.write(f"- **Max stress**: {best_results.get('max_von_mises', 0):.3f} MPa\n") + f.write(f"- **Safety factor**: {best_calcs.get('safety_factor', 0):.3f}\n") + f.write(f"- **Constraint**: {'✓ SATISFIED' if best_calcs.get('safety_factor', 0) >= 4.0 else '✗ VIOLATED'}\n\n") + + f.write("## Trial History\n\n") + f.write("| Trial | Tip (mm) | Angle (°) | Disp (mm) | Stress (MPa) | SF | Objective |\n") + f.write("|-------|----------|-----------|-----------|--------------|----|-----------|\n") + + for trial in results['history']: + num = trial['trial_number'] + tip = trial['design_variables']['tip_thickness'] + ang = trial['design_variables']['support_angle'] + disp = trial['results'].get('max_displacement', 0) + stress = trial['results'].get('max_von_mises', 0) + sf = trial['calculations'].get('safety_factor', 0) + obj = trial['objective'] + f.write(f"| {num} | {tip:.2f} | {ang:.2f} | {disp:.6f} | {stress:.2f} | {sf:.2f} | {obj:.6f} |\n") + + return history_file, best_file, report_file + + +def main(): + print_section("BRACKET DISPLACEMENT MAXIMIZATION STUDY") + + print("Study Configuration:") + print(" - Objective: Maximize displacement") + print(" - Constraint: Safety factor >= 4.0") + print(" - Material: Aluminum 6061-T6 (Yield = 276 MPa)") + print(" - Design Variables:") + print(" * tip_thickness: 15-25 mm") + print(" * support_angle: 20-40 degrees") + print(" - Optimization trials: 20") + print() + + # File paths - USE STUDY DIRECTORY + study_dir = Path(__file__).parent + prt_file = study_dir / "model" / "Bracket.prt" + sim_file = study_dir / "model" / "Bracket_sim1.sim" + + if not prt_file.exists(): + print(f"ERROR: Part file not found: {prt_file}") + sys.exit(1) + + if not sim_file.exists(): + print(f"ERROR: Simulation file not found: {sim_file}") + sys.exit(1) + + print(f"Part file: {prt_file}") + print(f"Simulation file: {sim_file}") + print(f"Study directory: {study_dir}") + print() + + # ========================================================================= + # PHASE 3.3: OPTIMIZATION SETUP WIZARD + # ========================================================================= + + print_section("STEP 1: INITIALIZATION") + + print("Initializing Optimization Setup Wizard...") + wizard = OptimizationSetupWizard(prt_file, sim_file) + print(" [OK] Wizard initialized") + print() + + print_section("STEP 2: MODEL INTROSPECTION") + + print("Reading NX model expressions...") + model_info = wizard.introspect_model() + + print(f"Found {len(model_info.expressions)} expressions:") + for name, info in model_info.expressions.items(): + print(f" - {name}: {info['value']} {info['units']}") + print() + + print_section("STEP 3: BASELINE SIMULATION") + + print("Running baseline simulation to generate reference OP2...") + print("(This validates that NX simulation works before optimization)") + baseline_op2 = wizard.run_baseline_simulation() + print(f" [OK] Baseline OP2: {baseline_op2.name}") + print() + + print_section("STEP 4: OP2 INTROSPECTION") + + print("Analyzing OP2 file to auto-detect element types...") + op2_info = wizard.introspect_op2() + + print("OP2 Contents:") + print(f" - Element types with stress: {', '.join(op2_info.element_types)}") + print(f" - Available result types: {', '.join(op2_info.result_types)}") + print(f" - Subcases: {op2_info.subcases}") + print(f" - Nodes: {op2_info.node_count}") + print(f" - Elements: {op2_info.element_count}") + print() + + print_section("STEP 5: WORKFLOW CONFIGURATION") + + print("Building LLM workflow with auto-detected element types...") + + # Use the FIRST detected element type (could be CHEXA, CPENTA, CTETRA, etc.) + detected_element_type = op2_info.element_types[0].lower() if op2_info.element_types else 'ctetra' + + print(f" Using detected element type: {detected_element_type.upper()}") + print() + + llm_workflow = { + 'engineering_features': [ + { + 'action': 'extract_displacement', + 'domain': 'result_extraction', + 'description': 'Extract displacement results from OP2 file', + 'params': {'result_type': 'displacement'} + }, + { + 'action': 'extract_solid_stress', + 'domain': 'result_extraction', + 'description': f'Extract von Mises stress from {detected_element_type.upper()} elements', + 'params': { + 'result_type': 'stress', + 'element_type': detected_element_type # AUTO-DETECTED! + } + } + ], + 'inline_calculations': [ + { + 'action': 'calculate_safety_factor', + 'params': { + 'input': 'max_von_mises', + 'yield_strength': 276.0, # MPa for Aluminum 6061-T6 + 'operation': 'divide' + }, + 'code_hint': 'safety_factor = 276.0 / max_von_mises' + }, + { + 'action': 'negate_displacement', + 'params': { + 'input': 'max_displacement', + 'operation': 'negate' + }, + 'code_hint': 'neg_displacement = -max_displacement' + } + ], + 'post_processing_hooks': [], # Using manual safety_factor_constraint hook + 'optimization': { + 'algorithm': 'TPE', + 'direction': 'minimize', # Minimize neg_displacement = maximize displacement + 'design_variables': [ + { + 'parameter': 'tip_thickness', + 'min': 15.0, + 'max': 25.0, + 'units': 'mm' + }, + { + 'parameter': 'support_angle', + 'min': 20.0, + 'max': 40.0, + 'units': 'degrees' + } + ] + } + } + + print_section("STEP 6: PIPELINE VALIDATION") + + print("Validating complete pipeline with baseline OP2...") + print("(Dry-run test of extractors, calculations, hooks, objective)") + print() + + validation_results = wizard.validate_pipeline(llm_workflow) + + all_passed = all(r.success for r in validation_results) + + print("Validation Results:") + for result in validation_results: + status = "[OK]" if result.success else "[FAIL]" + print(f" {status} {result.component}: {result.message.split(':')[-1].strip()}") + print() + + if not all_passed: + print("[FAILED] Pipeline validation failed!") + print("Fix the issues above before running optimization.") + sys.exit(1) + + print("[SUCCESS] All pipeline components validated!") + print() + + print_section("STEP 7: OPTIMIZATION SETUP") + + print("Creating model updater and simulation runner...") + + # Model updater - UPDATE MODEL IN STUDY DIRECTORY + updater = NXParameterUpdater(prt_file_path=prt_file) + def model_updater(design_vars: dict): + updater.update_expressions(design_vars) + updater.save() + + # Simulation runner - RUN SIMULATIONS IN STUDY DIRECTORY + solver = NXSolver(nastran_version='2412', use_journal=True) + def simulation_runner(design_vars: dict) -> Path: + # Pass expression values to NX journal so it can update geometry + result = solver.run_simulation(sim_file, expression_updates=design_vars) + return result['op2_file'] + + print(" [OK] Model updater ready") + print(" [OK] Simulation runner ready") + print() + + print("Initializing LLM optimization runner...") + + # Save results in study/results directory + runner = LLMOptimizationRunner( + llm_workflow=llm_workflow, + model_updater=model_updater, + simulation_runner=simulation_runner, + study_name='bracket_displacement_maximizing', + output_dir=study_dir / "results" + ) + + print(f" [OK] Output directory: {runner.output_dir}") + print(f" [OK] Extractors generated: {len(runner.extractors)}") + print(f" [OK] Inline calculations: {len(runner.inline_code)}") + hook_summary = runner.hook_manager.get_summary() + print(f" [OK] Hooks loaded: {hook_summary['enabled_hooks']}") + print() + + print_section("STEP 8: RUNNING OPTIMIZATION") + + print("Starting 20-trial optimization...") + print("(This will take several minutes)") + print() + + start_time = datetime.now() + results = runner.run_optimization(n_trials=20) + end_time = datetime.now() + + duration = (end_time - start_time).total_seconds() + + print() + print_section("OPTIMIZATION COMPLETE!") + + print(f"Duration: {duration:.1f} seconds ({duration/60:.1f} minutes)") + print() + print("Best Design Found:") + print(f" - tip_thickness: {results['best_params']['tip_thickness']:.3f} mm") + print(f" - support_angle: {results['best_params']['support_angle']:.3f} degrees") + print(f" - Objective value: {results['best_value']:.6f}") + print() + + # Show best trial details + best_trial = results['history'][results['best_trial_number']] + best_results = best_trial['results'] + best_calcs = best_trial['calculations'] + + print("Best Design Performance:") + print(f" - Max displacement: {best_results.get('max_displacement', 0):.6f} mm") + print(f" - Max stress: {best_results.get('max_von_mises', 0):.3f} MPa") + print(f" - Safety factor: {best_calcs.get('safety_factor', 0):.3f}") + print(f" - Constraint: {'SATISFIED' if best_calcs.get('safety_factor', 0) >= 4.0 else 'VIOLATED'}") + print() + + # Save results + print("Saving results...") + history_file, best_file, report_file = save_results(results, study_dir) + print(f" [OK] History: {history_file.name}") + print(f" [OK] Best design: {best_file.name}") + print(f" [OK] Report: {report_file.name}") + print() + + print_section("STUDY COMPLETE!") + print("Phase 3.3 Optimization Setup Wizard successfully guided the") + print("complete optimization from setup through execution!") + print() + print(f"Study directory: {study_dir}") + print(f"Results directory: {study_dir / 'results'}") + print() + + +if __name__ == '__main__': + main() diff --git a/studies/bracket_displacement_maximizing/run_optimization_old.py b/studies/bracket_displacement_maximizing/run_optimization_old.py new file mode 100644 index 00000000..b076858d --- /dev/null +++ b/studies/bracket_displacement_maximizing/run_optimization_old.py @@ -0,0 +1,283 @@ +""" +Bracket Displacement Maximization Study +======================================== + +Complete optimization workflow using Phase 3.3 Wizard: +1. Setup wizard validates the complete pipeline +2. Auto-detects element types from OP2 +3. Runs 20-trial optimization +4. Generates comprehensive report + +Objective: Maximize displacement +Constraint: Safety factor >= 4.0 +Material: Aluminum 6061-T6 (Yield = 276 MPa) +Design Variables: tip_thickness (15-25mm), support_angle (20-40deg) +""" + +import sys +from pathlib import Path + +# Add parent directories to path +sys.path.insert(0, str(Path(__file__).parent.parent.parent)) + +from optimization_engine.optimization_setup_wizard import OptimizationSetupWizard +from optimization_engine.llm_optimization_runner import LLMOptimizationRunner +from optimization_engine.nx_solver import NXSolver +from optimization_engine.nx_updater import NXParameterUpdater +from datetime import datetime + + +def print_section(title: str): + """Print a section header.""" + print() + print("=" * 80) + print(f" {title}") + print("=" * 80) + print() + + +def main(): + print_section("BRACKET DISPLACEMENT MAXIMIZATION STUDY") + + print("Study Configuration:") + print(" - Objective: Maximize displacement") + print(" - Constraint: Safety factor >= 4.0") + print(" - Material: Aluminum 6061-T6 (Yield = 276 MPa)") + print(" - Design Variables:") + print(" * tip_thickness: 15-25 mm") + print(" * support_angle: 20-40 degrees") + print(" - Optimization trials: 20") + print() + + # File paths + base_dir = Path(__file__).parent.parent.parent + prt_file = base_dir / "tests" / "Bracket.prt" + sim_file = base_dir / "tests" / "Bracket_sim1.sim" + + if not prt_file.exists(): + print(f"ERROR: Part file not found: {prt_file}") + sys.exit(1) + + if not sim_file.exists(): + print(f"ERROR: Simulation file not found: {sim_file}") + sys.exit(1) + + print(f"Part file: {prt_file}") + print(f"Simulation file: {sim_file}") + print() + + # ========================================================================= + # PHASE 3.3: OPTIMIZATION SETUP WIZARD + # ========================================================================= + + print_section("STEP 1: INITIALIZATION") + + print("Initializing Optimization Setup Wizard...") + wizard = OptimizationSetupWizard(prt_file, sim_file) + print(" [OK] Wizard initialized") + print() + + print_section("STEP 2: MODEL INTROSPECTION") + + print("Reading NX model expressions...") + model_info = wizard.introspect_model() + + print(f"Found {len(model_info.expressions)} expressions:") + for name, info in model_info.expressions.items(): + print(f" - {name}: {info['value']} {info['units']}") + print() + + print_section("STEP 3: BASELINE SIMULATION") + + print("Running baseline simulation to generate reference OP2...") + print("(This validates that NX simulation works before optimization)") + baseline_op2 = wizard.run_baseline_simulation() + print(f" [OK] Baseline OP2: {baseline_op2.name}") + print() + + print_section("STEP 4: OP2 INTROSPECTION") + + print("Analyzing OP2 file to auto-detect element types...") + op2_info = wizard.introspect_op2() + + print("OP2 Contents:") + print(f" - Element types with stress: {', '.join(op2_info.element_types)}") + print(f" - Available result types: {', '.join(op2_info.result_types)}") + print(f" - Subcases: {op2_info.subcases}") + print(f" - Nodes: {op2_info.node_count}") + print(f" - Elements: {op2_info.element_count}") + print() + + print_section("STEP 5: WORKFLOW CONFIGURATION") + + print("Building LLM workflow with auto-detected element types...") + + # Use the FIRST detected element type (could be CHEXA, CPENTA, CTETRA, etc.) + detected_element_type = op2_info.element_types[0].lower() if op2_info.element_types else 'ctetra' + + print(f" Using detected element type: {detected_element_type.upper()}") + print() + + llm_workflow = { + 'engineering_features': [ + { + 'action': 'extract_displacement', + 'domain': 'result_extraction', + 'description': 'Extract displacement results from OP2 file', + 'params': {'result_type': 'displacement'} + }, + { + 'action': 'extract_solid_stress', + 'domain': 'result_extraction', + 'description': f'Extract von Mises stress from {detected_element_type.upper()} elements', + 'params': { + 'result_type': 'stress', + 'element_type': detected_element_type # AUTO-DETECTED! + } + } + ], + 'inline_calculations': [ + { + 'action': 'calculate_safety_factor', + 'params': { + 'input': 'max_von_mises', + 'yield_strength': 276.0, # MPa for Aluminum 6061-T6 + 'operation': 'divide' + }, + 'code_hint': 'safety_factor = 276.0 / max_von_mises' + }, + { + 'action': 'negate_displacement', + 'params': { + 'input': 'max_displacement', + 'operation': 'negate' + }, + 'code_hint': 'neg_displacement = -max_displacement' + } + ], + 'post_processing_hooks': [], # Using manual safety_factor_constraint hook + 'optimization': { + 'algorithm': 'TPE', + 'direction': 'minimize', # Minimize neg_displacement = maximize displacement + 'design_variables': [ + { + 'parameter': 'tip_thickness', + 'min': 15.0, + 'max': 25.0, + 'units': 'mm' + }, + { + 'parameter': 'support_angle', + 'min': 20.0, + 'max': 40.0, + 'units': 'degrees' + } + ] + } + } + + print_section("STEP 6: PIPELINE VALIDATION") + + print("Validating complete pipeline with baseline OP2...") + print("(Dry-run test of extractors, calculations, hooks, objective)") + print() + + validation_results = wizard.validate_pipeline(llm_workflow) + + all_passed = all(r.success for r in validation_results) + + print("Validation Results:") + for result in validation_results: + status = "[OK]" if result.success else "[FAIL]" + print(f" {status} {result.component}: {result.message.split(':')[-1].strip()}") + print() + + if not all_passed: + print("[FAILED] Pipeline validation failed!") + print("Fix the issues above before running optimization.") + sys.exit(1) + + print("[SUCCESS] All pipeline components validated!") + print() + + print_section("STEP 7: OPTIMIZATION SETUP") + + print("Creating model updater and simulation runner...") + + # Model updater + updater = NXParameterUpdater(prt_file_path=prt_file) + def model_updater(design_vars: dict): + updater.update_expressions(design_vars) + updater.save() + + # Simulation runner + solver = NXSolver(nastran_version='2412', use_journal=True) + def simulation_runner() -> Path: + result = solver.run_simulation(sim_file) + return result['op2_file'] + + print(" [OK] Model updater ready") + print(" [OK] Simulation runner ready") + print() + + print("Initializing LLM optimization runner...") + runner = LLMOptimizationRunner( + llm_workflow=llm_workflow, + model_updater=model_updater, + simulation_runner=simulation_runner, + study_name='bracket_displacement_maximizing' + ) + + print(f" [OK] Output directory: {runner.output_dir}") + print(f" [OK] Extractors generated: {len(runner.extractors)}") + print(f" [OK] Inline calculations: {len(runner.inline_code)}") + hook_summary = runner.hook_manager.get_summary() + print(f" [OK] Hooks loaded: {hook_summary['enabled_hooks']}") + print() + + print_section("STEP 8: RUNNING OPTIMIZATION") + + print("Starting 20-trial optimization...") + print("(This will take several minutes)") + print() + + start_time = datetime.now() + results = runner.run_optimization(n_trials=20) + end_time = datetime.now() + + duration = (end_time - start_time).total_seconds() + + print() + print_section("OPTIMIZATION COMPLETE!") + + print(f"Duration: {duration:.1f} seconds ({duration/60:.1f} minutes)") + print() + print("Best Design Found:") + print(f" - tip_thickness: {results['best_params']['tip_thickness']:.3f} mm") + print(f" - support_angle: {results['best_params']['support_angle']:.3f} degrees") + print(f" - Objective value: {results['best_value']:.6f}") + print() + + # Show best trial details + best_trial = results['history'][results['best_trial_number']] + best_results = best_trial['results'] + best_calcs = best_trial['calculations'] + + print("Best Design Performance:") + print(f" - Max displacement: {best_results.get('max_displacement', 0):.6f} mm") + print(f" - Max stress: {best_results.get('max_von_mises', 0):.3f} MPa") + print(f" - Safety factor: {best_calcs.get('safety_factor', 0):.3f}") + print(f" - Constraint: {'SATISFIED' if best_calcs.get('safety_factor', 0) >= 4.0 else 'VIOLATED'}") + print() + + print(f"Results saved to: {runner.output_dir}") + print() + + print_section("STUDY COMPLETE!") + print("Phase 3.3 Optimization Setup Wizard successfully guided the") + print("complete optimization from setup through execution!") + print() + + +if __name__ == '__main__': + main() diff --git a/studies/bracket_displacement_maximizing/run_substudy.py b/studies/bracket_displacement_maximizing/run_substudy.py new file mode 100644 index 00000000..d98ffa6f --- /dev/null +++ b/studies/bracket_displacement_maximizing/run_substudy.py @@ -0,0 +1,293 @@ +""" +Bracket Displacement Maximization - Substudy Runner +==================================================== + +Run optimization substudies with shared model but independent configurations. +Supports: +- Multiple substudies with different parameters (coarse/fine, different algorithms) +- Continuation from previous substudy results +- Real-time incremental history updates +- Shared model files (Bracket.prt, Bracket_fem1.fem, Bracket_sim1.sim) + +Usage: + python run_substudy.py coarse_exploration + python run_substudy.py fine_tuning +""" + +import sys +import json +from pathlib import Path +from datetime import datetime + +# Add parent directories to path +sys.path.insert(0, str(Path(__file__).parent.parent.parent)) + +from optimization_engine.optimization_setup_wizard import OptimizationSetupWizard +from optimization_engine.llm_optimization_runner import LLMOptimizationRunner +from optimization_engine.nx_solver import NXSolver +from optimization_engine.nx_updater import NXParameterUpdater + + +def print_section(title: str): + """Print a section header.""" + print() + print("=" * 80) + print(f" {title}") + print("=" * 80) + print() + + +def load_substudy_config(substudy_path: Path) -> dict: + """Load substudy configuration.""" + config_file = substudy_path / "config.json" + if not config_file.exists(): + raise FileNotFoundError(f"Substudy config not found: {config_file}") + + with open(config_file, 'r') as f: + return json.load(f) + + +def load_parent_best_params(parent_substudy_path: Path) -> dict: + """Load best parameters from parent substudy for continuation.""" + best_file = parent_substudy_path / "best_design.json" + if not best_file.exists(): + return None + + with open(best_file, 'r') as f: + best_design = json.load(f) + return best_design.get('parameters', {}) + + +def save_substudy_results(results: dict, substudy_dir: Path, config: dict): + """Save substudy results.""" + # Save complete history + history_file = substudy_dir / "optimization_history.json" + with open(history_file, 'w') as f: + json.dump(results['history'], f, indent=2, default=str) + + # Save best design + # Find the best trial in history (trial_number starts at 1, but list is 0-indexed) + best_trial_num = results['best_trial_number'] + best_trial = next((t for t in results['history'] if t['trial_number'] == best_trial_num), None) + if not best_trial: + # Fallback: assume trial numbers are 1-indexed + best_trial = results['history'][best_trial_num - 1] if best_trial_num > 0 else results['history'][0] + best_design = { + 'substudy_name': config['substudy_name'], + 'trial_number': results['best_trial_number'], + 'parameters': results['best_params'], + 'objective_value': results['best_value'], + 'results': best_trial['results'], + 'calculations': best_trial['calculations'], + 'timestamp': datetime.now().isoformat() + } + + best_file = substudy_dir / "best_design.json" + with open(best_file, 'w') as f: + json.dump(best_design, f, indent=2, default=str) + + # Generate markdown report + report_file = substudy_dir / "report.md" + with open(report_file, 'w') as f: + f.write(f"# {config['substudy_name']} - Optimization Report\n\n") + f.write(f"**Generated**: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n\n") + f.write(f"**Description**: {config.get('description', 'N/A')}\n\n") + + f.write("## Configuration\n\n") + f.write(f"- **Algorithm**: {config['optimization']['algorithm']}\n") + f.write(f"- **Trials**: {config['optimization']['n_trials']}\n") + f.write(f"- **Direction**: {config['optimization']['direction']}\n\n") + + if config.get('continuation', {}).get('enabled'): + f.write("## Continuation\n\n") + f.write(f"- Continued from: `{config['continuation']['from_substudy']}`\n") + f.write(f"- Inherit best params: {config['continuation'].get('inherit_best_params', False)}\n\n") + + f.write("## Best Design\n\n") + f.write(f"- **Trial**: {results['best_trial_number']}\n") + for var in config['optimization']['design_variables']: + var_name = var['name'] + f.write(f"- **{var_name}**: {results['best_params'][var_name]:.3f} {var.get('units', '')}\n") + f.write(f"- **Objective**: {results['best_value']:.6f}\n\n") + + best_results = best_trial['results'] + best_calcs = best_trial['calculations'] + + f.write("## Performance\n\n") + f.write(f"- **Max displacement**: {best_results.get('max_displacement', 0):.6f} mm\n") + f.write(f"- **Max stress**: {best_results.get('max_von_mises', 0):.3f} MPa\n") + f.write(f"- **Safety factor**: {best_calcs.get('safety_factor', 0):.3f}\n\n") + + f.write("## Trial History\n\n") + f.write("| Trial | Tip (mm) | Angle (°) | Disp (mm) | Stress (MPa) | SF | Objective |\n") + f.write("|-------|----------|-----------|-----------|--------------|----|-----------|\n") + + for trial in results['history']: + num = trial['trial_number'] + tip = trial['design_variables']['tip_thickness'] + ang = trial['design_variables']['support_angle'] + disp = trial['results'].get('max_displacement', 0) + stress = trial['results'].get('max_von_mises', 0) + sf = trial['calculations'].get('safety_factor', 0) + obj = trial['objective'] + f.write(f"| {num} | {tip:.2f} | {ang:.2f} | {disp:.6f} | {stress:.2f} | {sf:.2f} | {obj:.6f} |\n") + + return history_file, best_file, report_file + + +def main(): + if len(sys.argv) < 2: + print("Usage: python run_substudy.py ") + print("\nAvailable substudies:") + study_dir = Path(__file__).parent + substudies_dir = study_dir / "substudies" + if substudies_dir.exists(): + for substudy in sorted(substudies_dir.iterdir()): + if substudy.is_dir() and (substudy / "config.json").exists(): + print(f" - {substudy.name}") + sys.exit(1) + + substudy_name = sys.argv[1] + + print_section(f"SUBSTUDY: {substudy_name.upper()}") + + # Paths + study_dir = Path(__file__).parent + substudy_dir = study_dir / "substudies" / substudy_name + + # Shared model files + prt_file = study_dir / "model" / "Bracket.prt" + sim_file = study_dir / "model" / "Bracket_sim1.sim" + + if not substudy_dir.exists(): + print(f"ERROR: Substudy directory not found: {substudy_dir}") + sys.exit(1) + + # Load configuration + config = load_substudy_config(substudy_dir) + + print(f"Substudy: {config['substudy_name']}") + print(f"Description: {config.get('description', 'N/A')}") + print(f"Trials: {config['optimization']['n_trials']}") + print() + + # Check for continuation + if config.get('continuation', {}).get('enabled'): + parent_substudy = config['continuation']['from_substudy'] + parent_dir = study_dir / "substudies" / parent_substudy + print(f"Continuation enabled from: {parent_substudy}") + + if config['continuation'].get('inherit_best_params'): + best_params = load_parent_best_params(parent_dir) + if best_params: + print(f"Starting from best parameters: {best_params}") + print() + + # Run wizard validation (only once per study, use cached baseline) + print_section("VALIDATION") + + baseline_op2 = study_dir / "model" / "bracket_sim1-solution_1.op2" + if baseline_op2.exists(): + print("Using existing baseline OP2 for validation") + else: + print("Running baseline simulation...") + wizard = OptimizationSetupWizard(prt_file, sim_file) + wizard.run_baseline_simulation() + + # Setup optimization + print_section("OPTIMIZATION SETUP") + + # Build LLM workflow from substudy config + llm_workflow = { + 'engineering_features': [ + { + 'action': 'extract_displacement', + 'domain': 'result_extraction', + 'params': {'result_type': 'displacement'} + }, + { + 'action': 'extract_solid_stress', + 'domain': 'result_extraction', + 'params': { + 'result_type': 'stress', + 'element_type': 'chexa' # Auto-detected from baseline + } + } + ], + 'inline_calculations': [ + { + 'action': 'calculate_safety_factor', + 'params': { + 'input': 'max_von_mises', + 'yield_strength': 276.0, + 'operation': 'divide' + }, + 'code_hint': 'safety_factor = 276.0 / max_von_mises' + }, + { + 'action': 'negate_displacement', + 'params': { + 'input': 'max_displacement', + 'operation': 'negate' + }, + 'code_hint': 'neg_displacement = -max_displacement' + } + ], + 'post_processing_hooks': [], + 'optimization': config['optimization'] + } + + # Model updater and simulation runner + updater = NXParameterUpdater(prt_file_path=prt_file) + def model_updater(design_vars: dict): + updater.update_expressions(design_vars) + updater.save() + + solver = NXSolver(nastran_version='2412', use_journal=True) + def simulation_runner(design_vars: dict) -> Path: + result = solver.run_simulation(sim_file, expression_updates=design_vars) + return result['op2_file'] + + # Initialize runner with substudy-specific output directory + runner = LLMOptimizationRunner( + llm_workflow=llm_workflow, + model_updater=model_updater, + simulation_runner=simulation_runner, + study_name=f"{config['substudy_name']}", + output_dir=substudy_dir + ) + + print(f" [OK] Output directory: {substudy_dir}") + print(f" [OK] Incremental history: optimization_history_incremental.json") + print() + + # Run optimization + print_section("RUNNING OPTIMIZATION") + + start_time = datetime.now() + results = runner.run_optimization(n_trials=config['optimization']['n_trials']) + end_time = datetime.now() + + duration = (end_time - start_time).total_seconds() + + print() + print_section("OPTIMIZATION COMPLETE!") + + print(f"Duration: {duration:.1f}s ({duration/60:.1f} min)") + print() + + # Save results + print("Saving results...") + history_file, best_file, report_file = save_substudy_results(results, substudy_dir, config) + print(f" [OK] History: {history_file.name}") + print(f" [OK] Best design: {best_file.name}") + print(f" [OK] Report: {report_file.name}") + print() + + print_section("SUBSTUDY COMPLETE!") + print(f"Substudy directory: {substudy_dir}") + print() + + +if __name__ == '__main__': + main() diff --git a/studies/bracket_displacement_maximizing/substudies/coarse_exploration/coarse_exploration.db b/studies/bracket_displacement_maximizing/substudies/coarse_exploration/coarse_exploration.db new file mode 100644 index 00000000..4490effa Binary files /dev/null and b/studies/bracket_displacement_maximizing/substudies/coarse_exploration/coarse_exploration.db differ diff --git a/studies/bracket_displacement_maximizing/substudies/coarse_exploration/config.json b/studies/bracket_displacement_maximizing/substudies/coarse_exploration/config.json new file mode 100644 index 00000000..aa1d116d --- /dev/null +++ b/studies/bracket_displacement_maximizing/substudies/coarse_exploration/config.json @@ -0,0 +1,31 @@ +{ + "substudy_name": "coarse_exploration", + "description": "Fast coarse exploration with 20 trials across wide parameter space", + "parent_study": "bracket_displacement_maximizing", + "created_date": "2025-11-16", + + "optimization": { + "algorithm": "TPE", + "direction": "minimize", + "n_trials": 20, + "n_startup_trials": 10, + "design_variables": [ + { + "parameter": "tip_thickness", + "min": 15.0, + "max": 25.0, + "units": "mm" + }, + { + "parameter": "support_angle", + "min": 20.0, + "max": 40.0, + "units": "degrees" + } + ] + }, + + "continuation": { + "enabled": false + } +} diff --git a/studies/bracket_displacement_maximizing/substudies/coarse_exploration/generated_extractors/extract_displacement.py b/studies/bracket_displacement_maximizing/substudies/coarse_exploration/generated_extractors/extract_displacement.py new file mode 100644 index 00000000..1d35c61f --- /dev/null +++ b/studies/bracket_displacement_maximizing/substudies/coarse_exploration/generated_extractors/extract_displacement.py @@ -0,0 +1,56 @@ +""" + +Auto-generated by Atomizer Phase 3 - pyNastran Research Agent + +Pattern: displacement +Element Type: General +Result Type: displacement +API: model.displacements[subcase] +""" + +from pathlib import Path +from typing import Dict, Any +import numpy as np +from pyNastran.op2.op2 import OP2 + + +def extract_displacement(op2_file: Path, subcase: int = 1): + """Extract displacement results from OP2 file.""" + from pyNastran.op2.op2 import OP2 + import numpy as np + + model = OP2() + model.read_op2(str(op2_file)) + + disp = model.displacements[subcase] + itime = 0 # static case + + # Extract translation components + txyz = disp.data[itime, :, :3] # [tx, ty, tz] + + # Calculate total displacement + total_disp = np.linalg.norm(txyz, axis=1) + max_disp = np.max(total_disp) + + # Get node info + node_ids = [nid for (nid, grid_type) in disp.node_gridtype] + max_disp_node = node_ids[np.argmax(total_disp)] + + return { + 'max_displacement': float(max_disp), + 'max_disp_node': int(max_disp_node), + 'max_disp_x': float(np.max(np.abs(txyz[:, 0]))), + 'max_disp_y': float(np.max(np.abs(txyz[:, 1]))), + 'max_disp_z': float(np.max(np.abs(txyz[:, 2]))) + } + + +if __name__ == '__main__': + # Example usage + import sys + if len(sys.argv) > 1: + op2_file = Path(sys.argv[1]) + result = extract_displacement(op2_file) + print(f"Extraction result: {result}") + else: + print("Usage: python {sys.argv[0]} ") diff --git a/studies/bracket_displacement_maximizing/substudies/coarse_exploration/generated_extractors/extract_solid_stress.py b/studies/bracket_displacement_maximizing/substudies/coarse_exploration/generated_extractors/extract_solid_stress.py new file mode 100644 index 00000000..3e5996ff --- /dev/null +++ b/studies/bracket_displacement_maximizing/substudies/coarse_exploration/generated_extractors/extract_solid_stress.py @@ -0,0 +1,64 @@ +""" + +Auto-generated by Atomizer Phase 3 - pyNastran Research Agent + +Pattern: solid_stress +Element Type: CTETRA +Result Type: stress +API: model.ctetra_stress[subcase] or model.chexa_stress[subcase] +""" + +from pathlib import Path +from typing import Dict, Any +import numpy as np +from pyNastran.op2.op2 import OP2 + + +def extract_solid_stress(op2_file: Path, subcase: int = 1, element_type: str = 'ctetra'): + """Extract stress from solid elements.""" + from pyNastran.op2.op2 import OP2 + import numpy as np + + model = OP2() + model.read_op2(str(op2_file)) + + # Get stress object for element type + # In pyNastran, stress is stored in model.op2_results.stress + stress_attr = f"{element_type}_stress" + + if not hasattr(model, 'op2_results') or not hasattr(model.op2_results, 'stress'): + raise ValueError(f"No stress results in OP2") + + stress_obj = model.op2_results.stress + if not hasattr(stress_obj, stress_attr): + raise ValueError(f"No {element_type} stress results in OP2") + + stress = getattr(stress_obj, stress_attr)[subcase] + itime = 0 + + # Extract von Mises if available + if stress.is_von_mises: # Property, not method + von_mises = stress.data[itime, :, 9] # Column 9 is von Mises + max_stress = float(np.max(von_mises)) + + # Get element info + element_ids = [eid for (eid, node) in stress.element_node] + max_stress_elem = element_ids[np.argmax(von_mises)] + + return { + 'max_von_mises': max_stress, + 'max_stress_element': int(max_stress_elem) + } + else: + raise ValueError("von Mises stress not available") + + +if __name__ == '__main__': + # Example usage + import sys + if len(sys.argv) > 1: + op2_file = Path(sys.argv[1]) + result = extract_solid_stress(op2_file) + print(f"Extraction result: {result}") + else: + print("Usage: python {sys.argv[0]} ") diff --git a/studies/bracket_displacement_maximizing/substudies/coarse_exploration/optimization_history.json b/studies/bracket_displacement_maximizing/substudies/coarse_exploration/optimization_history.json new file mode 100644 index 00000000..86a1a6f7 --- /dev/null +++ b/studies/bracket_displacement_maximizing/substudies/coarse_exploration/optimization_history.json @@ -0,0 +1,362 @@ +[ + { + "trial_number": 1, + "design_variables": { + "tip_thickness": 17.389878779619163, + "support_angle": 20.866887194604573 + }, + "results": { + "max_displacement": 0.6116114854812622, + "max_disp_node": 55, + "max_disp_x": 0.0039984011091291904, + "max_disp_y": 0.10416693240404129, + "max_disp_z": 0.6026755571365356 + }, + "calculations": { + "neg_displacement": -0.6116114854812622 + }, + "objective": 0.6116114854812622 + }, + { + "trial_number": 2, + "design_variables": { + "tip_thickness": 22.220441224956033, + "support_angle": 30.840923860420357 + }, + "results": { + "max_displacement": 0.28716832399368286, + "max_disp_node": 58, + "max_disp_x": 0.0024955333210527897, + "max_disp_y": 0.06367127597332001, + "max_disp_z": 0.28002074360847473 + }, + "calculations": { + "neg_displacement": -0.28716832399368286 + }, + "objective": 0.28716832399368286 + }, + { + "trial_number": 3, + "design_variables": { + "tip_thickness": 16.556374034848037, + "support_angle": 22.45231282549564 + }, + "results": { + "max_displacement": 0.6623445749282837, + "max_disp_node": 58, + "max_disp_x": 0.004246150143444538, + "max_disp_y": 0.1103561595082283, + "max_disp_z": 0.6530864238739014 + }, + "calculations": { + "neg_displacement": -0.6623445749282837 + }, + "objective": 0.6623445749282837 + }, + { + "trial_number": 4, + "design_variables": { + "tip_thickness": 22.88337112412688, + "support_angle": 34.142850054848 + }, + "results": { + "max_displacement": 0.2482926845550537, + "max_disp_node": 58, + "max_disp_x": 0.002143946709111333, + "max_disp_y": 0.05768103152513504, + "max_disp_z": 0.24149981141090393 + }, + "calculations": { + "neg_displacement": -0.2482926845550537 + }, + "objective": 0.2482926845550537 + }, + { + "trial_number": 5, + "design_variables": { + "tip_thickness": 20.338667724550465, + "support_angle": 29.92278029095064 + }, + "results": { + "max_displacement": 0.34881672263145447, + "max_disp_node": 58, + "max_disp_x": 0.0029699159786105156, + "max_disp_y": 0.07262033224105835, + "max_disp_z": 0.34117355942726135 + }, + "calculations": { + "neg_displacement": -0.34881672263145447 + }, + "objective": 0.34881672263145447 + }, + { + "trial_number": 6, + "design_variables": { + "tip_thickness": 24.50967137117151, + "support_angle": 21.697159236156473 + }, + "results": { + "max_displacement": 0.2758632004261017, + "max_disp_node": 58, + "max_disp_x": 0.00244400673545897, + "max_disp_y": 0.06081655994057655, + "max_disp_z": 0.2690759301185608 + }, + "calculations": { + "neg_displacement": -0.2758632004261017 + }, + "objective": 0.2758632004261017 + }, + { + "trial_number": 7, + "design_variables": { + "tip_thickness": 22.377093973916722, + "support_angle": 31.532495067510975 + }, + "results": { + "max_displacement": 0.27826353907585144, + "max_disp_node": 58, + "max_disp_x": 0.0023749535903334618, + "max_disp_y": 0.06228335201740265, + "max_disp_z": 0.27120357751846313 + }, + "calculations": { + "neg_displacement": -0.27826353907585144 + }, + "objective": 0.27826353907585144 + }, + { + "trial_number": 8, + "design_variables": { + "tip_thickness": 16.397088760589114, + "support_angle": 39.6907686972716 + }, + "results": { + "max_displacement": 0.38282549381256104, + "max_disp_node": 58, + "max_disp_x": 0.0032198228873312473, + "max_disp_y": 0.08009155839681625, + "max_disp_z": 0.37435370683670044 + }, + "calculations": { + "neg_displacement": -0.38282549381256104 + }, + "objective": 0.38282549381256104 + }, + { + "trial_number": 9, + "design_variables": { + "tip_thickness": 15.779109046050685, + "support_angle": 37.544844028080135 + }, + "results": { + "max_displacement": 0.4436984956264496, + "max_disp_node": 58, + "max_disp_x": 0.003604060271754861, + "max_disp_y": 0.08796636015176773, + "max_disp_z": 0.43489110469818115 + }, + "calculations": { + "neg_displacement": -0.4436984956264496 + }, + "objective": 0.4436984956264496 + }, + { + "trial_number": 10, + "design_variables": { + "tip_thickness": 21.072632312643005, + "support_angle": 38.313469876751704 + }, + "results": { + "max_displacement": 0.2564539313316345, + "max_disp_node": 58, + "max_disp_x": 0.002298053354024887, + "max_disp_y": 0.05997171252965927, + "max_disp_z": 0.2493431717157364 + }, + "calculations": { + "neg_displacement": -0.2564539313316345 + }, + "objective": 0.2564539313316345 + }, + { + "trial_number": 11, + "design_variables": { + "tip_thickness": 24.95032894956337, + "support_angle": 34.20965061068569 + }, + "results": { + "max_displacement": 0.21304214000701904, + "max_disp_node": 58, + "max_disp_x": 0.002044219756498933, + "max_disp_y": 0.052074797451496124, + "max_disp_z": 0.20657968521118164 + }, + "calculations": { + "neg_displacement": -0.21304214000701904 + }, + "objective": 0.21304214000701904 + }, + { + "trial_number": 12, + "design_variables": { + "tip_thickness": 24.894489548087346, + "support_angle": 34.551063779949075 + }, + "results": { + "max_displacement": 0.21274541318416595, + "max_disp_node": 58, + "max_disp_x": 0.002061901381239295, + "max_disp_y": 0.052174802869558334, + "max_disp_z": 0.20624838769435883 + }, + "calculations": { + "neg_displacement": -0.21274541318416595 + }, + "objective": 0.21274541318416595 + }, + { + "trial_number": 13, + "design_variables": { + "tip_thickness": 24.952883393809497, + "support_angle": 34.77451710881955 + }, + "results": { + "max_displacement": 0.21082018315792084, + "max_disp_node": 58, + "max_disp_x": 0.0020510517060756683, + "max_disp_y": 0.05187264829874039, + "max_disp_z": 0.20433887839317322 + }, + "calculations": { + "neg_displacement": -0.21082018315792084 + }, + "objective": 0.21082018315792084 + }, + { + "trial_number": 14, + "design_variables": { + "tip_thickness": 18.70443149555537, + "support_angle": 26.11221806912443 + }, + "results": { + "max_displacement": 0.46135807037353516, + "max_disp_node": 58, + "max_disp_x": 0.0034599562641233206, + "max_disp_y": 0.08689243346452713, + "max_disp_z": 0.4531014859676361 + }, + "calculations": { + "neg_displacement": -0.46135807037353516 + }, + "objective": 0.46135807037353516 + }, + { + "trial_number": 15, + "design_variables": { + "tip_thickness": 23.84954584574589, + "support_angle": 34.69889355903453 + }, + "results": { + "max_displacement": 0.22793325781822205, + "max_disp_node": 58, + "max_disp_x": 0.0021433867514133453, + "max_disp_y": 0.05458956956863403, + "max_disp_z": 0.2212996780872345 + }, + "calculations": { + "neg_displacement": -0.22793325781822205 + }, + "objective": 0.22793325781822205 + }, + { + "trial_number": 16, + "design_variables": { + "tip_thickness": 23.545082857154053, + "support_angle": 27.33776442268342 + }, + "results": { + "max_displacement": 0.27459517121315, + "max_disp_node": 58, + "max_disp_x": 0.002392930444329977, + "max_disp_y": 0.06125558167695999, + "max_disp_z": 0.2676756680011749 + }, + "calculations": { + "neg_displacement": -0.27459517121315 + }, + "objective": 0.27459517121315 + }, + { + "trial_number": 17, + "design_variables": { + "tip_thickness": 19.395958700724172, + "support_angle": 35.874156921626124 + }, + "results": { + "max_displacement": 0.32070934772491455, + "max_disp_node": 58, + "max_disp_x": 0.002739877672865987, + "max_disp_y": 0.06964103132486343, + "max_disp_z": 0.3130568861961365 + }, + "calculations": { + "neg_displacement": -0.32070934772491455 + }, + "objective": 0.32070934772491455 + }, + { + "trial_number": 18, + "design_variables": { + "tip_thickness": 21.536592042850017, + "support_angle": 32.171364735552 + }, + "results": { + "max_displacement": 0.29555052518844604, + "max_disp_node": 58, + "max_disp_x": 0.0025494550354778767, + "max_disp_y": 0.06503863632678986, + "max_disp_z": 0.2883055508136749 + }, + "calculations": { + "neg_displacement": -0.29555052518844604 + }, + "objective": 0.29555052518844604 + }, + { + "trial_number": 19, + "design_variables": { + "tip_thickness": 23.75885172872223, + "support_angle": 28.17043178772967 + }, + "results": { + "max_displacement": 0.2622140347957611, + "max_disp_node": 58, + "max_disp_x": 0.002298196544870734, + "max_disp_y": 0.05939820408821106, + "max_disp_z": 0.25539782643318176 + }, + "calculations": { + "neg_displacement": -0.2622140347957611 + }, + "objective": 0.2622140347957611 + }, + { + "trial_number": 20, + "design_variables": { + "tip_thickness": 24.946257551293495, + "support_angle": 36.54595394544202 + }, + "results": { + "max_displacement": 0.20071247220039368, + "max_disp_node": 58, + "max_disp_x": 0.0018801360856741667, + "max_disp_y": 0.05026965215802193, + "max_disp_z": 0.1943153589963913 + }, + "calculations": { + "neg_displacement": -0.20071247220039368 + }, + "objective": 0.20071247220039368 + } +] \ No newline at end of file diff --git a/studies/bracket_displacement_maximizing/substudies/coarse_exploration/optimization_history_incremental.json b/studies/bracket_displacement_maximizing/substudies/coarse_exploration/optimization_history_incremental.json new file mode 100644 index 00000000..ba7709f2 --- /dev/null +++ b/studies/bracket_displacement_maximizing/substudies/coarse_exploration/optimization_history_incremental.json @@ -0,0 +1,362 @@ +[ + { + "trial_number": 1, + "design_variables": { + "tip_thickness": 17.389878779619163, + "support_angle": 20.866887194604573 + }, + "results": { + "max_displacement": 0.6116114854812622, + "max_disp_node": 55.0, + "max_disp_x": 0.0039984011091291904, + "max_disp_y": 0.10416693240404129, + "max_disp_z": 0.6026755571365356 + }, + "calculations": { + "neg_displacement": -0.6116114854812622 + }, + "objective": 0.6116114854812622 + }, + { + "trial_number": 2, + "design_variables": { + "tip_thickness": 22.220441224956033, + "support_angle": 30.840923860420357 + }, + "results": { + "max_displacement": 0.28716832399368286, + "max_disp_node": 58.0, + "max_disp_x": 0.0024955333210527897, + "max_disp_y": 0.06367127597332001, + "max_disp_z": 0.28002074360847473 + }, + "calculations": { + "neg_displacement": -0.28716832399368286 + }, + "objective": 0.28716832399368286 + }, + { + "trial_number": 3, + "design_variables": { + "tip_thickness": 16.556374034848037, + "support_angle": 22.45231282549564 + }, + "results": { + "max_displacement": 0.6623445749282837, + "max_disp_node": 58.0, + "max_disp_x": 0.004246150143444538, + "max_disp_y": 0.1103561595082283, + "max_disp_z": 0.6530864238739014 + }, + "calculations": { + "neg_displacement": -0.6623445749282837 + }, + "objective": 0.6623445749282837 + }, + { + "trial_number": 4, + "design_variables": { + "tip_thickness": 22.88337112412688, + "support_angle": 34.142850054848 + }, + "results": { + "max_displacement": 0.2482926845550537, + "max_disp_node": 58.0, + "max_disp_x": 0.002143946709111333, + "max_disp_y": 0.05768103152513504, + "max_disp_z": 0.24149981141090393 + }, + "calculations": { + "neg_displacement": -0.2482926845550537 + }, + "objective": 0.2482926845550537 + }, + { + "trial_number": 5, + "design_variables": { + "tip_thickness": 20.338667724550465, + "support_angle": 29.92278029095064 + }, + "results": { + "max_displacement": 0.34881672263145447, + "max_disp_node": 58.0, + "max_disp_x": 0.0029699159786105156, + "max_disp_y": 0.07262033224105835, + "max_disp_z": 0.34117355942726135 + }, + "calculations": { + "neg_displacement": -0.34881672263145447 + }, + "objective": 0.34881672263145447 + }, + { + "trial_number": 6, + "design_variables": { + "tip_thickness": 24.50967137117151, + "support_angle": 21.697159236156473 + }, + "results": { + "max_displacement": 0.2758632004261017, + "max_disp_node": 58.0, + "max_disp_x": 0.00244400673545897, + "max_disp_y": 0.06081655994057655, + "max_disp_z": 0.2690759301185608 + }, + "calculations": { + "neg_displacement": -0.2758632004261017 + }, + "objective": 0.2758632004261017 + }, + { + "trial_number": 7, + "design_variables": { + "tip_thickness": 22.377093973916722, + "support_angle": 31.532495067510975 + }, + "results": { + "max_displacement": 0.27826353907585144, + "max_disp_node": 58.0, + "max_disp_x": 0.0023749535903334618, + "max_disp_y": 0.06228335201740265, + "max_disp_z": 0.27120357751846313 + }, + "calculations": { + "neg_displacement": -0.27826353907585144 + }, + "objective": 0.27826353907585144 + }, + { + "trial_number": 8, + "design_variables": { + "tip_thickness": 16.397088760589114, + "support_angle": 39.6907686972716 + }, + "results": { + "max_displacement": 0.38282549381256104, + "max_disp_node": 58.0, + "max_disp_x": 0.0032198228873312473, + "max_disp_y": 0.08009155839681625, + "max_disp_z": 0.37435370683670044 + }, + "calculations": { + "neg_displacement": -0.38282549381256104 + }, + "objective": 0.38282549381256104 + }, + { + "trial_number": 9, + "design_variables": { + "tip_thickness": 15.779109046050685, + "support_angle": 37.544844028080135 + }, + "results": { + "max_displacement": 0.4436984956264496, + "max_disp_node": 58.0, + "max_disp_x": 0.003604060271754861, + "max_disp_y": 0.08796636015176773, + "max_disp_z": 0.43489110469818115 + }, + "calculations": { + "neg_displacement": -0.4436984956264496 + }, + "objective": 0.4436984956264496 + }, + { + "trial_number": 10, + "design_variables": { + "tip_thickness": 21.072632312643005, + "support_angle": 38.313469876751704 + }, + "results": { + "max_displacement": 0.2564539313316345, + "max_disp_node": 58.0, + "max_disp_x": 0.002298053354024887, + "max_disp_y": 0.05997171252965927, + "max_disp_z": 0.2493431717157364 + }, + "calculations": { + "neg_displacement": -0.2564539313316345 + }, + "objective": 0.2564539313316345 + }, + { + "trial_number": 11, + "design_variables": { + "tip_thickness": 24.95032894956337, + "support_angle": 34.20965061068569 + }, + "results": { + "max_displacement": 0.21304214000701904, + "max_disp_node": 58.0, + "max_disp_x": 0.002044219756498933, + "max_disp_y": 0.052074797451496124, + "max_disp_z": 0.20657968521118164 + }, + "calculations": { + "neg_displacement": -0.21304214000701904 + }, + "objective": 0.21304214000701904 + }, + { + "trial_number": 12, + "design_variables": { + "tip_thickness": 24.894489548087346, + "support_angle": 34.551063779949075 + }, + "results": { + "max_displacement": 0.21274541318416595, + "max_disp_node": 58.0, + "max_disp_x": 0.002061901381239295, + "max_disp_y": 0.052174802869558334, + "max_disp_z": 0.20624838769435883 + }, + "calculations": { + "neg_displacement": -0.21274541318416595 + }, + "objective": 0.21274541318416595 + }, + { + "trial_number": 13, + "design_variables": { + "tip_thickness": 24.952883393809497, + "support_angle": 34.77451710881955 + }, + "results": { + "max_displacement": 0.21082018315792084, + "max_disp_node": 58.0, + "max_disp_x": 0.0020510517060756683, + "max_disp_y": 0.05187264829874039, + "max_disp_z": 0.20433887839317322 + }, + "calculations": { + "neg_displacement": -0.21082018315792084 + }, + "objective": 0.21082018315792084 + }, + { + "trial_number": 14, + "design_variables": { + "tip_thickness": 18.70443149555537, + "support_angle": 26.11221806912443 + }, + "results": { + "max_displacement": 0.46135807037353516, + "max_disp_node": 58.0, + "max_disp_x": 0.0034599562641233206, + "max_disp_y": 0.08689243346452713, + "max_disp_z": 0.4531014859676361 + }, + "calculations": { + "neg_displacement": -0.46135807037353516 + }, + "objective": 0.46135807037353516 + }, + { + "trial_number": 15, + "design_variables": { + "tip_thickness": 23.84954584574589, + "support_angle": 34.69889355903453 + }, + "results": { + "max_displacement": 0.22793325781822205, + "max_disp_node": 58.0, + "max_disp_x": 0.0021433867514133453, + "max_disp_y": 0.05458956956863403, + "max_disp_z": 0.2212996780872345 + }, + "calculations": { + "neg_displacement": -0.22793325781822205 + }, + "objective": 0.22793325781822205 + }, + { + "trial_number": 16, + "design_variables": { + "tip_thickness": 23.545082857154053, + "support_angle": 27.33776442268342 + }, + "results": { + "max_displacement": 0.27459517121315, + "max_disp_node": 58.0, + "max_disp_x": 0.002392930444329977, + "max_disp_y": 0.06125558167695999, + "max_disp_z": 0.2676756680011749 + }, + "calculations": { + "neg_displacement": -0.27459517121315 + }, + "objective": 0.27459517121315 + }, + { + "trial_number": 17, + "design_variables": { + "tip_thickness": 19.395958700724172, + "support_angle": 35.874156921626124 + }, + "results": { + "max_displacement": 0.32070934772491455, + "max_disp_node": 58.0, + "max_disp_x": 0.002739877672865987, + "max_disp_y": 0.06964103132486343, + "max_disp_z": 0.3130568861961365 + }, + "calculations": { + "neg_displacement": -0.32070934772491455 + }, + "objective": 0.32070934772491455 + }, + { + "trial_number": 18, + "design_variables": { + "tip_thickness": 21.536592042850017, + "support_angle": 32.171364735552 + }, + "results": { + "max_displacement": 0.29555052518844604, + "max_disp_node": 58.0, + "max_disp_x": 0.0025494550354778767, + "max_disp_y": 0.06503863632678986, + "max_disp_z": 0.2883055508136749 + }, + "calculations": { + "neg_displacement": -0.29555052518844604 + }, + "objective": 0.29555052518844604 + }, + { + "trial_number": 19, + "design_variables": { + "tip_thickness": 23.75885172872223, + "support_angle": 28.17043178772967 + }, + "results": { + "max_displacement": 0.2622140347957611, + "max_disp_node": 58.0, + "max_disp_x": 0.002298196544870734, + "max_disp_y": 0.05939820408821106, + "max_disp_z": 0.25539782643318176 + }, + "calculations": { + "neg_displacement": -0.2622140347957611 + }, + "objective": 0.2622140347957611 + }, + { + "trial_number": 20, + "design_variables": { + "tip_thickness": 24.946257551293495, + "support_angle": 36.54595394544202 + }, + "results": { + "max_displacement": 0.20071247220039368, + "max_disp_node": 58.0, + "max_disp_x": 0.0018801360856741667, + "max_disp_y": 0.05026965215802193, + "max_disp_z": 0.1943153589963913 + }, + "calculations": { + "neg_displacement": -0.20071247220039368 + }, + "objective": 0.20071247220039368 + } +] \ No newline at end of file diff --git a/studies/bracket_displacement_maximizing/substudies/coarse_exploration/optimization_results.json b/studies/bracket_displacement_maximizing/substudies/coarse_exploration/optimization_results.json new file mode 100644 index 00000000..f6ddf970 --- /dev/null +++ b/studies/bracket_displacement_maximizing/substudies/coarse_exploration/optimization_results.json @@ -0,0 +1,11 @@ +{ + "best_params": { + "tip_thickness": 24.946257551293495, + "support_angle": 36.54595394544202 + }, + "best_value": 0.20071247220039368, + "best_trial_number": 20, + "timestamp": "2025-11-16T21:21:37.211289", + "study_name": "coarse_exploration", + "n_trials": 20 +} \ No newline at end of file diff --git a/studies/bracket_displacement_maximizing/substudies/fine_tuning/config.json b/studies/bracket_displacement_maximizing/substudies/fine_tuning/config.json new file mode 100644 index 00000000..dff28793 --- /dev/null +++ b/studies/bracket_displacement_maximizing/substudies/fine_tuning/config.json @@ -0,0 +1,36 @@ +{ + "substudy_name": "fine_tuning", + "description": "Fine-grained optimization with 50 trials in narrow bounds around best design from coarse exploration", + "parent_study": "bracket_displacement_maximizing", + "created_date": "2025-11-16", + + "optimization": { + "algorithm": "TPE", + "direction": "minimize", + "n_trials": 50, + "n_startup_trials": 5, + "design_variables": [ + { + "parameter": "tip_thickness", + "min": 18.0, + "max": 22.0, + "units": "mm", + "comment": "Narrowed from coarse_exploration results" + }, + { + "parameter": "support_angle", + "min": 28.0, + "max": 35.0, + "units": "degrees", + "comment": "Narrowed from coarse_exploration results" + } + ] + }, + + "continuation": { + "enabled": true, + "from_substudy": "coarse_exploration", + "inherit_best_params": true, + "comment": "Start from best design found in coarse exploration" + } +} diff --git a/studies/bracket_displacement_maximizing/test_fix.py b/studies/bracket_displacement_maximizing/test_fix.py new file mode 100644 index 00000000..9758e247 --- /dev/null +++ b/studies/bracket_displacement_maximizing/test_fix.py @@ -0,0 +1,53 @@ +"""Quick test to verify expression updates are working""" +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).parent.parent.parent)) + +from optimization_engine.nx_solver import NXSolver +from optimization_engine.nx_updater import NXParameterUpdater + +study_dir = Path(__file__).parent +prt_file = study_dir / "model" / "Bracket.prt" +sim_file = study_dir / "model" / "Bracket_sim1.sim" + +print("Testing expression update workflow...") +print() + +# Test with two different parameter sets +test_params = [ + {'tip_thickness': 15.0, 'support_angle': 25.0}, + {'tip_thickness': 25.0, 'support_angle': 35.0}, +] + +updater = NXParameterUpdater(prt_file_path=prt_file) +solver = NXSolver(nastran_version='2412', use_journal=True) + +for i, params in enumerate(test_params): + print(f"Trial {i}: tip_thickness={params['tip_thickness']}, support_angle={params['support_angle']}") + + # Update .prt file + updater.update_expressions(params) + updater.save() + + # Run simulation WITH expression_updates + result = solver.run_simulation(sim_file, expression_updates=params) + + if result['success']: + print(f" SUCCESS: OP2 generated") + + # Read OP2 to check displacement + from pyNastran.op2.op2 import OP2 + model = OP2() + model.read_op2(str(result['op2_file'])) + + if hasattr(model, 'displacements') and model.displacements: + disp = model.displacements[1] + max_disp = abs(disp.data[:, :3]).max() + print(f" Max displacement: {max_disp:.6f} mm") + print() + else: + print(f" FAILED") + print() + +print("If the two displacement values are DIFFERENT, the fix worked!") diff --git a/studies/bracket_stress_minimization/model/Bracket_fem1_i.prt b/studies/bracket_stress_minimization/model/Bracket_fem1_i.prt new file mode 100644 index 00000000..c8759f71 Binary files /dev/null and b/studies/bracket_stress_minimization/model/Bracket_fem1_i.prt differ diff --git a/tests/Bracket.prt b/tests/Bracket.prt index 82091dc6..32abb347 100644 Binary files a/tests/Bracket.prt and b/tests/Bracket.prt differ diff --git a/tests/Bracket.prt.bak_20251116_200950 b/tests/Bracket.prt.bak_20251116_200950 new file mode 100644 index 00000000..82091dc6 Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_200950 differ diff --git a/tests/Bracket.prt.bak_20251116_201643 b/tests/Bracket.prt.bak_20251116_201643 new file mode 100644 index 00000000..82091dc6 Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_201643 differ diff --git a/tests/Bracket.prt.bak_20251116_201649 b/tests/Bracket.prt.bak_20251116_201649 new file mode 100644 index 00000000..5859c0ca Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_201649 differ diff --git a/tests/Bracket.prt.bak_20251116_201654 b/tests/Bracket.prt.bak_20251116_201654 new file mode 100644 index 00000000..9ce7e9f6 Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_201654 differ diff --git a/tests/Bracket.prt.bak_20251116_201659 b/tests/Bracket.prt.bak_20251116_201659 new file mode 100644 index 00000000..ce6b55dd Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_201659 differ diff --git a/tests/Bracket.prt.bak_20251116_201705 b/tests/Bracket.prt.bak_20251116_201705 new file mode 100644 index 00000000..d242d931 Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_201705 differ diff --git a/tests/Bracket.prt.bak_20251116_201736 b/tests/Bracket.prt.bak_20251116_201736 new file mode 100644 index 00000000..5859c0ca Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_201736 differ diff --git a/tests/Bracket.prt.bak_20251116_201741 b/tests/Bracket.prt.bak_20251116_201741 new file mode 100644 index 00000000..51808027 Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_201741 differ diff --git a/tests/Bracket.prt.bak_20251116_201806 b/tests/Bracket.prt.bak_20251116_201806 new file mode 100644 index 00000000..0aeacce8 Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_201806 differ diff --git a/tests/Bracket.prt.bak_20251116_201811 b/tests/Bracket.prt.bak_20251116_201811 new file mode 100644 index 00000000..aeb0fd4d Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_201811 differ diff --git a/tests/Bracket.prt.bak_20251116_201816 b/tests/Bracket.prt.bak_20251116_201816 new file mode 100644 index 00000000..8acd0710 Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_201816 differ diff --git a/tests/Bracket.prt.bak_20251116_201821 b/tests/Bracket.prt.bak_20251116_201821 new file mode 100644 index 00000000..febcbaca Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_201821 differ diff --git a/tests/Bracket.prt.bak_20251116_203748 b/tests/Bracket.prt.bak_20251116_203748 new file mode 100644 index 00000000..cb85097f Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_203748 differ diff --git a/tests/Bracket.prt.bak_20251116_203753 b/tests/Bracket.prt.bak_20251116_203753 new file mode 100644 index 00000000..5b783946 Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_203753 differ diff --git a/tests/Bracket.prt.bak_20251116_203758 b/tests/Bracket.prt.bak_20251116_203758 new file mode 100644 index 00000000..24bbd79a Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_203758 differ diff --git a/tests/Bracket.prt.bak_20251116_203803 b/tests/Bracket.prt.bak_20251116_203803 new file mode 100644 index 00000000..d0c5f882 Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_203803 differ diff --git a/tests/Bracket.prt.bak_20251116_203824 b/tests/Bracket.prt.bak_20251116_203824 new file mode 100644 index 00000000..0aeacce8 Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_203824 differ diff --git a/tests/Bracket.prt.bak_20251116_203829 b/tests/Bracket.prt.bak_20251116_203829 new file mode 100644 index 00000000..97c1f1df Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_203829 differ diff --git a/tests/Bracket.prt.bak_20251116_204358 b/tests/Bracket.prt.bak_20251116_204358 new file mode 100644 index 00000000..c1e982e2 Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_204358 differ diff --git a/tests/Bracket.prt.bak_20251116_204403 b/tests/Bracket.prt.bak_20251116_204403 new file mode 100644 index 00000000..df3023a6 Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_204403 differ diff --git a/tests/Bracket.prt.bak_20251116_204408 b/tests/Bracket.prt.bak_20251116_204408 new file mode 100644 index 00000000..d11c3d01 Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_204408 differ diff --git a/tests/Bracket.prt.bak_20251116_204413 b/tests/Bracket.prt.bak_20251116_204413 new file mode 100644 index 00000000..0331481e Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_204413 differ diff --git a/tests/Bracket.prt.bak_20251116_204418 b/tests/Bracket.prt.bak_20251116_204418 new file mode 100644 index 00000000..f9acef09 Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_204418 differ diff --git a/tests/Bracket.prt.bak_20251116_204424 b/tests/Bracket.prt.bak_20251116_204424 new file mode 100644 index 00000000..24bbd79a Binary files /dev/null and b/tests/Bracket.prt.bak_20251116_204424 differ diff --git a/tests/Bracket_fem1_i.prt b/tests/Bracket_fem1_i.prt new file mode 100644 index 00000000..522c0c4f Binary files /dev/null and b/tests/Bracket_fem1_i.prt differ diff --git a/tests/Bracket_sim1.sim b/tests/Bracket_sim1.sim index 5d9af1cc..1aa11c31 100644 Binary files a/tests/Bracket_sim1.sim and b/tests/Bracket_sim1.sim differ diff --git a/tests/bracket_sim1-solution_1.dat b/tests/bracket_sim1-solution_1.dat index 94425304..1c3fbbac 100644 --- a/tests/bracket_sim1-solution_1.dat +++ b/tests/bracket_sim1-solution_1.dat @@ -3,15 +3,15 @@ $* $* Simcenter v2412.0.0.3001 Translator $* for Simcenter Nastran version 2412.0 $* -$* FEM FILE: C:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket_fem1.fem -$* SIM FILE: C:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket_sim1.sim +$* FEM FILE: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket_fem1.fem +$* SIM FILE: c:\Users\antoi\Documents\Atomaste\Atomizer\tests\Bracket_sim1.sim $* ANALYSIS TYPE: Structural $* SOLUTION NAME: Solution 1 $* SOLUTION TYPE: SOL 101 Linear Statics $* $* SOLVER INPUT FILE: bracket_sim1-solution_1.dat -$* CREATION DATE: 15-Nov-2025 -$* CREATION TIME: 12:17:41 +$* CREATION DATE: 16-Nov-2025 +$* CREATION TIME: 20:44:27 $* HOSTNAME: AntoineThinkpad $* NASTRAN LICENSE: Desktop Bundle $* diff --git a/tests/bracket_sim1-solution_1.t13980_32.asg b/tests/bracket_sim1-solution_1.t13980_32.asg new file mode 100644 index 00000000..08886a55 --- /dev/null +++ b/tests/bracket_sim1-solution_1.t13980_32.asg @@ -0,0 +1,33 @@ +Nastran BUFFSIZE=32769 $(c:/program files/siemens/simcenter3d_2412/nxnastran/conf/nastran.rcf[1]) +Nastran BUFFPOOL=20.0X $(c:/program files/siemens/simcenter3d_2412/nxnastran/conf/nastran.rcf[4]) +Nastran DIAGA=128 DIAGB=0 $(c:/program files/siemens/simcenter3d_2412/nxnastran/conf/nastran.rcf[7]) +Nastran SYSTEM(442)=2 $(command line[5]) +Nastran REAL=8545370112 $(Memory limit for MPI and other specialized modules) +JID='c:\Users\antoi\Documents\Atomaste\Atomizer\tests\bracket_sim1-solution_1.dat' +OUT='./bracket_sim1-solution_1' +MEM=3846123520 +MACH='Intel64 Family 6 Model 183 Stepping 1' +OPER='Windows 10' +OSV=' ' +MODEL='Intel(R) Core(TM) i7-14700HX (AntoineThinkpad)' +CONFIG=8666 +NPROC=28 +symbol=DELDIR='c:/program files/siemens/simcenter3d_2412/nxnastran/scnas/nast/del' $(program default) +symbol=DEMODIR='c:/program files/siemens/simcenter3d_2412/nxnastran/scnas/nast/demo' $(program default) +symbol=SSSALTERDIR='c:/program files/siemens/simcenter3d_2412/nxnastran/scnas/nast/misc/sssalter' $(program default) +symbol=TPLDIR='c:/program files/siemens/simcenter3d_2412/nxnastran/scnas/nast/tpl' $(program default) +SDIR='c:/users/antoi/appdata/local/temp/bracket_sim1-solution_1.T13980_32' +DBS='c:/users/antoi/appdata/local/temp/bracket_sim1-solution_1.T13980_32' +SCR=yes +SMEM=20.0X +NEWDEL='c:/program files/siemens/simcenter3d_2412/nxnastran/scnas/em64tntl/SSS' +DEL='NXNDEF' +AUTH='29000@AntoineThinkpad' +AUTHQUE=0 +MSGCAT='c:/program files/siemens/simcenter3d_2412/nxnastran/scnas/em64tntl/analysis.msg' +MSGDEST='f06' +PROG=bundle +NEWS='c:/program files/siemens/simcenter3d_2412/nxnastran/scnas/nast/news.txt' +UMATLIB='libnxumat.dll' +UCRPLIB='libucreep.dll' +USOLLIB='libusol.dll' diff --git a/tests/interactive_optimization_setup.py b/tests/interactive_optimization_setup.py new file mode 100644 index 00000000..6c65551e --- /dev/null +++ b/tests/interactive_optimization_setup.py @@ -0,0 +1,324 @@ +""" +Interactive Optimization Setup - Phase 3.3 + +This script simulates a real Atomizer setup session where: +- User provides their optimization goal in natural language +- Atomizer LLM Assistant helps configure the optimization +- Wizard validates the setup before running +- User confirms and starts optimization + +This is how Atomizer SHOULD work in production! +""" + +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).parent.parent)) + +from optimization_engine.optimization_setup_wizard import OptimizationSetupWizard +from optimization_engine.llm_optimization_runner import LLMOptimizationRunner +from optimization_engine.nx_solver import NXSolver +from optimization_engine.nx_updater import NXParameterUpdater + + +def print_section(title: str): + """Print a section header.""" + print() + print("=" * 80) + print(f" {title}") + print("=" * 80) + print() + + +def print_assistant(message: str): + """Print Atomizer LLM Assistant message.""" + print(f"\n[Atomizer] {message}\n") + + +def print_user(message: str): + """Print user message.""" + print(f"\n[User] {message}\n") + + +def print_wizard(message: str): + """Print wizard message.""" + print(f"[Wizard] {message}") + + +def main(): + print_section("ATOMIZER - INTERACTIVE OPTIMIZATION SETUP") + + print_assistant("Welcome to Atomizer! I'll help you set up your optimization.") + print_assistant("First, I need to know about your model files.") + + # File paths + prt_file = Path("tests/Bracket.prt") + sim_file = Path("tests/Bracket_sim1.sim") + + if not prt_file.exists() or not sim_file.exists(): + print("[ERROR] Test files not found!") + sys.exit(1) + + print_user(f"I have a bracket model:") + print(f" - Part file: {prt_file}") + print(f" - Simulation file: {sim_file}") + + print_assistant("Great! Let me initialize the Setup Wizard to analyze your model...") + + # Initialize wizard + wizard = OptimizationSetupWizard(prt_file, sim_file) + + print_section("STEP 1: MODEL INTROSPECTION") + + print_assistant("I'm reading your NX model to find available design parameters...") + + # Introspect model + model_info = wizard.introspect_model() + + print_assistant(f"Found {len(model_info.expressions)} expressions in your model:") + for name, info in model_info.expressions.items(): + print(f" - {name}: {info['value']} {info['units']}") + + print_assistant("Which parameters would you like to use as design variables?") + + print_user("I want to optimize tip_thickness and support_angle") + + print_assistant("Perfect! Now, what's your optimization goal?") + + print_user("I want to maximize displacement while keeping stress below") + print(" a safety factor of 4. The material is Aluminum 6061-T6.") + + user_goal = "Maximize displacement while keeping stress below safety factor of 4 (Aluminum 6061-T6, yield=276 MPa)" + + print_section("STEP 2: BASELINE SIMULATION") + + print_assistant("To validate your setup, I need to run ONE baseline simulation.") + print_assistant("This will generate an OP2 file that I can analyze to ensure") + print_assistant("the extraction pipeline will work correctly.") + print_assistant("") + print_assistant("Running baseline simulation with current parameter values...") + + # Run baseline + baseline_op2 = wizard.run_baseline_simulation() + + print_assistant(f"Baseline simulation complete! OP2 file: {baseline_op2.name}") + + print_section("STEP 3: OP2 INTROSPECTION") + + print_assistant("Now I'll analyze the OP2 file to see what's actually in there...") + + # Introspect OP2 + op2_info = wizard.introspect_op2() + + print_assistant("Here's what I found in your OP2 file:") + print(f" - Element types with stress: {', '.join(op2_info.element_types)}") + print(f" - Available results: {', '.join(op2_info.result_types)}") + print(f" - Number of elements: {op2_info.element_count}") + print(f" - Number of nodes: {op2_info.node_count}") + + print_section("STEP 4: LLM-GUIDED CONFIGURATION") + + print_assistant("Based on your goal and the OP2 contents, here's what I recommend:") + print_assistant("") + print_assistant("OBJECTIVE:") + print_assistant(" - Maximize displacement (minimize negative displacement)") + print_assistant("") + print_assistant("EXTRACTIONS:") + print_assistant(" - Extract displacement from OP2") + print_assistant(f" - Extract stress from {op2_info.element_types[0]} elements") + print_assistant(" (I detected these element types in your model)") + print_assistant("") + print_assistant("CALCULATIONS:") + print_assistant(" - Calculate safety factor: SF = 276 MPa / max_stress") + print_assistant(" - Negate displacement for minimization") + print_assistant("") + print_assistant("CONSTRAINT:") + print_assistant(" - Enforce SF >= 4.0 with penalty") + print_assistant("") + print_assistant("DESIGN VARIABLES:") + print_assistant(f" - tip_thickness: {model_info.expressions['tip_thickness']['value']} mm (suggest range: 15-25 mm)") + print_assistant(f" - support_angle: {model_info.expressions['support_angle']['value']} degrees (suggest range: 20-40 deg)") + + print_user("That looks good! Let's use those ranges.") + + # Build configuration + llm_workflow = { + 'engineering_features': [ + { + 'action': 'extract_displacement', + 'domain': 'result_extraction', + 'description': 'Extract displacement results from OP2 file', + 'params': {'result_type': 'displacement'} + }, + { + 'action': 'extract_solid_stress', + 'domain': 'result_extraction', + 'description': f'Extract von Mises stress from {op2_info.element_types[0]} elements', + 'params': { + 'result_type': 'stress', + 'element_type': op2_info.element_types[0].lower() # Use detected element type! + } + } + ], + 'inline_calculations': [ + { + 'action': 'calculate_safety_factor', + 'params': { + 'input': 'max_von_mises', + 'yield_strength': 276.0, + 'operation': 'divide' + }, + 'code_hint': 'safety_factor = 276.0 / max_von_mises' + }, + { + 'action': 'negate_displacement', + 'params': { + 'input': 'max_displacement', + 'operation': 'negate' + }, + 'code_hint': 'neg_displacement = -max_displacement' + } + ], + 'post_processing_hooks': [], # Using manual safety_factor_constraint hook + 'optimization': { + 'algorithm': 'TPE', + 'direction': 'minimize', + 'design_variables': [ + { + 'parameter': 'tip_thickness', + 'min': 15.0, + 'max': 25.0, + 'units': 'mm' + }, + { + 'parameter': 'support_angle', + 'min': 20.0, + 'max': 40.0, + 'units': 'degrees' + } + ] + } + } + + print_section("STEP 5: PIPELINE VALIDATION (DRY RUN)") + + print_assistant("Before running 20-30 optimization trials, let me validate that") + print_assistant("EVERYTHING works correctly with your baseline OP2 file...") + print_assistant("") + print_assistant("Running dry-run validation...") + + # Validate pipeline + validation_results = wizard.validate_pipeline(llm_workflow) + + # Check results + all_passed = all(r.success for r in validation_results) + + print() + print_wizard("VALIDATION RESULTS:") + for result in validation_results: + status = "[OK]" if result.success else "[FAIL]" + print_wizard(f" {status} {result.component}: {result.message.split(':')[-1].strip()}") + + print() + + if all_passed: + print_section("VALIDATION PASSED!") + + print_assistant("Excellent! All pipeline components validated successfully.") + print_assistant("Your optimization is ready to run!") + print_assistant("") + print_assistant("Summary:") + print(f" - Design variables: tip_thickness (15-25mm), support_angle (20-40deg)") + print(f" - Objective: Maximize displacement") + print(f" - Constraint: Safety factor >= 4.0") + print(f" - Material: Aluminum 6061-T6 (Yield = 276 MPa)") + print() + + print_user("Great! Let's run 10 trials to test it.") + + print_section("STEP 6: RUNNING OPTIMIZATION") + + print_assistant("Initializing optimization runner...") + + # Create updater and runner + def create_model_updater(prt_file: Path): + updater = NXParameterUpdater(prt_file_path=prt_file) + def update_model(design_vars: dict): + updater.update_expressions(design_vars) + updater.save() + return update_model + + def create_simulation_runner(sim_file: Path): + solver = NXSolver(nastran_version='2412', use_journal=True) + def run_simulation() -> Path: + result = solver.run_simulation(sim_file) + return result['op2_file'] + return run_simulation + + model_updater = create_model_updater(prt_file) + simulation_runner = create_simulation_runner(sim_file) + + # Initialize runner + runner = LLMOptimizationRunner( + llm_workflow=llm_workflow, + model_updater=model_updater, + simulation_runner=simulation_runner, + study_name='bracket_interactive_setup' + ) + + print_assistant("Starting optimization with 10 trials...") + print_assistant("(This will take a few minutes...)") + print() + + # Run optimization + results = runner.run_optimization(n_trials=10) + + print() + print_section("OPTIMIZATION COMPLETE!") + + print_assistant("Optimization finished! Here are the results:") + print() + print(f" Best tip_thickness: {results['best_params']['tip_thickness']:.3f} mm") + print(f" Best support_angle: {results['best_params']['support_angle']:.3f} degrees") + print(f" Best objective value: {results['best_value']:.6f}") + print() + print(f" Results saved to: {runner.output_dir}") + + # Show some trial history + print() + print_assistant("Trial history (last 5 trials):") + print() + print(" Trial | Tip(mm) | Angle(°) | Disp(mm) | Stress(MPa) | Objective") + print(" ------|---------|----------|----------|-------------|----------") + + for trial in results['history'][-5:]: + trial_num = trial['trial_number'] + tip = trial['design_variables']['tip_thickness'] + ang = trial['design_variables']['support_angle'] + disp = trial['results'].get('max_displacement', 0) + stress = trial['results'].get('max_von_mises', 0) + obj = trial['objective'] + print(f" {trial_num:5d} | {tip:7.2f} | {ang:8.2f} | {disp:8.5f} | {stress:11.2f} | {obj:9.6f}") + + print() + print_assistant("Success! Your optimization completed without errors.") + print_assistant("This is exactly how Atomizer should work - validate first,") + print_assistant("then optimize with confidence!") + + else: + print_section("VALIDATION FAILED!") + + print_assistant("The validation found issues that need to be fixed:") + print() + + for result in validation_results: + if not result.success: + print(f" [ERROR] {result.message}") + + print() + print_assistant("Please fix these issues before starting the optimization.") + print_assistant("This saved you from wasting time on 20-30 failed trials!") + + +if __name__ == '__main__': + main() diff --git a/tests/test_bracket_full_optimization.py b/tests/test_bracket_full_optimization.py new file mode 100644 index 00000000..8ad24b7b --- /dev/null +++ b/tests/test_bracket_full_optimization.py @@ -0,0 +1,278 @@ +""" +Full End-to-End Bracket Optimization Test - Phase 3.2 + +This test demonstrates the complete LLM-enhanced optimization workflow: +1. LLM workflow configuration +2. Automatic extractor generation (displacement + stress) +3. Inline calculation generation (safety factor) +4. Manual safety factor constraint hook +5. Real NX simulation execution +6. OP2 result extraction +7. Constraint checking +8. Optimization with Optuna +9. Report generation + +Objective: Maximize displacement +Constraint: Safety factor >= 4.0 (stress < yield/4) +Material: Aluminum 6061-T6 (Yield = 276 MPa) +Design Variable: wall_thickness (3-8mm) +""" + +import sys +from pathlib import Path +from datetime import datetime +import json + +sys.path.insert(0, str(Path(__file__).parent.parent)) + +from optimization_engine.llm_optimization_runner import LLMOptimizationRunner +from optimization_engine.nx_solver import NXSolver +from optimization_engine.nx_updater import NXParameterUpdater + +# LLM workflow for bracket optimization +llm_workflow = { + 'engineering_features': [ + { + 'action': 'extract_displacement', + 'domain': 'result_extraction', + 'description': 'Extract displacement results from OP2 file', + 'params': {'result_type': 'displacement'} + }, + { + 'action': 'extract_solid_stress', + 'domain': 'result_extraction', + 'description': 'Extract von Mises stress from solid elements', + 'params': { + 'result_type': 'stress', + 'element_type': 'chexa' # Bracket uses CHEXA elements, not CTETRA + } + } + ], + 'inline_calculations': [ + { + 'action': 'calculate_safety_factor', + 'params': { + 'input': 'max_von_mises', + 'yield_strength': 276.0, # MPa for Aluminum 6061-T6 + 'operation': 'divide' + }, + 'code_hint': 'safety_factor = 276.0 / max_von_mises' + }, + { + 'action': 'negate_displacement', + 'params': { + 'input': 'max_displacement', + 'operation': 'negate' + }, + 'code_hint': 'neg_displacement = -max_displacement' + } + ], + 'post_processing_hooks': [], # Using manual safety_factor_constraint hook + 'optimization': { + 'algorithm': 'TPE', + 'direction': 'minimize', # Minimize neg_displacement = maximize displacement + 'design_variables': [ + { + 'parameter': 'tip_thickness', + 'min': 15.0, + 'max': 25.0, + 'units': 'mm' + }, + { + 'parameter': 'support_angle', + 'min': 20.0, + 'max': 40.0, + 'units': 'degrees' + } + ] + } +} + + +def create_model_updater(prt_file: Path): + """Create model updater for NX.""" + updater = NXParameterUpdater(prt_file_path=prt_file) + + def update_model(design_vars: dict): + """Update NX model with design variables.""" + updater.update_expressions(design_vars) + updater.save() # Save changes to disk + + return update_model + + +def create_simulation_runner(sim_file: Path): + """Create simulation runner for NX.""" + solver = NXSolver(nastran_version='2412', use_journal=True) + + def run_simulation() -> Path: + """Run NX simulation and return OP2 file path.""" + result = solver.run_simulation(sim_file) + return result['op2_file'] # Extract Path from result dict + + return run_simulation + + +def generate_report(results: dict, output_dir: Path): + """Generate optimization report with history.""" + report_file = output_dir / "optimization_report.md" + + best_params = results['best_params'] + best_value = results['best_value'] + history = results['history'] + + with open(report_file, 'w') as f: + f.write("# Bracket Optimization Report - Phase 3.2\n\n") + f.write(f"**Generated**: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n\n") + + f.write("## Problem Definition\n\n") + f.write("- **Objective**: Maximize displacement\n") + f.write("- **Constraint**: Safety factor >= 4.0\n") + f.write("- **Material**: Aluminum 6061-T6 (Yield = 276 MPa)\n") + f.write("- **Allowable Stress**: 69 MPa (276/4)\n") + f.write("- **Design Variables**:\n") + f.write(" - tip_thickness (15-25 mm)\n") + f.write(" - support_angle (20-40 degrees)\n\n") + + f.write("## Optimization Results\n\n") + f.write(f"- **Best tip_thickness**: {best_params['tip_thickness']:.3f} mm\n") + f.write(f"- **Best support_angle**: {best_params['support_angle']:.3f} degrees\n") + f.write(f"- **Best objective value**: {best_value:.6f}\n") + f.write(f"- **Total trials**: {len(history)}\n\n") + + # Find best trial details + best_trial = history[results['best_trial_number']] + best_results = best_trial['results'] + best_calcs = best_trial['calculations'] + + f.write("## Best Design Details\n\n") + f.write(f"- **Max displacement**: {best_results.get('max_displacement', 0):.6f} mm\n") + f.write(f"- **Max stress**: {best_results.get('max_von_mises', 0):.3f} MPa\n") + f.write(f"- **Safety factor**: {best_calcs.get('safety_factor', 0):.3f}\n") + f.write(f"- **Constraint status**: {'SATISFIED' if best_calcs.get('safety_factor', 0) >= 4.0 else 'VIOLATED'}\n\n") + + f.write("## Optimization History\n\n") + f.write("| Trial | Tip Thick (mm) | Support Angle (°) | Displacement (mm) | Stress (MPa) | Safety Factor | Constraint | Objective |\n") + f.write("|-------|----------------|-------------------|-------------------|--------------|---------------|------------|-----------|\n") + + for trial in history: + trial_num = trial['trial_number'] + tip_thick = trial['design_variables']['tip_thickness'] + support_ang = trial['design_variables']['support_angle'] + disp = trial['results'].get('max_displacement', 0) + stress = trial['results'].get('max_von_mises', 0) + sf = trial['calculations'].get('safety_factor', 0) + constraint = 'OK' if sf >= 4.0 else 'FAIL' + obj = trial['objective'] + + f.write(f"| {trial_num} | {tip_thick:.3f} | {support_ang:.3f} | {disp:.6f} | {stress:.3f} | {sf:.3f} | {constraint} | {obj:.6f} |\n") + + f.write("\n## LLM-Enhanced Workflow\n\n") + f.write("This optimization was run using the Phase 3.2 LLM-enhanced runner with:\n\n") + f.write("- **Automatic extractor generation**: Displacement + Stress (Phase 3.1)\n") + f.write("- **Inline calculations**: Safety factor + Objective negation (Phase 2.8)\n") + f.write("- **Manual constraint hook**: Safety factor constraint (demonstrates flexibility)\n") + f.write("- **Real NX simulation**: Journal-based solver execution\n") + f.write("- **Optuna optimization**: TPE sampler\n\n") + + f.write("---\n\n") + f.write("*Generated by Atomizer Phase 3.2 - LLM-Enhanced Optimization Framework*\n") + + print(f"\nReport saved to: {report_file}") + return report_file + + +if __name__ == '__main__': + print("=" * 80) + print("Phase 3.2: Full End-to-End Bracket Optimization Test") + print("=" * 80) + print() + print("Problem:") + print(" Maximize displacement while maintaining safety factor >= 4.0") + print(" Material: Aluminum 6061-T6 (Yield = 276 MPa)") + print(" Design Variables:") + print(" - tip_thickness (15-25 mm)") + print(" - support_angle (20-40 degrees)") + print() + + # Configuration + sim_file = Path("tests/Bracket_sim1.sim") + prt_file = Path("tests/Bracket.prt") + n_trials = 5 # Start with 5 trials for testing + + if not sim_file.exists(): + print(f"ERROR: Simulation file not found: {sim_file}") + print("Please ensure the bracket .sim file is available") + sys.exit(1) + + if not prt_file.exists(): + print(f"ERROR: Part file not found: {prt_file}") + print("Please ensure the bracket .prt file is available") + sys.exit(1) + + print(f"Simulation file: {sim_file}") + print(f"Part file: {prt_file}") + print(f"Number of trials: {n_trials}") + print() + + try: + # Create model updater and simulation runner + print("Setting up NX integration...") + model_updater = create_model_updater(prt_file) + simulation_runner = create_simulation_runner(sim_file) + print(" NX updater: OK") + print(" NX solver: OK") + print() + + # Initialize LLM optimization runner + print("Initializing LLM-enhanced optimization runner...") + runner = LLMOptimizationRunner( + llm_workflow=llm_workflow, + model_updater=model_updater, + simulation_runner=simulation_runner, + study_name='bracket_maximize_disp_sf4' + ) + + print(f" Extractors generated: {len(runner.extractors)}") + for ext in runner.extractors: + print(f" - {ext}") + print(f" Inline calculations: {len(runner.inline_code)}") + hook_summary = runner.hook_manager.get_summary() + print(f" Hooks loaded: {hook_summary['enabled_hooks']}") + print(" (Including manual safety_factor_constraint hook)") + print() + + # Run optimization + print("=" * 80) + print("Starting Optimization...") + print("=" * 80) + print() + + results = runner.run_optimization(n_trials=n_trials) + + print() + print("=" * 80) + print("Optimization Complete!") + print("=" * 80) + print() + print(f"Best tip_thickness: {results['best_params']['tip_thickness']:.3f} mm") + print(f"Best support_angle: {results['best_params']['support_angle']:.3f} degrees") + print(f"Best objective value: {results['best_value']:.6f}") + print() + + # Generate report + print("Generating optimization report...") + report_file = generate_report(results, runner.output_dir) + + print() + print("=" * 80) + print("Test Complete!") + print("=" * 80) + print(f"Results directory: {runner.output_dir}") + print(f"Report: {report_file}") + + except Exception as e: + print(f"\nERROR during optimization: {e}") + import traceback + traceback.print_exc() + sys.exit(1) diff --git a/tests/test_bracket_llm_runner.py b/tests/test_bracket_llm_runner.py new file mode 100644 index 00000000..2d898aa2 --- /dev/null +++ b/tests/test_bracket_llm_runner.py @@ -0,0 +1,144 @@ +""" +Test LLM Optimization Runner with Bracket Problem + +Objective: Maximize displacement +Constraint: Stress must remain under safety factor of 4 + +Assuming Aluminum 6061-T6: +- Yield Strength: 276 MPa +- Safety Factor: 4 +- Allowable Stress: 276 / 4 = 69 MPa + +This test validates Phase 3.2 LLM-enhanced optimization with stress constraints. +""" + +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).parent.parent)) + +from optimization_engine.llm_optimization_runner import LLMOptimizationRunner + +# LLM workflow for bracket optimization +# Goal: Maximize displacement while keeping stress below safety factor +llm_workflow = { + 'engineering_features': [ + { + 'action': 'extract_displacement', + 'domain': 'result_extraction', + 'description': 'Extract displacement results from OP2 file', + 'params': {'result_type': 'displacement'} + }, + { + 'action': 'extract_solid_stress', + 'domain': 'result_extraction', + 'description': 'Extract von Mises stress from solid elements', + 'params': { + 'result_type': 'stress', + 'element_type': 'ctetra' + } + } + ], + 'inline_calculations': [ + { + 'action': 'calculate_safety_factor', + 'params': { + 'input': 'max_von_mises', + 'yield_strength': 276.0, # MPa for Aluminum 6061-T6 + 'operation': 'divide' + }, + 'code_hint': 'safety_factor = 276.0 / max_von_mises' + }, + { + 'action': 'negate_displacement', + 'params': { + 'input': 'max_displacement', + 'operation': 'negate' + }, + 'code_hint': 'neg_displacement = -max_displacement' + } + ], + 'post_processing_hooks': [ + { + 'action': 'weighted_objective', + 'params': { + 'inputs': ['neg_displacement'], + 'weights': [1.0], + 'objective': 'minimize' + }, + 'description': 'Minimize negative displacement (maximize actual displacement)' + } + ], + 'optimization': { + 'algorithm': 'TPE', + 'direction': 'minimize', # Minimize negative displacement = maximize displacement + 'design_variables': [ + { + 'parameter': 'wall_thickness', + 'min': 3.0, + 'max': 8.0, + 'units': 'mm' + } + ] + } +} + + +def dummy_updater(design_vars): + """Dummy model updater for testing.""" + print(f" [Test] Would update model with: {design_vars}") + + +def dummy_runner(): + """Dummy simulation runner for testing.""" + print(" [Test] Would run NX simulation...") + # Return path to existing test OP2 + return Path('tests/bracket_sim1-solution_1.op2') + + +if __name__ == '__main__': + print("=" * 80) + print("Test: LLM Runner with Bracket Problem") + print("=" * 80) + print() + print("Problem Definition:") + print(" Objective: MAXIMIZE displacement") + print(" Constraint: Stress must remain below yield/SF") + print(" Material: Aluminum 6061-T6 (Yield = 276 MPa)") + print(" Safety Factor: 4.0") + print(" Allowable Stress: 69 MPa") + print() + print("LLM Workflow:") + print(f" Engineering features: {len(llm_workflow['engineering_features'])}") + print(f" Inline calculations: {len(llm_workflow['inline_calculations'])}") + print(f" Post-processing hooks: {len(llm_workflow['post_processing_hooks'])}") + print(f" Design variables: {len(llm_workflow['optimization']['design_variables'])}") + print() + + # Initialize LLM runner + print("Initializing LLM optimization runner...") + try: + runner = LLMOptimizationRunner( + llm_workflow=llm_workflow, + model_updater=dummy_updater, + simulation_runner=dummy_runner, + study_name='bracket_maximize_disp_constrained' + ) + + print() + print("=" * 80) + print("Runner Initialized Successfully!") + print("=" * 80) + print(f" Extractors generated: {len(runner.extractors)}") + print(f" Inline calculations: {len(runner.inline_code)}") + hook_summary = runner.hook_manager.get_summary() + print(f" Hooks loaded: {hook_summary['enabled_hooks']}") + print() + + print("To run full optimization, call runner.run_optimization(n_trials=50)") + + except Exception as e: + print(f"\nERROR during initialization: {e}") + import traceback + traceback.print_exc() + sys.exit(1) diff --git a/tests/test_llm_runner_init.py b/tests/test_llm_runner_init.py new file mode 100644 index 00000000..ddf0b866 --- /dev/null +++ b/tests/test_llm_runner_init.py @@ -0,0 +1,70 @@ +"""Quick test of LLM runner initialization""" +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).parent.parent)) + +from optimization_engine.llm_optimization_runner import LLMOptimizationRunner + +# Example LLM workflow +llm_workflow = { + 'engineering_features': [ + { + 'action': 'extract_displacement', + 'domain': 'result_extraction', + 'description': 'Extract displacement from OP2', + 'params': {'result_type': 'displacement'} + } + ], + 'inline_calculations': [ + { + 'action': 'normalize', + 'params': { + 'input': 'max_displacement', + 'reference': 'max_allowed_disp', + 'value': 5.0 + }, + 'code_hint': 'norm_disp = max_displacement / 5.0' + } + ], + 'post_processing_hooks': [ + { + 'action': 'weighted_objective', + 'params': { + 'inputs': ['norm_disp'], + 'weights': [1.0], + 'objective': 'minimize' + } + } + ], + 'optimization': { + 'algorithm': 'TPE', + 'direction': 'minimize', + 'design_variables': [ + { + 'parameter': 'wall_thickness', + 'min': 3.0, + 'max': 8.0 + } + ] + } +} + +def dummy_updater(dv): + pass + +def dummy_runner(): + return Path('tests/bracket_sim1-solution_1.op2') + +print("Initializing LLM runner...") +runner = LLMOptimizationRunner( + llm_workflow=llm_workflow, + model_updater=dummy_updater, + simulation_runner=dummy_runner, + study_name='test' +) + +print(f"\nSuccess!") +print(f"Extractors: {len(runner.extractors)}") +print(f"Inline code: {len(runner.inline_code)}") +print(f"Hooks: {runner.hook_manager.get_summary()['enabled_hooks']}") diff --git a/tests/test_optimization_setup_wizard.py b/tests/test_optimization_setup_wizard.py new file mode 100644 index 00000000..88f07105 --- /dev/null +++ b/tests/test_optimization_setup_wizard.py @@ -0,0 +1,168 @@ +""" +Test Optimization Setup Wizard - Phase 3.3 + +This test demonstrates the complete validation workflow: +1. Introspect model for expressions +2. Run baseline simulation +3. Introspect OP2 for element types +4. Validate complete pipeline +5. Report readiness for optimization + +This prevents wasted time on optimizations that will fail! +""" + +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).parent.parent)) + +from optimization_engine.optimization_setup_wizard import OptimizationSetupWizard + + +if __name__ == '__main__': + print("=" * 80) + print("Phase 3.3: Optimization Setup Wizard Test") + print("=" * 80) + print() + print("This wizard validates the optimization pipeline BEFORE running trials.") + print("It will:") + print(" 1. Introspect NX model for available expressions") + print(" 2. Run baseline simulation to generate OP2") + print(" 3. Introspect OP2 to detect element types and results") + print(" 4. Validate extraction/calculation/hook pipeline") + print(" 5. Report readiness for optimization") + print() + + # Configuration + prt_file = Path("tests/Bracket.prt") + sim_file = Path("tests/Bracket_sim1.sim") + + if not prt_file.exists(): + print(f"ERROR: Part file not found: {prt_file}") + sys.exit(1) + + if not sim_file.exists(): + print(f"ERROR: Simulation file not found: {sim_file}") + sys.exit(1) + + print(f"Part file: {prt_file}") + print(f"Sim file: {sim_file}") + print() + + try: + # Initialize wizard + print("Initializing Optimization Setup Wizard...") + wizard = OptimizationSetupWizard(prt_file, sim_file) + print(" Wizard initialized!") + print() + + # Define optimization goal + user_goal = "Maximize displacement while keeping stress below yield/4 (safety factor >= 4.0)" + + # Custom workflow with safety factor constraint + llm_workflow = { + 'engineering_features': [ + { + 'action': 'extract_displacement', + 'domain': 'result_extraction', + 'description': 'Extract displacement results from OP2 file', + 'params': {'result_type': 'displacement'} + }, + { + 'action': 'extract_solid_stress', + 'domain': 'result_extraction', + 'description': 'Extract von Mises stress from solid elements', + 'params': { + 'result_type': 'stress', + 'element_type': 'chexa' # Will be auto-detected + } + } + ], + 'inline_calculations': [ + { + 'action': 'calculate_safety_factor', + 'params': { + 'input': 'max_von_mises', + 'yield_strength': 276.0, # MPa for Aluminum 6061-T6 + 'operation': 'divide' + }, + 'code_hint': 'safety_factor = 276.0 / max_von_mises' + }, + { + 'action': 'negate_displacement', + 'params': { + 'input': 'max_displacement', + 'operation': 'negate' + }, + 'code_hint': 'neg_displacement = -max_displacement' + } + ], + 'post_processing_hooks': [] # Using manual safety_factor_constraint hook + } + + # Run complete validation + print("=" * 80) + print("RUNNING COMPLETE VALIDATION WORKFLOW") + print("=" * 80) + print() + + success, validation_results = wizard.run_complete_validation( + user_goal=user_goal, + llm_workflow=llm_workflow + ) + + print() + print("=" * 80) + print("VALIDATION COMPLETE") + print("=" * 80) + print() + + if success: + print("[SUCCESS] ALL VALIDATIONS PASSED!") + print() + print("Pipeline is ready for optimization. Key findings:") + print() + + # Show model expressions + if wizard.model_info: + print(f"Model Expressions ({len(wizard.model_info.expressions)}):") + for name, info in wizard.model_info.expressions.items(): + print(f" - {name}: {info['value']} {info['units']}") + print() + + # Show OP2 contents + if wizard.op2_info: + print(f"OP2 Contents:") + print(f" - Element types: {', '.join(wizard.op2_info.element_types)}") + print(f" - Result types: {', '.join(wizard.op2_info.result_types)}") + print(f" - Subcases: {wizard.op2_info.subcases}") + print(f" - Nodes: {wizard.op2_info.node_count}") + print(f" - Elements: {wizard.op2_info.element_count}") + print() + + # Show validation summary + print(f"Validation Summary:") + for result in validation_results: + if result.success: + print(f" {result.message}") + print() + + print("[OK] You can now start the optimization with confidence!") + print(" The system has verified that all pipeline components work correctly.") + + else: + print("[FAILED] VALIDATION FAILED!") + print() + print("Issues found:") + for result in validation_results: + if not result.success: + print(f" [ERROR] {result.message}") + print() + print("Please fix these issues before starting optimization.") + sys.exit(1) + + except Exception as e: + print(f"\nERROR during validation: {e}") + import traceback + traceback.print_exc() + sys.exit(1) diff --git a/tests/test_timestamp_verification.py b/tests/test_timestamp_verification.py new file mode 100644 index 00000000..685ba515 --- /dev/null +++ b/tests/test_timestamp_verification.py @@ -0,0 +1,70 @@ +""" +Test: Verify NX regenerates .dat and .op2 files with new timestamps + +This test verifies the fix for OP2 caching by checking file timestamps. +""" + +from pathlib import Path +import sys +import time + +sys.path.insert(0, str(Path(__file__).parent.parent)) + +from optimization_engine.nx_solver import NXSolver + +print("=" * 60) +print("Testing timestamp verification fix") +print("=" * 60) + +sim_file = Path('studies/bracket_displacement_maximizing/model/Bracket_sim1.sim') + +if not sim_file.exists(): + print(f"ERROR: Simulation file not found: {sim_file}") + sys.exit(1) + +# Check current timestamps +dat_file = sim_file.parent / "bracket_sim1-solution_1.dat" +op2_file = sim_file.parent / "bracket_sim1-solution_1.op2" + +print(f"\nSimulation file: {sim_file}") +print(f"Working directory: {sim_file.parent}") + +if dat_file.exists(): + old_dat_time = dat_file.stat().st_mtime + print(f"\nBefore solve:") + print(f" .dat modified: {time.ctime(old_dat_time)}") + +if op2_file.exists(): + old_op2_time = op2_file.stat().st_mtime + print(f" .op2 modified: {time.ctime(old_op2_time)}") + +# Run solve with timestamp verification +print(f"\nRunning solve with timestamp verification...") +solver = NXSolver(nastran_version='2412', use_journal=True) +result = solver.run_simulation(sim_file) + +print(f"\nSolve result: {'SUCCESS' if result['success'] else 'FAILED'}") + +# Check new timestamps +if op2_file.exists(): + new_op2_time = op2_file.stat().st_mtime + print(f"\nAfter solve:") + print(f" .op2 modified: {time.ctime(new_op2_time)}") + + if 'old_op2_time' in locals(): + if new_op2_time > old_op2_time: + print(f"\n ✓ SUCCESS! .op2 file was regenerated!") + print(f" Time difference: {new_op2_time - old_op2_time:.1f} seconds") + else: + print(f"\n ✗ FAILED! .op2 file was NOT updated") + print(f" This means NX did not regenerate the file") + else: + print(f"\n ✓ New .op2 file created") + +if dat_file.exists(): + new_dat_time = dat_file.stat().st_mtime + print(f" .dat modified: {time.ctime(new_dat_time)}") + + if 'old_dat_time' in locals(): + if new_dat_time > old_dat_time: + print(f"\n ✓ .dat file was also regenerated")