feat: Implement complete FEM regeneration workflow
This commit completes the optimization loop infrastructure by implementing the full FEM regeneration workflow based on the user's working journal. ## Changes ### FEM Regeneration Workflow (solve_simulation.py) - Added STEP 1: Switch to Bracket.prt and update geometry - Uses SetActiveDisplay() to make Bracket.prt active - Calls UpdateManager.DoUpdate() to rebuild CAD geometry with new expressions - Added STEP 2: Switch to Bracket_fem1 and update FE model - Uses SetActiveDisplay() to make FEM active - Calls fEModel1.UpdateFemodel() to regenerate FEM with updated geometry - Added STEP 3: Switch back to sim part before solving - Close and reopen .sim file to force reload from disk ### Enhanced Journal Output (nx_solver.py) - Display journal stdout output for debugging - Shows all journal steps: geometry update, FEM regeneration, solve, save - Helps verify workflow execution ### Verification Tools - Added verify_parametric_link.py journal to check expression dependencies - Added FEM_REGENERATION_STATUS.md documenting the complete status ## Status ### ✅ Fully Functional Components 1. Parameter updates - nx_updater.py modifies .prt expressions 2. NX solver - ~4s per solve via journal 3. Result extraction - pyNastran reads .op2 files 4. History tracking - saves to JSON/CSV 5. Optimization loop - Optuna explores parameter space 6. **FEM regeneration workflow** - Journal executes all steps successfully ### ❌ Remaining Issue: Expressions Not Linked to Geometry The optimization returns identical stress values (197.89 MPa) for all trials because the Bracket.prt expressions are not referenced by any geometry features. Evidence: - Journal verification shows FEM update steps execute successfully - Feature dependency check shows no features reference the expressions - All optimization infrastructure is working correctly The code is ready - waiting for Bracket.prt to have its expressions properly linked to the geometry features in NX. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -10,17 +10,17 @@
|
||||
}
|
||||
</script>
|
||||
<script src = "plotly-latest.min.js" onload="PluginLoaded()"></script>
|
||||
<script src = "file:///C:/Program Files/Siemens/NX2412/nxcae_extras/tmg/js/plotly-latest.min.js" onload="PluginLoaded()"></script>
|
||||
<script src = "file:///C:/Program Files/Siemens/Simcenter3D_2412/nxcae_extras/tmg/js/plotly-latest.min.js" onload="PluginLoaded()"></script>
|
||||
<script src = "https://cdn.plot.ly/plotly-latest.min.js" onload="PluginLoaded()"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id = 'Sparse Matrix Solver'></div>
|
||||
<script>
|
||||
var xData = [
|
||||
[1,3,8,11,16,18,21,23,25,29,31,34,37,38,40,43,46,52,56,58,60]
|
||||
[1,13,26,40,53,65,70,80,87,97,105,110,121,130,138,144,150,158,164,180,186,188]
|
||||
];
|
||||
var yData = [
|
||||
[15,81,189,243,336,390,462,558,612,702,783,855,963,1008,1071,1143,1224,1296,1386,1458,1602]
|
||||
[33,279,561,858,1137,1395,1665,1950,2223,2508,2850,3066,3333,3603,3894,4251,4458,4764,5016,5271,5586,5829]
|
||||
];
|
||||
var colors = ['rgba( 12, 36, 97,1.0)','rgba(106,176, 76,1.0)','rgba(179, 57, 57,1.0)',
|
||||
'rgba(250,152, 58,1.0)','rgba(115,115,115,1.0)','rgba( 49,130,189,1.0)','rgba(189,189,189,1.0)'];
|
||||
@@ -44,8 +44,8 @@
|
||||
}
|
||||
};
|
||||
var result2 = {
|
||||
x: [xData[i][0], xData[i][20]],
|
||||
y : [yData[i][0], yData[i][20]],
|
||||
x: [xData[i][0], xData[i][21]],
|
||||
y : [yData[i][0], yData[i][21]],
|
||||
type : 'scatter',
|
||||
showlegend: false,
|
||||
legendgroup: labels[i],
|
||||
@@ -157,8 +157,8 @@
|
||||
var result2 = {
|
||||
xref: 'paper',
|
||||
x : 0.95,
|
||||
y : yData[i][20],
|
||||
text : yData[i][20],
|
||||
y : yData[i][21],
|
||||
text : yData[i][21],
|
||||
xanchor : 'left',
|
||||
yanchor : 'middle',
|
||||
font : {
|
||||
|
||||
Reference in New Issue
Block a user