forked from celeritas-project/celeritas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NeutronInelasticProcess.cc
70 lines (63 loc) · 2.42 KB
/
NeutronInelasticProcess.cc
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
//----------------------------------*-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/process/NeutronInelasticProcess.cc
//---------------------------------------------------------------------------//
#include "NeutronInelasticProcess.hh"
#include "corecel/Assert.hh"
#include "celeritas/grid/ValueGridBuilder.hh"
#include "celeritas/neutron/model/NeutronInelasticModel.hh"
#include "celeritas/phys/PDGNumber.hh"
namespace celeritas
{
//---------------------------------------------------------------------------//
/*!
* Construct from host data.
*/
NeutronInelasticProcess::NeutronInelasticProcess(SPConstParticles particles,
SPConstMaterials materials,
ReadData load_data)
: particles_(std::move(particles))
, materials_(std::move(materials))
, load_data_(std::move(load_data))
, neutron_id_(particles_->find(pdg::neutron()))
{
CELER_EXPECT(particles_);
CELER_EXPECT(materials_);
CELER_EXPECT(load_data_);
CELER_ENSURE(neutron_id_);
}
//---------------------------------------------------------------------------//
/*!
* Construct the models associated with this process.
*/
auto NeutronInelasticProcess::build_models(ActionIdIter id) const -> VecModel
{
return {std::make_shared<NeutronInelasticModel>(
*id++, *particles_, *materials_, load_data_)};
}
//---------------------------------------------------------------------------//
/*!
* Get the inelastic interaction cross sections for the given energy range.
*/
auto NeutronInelasticProcess::step_limits(Applicability applic) const
-> StepLimitBuilders
{
CELER_EXPECT(applic.particle == neutron_id_);
// Cross sections are calculated on the fly
StepLimitBuilders builders;
builders[ValueGridType::macro_xs] = std::make_unique<ValueGridOTFBuilder>();
return builders;
}
//---------------------------------------------------------------------------//
/*!
* Name of the process.
*/
std::string_view NeutronInelasticProcess::label() const
{
return "Neutron inelastic";
}
//---------------------------------------------------------------------------//
} // namespace celeritas