|
11 | 11 | #include <algorithm> |
12 | 12 | #include <utility> |
13 | 13 |
|
14 | | - |
15 | 14 | void AtomTypeMix::operator=(const AtomTypeMix &source) { types_ = source.types_; } |
16 | 15 |
|
17 | 16 | AtomTypeData &AtomTypeMix::operator[](int n) { return types_[n]; } |
@@ -225,64 +224,3 @@ void AtomTypeMix::print() const |
225 | 224 | Messenger::print(" -----------------------------------------------------------------\n"); |
226 | 225 | } |
227 | 226 | } |
228 | | - |
229 | | -/* |
230 | | - * Serialisation |
231 | | - */ |
232 | | - |
233 | | -// Read data through specified LineParser |
234 | | -bool AtomTypeMix::deserialise(LineParser &parser, const CoreData &coreData) |
235 | | -{ |
236 | | - types_.clear(); |
237 | | - |
238 | | - if (parser.getArgsDelim(LineParser::Defaults) != LineParser::Success) |
239 | | - return false; |
240 | | - auto nItems = parser.argi(0); |
241 | | - for (auto n = 0; n < nItems; ++n) |
242 | | - { |
243 | | - // Line Contains: AtomType name, population, fraction, boundCoherent, and nIsotopes |
244 | | - if (parser.getArgsDelim(LineParser::Defaults) != LineParser::Success) |
245 | | - return false; |
246 | | - auto atomType = coreData.findAtomType(parser.argsv(0)); |
247 | | - if (!atomType) |
248 | | - return Messenger::error("Could not find atom type {}.", parser.argsv(0)); |
249 | | - auto population = parser.argd(1); |
250 | | - auto fraction = parser.argd(2); |
251 | | - auto boundCoherent = parser.argd(3); |
252 | | - auto nIsotopes = parser.argi(4); |
253 | | - |
254 | | - // Create AtomTypeData |
255 | | - auto &atd = types_.emplace_back(atomType.get(), population, fraction, boundCoherent); |
256 | | - |
257 | | - // For each of the nIsotopes, read (and check) A, population, and fraction |
258 | | - for (auto i = 0; i < nIsotopes; ++i) |
259 | | - { |
260 | | - if (parser.getArgsDelim(LineParser::Defaults) != LineParser::Success) |
261 | | - return false; |
262 | | - auto isotope = Sears91::isotope(atomType->Z(), parser.argi(0)); |
263 | | - atd.setIsotope(isotope, parser.argd(1), parser.argd(2)); |
264 | | - } |
265 | | - } |
266 | | - |
267 | | - return true; |
268 | | -} |
269 | | - |
270 | | -// Write data through specified LineParser |
271 | | -bool AtomTypeMix::serialise(LineParser &parser) const |
272 | | -{ |
273 | | - if (!parser.writeLineF("{} # nItems\n", types_.size())) |
274 | | - return false; |
275 | | - for (auto &atd : types_) |
276 | | - { |
277 | | - // Line Contains: AtomType name, population, fraction, boundCoherent, and nIsotopes |
278 | | - if (!parser.writeLineF("{} {} {} {} {}\n", atd.atomTypeName(), atd.population(), atd.fraction(), atd.boundCoherent(), |
279 | | - atd.isotopeData().size())) |
280 | | - return false; |
281 | | - // For each isotope write A, population, and fraction |
282 | | - for (const auto &topeData : atd.isotopeData()) |
283 | | - if (!parser.writeLineF("{} {} {}\n", Sears91::A(topeData.isotope()), topeData.population(), topeData.fraction())) |
284 | | - return false; |
285 | | - } |
286 | | - |
287 | | - return true; |
288 | | -} |
0 commit comments