-
Notifications
You must be signed in to change notification settings - Fork 31
/
NeutronInelasticModel.hh
102 lines (81 loc) · 3.2 KB
/
NeutronInelasticModel.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//----------------------------------*-C++-*----------------------------------//
// Copyright 2024 UT-Battelle, LLC, and other Celeritas developers.
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
//---------------------------------------------------------------------------//
//! \file celeritas/neutron/model/NeutronInelasticModel.hh
//---------------------------------------------------------------------------//
#pragma once
#include <functional>
#include "corecel/data/CollectionMirror.hh"
#include "celeritas/Quantities.hh"
#include "celeritas/mat/IsotopeView.hh"
#include "celeritas/mat/MaterialView.hh"
#include "celeritas/neutron/data/NeutronInelasticData.hh"
#include "celeritas/phys/AtomicNumber.hh"
#include "celeritas/phys/Model.hh"
namespace celeritas
{
struct ImportPhysicsVector;
class MaterialParams;
class ParticleParams;
//---------------------------------------------------------------------------//
/*!
* Set up and launch the neutron inelastic model interaction.
*/
class NeutronInelasticModel final : public Model
{
public:
//!@{
using AtomicMassNumber = IsotopeView::AtomicMassNumber;
using MevEnergy = units::MevEnergy;
using ReadData = std::function<ImportPhysicsVector(AtomicNumber)>;
using HostRef = NeutronInelasticHostRef;
using DeviceRef = NeutronInelasticDeviceRef;
//!@}
public:
// Construct from model ID and other necessary data
NeutronInelasticModel(ActionId id,
ParticleParams const& particles,
MaterialParams const& materials,
ReadData load_data);
// Particle types and energy ranges that this model applies to
SetApplicability applicability() const final;
// Get the microscopic cross sections for the given particle and material
MicroXsBuilders micro_xs(Applicability) const final;
//! Apply the interaction kernel to host data
void execute(CoreParams const&, CoreStateHost&) const final;
// Apply the interaction kernel to device data
void execute(CoreParams const&, CoreStateDevice&) const final;
// ID of the model
ActionId action_id() const final;
//! Short name for the interaction kernel
std::string label() const final { return "neutron-inelastic-bertini"; }
//! Short description of the post-step action
std::string description() const final
{
return "interact by neutron inelastic (Bertini)";
}
//!@{
//! Access model data
HostRef const& host_ref() const { return data_.host_ref(); }
DeviceRef const& device_ref() const { return data_.device_ref(); }
//!@}
private:
//// DATA ////
// Host/device storage and reference
CollectionMirror<NeutronInelasticData> data_;
//// TYPES ////
using HostXsData = HostVal<NeutronInelasticData>;
using ChannelArray = Array<double, 13>;
struct ChannelXsData
{
StepanovParameters par;
ChannelArray xs;
};
//// HELPER FUNCTIONS ////
Span<double const> get_channel_bins() const;
static ChannelXsData const& get_channel_xs(ChannelId id);
};
//---------------------------------------------------------------------------//
} // namespace celeritas