Simpatico  v1.10
mcMd/trajectory/TrajectoryReaderFactory.cpp
1 /*
2 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
3 *
4 * Copyright 2010 - 2017, The Regents of the University of Minnesota
5 * Distributed under the terms of the GNU General Public License.
6 */
7 
8 #include "TrajectoryReaderFactory.h"
9 
10 // Subclasses of ConfigIo
11 #include "LammpsDumpReader.h"
12 #include "DdMdTrajectoryReader.h"
13 #include "DCDTrajectoryReader.h"
14 
15 namespace McMd
16 {
17 
18  using namespace Util;
19 
20  /*
21  * Constructor
22  */
24  : systemPtr_(&system)
25  {}
26 
27  /*
28  * Return a pointer to a instance of Trajectory subclass className.
29  */
31  TrajectoryReaderFactory::factory(const std::string &className) const
32  {
33  TrajectoryReader *ptr = 0;
34 
35  // Try subfactories first
36  ptr = trySubfactories(className);
37  if (ptr) return ptr;
38 
39  if (className == "LammpsDumpReader") {
40  ptr = new LammpsDumpReader(*systemPtr_);
41  } else
42  if (className == "DdMdTrajectoryReader") {
43  ptr = new DdMdTrajectoryReader(*systemPtr_);
44  } else
45  if (className == "DCDTrajectoryReader") {
46  ptr = new DCDTrajectoryReader(*systemPtr_);
47  }
48  return ptr;
49  }
50 
51 }
TrajectoryReader for CHARMM ".dcd" data files.
A set of interacting Molecules enclosed by a Boundary.
Definition: System.h:115
TrajectoryReader * factory(const std::string &trajectoryIoName) const
Method to create any TrajectoryReader supplied with Simpatico.
TrajectoryReader for a DdMd trajectory file.
TrajectoryReader for Lammps dump trajectory files.
TrajectoryReader * trySubfactories(const std::string &className) const
Search through subfactories for match.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Trajectory file reader (base class).
Single-processor Monte Carlo (MC) and molecular dynamics (MD).