{
  "version": "1.0",
  "last_updated": "2025-12-07",
  "templates": [
    {
      "id": "multi_objective_structural",
      "name": "Multi-Objective Structural",
      "description": "NSGA-II optimization for structural analysis with mass, stress, and stiffness objectives",
      "category": "structural",
      "objectives": [
        {"name": "mass", "direction": "minimize", "extractor": "E4"},
        {"name": "stress", "direction": "minimize", "extractor": "E3"},
        {"name": "stiffness", "direction": "maximize", "extractor": "E1"}
      ],
      "extractors": ["E1", "E3", "E4"],
      "solver": "SOL 101",
      "element_types": ["CTETRA", "CHEXA", "CQUAD4"],
      "sampler": "NSGAIISampler",
      "recommended_trials": {
        "discovery": 1,
        "validation": 3,
        "quick": 20,
        "full": 50,
        "comprehensive": 100
      },
      "turbo_suitable": true,
      "example_study": "bracket_pareto_3obj",
      "wizard_questions": [
        {"key": "element_type", "question": "What element type does your mesh use?", "options": ["CTETRA (solid)", "CHEXA (solid)", "CQUAD4 (shell)"]},
        {"key": "stress_limit", "question": "What is the allowable stress limit (MPa)?", "default": 200},
        {"key": "displacement_limit", "question": "What is the max allowable displacement (mm)?", "default": 10}
      ]
    },
    {
      "id": "frequency_optimization",
      "name": "Frequency Optimization",
      "description": "Maximize natural frequency while minimizing mass for vibration-sensitive structures",
      "category": "dynamics",
      "objectives": [
        {"name": "frequency", "direction": "maximize", "extractor": "E2"},
        {"name": "mass", "direction": "minimize", "extractor": "E4"}
      ],
      "extractors": ["E2", "E4"],
      "solver": "SOL 103",
      "element_types": ["CTETRA", "CHEXA", "CQUAD4", "CBAR"],
      "sampler": "NSGAIISampler",
      "recommended_trials": {
        "discovery": 1,
        "validation": 3,
        "quick": 20,
        "full": 50
      },
      "turbo_suitable": true,
      "example_study": "uav_arm_optimization",
      "wizard_questions": [
        {"key": "target_mode", "question": "Which vibration mode to optimize?", "default": 1},
        {"key": "min_frequency", "question": "Minimum acceptable frequency (Hz)?", "default": 50}
      ]
    },
    {
      "id": "single_objective_mass",
      "name": "Mass Minimization",
      "description": "Minimize mass subject to stress and displacement constraints",
      "category": "structural",
      "objectives": [
        {"name": "mass", "direction": "minimize", "extractor": "E4"}
      ],
      "extractors": ["E1", "E3", "E4"],
      "solver": "SOL 101",
      "element_types": ["CTETRA", "CHEXA", "CQUAD4"],
      "sampler": "TPESampler",
      "recommended_trials": {
        "discovery": 1,
        "validation": 3,
        "quick": 30,
        "full": 100
      },
      "turbo_suitable": true,
      "example_study": "bracket_stiffness_optimization_V3",
      "wizard_questions": [
        {"key": "stress_constraint", "question": "Max stress constraint (MPa)?", "default": 200},
        {"key": "displacement_constraint", "question": "Max displacement constraint (mm)?", "default": 5}
      ]
    },
    {
      "id": "mirror_wavefront",
      "name": "Mirror Wavefront Optimization",
      "description": "Minimize Zernike wavefront error for optical mirror deformation",
      "category": "optics",
      "objectives": [
        {"name": "zernike_rms", "direction": "minimize", "extractor": "E8"}
      ],
      "extractors": ["E8", "E9", "E10"],
      "solver": "SOL 101",
      "element_types": ["CQUAD4", "CTRIA3"],
      "sampler": "TPESampler",
      "recommended_trials": {
        "discovery": 1,
        "validation": 3,
        "quick": 30,
        "full": 100
      },
      "turbo_suitable": false,
      "example_study": "m1_mirror_zernike_optimization",
      "wizard_questions": [
        {"key": "mirror_radius", "question": "Mirror radius (mm)?", "required": true},
        {"key": "zernike_modes", "question": "Number of Zernike modes?", "default": 36},
        {"key": "target_wfe", "question": "Target WFE RMS (nm)?", "default": 50}
      ]
    },
    {
      "id": "thermal_structural",
      "name": "Thermal-Structural Coupled",
      "description": "Optimize for thermal and structural performance",
      "category": "multiphysics",
      "objectives": [
        {"name": "max_temperature", "direction": "minimize", "extractor": "E15"},
        {"name": "thermal_stress", "direction": "minimize", "extractor": "E3"}
      ],
      "extractors": ["E3", "E15", "E16"],
      "solver": "SOL 153/400",
      "element_types": ["CTETRA", "CHEXA"],
      "sampler": "NSGAIISampler",
      "recommended_trials": {
        "discovery": 1,
        "validation": 3,
        "quick": 20,
        "full": 50
      },
      "turbo_suitable": false,
      "example_study": null,
      "wizard_questions": [
        {"key": "max_temp_limit", "question": "Maximum allowable temperature (°C)?", "default": 100},
        {"key": "stress_limit", "question": "Maximum allowable thermal stress (MPa)?", "default": 150}
      ]
    },
    {
      "id": "shell_structural",
      "name": "Shell Structure Optimization",
      "description": "Optimize shell structures (CQUAD4/CTRIA3) for mass and stress",
      "category": "structural",
      "objectives": [
        {"name": "mass", "direction": "minimize", "extractor": "E4"},
        {"name": "stress", "direction": "minimize", "extractor": "E3"}
      ],
      "extractors": ["E1", "E3", "E4"],
      "solver": "SOL 101",
      "element_types": ["CQUAD4", "CTRIA3"],
      "sampler": "NSGAIISampler",
      "recommended_trials": {
        "discovery": 1,
        "validation": 3,
        "quick": 20,
        "full": 50
      },
      "turbo_suitable": true,
      "example_study": "beam_pareto_4var",
      "notes": "Remember to specify element_type='cquad4' in stress extractor",
      "wizard_questions": [
        {"key": "stress_limit", "question": "Max stress constraint (MPa)?", "default": 200}
      ]
    }
  ],
  "extractors": {
    "E1": {"name": "Displacement", "function": "extract_displacement", "units": "mm", "phase": 1},
    "E2": {"name": "Frequency", "function": "extract_frequency", "units": "Hz", "phase": 1},
    "E3": {"name": "Von Mises Stress", "function": "extract_solid_stress", "units": "MPa", "phase": 1, "notes": "Specify element_type for shell elements"},
    "E4": {"name": "BDF Mass", "function": "extract_mass_from_bdf", "units": "kg", "phase": 1},
    "E5": {"name": "CAD Mass", "function": "extract_mass_from_expression", "units": "kg", "phase": 1},
    "E6": {"name": "Stiffness (from disp)", "function": "calculate_stiffness", "units": "N/mm", "phase": 1},
    "E7": {"name": "Compliance", "function": "calculate_compliance", "units": "mm/N", "phase": 1},
    "E8": {"name": "Zernike WFE RMS", "function": "extract_zernike_wfe_rms", "units": "nm", "phase": 1},
    "E9": {"name": "Zernike Coefficients", "function": "extract_zernike_coefficients", "units": "nm", "phase": 1},
    "E10": {"name": "Zernike RMS per Mode", "function": "extract_zernike_rms_per_mode", "units": "nm", "phase": 1},
    "E12": {"name": "Principal Stress", "function": "extract_principal_stress", "units": "MPa", "phase": 2},
    "E13": {"name": "Strain Energy", "function": "extract_strain_energy", "units": "J", "phase": 2},
    "E14": {"name": "SPC Forces", "function": "extract_spc_forces", "units": "N", "phase": 2},
    "E15": {"name": "Temperature", "function": "extract_temperature", "units": "°C", "phase": 3},
    "E16": {"name": "Temperature Gradient", "function": "extract_temperature_gradient", "units": "°C/mm", "phase": 3},
    "E17": {"name": "Heat Flux", "function": "extract_heat_flux", "units": "W/mm²", "phase": 3},
    "E18": {"name": "Modal Mass", "function": "extract_modal_mass", "units": "kg", "phase": 3}
  },
  "categories": {
    "structural": {
      "name": "Structural Analysis",
      "description": "Static structural optimization (SOL 101)",
      "icon": "🏗️"
    },
    "dynamics": {
      "name": "Dynamics / Modal",
      "description": "Frequency and modal optimization (SOL 103)",
      "icon": "📳"
    },
    "optics": {
      "name": "Optical Systems",
      "description": "Wavefront error optimization for mirrors/lenses",
      "icon": "🔭"
    },
    "multiphysics": {
      "name": "Multi-Physics",
      "description": "Coupled thermal-structural analysis",
      "icon": "🔥"
    }
  }
}
