50 EXPECT_EQ(_dictator->porousFlowVariableNum(1), (
unsigned int)0);
51 EXPECT_EQ(_dictator->porousFlowVariableNum(4), (
unsigned int)1);
52 EXPECT_EQ(_dictator->porousFlowVariableNum(3), (
unsigned int)2);
56 _dictator->porousFlowVariableNum(0);
59 catch (
const std::exception & err)
61 std::size_t pos = std::string(err.what())
62 .find(
"The Dictator proclaims that the moose variable with number 0 is "
63 "not a PorousFlow variable. Exiting with error code 1984.");
64 ASSERT_TRUE(pos != std::string::npos);
69 _dictator->porousFlowVariableNum(2);
72 catch (
const std::exception & err)
74 std::size_t pos = std::string(err.what())
75 .find(
"The Dictator proclaims that the moose variable with number 2 is "
76 "not a PorousFlow variable. Exiting with error code 1984.");
77 ASSERT_TRUE(pos != std::string::npos);
82 _dictator->porousFlowVariableNum(5);
85 catch (
const std::exception & err)
87 std::size_t pos = std::string(err.what())
88 .find(
"The Dictator proclaims that the moose variable with number 5 is "
89 "not a PorousFlow variable. Exiting with error code 1984.");
90 ASSERT_TRUE(pos != std::string::npos);
95 _dictator->porousFlowVariableNum(123);
98 catch (
const std::exception & err)
100 std::size_t pos = std::string(err.what())
101 .find(
"The Dictator proclaims that the moose variable with number 123 is "
102 "not a PorousFlow variable. Exiting with error code 1984.");
103 ASSERT_TRUE(pos != std::string::npos);
106 EXPECT_EQ(_dictator_no_fetype->porousFlowVariableNum(1), (
unsigned int)0);
107 EXPECT_EQ(_dictator_no_fetype->porousFlowVariableNum(6), (
unsigned int)1);
112 EXPECT_EQ(_dictator->mooseVariableNum(0), (
unsigned int)1);
113 EXPECT_EQ(_dictator->mooseVariableNum(1), (
unsigned int)4);
114 EXPECT_EQ(_dictator->mooseVariableNum(2), (
unsigned int)3);
118 _dictator->mooseVariableNum(3);
121 catch (
const std::exception & err)
123 std::size_t pos = std::string(err.what())
124 .find(
"The Dictator proclaims that there is no such PorousFlow variable "
125 "with number 3. Exiting with error code 1984.");
126 ASSERT_TRUE(pos != std::string::npos);
129 EXPECT_EQ(_dictator_no_fetype->mooseVariableNum(0), (
unsigned int)1);
130 EXPECT_EQ(_dictator_no_fetype->mooseVariableNum(1), (
unsigned int)6);
135 ASSERT_TRUE(!_dictator->isPorousFlowVariable(0));
136 ASSERT_TRUE(_dictator->isPorousFlowVariable(1));
137 ASSERT_TRUE(!_dictator->isPorousFlowVariable(2));
138 ASSERT_TRUE(_dictator->isPorousFlowVariable(3));
139 ASSERT_TRUE(_dictator->isPorousFlowVariable(4));
140 ASSERT_TRUE(!_dictator->isPorousFlowVariable(5));
141 ASSERT_TRUE(!_dictator->isPorousFlowVariable(123));
146 ASSERT_TRUE(_dictator->notPorousFlowVariable(0));
147 ASSERT_TRUE(!_dictator->notPorousFlowVariable(1));
148 ASSERT_TRUE(_dictator->notPorousFlowVariable(2));
149 ASSERT_TRUE(!_dictator->notPorousFlowVariable(3));
150 ASSERT_TRUE(!_dictator->notPorousFlowVariable(4));
151 ASSERT_TRUE(_dictator->notPorousFlowVariable(5));
152 ASSERT_TRUE(_dictator->notPorousFlowVariable(123));
173 InputParameters params = _factory.getValidParams(
"PorousFlowDictator");
174 params.
set<std::vector<VariableName>>(
"porous_flow_vars") =
175 std::vector<VariableName>{
"var3",
"aux_var",
"var0",
"var5"};
176 params.
set<
unsigned>(
"number_fluid_phases") = 1;
177 params.
set<
unsigned>(
"number_fluid_components") = 2;
178 _fe_problem->addUserObject(
"PorousFlowDictator",
"dictator_with_aux", params);
181 catch (
const std::exception & err)
184 std::string(err.what())
186 "PorousFlowDictator: AuxVariables variables must not be coupled into the Dictator "
187 "for this is against specification #1984. Variable 'aux_var' is either an "
188 "AuxVariable or from a different nonlinear system.");
189 ASSERT_TRUE(pos != std::string::npos);
197 InputParameters params = _factory.getValidParams(
"PorousFlowDictator");
198 params.
set<std::vector<VariableName>>(
"porous_flow_vars") = std::vector<VariableName>{
"var0"};
199 params.
set<
unsigned>(
"number_fluid_phases") = 1;
200 params.
set<
unsigned>(
"number_fluid_components") = 2;
201 params.
set<
unsigned>(
"aqueous_phase_number") = 1;
202 _fe_problem->addUserObject(
203 "PorousFlowDictator",
"dictator_with_large_aqueous_phase_number", params);
206 catch (
const std::exception & err)
209 std::string(err.what())
210 .find(
"PorousflowDictator: The aqueous phase number must be less than the number of "
211 "fluid phases. The Dictator does not appreciate jokes.");
212 ASSERT_TRUE(pos != std::string::npos);