Chi-Tech
lbs_01a_inputchecks.cc
Go to the documentation of this file.
1#include "lbs_solver.h"
2
5
6#include "chi_runtime.h"
7#include "chi_log.h"
8
9//###################################################################
10/**Performs general input checks before initialization continues.*/
12{
13 if (groups_.empty())
14 {
16 << "LinearBoltzmann::SteadyStateSolver: No groups added to solver.";
17 Chi::Exit(EXIT_FAILURE);
18 }
19
20 num_groups_ = groups_.size();
21
22 if (groupsets_.empty())
23 {
25 << "LinearBoltzmann::SteadyStateSolver: No group-sets added to solver.";
26 Chi::Exit(EXIT_FAILURE);
27 }
28 int grpset_counter=0;
29 for (auto& group_set : groupsets_)
30 {
31 if (group_set.groups_.empty())
32 {
34 << "LinearBoltzmann::SteadyStateSolver: No groups added to groupset "
35 << grpset_counter << ".";
36 Chi::Exit(EXIT_FAILURE);
37 }
38 ++grpset_counter;
39 }
41 {
43 << "LinearBoltzmann::SteadyStateSolver: No discretization_ method set.";
44 Chi::Exit(EXIT_FAILURE);
45 }
46
48
49 if (grid_ptr_ == nullptr)
50 {
52 << "LinearBoltzmann::SteadyStateSolver: No grid_ptr_ available from region.";
53 Chi::Exit(EXIT_FAILURE);
54 }
55
56 //======================================== Determine geometry type
57 using namespace chi_mesh;
58 const auto grid_attribs = grid_ptr_->Attributes();
59 if (grid_attribs & DIMENSION_1)
61 else if (grid_attribs & DIMENSION_2)
63 else if (grid_attribs & DIMENSION_3)
65 else
66 ChiLogicalError("Cannot deduce geometry type from mesh.");
67
68
69}
#define ChiLogicalError(message)
static void Exit(int error_code)
Definition: chi_runtime.cc:342
static chi::ChiLog & log
Definition: chi_runtime.h:81
LogStream LogAllError()
Definition: chi_log.h:239
chi_mesh::MeshContinuumPtr & GetGrid() const
virtual void PerformInputChecks()
chi_mesh::MeshContinuumPtr grid_ptr_
Definition: lbs_solver.h:75
std::vector< LBSGroup > groups_
Definition: lbs_solver.h:67
size_t num_groups_
Definition: lbs_solver.h:63
lbs::Options options_
Definition: lbs_solver.h:61
std::vector< LBSGroupset > groupsets_
Definition: lbs_solver.h:68
@ DIMENSION_1
Definition: chi_mesh.h:72
@ DIMENSION_2
Definition: chi_mesh.h:73
@ DIMENSION_3
Definition: chi_mesh.h:74
MeshHandler & GetCurrentHandler()
GeometryType geometry_type
Definition: lbs_structs.h:124
SDMType sd_type
Definition: lbs_structs.h:125