13 const std::string fname =
"chi_diffusion::Solver::InitializeCommonItems";
17 throw std::logic_error(fname +
" No grid defined.");
19 auto globl_unique_bndry_ids =
grid_ptr_->GetDomainUniqueBoundaryIDs();
21 const auto& grid_boundary_id_map =
grid_ptr_->GetBoundaryIDMap();
22 for (uint64_t bndry_id : globl_unique_bndry_ids)
24 if (grid_boundary_id_map.count(bndry_id) == 0)
25 throw std::logic_error(fname +
": Boundary id " +
26 std::to_string(bndry_id) +
" does not have a name-assignment.");
28 const auto& bndry_name = grid_boundary_id_map.at(bndry_id);
32 auto& bndry_vals = bndry_info.second;
33 switch (bndry_info.first)
38 std::make_pair(bndry_id,
new
40 Chi::log.
Log() <<
"Boundary \"" << bndry_name <<
"\" set to reflecting.";
45 if (bndry_vals.empty()) bndry_vals.resize(1,0.0);
47 std::make_pair(bndry_id,
new
49 Chi::log.
Log() <<
"Boundary \"" << bndry_name <<
"\" set to dirichlet.";
54 if (bndry_vals.size()<3) bndry_vals.resize(3,0.0);
56 std::make_pair(bndry_id,
new
60 Chi::log.
Log() <<
"Boundary \"" << bndry_name <<
"\" set to robin.";
66 std::make_pair(bndry_id,
new
68 Chi::log.
Log() <<
"Boundary \"" << bndry_name <<
"\" set to vacuum.";
73 if (bndry_vals.size()<3) bndry_vals.resize(3,0.0);
75 std::make_pair(bndry_id,
new
79 Chi::log.
Log() <<
"Boundary \"" << bndry_name <<
"\" set to neumann.";
87 std::make_pair(bndry_id,
new
90 <<
"No boundary preference found for boundary \"" << bndry_name
91 <<
"\" Dirichlet boundary added with zero boundary value.";
LogStream Log(LOG_LVL level=LOG_0)
std::pair< BoundaryType, std::vector< double > > BoundaryInfo
BoundaryPreferences boundary_preferences_
std::map< uint64_t, chi_diffusion::Boundary * > boundaries_
chi_mesh::MeshContinuumPtr grid_ptr_
void InitializeCommonItems()
bool common_items_initialized_
chi_mesh::MeshContinuumPtr & GetGrid() const
MeshHandler & GetCurrentHandler()