def calc_d(D_o, t, inner=False):
    """Return the outer or inner diameter [m].
    
    :param float D_o: Outer diameter [m]
    :param float t: Layer thickness [m]
    :param boolean inner: Select diameter    
    """
    if inner:
        return D_o - 2 * t
    else:
        return D_o + 2 * t