-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding coherent and incoherent distribution data
- Loading branch information
Showing
5 changed files
with
243 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#ifndef NJOY_DRYAD_COHERENTDISTRIBUTIONDATA | ||
#define NJOY_DRYAD_COHERENTDISTRIBUTIONDATA | ||
|
||
// system includes | ||
#include <optional> | ||
|
||
// other includes | ||
#include "dryad/DistributionDataType.hpp" | ||
#include "dryad/ReferenceFrame.hpp" | ||
#include "dryad/TabulatedScatteringFunction.hpp" | ||
#include "dryad/TabulatedFormFactor.hpp" | ||
|
||
namespace njoy { | ||
namespace dryad { | ||
|
||
/** | ||
* @class | ||
* @brief The distribution data for coherent scattering in photoatomic interactions | ||
* | ||
* This representation is only available for a photoatomic ProjectileTarget. | ||
* | ||
* In this representation, a scattering function S(x,Z) and two optional form factor | ||
* functions are defined which together with the Thompson cross section determine the | ||
* double differential cross section. | ||
* | ||
* This corresponds with the coherent scattering function data given in | ||
* MF27 MT502 and the form factors in MF27 MT505 and MT506. | ||
*/ | ||
class IncoherentDistributionData { | ||
|
||
/* fields */ | ||
ReferenceFrame frame_; | ||
TabulatedScatteringFunction scattering_; | ||
std::optional< TabulatedFormFactor > real_; | ||
std::optional< TabulatedFormFactor > imaginary_; | ||
|
||
public: | ||
|
||
/* constructor */ | ||
|
||
#include "dryad/TwoBodyDistributionData/src/ctor.hpp" | ||
|
||
/* methods */ | ||
|
||
/** | ||
* @brief Return the distribution data type | ||
*/ | ||
static constexpr DistributionDataType type() noexcept { | ||
|
||
return DistributionDataType::Coherent; | ||
} | ||
|
||
/** | ||
* @brief Return the reference frame | ||
*/ | ||
const ReferenceFrame& frame() const noexcept { | ||
|
||
return this->frame_; | ||
} | ||
|
||
/** | ||
* @brief Return the scattering function | ||
*/ | ||
const TabulatedScatteringFunction& scatteringFunction() const noexcept { | ||
|
||
return this->scattering_; | ||
} | ||
|
||
/** | ||
* @brief Return the real part of the anomolous form factor | ||
*/ | ||
const std::optional< TabulatedFormFactor >& realAnomolousFormFactor() const noexcept { | ||
|
||
return this->real_; | ||
} | ||
|
||
/** | ||
* @brief Return the imaginary part of the anomolous form factor | ||
*/ | ||
const std::optional< TabulatedFormFactor >& imaginaryAnomolousFormFactor() const noexcept { | ||
|
||
return this->imaginary_; | ||
} | ||
}; | ||
|
||
} // dryad namespace | ||
} // njoy namespace | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
private: | ||
|
||
/** | ||
* @brief Private constructor | ||
* | ||
* @param frame the reference frame of the distribution data | ||
* @param scattering the scattering function | ||
* @param real the optional real part of the anamolous form factor | ||
* @param imaginary the optional imaginary part of the anamolous form factor | ||
*/ | ||
CoherentDistributionData( ReferenceFrame&& frame, | ||
TabulatedScatteringFunction&& scattering, | ||
std::optional< TabulatedFormFactor >&& real, | ||
std::optional< TabulatedFormFactor >&& imaginary > ) : | ||
frame_( std::move( frame ) ), scattering_( std::move( scattering ) ), | ||
real_( std::move( real ) ), imaginary_( std::move( imaginary ) ) {} | ||
|
||
public: | ||
|
||
//! @todo pybind11 variant needs default constructor workaround | ||
#ifdef PYBIND11 | ||
/** | ||
* @brief Default constructor - only enabled for pybind11 | ||
*/ | ||
CoherentDistributionData() = default; | ||
#endif | ||
|
||
CoherentDistributionData( const CoherentDistributionData& ) = default; | ||
CoherentDistributionData( CoherentDistributionData&& ) = default; | ||
|
||
CoherentDistributionData& operator=( const CoherentDistributionData& ) = default; | ||
CoherentDistributionData& operator=( CoherentDistributionData&& ) = default; | ||
|
||
/** | ||
* @brief Constructor (no anomolous form factors) | ||
* | ||
* @param frame the reference frame of the distribution data | ||
* @param scattering the scattering function | ||
*/ | ||
CoherentDistributionData( ReferenceFrame frame, | ||
TabulatedScatteringFunction scattering ) : | ||
CoherentDistributionData( std::move( frame ), std::move( scattering ), | ||
std::nullopt, std::nullopt ) {} | ||
|
||
/** | ||
* @brief Constructor (with anomolous form factors) | ||
* | ||
* @param frame the reference frame of the distribution data | ||
* @param scattering the scattering function | ||
* @param real the real part of the anamolous form factor | ||
* @param imaginary the imaginary part of the anamolous form factor | ||
*/ | ||
CoherentDistributionData( ReferenceFrame frame, | ||
TabulatedScatteringFunction scattering, | ||
TabulatedFormFactor real, | ||
TabulatedFormFactor imaginary ) : | ||
CoherentDistributionData( std::move( frame ), std::move( scattering ), | ||
std::move( real ), std::move( imaginary ) ) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#ifndef NJOY_DRYAD_INCOHERENTDISTRIBUTIONDATA | ||
#define NJOY_DRYAD_INCOHERENTDISTRIBUTIONDATA | ||
|
||
// system includes | ||
#include <variant> | ||
|
||
// other includes | ||
#include "dryad/DistributionDataType.hpp" | ||
#include "dryad/ReferenceFrame.hpp" | ||
#include "dryad/TabulatedScatteringFunction.hpp" | ||
|
||
namespace njoy { | ||
namespace dryad { | ||
|
||
/** | ||
* @class | ||
* @brief The distribution data for incoherent scattering in photoatomic interactions | ||
* | ||
* This representation is only available for a photoatomic ProjectileTarget. | ||
* | ||
* In this representation, a scattering function S(x,Z) is defined that | ||
* together with the Klein-Nishina cross section determines the double | ||
* differential cross section. | ||
* | ||
* This corresponds with the incoherent scattering function data given in | ||
* MF27 MT504. | ||
*/ | ||
class IncoherentDistributionData { | ||
|
||
/* fields */ | ||
ReferenceFrame frame_; | ||
TabulatedScatteringFunction scattering_; | ||
|
||
public: | ||
|
||
/* constructor */ | ||
|
||
#include "dryad/IncoherentDistributionData/src/ctor.hpp" | ||
|
||
/* methods */ | ||
|
||
/** | ||
* @brief Return the distribution data type | ||
*/ | ||
static constexpr DistributionDataType type() noexcept { | ||
|
||
return DistributionDataType::Incoherent; | ||
} | ||
|
||
/** | ||
* @brief Return the reference frame | ||
*/ | ||
const ReferenceFrame& frame() const noexcept { | ||
|
||
return this->frame_; | ||
} | ||
|
||
/** | ||
* @brief Return the scattering function | ||
*/ | ||
const TabulatedScatteringFunction& scatteringFunction() const noexcept { | ||
|
||
return this->scattering_; | ||
} | ||
}; | ||
|
||
} // dryad namespace | ||
} // njoy namespace | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//! @todo pybind11 variant needs default constructor workaround | ||
#ifdef PYBIND11 | ||
/** | ||
* @brief Default constructor - only enabled for pybind11 | ||
*/ | ||
IncoherentDistributionData() = default; | ||
#endif | ||
|
||
IncoherentDistributionData( const IncoherentDistributionData& ) = default; | ||
IncoherentDistributionData( IncoherentDistributionData&& ) = default; | ||
|
||
IncoherentDistributionData& operator=( const IncoherentDistributionData& ) = default; | ||
IncoherentDistributionData& operator=( IncoherentDistributionData&& ) = default; | ||
|
||
/** | ||
* @brief Constructor | ||
* | ||
* @param frame the reference frame of the distribution data | ||
* @param scattering the scattering function | ||
*/ | ||
IncoherentDistributionData( ReferenceFrame frame, | ||
TabulatedScatteringFunction scattering ) : | ||
frame_( std::move( frame ) ), scattering_( std::move( scattering ) ) {} |