# distutils: language = c++

# https://stackoverflow.com/questions/5697479/how-can-a-defined-c-value-be-exposed-to-python-in-a-cython-module
# Need to modify this if optimization functions are changed, of course.
cdef extern from "Solver/OptimizationFunction.H":
    cdef int OPT_CL_TOTAL
    cdef int OPT_CD_TOTAL
    cdef int OPT_CS_TOTAL
    cdef int OPT_CL_INVISCID
    cdef int OPT_CD_INVISCID
    cdef int OPT_CS_INVISCID
    cdef int OPT_CL_VISCOUS
    cdef int OPT_CD_VISCOUS
    cdef int OPT_CS_VISCOUS
    cdef int OPT_CX_TOTAL
    cdef int OPT_CY_TOTAL
    cdef int OPT_CZ_TOTAL
    cdef int OPT_CX_INVISCID
    cdef int OPT_CY_INVISCID
    cdef int OPT_CZ_INVISCID
    cdef int OPT_CX_VISCOUS
    cdef int OPT_CY_VISCOUS
    cdef int OPT_CZ_VISCOUS
    cdef int OPT_CMX_TOTAL
    cdef int OPT_CMY_TOTAL
    cdef int OPT_CMZ_TOTAL
    cdef int OPT_CMX_INVISCID
    cdef int OPT_CMY_INVISCID
    cdef int OPT_CMZ_INVISCID
    cdef int OPT_CMX_VISCOUS
    cdef int OPT_CMY_VISCOUS
    cdef int OPT_CMZ_VISCOUS
    cdef int OPT_WING_CL_TOTAL
    cdef int OPT_WING_CX_TOTAL
    cdef int OPT_WING_CY_TOTAL
    cdef int OPT_WING_CZ_TOTAL
    cdef int OPT_WING_CL_INVISCID
    cdef int OPT_WING_CX_INVISCID
    cdef int OPT_WING_CY_INVISCID
    cdef int OPT_WING_CZ_INVISCID
    cdef int OPT_WING_CL_VISCOUS
    cdef int OPT_WING_CX_VISCOUS
    cdef int OPT_WING_CY_VISCOUS
    cdef int OPT_WING_CZ_VISCOUS
    cdef int OPT_ROTOR_CT_TOTAL
    cdef int OPT_ROTOR_CP_TOTAL
    cdef int OPT_ROTOR_EFFICIENCY
    cdef int OPT_ROTOR_CT_INVISCID
    cdef int OPT_ROTOR_CP_INVISCID
    cdef int OPT_ROTOR_CT_VISCOUS
    cdef int OPT_ROTOR_CP_VISCOUS
    cdef int OPT_GRADIENT_WRT_ALPHA
    cdef int OPT_GRADIENT_WRT_BETA
    cdef int OPT_GRADIENT_WRT_MACH
    cdef int OPT_GRADIENT_WRT_VINF
    cdef int OPT_GRADIENT_WRT_VREF
    cdef int OPT_GRADIENT_WRT_DENSITY
    cdef int OPT_GRADIENT_WRT_RECREF
    cdef int OPT_GRADIENT_WRT_P_RATE
    cdef int OPT_GRADIENT_WRT_Q_RATE
    cdef int OPT_GRADIENT_WRT_R_RATE

    cdef int OPT_GRADIENT_WRT_X_CG
    cdef int OPT_GRADIENT_WRT_Y_CG
    cdef int OPT_GRADIENT_WRT_Z_CG
    cdef int OPT_GRADIENT_WRT_S_REF
    cdef int OPT_GRADIENT_WRT_B_REF
    cdef int OPT_GRADIENT_WRT_C_REF
    cdef int OPT_RESIDUAL

    cdef int OPT_GRADIENT_NUMBER_OF_INPUTS
    
CL = OPT_CL_TOTAL
CD = OPT_CD_TOTAL
CS = OPT_CS_TOTAL

CLi = OPT_CL_INVISCID
CDi = OPT_CD_INVISCID
CSi = OPT_CS_INVISCID

CLv = OPT_CL_VISCOUS
CDv = OPT_CD_VISCOUS
CSv = OPT_CS_VISCOUS

CX = OPT_CX_TOTAL
CY = OPT_CY_TOTAL
CZ = OPT_CZ_TOTAL

CXi = OPT_CX_INVISCID
CYi = OPT_CY_INVISCID
CZi = OPT_CZ_INVISCID

CXv = OPT_CX_VISCOUS
CYv = OPT_CY_VISCOUS
CZv = OPT_CZ_VISCOUS

CMX = OPT_CMX_TOTAL
CMY = OPT_CMY_TOTAL
CMZ = OPT_CMZ_TOTAL

CMXi = OPT_CMX_INVISCID
CMYi = OPT_CMY_INVISCID
CMZi = OPT_CMZ_INVISCID

CMXv = OPT_CMX_VISCOUS
CMYv = OPT_CMY_VISCOUS
CMZv = OPT_CMZ_VISCOUS

WING_CL = OPT_WING_CL_TOTAL
WING_CX = OPT_WING_CX_TOTAL
WING_CY = OPT_WING_CY_TOTAL
WING_CZ = OPT_WING_CZ_TOTAL

WING_CLi = OPT_WING_CL_INVISCID
WING_CXi = OPT_WING_CX_INVISCID
WING_CYi = OPT_WING_CY_INVISCID
WING_CZi = OPT_WING_CZ_INVISCID

WING_CLv = OPT_WING_CL_VISCOUS
WING_CXv = OPT_WING_CX_VISCOUS
WING_CYv = OPT_WING_CY_VISCOUS
WING_CZv = OPT_WING_CZ_VISCOUS

ROTOR_CT = OPT_ROTOR_CT_TOTAL
ROTOR_CP = OPT_ROTOR_CP_TOTAL

ROTOR_ETA = OPT_ROTOR_EFFICIENCY

CTi = OPT_ROTOR_CT_INVISCID
CPi = OPT_ROTOR_CP_INVISCID

CTv = OPT_ROTOR_CT_VISCOUS
CPv = OPT_ROTOR_CP_VISCOUS

#residual

RESIDUAL = OPT_RESIDUAL

#wrt free stream
WRT_ALPHA = OPT_GRADIENT_WRT_ALPHA
WRT_BETA = OPT_GRADIENT_WRT_BETA
WRT_MACH = OPT_GRADIENT_WRT_MACH
WRT_VINF = OPT_GRADIENT_WRT_VINF
WRT_VREF = OPT_GRADIENT_WRT_VREF
WRT_DENSITY = OPT_GRADIENT_WRT_DENSITY
WRT_RECREF = OPT_GRADIENT_WRT_RECREF
WRT_P_RATE = OPT_GRADIENT_WRT_P_RATE
WRT_Q_RATE = OPT_GRADIENT_WRT_Q_RATE
WRT_R_RATE = OPT_GRADIENT_WRT_R_RATE
WRT_X_CG = OPT_GRADIENT_WRT_X_CG
WRT_Y_CG = OPT_GRADIENT_WRT_Y_CG
WRT_Z_CG = OPT_GRADIENT_WRT_Z_CG
WRT_S_REF = OPT_GRADIENT_WRT_S_REF
WRT_B_REF = OPT_GRADIENT_WRT_B_REF
WRT_C_REF = OPT_GRADIENT_WRT_C_REF

# number of input (wrt) vars
NUMBER_OF_INPUTS = OPT_GRADIENT_NUMBER_OF_INPUTS
