21 const size_t g = g_and_m.first;
22 const size_t m = g_and_m.second;
26 for (
const auto& cell :
grid_ptr_->local_cells)
28 const auto& cell_mapping = sdm.GetCellMapping(cell);
29 const size_t num_nodes = cell_mapping.NumNodes();
31 for (
size_t i = 0; i < num_nodes; ++i)
33 const int64_t imapA = sdm.MapDOFLocal(cell, i, phi_uk_man, m, g);
34 const int64_t imapB = sdm.MapDOFLocal(cell, i);
41 ff_ptr->UpdateFieldVector(data_vector_local);
79 double local_total_power = 0.0;
80 for (
const auto& cell :
grid_ptr_->local_cells)
82 const auto& cell_mapping = sdm.GetCellMapping(cell);
83 const size_t num_nodes = cell_mapping.NumNodes();
89 if (not xs->IsFissionable())
continue;
91 for (
size_t i = 0; i < num_nodes; ++i)
93 const int64_t imapA = sdm.MapDOFLocal(cell, i);
94 const int64_t imapB = sdm.MapDOFLocal(cell, i, phi_uk_man, 0, 0);
96 double nodal_power = 0.0;
97 for (
size_t g = 0; g <
groups_.size(); ++g)
99 const double sigma_fg = xs->SigmaFission()[g];
106 data_vector_local[imapA] = nodal_power;
107 local_total_power += nodal_power * Vi[i];
113 double globl_total_power;
114 MPI_Allreduce(&local_total_power,
128 ff_ptr->UpdateFieldVector(data_vector_local);
137 const std::vector<size_t>& m_indices,
138 const std::vector<size_t>& g_indices)
140 std::vector<size_t> m_ids_to_copy = m_indices;
141 std::vector<size_t> g_ids_to_copy = g_indices;
142 if (m_indices.empty())
144 m_ids_to_copy.push_back(m);
145 if (g_ids_to_copy.empty())
147 g_ids_to_copy.push_back(g);
152 for (
const size_t m : m_ids_to_copy)
154 for (
const size_t g : g_ids_to_copy)
158 auto& ff_data = ff_ptr->FieldVector();
160 for (
const auto& cell :
grid_ptr_->local_cells)
162 const auto& cell_mapping = sdm.GetCellMapping(cell);
163 const size_t num_nodes = cell_mapping.NumNodes();
165 for (
size_t i = 0; i < num_nodes; ++i)
167 const int64_t imapA = sdm.MapDOFLocal(cell, i);
168 const int64_t imapB = sdm.MapDOFLocal(cell, i, phi_uk_man, m, g);
static chi::MPI_Info & mpi
std::vector< std::shared_ptr< FieldFunctionGridBased > > field_functions_
chi_mesh::MeshContinuumPtr grid_ptr_
std::shared_ptr< chi_math::SpatialDiscretization > discretization_
void SetPhiFromFieldFunctions(PhiSTLOption which_phi, const std::vector< size_t > &m_indices, const std::vector< size_t > &g_indices)
std::vector< UnitCellMatrices > unit_cell_matrices_
std::vector< double > phi_new_local_
std::vector< LBSGroup > groups_
chi_math::UnknownManager flux_moments_uk_man_
size_t power_gen_fieldfunc_local_handle_
std::vector< double > phi_old_local_
std::map< std::pair< size_t, size_t >, size_t > phi_field_functions_local_map_
uint64_t local_node_count_
std::map< int, XSPtr > matid_to_xs_map_
void UpdateFieldFunctions()
void Scale(VecDbl &x, const double &val)
double power_normalization
double power_default_kappa
bool power_field_function_on