Simpatico  v1.10
ProcessorAnalyzerFactory.cpp
1 /*
2 * Simpatico - Processor 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 "ProcessorAnalyzerFactory.h" // Class header
9 
10 #include <tools/processor/Processor.h>
11 
12 // Analyzers
13 #include <tools/analyzers/LogStep.h>
14 #include <tools/analyzers/LammpsDumpWriter.h>
15 #include <tools/analyzers/PairEnergy.h>
16 
17 namespace Tools
18 {
19 
20  using namespace Util;
21 
22  /*
23  * Constructor.
24  */
26  : processorPtr_(&processor)
27  {}
28 
29  /*
30  * Return a pointer to an instance of Analyzer subclass className.
31  */
32  Analyzer* ProcessorAnalyzerFactory::factory(const std::string &className) const
33  {
34  Analyzer* ptr = 0;
35 
36  // Try subfactories first (if any)
37  ptr = trySubfactories(className);
38  if (ptr) return ptr;
39 
40  // Analyzers
41  if (className == "LogStep") {
42  ptr = new LogStep(processor());
43  } else
44  if (className == "LammpsDumpWriter") {
45  ptr = new LammpsDumpWriter(processor());
46  } else
47  if (className == "PairEnergy") {
48  ptr = new PairEnergy(processor());
49  }
50  return ptr;
51  }
52 
53 }
ProcessorAnalyzerFactory(Processor &processor)
Constructor.
A post-processor for analyzing outputs of MD simulations.
Definition: Processor.h:30
Write step number to log.
Definition: LogStep.h:23
virtual Analyzer * factory(const std::string &className) const
Return pointer to a new Analyzer object.
Abstract base for periodic output and/or analysis actions.
Analyzer to compute total nonbonded pair energy.
Definition: PairEnergy.h:23
Analyzer * trySubfactories(const std::string &className) const
Search through subfactories for match.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Processor & processor() const
Return reference to parent Processor.
Single-processor classes for pre- and post-processing MD trajectories.
Write a trajectory in the Lammps dump format.