Skip to content

Registry and YAML

The registry maps concise YAML names to Python classes or factories.

problem:
  geometry:
    name: cst_airfoil
    n_upper: 8
    n_lower: 8

  evaluator:
    name: neuralfoil
    mach: 0.15
    reynolds: 1.0e6
    alpha: 2.0

  objectives:
    - name: drag_min
      target: CD
      mode: minimize
      weight: 1.0

  constraints:
    - name: CL
      type: target
      value: 0.5
      tolerance: 0.02
      weight: 20.0
      mode: soft

strategy:
  name: dflow
  num_samples: 256
  guidance_steps: 100

Python usage:

from flowdesign.registry import load_config, build_problem_from_config, build_strategy_from_config

config = load_config("configs/airfoil/dflow.yaml")
problem = build_problem_from_config(config)
strategy = build_strategy_from_config(config)
result = strategy.run(problem)