//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      Sample/Material/Vacuum.cpp
//! @brief     Implements class Vacuum.
//!
//! @homepage  http://www.bornagainproject.org
//! @license   GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
//  ************************************************************************************************

#include "Sample/Material/Vacuum.h"
#include "Base/Vector/WavevectorInfo.h"
#include <numbers>

using std::numbers::pi;

Vacuum::Vacuum(const std::string& name)
    : Material(name, MaterialColor(0.90, 0.93, 0.97), R3())
{
}

Vacuum* Vacuum::clone() const
{
    return new Vacuum(materialName());
}

complex_t Vacuum::plainSubtrSLD(double lambda0) const
{
    if (std::isnan(lambda0))
        throw std::runtime_error("wavelength not set");
    return pi / lambda0 / lambda0;
}
