Chi-Tech
CBC_FLUDS.cc
Go to the documentation of this file.
1#include "CBC_FLUDS.h"
2
6
7namespace lbs
8{
9
10CBC_FLUDS::CBC_FLUDS(size_t num_groups,
11 size_t num_angles,
12 const CBC_FLUDSCommonData& common_data,
13 std::vector<double>& local_psi_data,
14 const chi_math::UnknownManager& psi_uk_man,
16 : chi_mesh::sweep_management::FLUDS(
17 num_groups, num_angles, common_data.GetSPDS()),
18 common_data_(common_data),
19 local_psi_data_(local_psi_data),
20 psi_uk_man_(psi_uk_man),
21 sdm_(sdm)
22{
23}
24
26{
27 return common_data_;
28}
29
30const std::vector<double>& CBC_FLUDS::GetLocalUpwindDataBlock() const
31{
32 return local_psi_data_;
33}
34
35const double*
36CBC_FLUDS::GetLocalCellUpwindPsi(const std::vector<double>& psi_data_block,
37 const chi_mesh::Cell& cell)
38{
39 const auto dof_map =
40 sdm_.MapDOFLocal(cell, 0, psi_uk_man_, 0, 0);
41
42 return &psi_data_block[dof_map];
43}
44
45const std::vector<double>&
46CBC_FLUDS::GetNonLocalUpwindData(uint64_t cell_global_id,
47 unsigned int face_id) const
48{
49 return deplocs_outgoing_messages_.at({cell_global_id, face_id});
50}
51
52const double*
53CBC_FLUDS::GetNonLocalUpwindPsi(const std::vector<double>& psi_data,
54 unsigned int face_node_mapped,
55 unsigned int angle_set_index)
56{
57 const size_t dof_map =
58 face_node_mapped * num_groups_and_angles_ + angle_set_index * num_groups_;
59
60 return &psi_data[dof_map];
61}
62
63} // namespace lbs
virtual int64_t MapDOFLocal(const chi_mesh::Cell &cell, unsigned int node, const UnknownManager &unknown_manager, unsigned int unknown_id, unsigned int component) const =0
const size_t num_groups_and_angles_
Definition: FLUDS.h:69
CBC_FLUDS(size_t num_groups, size_t num_angles, const CBC_FLUDSCommonData &common_data, std::vector< double > &local_psi_data, const chi_math::UnknownManager &psi_uk_man, const chi_math::SpatialDiscretization &sdm)
Definition: CBC_FLUDS.cc:10
const double * GetLocalCellUpwindPsi(const std::vector< double > &psi_data_block, const chi_mesh::Cell &cell)
Definition: CBC_FLUDS.cc:36
const std::vector< double > & GetNonLocalUpwindData(uint64_t cell_global_id, unsigned int face_id) const
Definition: CBC_FLUDS.cc:46
std::reference_wrapper< std::vector< double > > local_psi_data_
Definition: CBC_FLUDS.h:108
const chi_mesh::sweep_management::FLUDSCommonData & CommonData() const
Definition: CBC_FLUDS.cc:25
const std::vector< double > & GetLocalUpwindDataBlock() const
Definition: CBC_FLUDS.cc:30
const chi_math::SpatialDiscretization & sdm_
Definition: CBC_FLUDS.h:110
std::map< CellFaceKey, std::vector< double > > deplocs_outgoing_messages_
Definition: CBC_FLUDS.h:121
const chi_math::UnknownManager & psi_uk_man_
Definition: CBC_FLUDS.h:109
const CBC_FLUDSCommonData & common_data_
Definition: CBC_FLUDS.h:107
const double * GetNonLocalUpwindPsi(const std::vector< double > &psi_data, unsigned int face_node_mapped, unsigned int angle_set_index)
Definition: CBC_FLUDS.cc:53