//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      Resample/Refine/ShareFormfactors.h
//! @brief     Defines function Refine::shareFormfactors.
//!
//! @homepage  http://www.bornagainproject.org
//! @license   GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2026
//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
//  ************************************************************************************************

#ifdef SWIG
#error no need to expose this header to Swig
#endif
#ifndef BORNAGAIN_RESAMPLE_REFINE_SHAREFORMFACTORS_H
#define BORNAGAIN_RESAMPLE_REFINE_SHAREFORMFACTORS_H

class IParticle;

namespace Refine {

//! Groups the innermost particles of a resampled tree (descending into mesocrystal bases)
//! by identical formfactor geometry, and gives each group of two or more a shared FFMemo:
//! the geometric form factor is then evaluated once per group and wavevector.
//! Must run after slicing and mesocrystal preparation, since both replace formfactors.
void shareFormfactors(IParticle& root);

} // namespace Refine

#endif // BORNAGAIN_RESAMPLE_REFINE_SHAREFORMFACTORS_H
