13{
14 try
15 {
16 _n1.addGlobalNode(1);
17 }
18 catch (const std::exception & err)
19 {
20 std::size_t pos =
21 std::string(
err.what())
22 .find("PorousFlowConnectedNodes: addGlobalNode called, but _still_adding_global_nodes "
23 "is false. You possibly called finalizeAddingGlobalNodes too soon.");
24 ASSERT_TRUE(pos != std::string::npos);
25 }
26
27 try
28 {
29 _n2.globalID(1);
30 }
31 catch (const std::exception & err)
32 {
33 std::size_t pos =
34 std::string(
err.what())
35 .find("PorousFlowConnectedNodes: globalID called, but _still_adding_global_nodes is "
36 "true. Probably you should have called finalizeAddingGlobalNodes.");
37 ASSERT_TRUE(pos != std::string::npos);
38 }
39
40 try
41 {
42 _n2.globalIDs();
43 }
44 catch (const std::exception & err)
45 {
46 std::size_t pos =
47 std::string(
err.what())
48 .find("PorousFlowConnectedNodes: globalIDs called, but _still_adding_global_nodes is "
49 "true. Probably you should have called finalizeAddingGlobalNodes.");
50 ASSERT_TRUE(pos != std::string::npos);
51 }
52
53 try
54 {
55 _n2.sequentialID(1);
56 }
57 catch (const std::exception & err)
58 {
59 std::size_t pos =
60 std::string(
err.what())
61 .find("PorousFlowConnectedNodes: sequentialID called, but _still_adding_global_nodes "
62 "is true. Probably you should have called finalizeAddingGlobalNodes.");
63 ASSERT_TRUE(pos != std::string::npos);
64 }
65
66 try
67 {
68 _n2.addConnection(1, 1);
69 }
70 catch (const std::exception & err)
71 {
72 std::size_t pos =
73 std::string(
err.what())
74 .find("PorousFlowConnectedNodes: addConnection called, but _still_adding_global_nodes "
75 "is true. Probably you should have called finalizeAddingGlobalNodes.");
76 ASSERT_TRUE(pos != std::string::npos);
77 }
78
79 try
80 {
81 _n1.addConnection(1, 1);
82 }
83 catch (const std::exception & err)
84 {
85 std::size_t pos =
86 std::string(
err.what())
87 .find("PorousFlowConnectedNodes: addConnection called, but _still_adding_connections "
88 "is false. Probably you should have called finalizeAddingConnections.");
89 ASSERT_TRUE(pos != std::string::npos);
90 }
91
92 try
93 {
94 _n2.sequentialConnectionsToGlobalID(1);
95 }
96 catch (const std::exception & err)
97 {
98 std::size_t pos = std::string(
err.what())
99 .find("PorousFlowConnectedNodes: sequentialConnectionsToGlobalID called, "
100 "but _still_adding_connections is true. Probably you should have "
101 "called finalizeAddingConnections.");
102 ASSERT_TRUE(pos != std::string::npos);
103 }
104
105 try
106 {
107 _n2.sequentialConnectionsToSequentialID(1);
108 }
109 catch (const std::exception & err)
110 {
111 std::size_t pos = std::string(
err.what())
112 .find("PorousFlowConnectedNodes: sequentialConnectionsToSequentialID "
113 "called, but _still_adding_connections is true. Probably you "
114 "should have called finalizeAddingConnections.");
115 ASSERT_TRUE(pos != std::string::npos);
116 }
117
118 try
119 {
120 _n2.globalConnectionsToGlobalID(1);
121 }
122 catch (const std::exception & err)
123 {
124 std::size_t pos = std::string(
err.what())
125 .find("PorousFlowConnectedNodes: globalConnectionsToGlobalID called, but "
126 "_still_adding_connections is true. Probably you should have "
127 "called finalizeAddingConnections.");
128 ASSERT_TRUE(pos != std::string::npos);
129 }
130
131 try
132 {
133 _n2.globalConnectionsToSequentialID(1);
134 }
135 catch (const std::exception & err)
136 {
137 std::size_t pos = std::string(
err.what())
138 .find("PorousFlowConnectedNodes: globalConnectionsToSequentialID called, "
139 "but _still_adding_connections is true. Probably you should have "
140 "called finalizeAddingConnections.");
141 ASSERT_TRUE(pos != std::string::npos);
142 }
143
144 try
145 {
146 _n2.indexOfSequentialConnection(0, 0);
147 }
148 catch (const std::exception & err)
149 {
150 std::size_t pos = std::string(
err.what())
151 .find("PorousFlowConnectedNodes: indexOfSequentialConnection called, but "
152 "_still_adding_connections is true. Probably you should have "
153 "called finalizeAddingConnections.");
154 ASSERT_TRUE(pos != std::string::npos);
155 }
156
157 try
158 {
159 _n1.indexOfSequentialConnection(1, 0);
160 }
161 catch (const std::exception & err)
162 {
163 std::size_t pos = std::string(
err.what())
164 .find("PorousFlowConnectedNode: sequential_node_ID_from 1 has no "
165 "connection to sequential_node_ID_to 0");
166 ASSERT_TRUE(pos != std::string::npos);
167 }
168
169 try
170 {
171 _n2.indexOfGlobalConnection(0, 0);
172 }
173 catch (const std::exception & err)
174 {
175 std::size_t pos = std::string(
err.what())
176 .find("PorousFlowConnectedNodes: indexOfGlobalConnection called, but "
177 "_still_adding_connections is true. Probably you should have "
178 "called finalizeAddingConnections.");
179 ASSERT_TRUE(pos != std::string::npos);
180 }
181
182 try
183 {
184 _n1.indexOfGlobalConnection(1, 12);
185 }
186 catch (const std::exception & err)
187 {
188 std::size_t pos = std::string(
err.what())
189 .find("PorousFlowConnectedNode: global_ID_from 1 has no connection to "
190 "global_node_ID_to 12");
191 ASSERT_TRUE(pos != std::string::npos);
192 }
193
194 try
195 {
196 _n2.sizeSequential();
197 }
198 catch (const std::exception & err)
199 {
200 std::size_t pos =
201 std::string(
err.what())
202 .find("PorousFlowConnectedNodes: sizeSequential called, but _still_adding_global_nodes "
203 "is true. Probably you should have called finalizeAddingGlobalNodes.");
204 ASSERT_TRUE(pos != std::string::npos);
205 }
206}
OStreamProxy err(std::cerr)