feat: Add AtomizerField training data export and intelligent model discovery

Major additions:
- Training data export system for AtomizerField neural network training
- Bracket stiffness optimization study with 50+ training samples
- Intelligent NX model discovery (auto-detect solutions, expressions, mesh)
- Result extractors module for displacement, stress, frequency, mass
- User-generated NX journals for advanced workflows
- Archive structure for legacy scripts and test outputs
- Protocol documentation and dashboard launcher

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-26 12:01:50 -05:00
parent a0c008a593
commit 2b3573ec42
949 changed files with 1405144 additions and 470 deletions

View File

@@ -0,0 +1,32 @@
Nastran BUFFSIZE=32769 $(c:/program files/siemens/nx2412/nxnastran/conf/nastran.rcf[1])
Nastran BUFFPOOL=20.0X $(c:/program files/siemens/nx2412/nxnastran/conf/nastran.rcf[4])
Nastran DIAGA=128 DIAGB=0 $(c:/program files/siemens/nx2412/nxnastran/conf/nastran.rcf[7])
Nastran REAL=8545370112 $(Memory limit for MPI and other specialized modules)
JID='C:\Users\antoi\Documents\Atomaste\Atomizer\studies\bracket_stiffness_optimization_atomizerfield\1_setup\model\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/nx2412/nxnastran/scnas/nast/del' $(program default)
symbol=DEMODIR='c:/program files/siemens/nx2412/nxnastran/scnas/nast/demo' $(program default)
symbol=SSSALTERDIR='c:/program files/siemens/nx2412/nxnastran/scnas/nast/misc/sssalter' $(program default)
symbol=TPLDIR='c:/program files/siemens/nx2412/nxnastran/scnas/nast/tpl' $(program default)
SDIR='c:/users/antoi/appdata/local/temp/bracket_sim1-solution_1.T199472_25'
DBS='c:/users/antoi/appdata/local/temp/bracket_sim1-solution_1.T199472_25'
SCR=yes
SMEM=20.0X
NEWDEL='c:/program files/siemens/nx2412/nxnastran/scnas/em64tntl/SSS'
DEL='NXNDEF'
AUTH='29000@AntoineThinkpad'
AUTHQUE=0
MSGCAT='c:/program files/siemens/nx2412/nxnastran/scnas/em64tntl/analysis.msg'
MSGDEST='f06'
PROG=bundle
NEWS='c:/program files/siemens/nx2412/nxnastran/scnas/nast/news.txt'
UMATLIB='libnxumat.dll'
UCRPLIB='libucreep.dll'
USOLLIB='libusol.dll'

View File

@@ -0,0 +1,91 @@
"""
NX Journal - Export Displacement Field for Bracket Stiffness Analysis
=====================================================================
This journal exports the z-displacement field from a ResultProbe to a .fld file.
Usage:
run_journal.exe export_displacement_field.py [sim_file_path]
If sim_file_path is not provided, uses Bracket_sim1.sim in the same directory.
"""
import sys
import math
from pathlib import Path
import NXOpen
import NXOpen.CAE
import NXOpen.Fields
def main(args):
"""
Export displacement field from NX simulation results.
Args:
args: Command line arguments, optionally including sim file path
The ResultProbe should already be defined in the simulation file
with z-displacement as the measured quantity.
"""
theSession = NXOpen.Session.GetSession()
# Determine sim file to open
if len(args) > 0:
sim_file = Path(args[0])
else:
# Default: Bracket_sim1.sim in same directory as this journal
journal_dir = Path(__file__).parent
sim_file = journal_dir / "Bracket_sim1.sim"
if not sim_file.exists():
print(f"ERROR: Simulation file not found: {sim_file}")
return 1
# Open the simulation file
print(f"Opening simulation: {sim_file}")
try:
basePart1, partLoadStatus1 = theSession.Parts.OpenBaseDisplay(str(sim_file))
partLoadStatus1.Dispose()
except Exception as e:
print(f"ERROR: Failed to open simulation: {e}")
return 1
workSimPart = theSession.Parts.BaseWork
if workSimPart is None:
print("ERROR: No work part loaded after opening simulation.")
return 1
# Get the FieldManager
fieldManager = workSimPart.FindObject("FieldManager")
if fieldManager is None:
print("ERROR: FieldManager not found. Make sure simulation results are loaded.")
return 1
# Find the ResultProbe (should be pre-configured for z-displacement)
resultProbe = fieldManager.FindObject("ResultProbe")
if resultProbe is None:
print("ERROR: ResultProbe not found. Please create a ResultProbe for z-displacement.")
return 1
# Prepare probe array for export
probes = [NXOpen.CAE.ResultProbe.Null] * 1
probes[0] = resultProbe
# Determine output file path (same directory as this journal)
journal_dir = Path(__file__).parent
output_file = journal_dir / "export_field_dz.fld"
# Export to field file
print(f"Exporting displacement field to: {output_file}")
theSession.ResultManager.ExportProbesToFieldFile(probes, str(output_file))
print(f"[OK] Successfully exported displacement field")
print(f" Output: {output_file}")
return 0
if __name__ == '__main__':
exit_code = main(sys.argv[1:])
sys.exit(exit_code)

View File

@@ -0,0 +1,48 @@
FIELD: [ResultProbe] : [TABLE]
FIELD LOCK STATE: [NO]
DUPLICATE_VALUE_OPTION: [0]
PARAMETERIZE INDEPENDENT DOMAIN: [NO]
PERSIST INTERPOL: [NO]
CREATE INTERPOLATOR: [NO]
FALLBACK DEFAULT INTERPOLATOR: [YES]
INTERPOL: [4]
VALUES OUTSIDE: [2]
REMOVE DELAUNAY SLIVERS: [NO]
INDEP VAR: [step] : [] : [] : [0]
BOUNDS: [0] : [YES] : [0] : [YES] : [27] : [0]
INDEP VAR: [node_id] : [] : [] : [5]
BOUNDS: [3] : [YES] : [413] : [YES] : [27] : [407]
DEP VAR: [x] : [Length] : [mm] : [0]
DESCRIPTION: ResultProbe
DESCRIPTION: dz
DESCRIPTION: 21-Nov-25
DESCRIPTION: 19:25:36
START DATA
0, 407, -0.0941346362233162
0, 408, -0.0937454551458359
0, 409, -0.0935764610767365
0, 410, -0.0935385450720787
0, 411, -0.0980110093951225
0, 412, -0.0959530174732208
0, 413, -0.094814196228981
0, 3, -0.10150358080864
0, 6, -0.101503469049931
0, 14, -0.0935568511486053
0, 11, -0.0935568138957024
0, 113, -0.0937929674983025
0, 114, -0.0942020565271378
0, 115, -0.0935586988925934
0, 116, -0.0936075374484062
0, 117, -0.0979839861392975
0, 118, -0.0960513949394226
0, 119, -0.0949068069458008
0, 52, -0.101693071424961
0, 145, -0.0942021608352661
0, 146, -0.093793049454689
0, 147, -0.0935587361454964
0, 148, -0.093607597053051
0, 149, -0.0979839861392975
0, 150, -0.0960515514016151
0, 151, -0.0949069485068321
0, 122, -0.0935398191213608
END DATA

View File

@@ -0,0 +1,151 @@
{
"study_name": "bracket_stiffness_optimization_atomizerfield",
"description": "Bracket Stiffness Optimization with AtomizerField Neural Acceleration - Multi-objective optimization of bracket geometry for maximum stiffness and minimum mass",
"engineering_context": "L-bracket optimization for mounting applications. Uses AtomizerField neural surrogate for accelerated optimization after initial FEA exploration phase.",
"template_info": {
"category": "structural",
"analysis_type": "static",
"typical_applications": ["mounting brackets", "L-brackets", "support structures"],
"based_on": "bracket_stiffness_optimization_V3",
"neural_enabled": true
},
"optimization_settings": {
"protocol": "protocol_11_multi_objective",
"n_trials": 100,
"sampler": "NSGAIISampler",
"pruner": null,
"timeout_per_trial": 400,
"fea_exploration_trials": 50,
"neural_acceleration_trials": 50
},
"design_variables": [
{
"parameter": "support_angle",
"bounds": [20, 70],
"description": "Angle of the support arm (degrees)",
"units": "degrees"
},
{
"parameter": "tip_thickness",
"bounds": [30, 60],
"description": "Thickness at the bracket tip (mm)",
"units": "mm"
}
],
"objectives": [
{
"name": "stiffness",
"goal": "maximize",
"weight": 1.0,
"description": "Structural stiffness (inverse of max displacement)",
"extraction": {
"action": "extract_displacement",
"domain": "result_extraction",
"params": {
"result_type": "displacement",
"metric": "max",
"invert_for_stiffness": true
}
}
},
{
"name": "mass",
"goal": "minimize",
"weight": 0.1,
"description": "Total bracket mass (kg)",
"extraction": {
"action": "extract_mass",
"domain": "result_extraction",
"params": {
"result_type": "mass",
"metric": "total"
}
}
}
],
"constraints": [
{
"name": "mass_limit",
"type": "less_than",
"threshold": 0.2,
"description": "Maximum mass constraint (kg)",
"extraction": {
"action": "extract_mass",
"domain": "result_extraction",
"params": {
"result_type": "mass",
"metric": "total"
}
}
}
],
"simulation": {
"model_file": "Bracket.prt",
"sim_file": "Bracket_sim1.sim",
"fem_file": "Bracket_fem1.fem",
"solver": "nastran",
"analysis_types": ["static"],
"solution_name": "Solution 1",
"dat_file": "bracket_sim1-solution_1.dat",
"op2_file": "bracket_sim1-solution_1.op2",
"field_export_journal": "export_displacement_field.py",
"field_output_file": "export_field_dz.fld"
},
"result_extraction": {
"mass": {
"method": "bdf_mass_extractor",
"source": "bracket_sim1-solution_1.dat",
"extractor_module": "optimization_engine.extractors.bdf_mass_extractor",
"function": "extract_mass_from_bdf",
"output_unit": "kg"
},
"stiffness": {
"method": "stiffness_calculator",
"displacement_source": "export_field_dz.fld",
"force_source": "bracket_sim1-solution_1.op2",
"extractor_module": "optimization_engine.extractors.stiffness_calculator",
"force_component": "fz",
"displacement_component": "z",
"output_unit": "N/mm"
},
"displacement": {
"method": "op2_displacement",
"source": "bracket_sim1-solution_1.op2",
"extractor_module": "optimization_engine.extractors.extract_displacement",
"function": "extract_displacement",
"output_unit": "mm"
}
},
"reporting": {
"generate_plots": true,
"save_incremental": true,
"llm_summary": true,
"generate_pareto_front": true
},
"training_data_export": {
"enabled": true,
"export_dir": "atomizer_field_training_data/bracket_stiffness_optimization_atomizerfield",
"export_every_n_trials": 1,
"include_mesh": true,
"compress": false
},
"neural_acceleration": {
"enabled": true,
"min_training_points": 50,
"auto_train": true,
"epochs": 100,
"validation_split": 0.2,
"retrain_threshold": 25,
"model_type": "parametric"
}
}