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>
196 lines
5.9 KiB
HTML
196 lines
5.9 KiB
HTML
<!DOCTYPE html>
|
|
<!-- saved from url=(0014)about:internet -->
|
|
<html>
|
|
<head>
|
|
<title>Solution Monitor Graphs</title>
|
|
<script type = "text/javascript">
|
|
var isPluginLoaded = false;
|
|
function PluginLoaded() {
|
|
isPluginLoaded = true;
|
|
}
|
|
</script>
|
|
<script src = "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,13,26,40,53,65,70,80,87,97,105,110,121,130,138,144,150,158,164,180,186,188]
|
|
];
|
|
var yData = [
|
|
[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)'];
|
|
var colors2 = ['rgba( 12, 36, 97,0.5)','rgba(106,176, 76,0.5)','rgba(179, 57, 57,0.5)',
|
|
'rgba(250,152, 58,0.5)','rgba(115,115,115,0.5)','rgba( 49,130,189,0.5)','rgba(189,189,189,0.5)'];
|
|
var lineSize = [2, 4, 2, 2, 2, 2];
|
|
var labels = [''];
|
|
var data = [];
|
|
for (var i = 0; i < xData.length; i++) {
|
|
var result = {
|
|
x: xData[i],
|
|
y : yData[i],
|
|
type : 'scatter',
|
|
showlegend: true,
|
|
legendgroup: labels[i],
|
|
mode : 'lines',
|
|
name : labels[i],
|
|
line : {
|
|
color: colors[i],
|
|
width : lineSize[i]
|
|
}
|
|
};
|
|
var result2 = {
|
|
x: [xData[i][0], xData[i][21]],
|
|
y : [yData[i][0], yData[i][21]],
|
|
type : 'scatter',
|
|
showlegend: false,
|
|
legendgroup: labels[i],
|
|
mode : 'markers',
|
|
name : '',
|
|
hoverinfo : 'skip',
|
|
marker : {
|
|
color: colors2[i],
|
|
size : 12
|
|
}
|
|
};
|
|
data.push(result, result2);
|
|
}
|
|
var layout = {
|
|
height : 900,
|
|
width : 1200,
|
|
xaxis : {
|
|
showline: true,
|
|
showgrid : false,
|
|
zeroline : false,
|
|
showticklabels : true,
|
|
linecolor : 'rgb(204,204,204)',
|
|
linewidth : 2,
|
|
autotick : true,
|
|
ticks : 'outside',
|
|
tickcolor : 'rgb(204,204,204)',
|
|
tickwidth : 2,
|
|
ticklen : 5,
|
|
tickfont : {
|
|
family: 'Arial',
|
|
size : 12,
|
|
color : 'rgb(82, 82, 82)'
|
|
}
|
|
},
|
|
yaxis: {
|
|
showline: true,
|
|
showgrid : false,
|
|
zeroline : false,
|
|
showticklabels : true,
|
|
linecolor : 'rgb(204,204,204)',
|
|
linewidth : 2,
|
|
autotick : true,
|
|
ticks : 'outside',
|
|
tickcolor : 'rgb(204,204,204)',
|
|
tickwidth : 2,
|
|
ticklen : 5,
|
|
tickfont : {
|
|
family: 'Arial',
|
|
size : 12,
|
|
color : 'rgb(82, 82, 82)'
|
|
},
|
|
},
|
|
autosize : false,
|
|
margin : {
|
|
autoexpand: true,
|
|
l : 100,
|
|
r : 150,
|
|
t : 110
|
|
},
|
|
annotations : [
|
|
{
|
|
xref: 'paper',
|
|
yref : 'paper',
|
|
x : 0.0,
|
|
y : 1.05,
|
|
xanchor : 'left',
|
|
yanchor : 'bottom',
|
|
text : 'Sparse Matrix Solver',
|
|
font : {
|
|
family: 'Arial',
|
|
size : 30,
|
|
color : 'rgb(37,37,37)'
|
|
},
|
|
showarrow : false
|
|
},
|
|
{
|
|
xref: 'paper',
|
|
yref : 'paper',
|
|
x : 0.5,
|
|
y : -0.1,
|
|
xanchor : 'center',
|
|
yanchor : 'top',
|
|
text : 'Supernode',
|
|
showarrow : false,
|
|
font : {
|
|
family: 'Arial',
|
|
size : 22,
|
|
color : 'rgb(150,150,150)'
|
|
}
|
|
}
|
|
]
|
|
};
|
|
for (var i = 0; i < xData.length; i++) {
|
|
var result = {
|
|
xref: 'paper',
|
|
x : 0.05,
|
|
y : yData[i][0],
|
|
text : yData[i][0],
|
|
xanchor : 'right',
|
|
yanchor : 'middle',
|
|
showarrow : false,
|
|
clicktoshow : 'onout',
|
|
font : {
|
|
family: 'Arial',
|
|
size : 16,
|
|
color : 'black'
|
|
}
|
|
};
|
|
var result2 = {
|
|
xref: 'paper',
|
|
x : 0.95,
|
|
y : yData[i][21],
|
|
text : yData[i][21],
|
|
xanchor : 'left',
|
|
yanchor : 'middle',
|
|
font : {
|
|
family: 'Arial',
|
|
size : 16,
|
|
color : 'black'
|
|
},
|
|
showarrow : false,
|
|
clicktoshow : 'onout'
|
|
};
|
|
layout.annotations.push(result, result2);
|
|
}
|
|
var config = {responsive: true,
|
|
displaylogo: false};
|
|
Plotly.newPlot('Sparse Matrix Solver', data, layout, config);
|
|
</script>
|
|
|
|
<div class="plotly" id="plotly">
|
|
<span onclick="document.getElementById('plotly').style.display='none'" class='none'>× </span>
|
|
<p>The Javascript file required for visualization is not located<br>
|
|
in the current directory.Please follow the link:<br>
|
|
<a href="https://cdn.plot.ly/plotly-latest.min.js" target="_blank">plotly-latest.min.js</a></p>
|
|
Click Control + S and save it to the current directory.
|
|
</div>
|
|
<script>
|
|
if (!isPluginLoaded) {
|
|
document.getElementById('plotly').style.margin="10px 10% 60px 50%";
|
|
}
|
|
else {
|
|
document.getElementById('plotly').style.display='none';
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|