feat: Add MCP build_optimization_config tool
Integrate OP2 data extraction with optimization config builder: - Add build_optimization_config() MCP tool - Add list_optimization_options() helper - Add format_optimization_options_for_llm() formatter - Update MCP tools documentation with full API details - Test with bracket example, generates valid config Features: - Discovers design variables from FEA model - Lists 4 available objectives (mass, stress, displacement, volume) - Lists 4 available constraints (stress/displacement/mass limits) - Validates user selections against model - Generates complete optimization_config.json Tested with examples/bracket/Bracket_sim1.sim: - Found 4 design variables (support_angle, tip_thickness, p3, support_blend_radius) - Created config with 2 objectives, 2 constraints, 150 trials 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
180
examples/bracket/optimization_config.json
Normal file
180
examples/bracket/optimization_config.json
Normal file
@@ -0,0 +1,180 @@
|
||||
{
|
||||
"design_variables": [
|
||||
{
|
||||
"name": "tip_thickness",
|
||||
"type": "continuous",
|
||||
"bounds": [
|
||||
15.0,
|
||||
25.0
|
||||
],
|
||||
"units": "mm",
|
||||
"initial_value": 20.0
|
||||
},
|
||||
{
|
||||
"name": "support_angle",
|
||||
"type": "continuous",
|
||||
"bounds": [
|
||||
20.0,
|
||||
40.0
|
||||
],
|
||||
"units": "degrees",
|
||||
"initial_value": 30.0
|
||||
}
|
||||
],
|
||||
"objectives": [
|
||||
{
|
||||
"name": "minimize_mass",
|
||||
"description": "Minimize total mass (weight reduction)",
|
||||
"extractor": "mass_extractor",
|
||||
"metric": "total_mass",
|
||||
"direction": "minimize",
|
||||
"weight": 5.0
|
||||
},
|
||||
{
|
||||
"name": "minimize_max_stress",
|
||||
"description": "Minimize maximum von Mises stress",
|
||||
"extractor": "stress_extractor",
|
||||
"metric": "max_von_mises",
|
||||
"direction": "minimize",
|
||||
"weight": 10.0
|
||||
}
|
||||
],
|
||||
"constraints": [
|
||||
{
|
||||
"name": "max_displacement_limit",
|
||||
"description": "Maximum allowable displacement",
|
||||
"extractor": "displacement_extractor",
|
||||
"metric": "max_displacement",
|
||||
"type": "upper_bound",
|
||||
"limit": 1.0,
|
||||
"units": "mm"
|
||||
},
|
||||
{
|
||||
"name": "max_stress_limit",
|
||||
"description": "Maximum allowable von Mises stress",
|
||||
"extractor": "stress_extractor",
|
||||
"metric": "max_von_mises",
|
||||
"type": "upper_bound",
|
||||
"limit": 200.0,
|
||||
"units": "MPa"
|
||||
}
|
||||
],
|
||||
"optimization_settings": {
|
||||
"n_trials": 150,
|
||||
"sampler": "TPE",
|
||||
"n_startup_trials": 20
|
||||
},
|
||||
"model_info": {
|
||||
"sim_file": "C:/Users/antoi/Documents/Atomaste/Atomizer/examples/bracket/Bracket_sim1.sim",
|
||||
"solutions": [
|
||||
{
|
||||
"name": "Direct Frequency Response",
|
||||
"type": "Direct Frequency Response",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "Disable in Thermal Solution 2D",
|
||||
"type": "Disable in Thermal Solution 2D",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "Nonlinear Statics",
|
||||
"type": "Nonlinear Statics",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "Linear Statics",
|
||||
"type": "Linear Statics",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "*Thermal-Flow Coupled Solution Parameters",
|
||||
"type": "*Thermal-Flow Coupled Solution Parameters",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "Thermal Solution Parameters",
|
||||
"type": "Thermal Solution Parameters",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "Disable in Thermal Solution 3D",
|
||||
"type": "Disable in Thermal Solution 3D",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "Modal Frequency Response",
|
||||
"type": "Modal Frequency Response",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "Direct Transient Response",
|
||||
"type": "Direct Transient Response",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "-Flow-Structural Coupled Solution Parameters",
|
||||
"type": "-Flow-Structural Coupled Solution Parameters",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "Normal Modes",
|
||||
"type": "Normal Modes",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "Modal Transient Response",
|
||||
"type": "Modal Transient Response",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "\"ObjectDisableInThermalSolution3D",
|
||||
"type": "\"ObjectDisableInThermalSolution3D",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "1Pass Structural Contact Solution to Flow Solver",
|
||||
"type": "1Pass Structural Contact Solution to Flow Solver",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "0Thermal-Structural Coupled Solution Parameters",
|
||||
"type": "0Thermal-Structural Coupled Solution Parameters",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "Design Optimization",
|
||||
"type": "Design Optimization",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "DisableInThermalSolution",
|
||||
"type": "DisableInThermalSolution",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
},
|
||||
{
|
||||
"name": "\"ObjectDisableInThermalSolution2D",
|
||||
"type": "\"ObjectDisableInThermalSolution2D",
|
||||
"solver": "NX Nastran",
|
||||
"description": "Extracted from binary .sim file"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user