//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      Sample/Aggregate/Ordered2D.cpp
//! @brief     Implements the interface class Ordered2D.
//!
//! @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/Aggregate/Ordered2D.h"

Ordered2D::Ordered2D(const IParticle& particle)
    : Struct2D(1., particle)
{
}

Ordered2D::~Ordered2D() = default;

double Ordered2D::structureFactor(const R3& q) const
{
    return structureFactorWithOuter(q, 1.0);
}

double Ordered2D::structureFactorWithOuter(const R3& q, double outer_iff) const
{
    return iff_no_inner(q, outer_iff);
}

void Ordered2D::instructClone(Ordered2D* dest) const
{
    Struct::instructClone(dest);
}

double Ordered2D::iff_no_inner(const R3& q, double outer_iff) const
{
    return DWfactor(q) * (iff_without_dw(q) * outer_iff - 1.0) + 1.0;
}
