Files
Atomizer/optimization_engine/interview/schemas/anti_patterns.json

214 lines
8.1 KiB
JSON
Raw Permalink Normal View History

{
"version": "1.0",
"description": "Common optimization setup anti-patterns and their detection",
"patterns": [
{
"id": "mass_no_constraint",
"name": "Mass Minimization Without Constraints",
"description": "Minimizing mass without any structural constraints will result in zero-thickness (or zero-size) designs that are physically impossible",
"severity": "error",
"condition": {
"type": "and",
"conditions": [
{
"type": "or",
"conditions": [
{"type": "contains", "field": "objectives", "value": "minimize_mass"},
{"type": "contains", "field": "objectives", "value": "minimize_weight"}
]
},
{"type": "empty", "field": "constraints"}
]
},
"fix_suggestion": "Add at least one constraint: maximum stress, maximum displacement, or minimum frequency",
"auto_fix": null
},
{
"id": "modal_single_solution",
"name": "Modal Analysis with Single Solution Step",
"description": "When both static and modal analysis are needed, using only a single solution may miss computing one type of result",
"severity": "error",
"condition": {
"type": "and",
"conditions": [
{"type": "contains", "field": "analysis_types", "value": "modal"},
{"type": "contains", "field": "analysis_types", "value": "static"},
{"type": "equals", "field": "solve_all_solutions", "value": false}
]
},
"fix_suggestion": "Enable 'solve all solutions' to ensure both static and modal results are computed",
"auto_fix": {
"field": "solve_all_solutions",
"value": true
}
},
{
"id": "bounds_too_wide",
"name": "Design Variable Bounds Too Wide",
"description": "When bounds span more than 10x the range (max/min > 10), optimization may struggle to converge efficiently",
"severity": "warning",
"condition": {
"type": "any_of",
"field": "design_variables",
"check": {
"type": "ratio_greater_than",
"field": ["max_value", "min_value"],
"value": 10
}
},
"fix_suggestion": "Consider narrowing bounds based on engineering knowledge. Very wide bounds increase the search space exponentially.",
"auto_fix": null
},
{
"id": "stress_over_yield",
"name": "Stress Limit Exceeds Material Yield",
"description": "The specified stress constraint exceeds the material yield stress, which could allow plastic deformation",
"severity": "warning",
"condition": {
"type": "and",
"conditions": [
{"type": "exists", "field": "constraints.max_stress"},
{"type": "exists", "field": "introspection.material"},
{
"type": "greater_than",
"field": "constraints.max_stress",
"compare_to": "material.yield_stress_mpa"
}
]
},
"fix_suggestion": "The stress limit should typically be the yield stress divided by a safety factor (1.5-2.0 for structural applications)",
"auto_fix": null
},
{
"id": "conflicting_objectives",
"name": "Typically Conflicting Objectives",
"description": "The selected objectives are typically in conflict. This is not an error, but expect a trade-off Pareto front rather than a single optimal solution.",
"severity": "info",
"condition": {
"type": "or",
"conditions": [
{
"type": "and",
"conditions": [
{"type": "contains", "field": "objectives", "value": "minimize_mass"},
{"type": "contains", "field": "objectives", "value": "minimize_displacement"}
]
},
{
"type": "and",
"conditions": [
{"type": "contains", "field": "objectives", "value": "minimize_mass"},
{"type": "contains", "field": "objectives", "value": "maximize_frequency"}
]
}
]
},
"fix_suggestion": "Consider which objective is more important, or proceed with multi-objective optimization to explore trade-offs",
"auto_fix": null
},
{
"id": "too_many_objectives",
"name": "Too Many Objectives",
"description": "More than 3 objectives makes interpretation difficult and may not improve the optimization",
"severity": "warning",
"condition": {
"type": "count_greater_than",
"field": "objectives",
"value": 3
},
"fix_suggestion": "Consider reducing to 2-3 primary objectives. Additional goals can often be handled as constraints.",
"auto_fix": null
},
{
"id": "missing_stress_constraint",
"name": "Missing Stress Constraint",
"description": "Static analysis without a stress constraint may result in designs that fail structurally",
"severity": "warning",
"condition": {
"type": "and",
"conditions": [
{"type": "contains", "field": "analysis_types", "value": "static"},
{"type": "not_exists", "field": "constraints.max_stress"},
{
"type": "not",
"condition": {"type": "contains", "field": "objectives", "value": "minimize_stress"}
}
]
},
"fix_suggestion": "Add a stress constraint based on material yield stress and appropriate safety factor",
"auto_fix": null
},
{
"id": "too_few_trials",
"name": "Insufficient Trials for Design Space",
"description": "The number of trials may be too low for the number of design variables to adequately explore the design space",
"severity": "warning",
"condition": {
"type": "less_than",
"field": "n_trials",
"compare_to": {
"type": "multiply",
"field": "design_variable_count",
"value": 15
}
},
"fix_suggestion": "Rule of thumb: use at least 10-20 trials per design variable. Consider increasing trials.",
"auto_fix": null
},
{
"id": "infeasible_baseline",
"name": "Baseline Violates Constraints",
"description": "The nominal design already violates one or more constraints. The optimizer starts in the infeasible region.",
"severity": "warning",
"condition": {
"type": "exists",
"field": "baseline_violations"
},
"fix_suggestion": "Consider relaxing constraints or modifying the baseline design to start from a feasible point",
"auto_fix": null
},
{
"id": "no_design_variables",
"name": "No Design Variables Selected",
"description": "At least one design variable must be selected for optimization",
"severity": "error",
"condition": {
"type": "empty",
"field": "design_variables"
},
"fix_suggestion": "Select one or more parameters to vary during optimization",
"auto_fix": null
},
{
"id": "thermal_no_temperature",
"name": "Thermal Analysis Without Temperature Gradient",
"description": "Thermal analysis typically requires a temperature boundary condition or thermal load",
"severity": "warning",
"condition": {
"type": "and",
"conditions": [
{"type": "contains", "field": "analysis_types", "value": "thermal"},
{"type": "not_exists", "field": "introspection.thermal_bc"}
]
},
"fix_suggestion": "Verify thermal boundary conditions are defined in the simulation",
"auto_fix": null
},
{
"id": "single_dv_many_trials",
"name": "Single Variable with Many Trials",
"description": "For single-variable optimization, many trials may be inefficient. Consider using gradient-based methods.",
"severity": "info",
"condition": {
"type": "and",
"conditions": [
{"type": "count_equals", "field": "design_variables", "value": 1},
{"type": "greater_than", "field": "n_trials", "value": 50}
]
},
"fix_suggestion": "For single-variable problems, L-BFGS-B or golden section search may converge faster than sampling-based optimization",
"auto_fix": null
}
]
}