ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/applications/nanoRodBuilder/nanorodBuilder.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/applications/nanoRodBuilder/nanorodBuilder.cpp (file contents):
Revision 2164 by chuckv, Mon Apr 11 21:37:30 2005 UTC vs.
Revision 2187 by tim, Wed Apr 13 18:41:17 2005 UTC

# Line 50 | Line 50
50  
51   #include "nanorodBuilderCmd.h"
52   //#include "GeometryBuilder.hpp"
53 < #include "applications/simpleBuilder/LatticeFactory.hpp"
54 < #include "applications/simpleBuilder/MoLocator.hpp"
55 < #include "applications/simpleBuilder/Lattice.hpp"
53 > #include "lattice/LatticeFactory.hpp"
54 > #include "utils/MoLocator.hpp"
55 > #include "lattice/Lattice.hpp"
56   #include "brains/Register.hpp"
57   #include "brains/SimInfo.hpp"
58   #include "brains/SimCreator.hpp"
# Line 70 | Line 70 | int main(int argc, char *argv []) {
70  
71      //register force fields
72      registerForceFields();
73 +    registerLattice();
74      
75      gengetopt_args_info args_info;
76      std::string latticeType;
# Line 80 | Line 81 | int main(int argc, char *argv []) {
81                  std::string outGeomFileName;
82                  
83                  
84 <    BaseLattice *simpleLat;
84 >    Lattice *simpleLat;
85      int numMol;
86      double latticeConstant;
87      std::vector<double> lc;
# Line 111 | Line 112 | int main(int argc, char *argv []) {
112      //get lattice type
113      latticeType = UpperCase(args_info.latticetype_arg);
114  
115 <    if (!LatticeFactory::getInstance()->hasLatticeCreator(latticeType)) {
116 <        std::cerr << latticeType << " is an invalid lattice type" << std::endl;
117 <        std::cerr << LatticeFactory::getInstance()->toString() << std::endl;
118 <        exit(1);
119 <    }
115 >
116 >    simpleLat = LatticeFactory::getInstance()->createLattice(latticeType);
117 >    if (simpleLat == NULL) {
118 >        sprintf(painCave.errMsg, "Lattice Factory can not create %s lattice\n",
119 >                latticeType.c_str());
120 >        painCave.isFatal = 1;
121 >        simError();
122 >    }      
123  
120    
124      //get input file name
125      if (args_info.inputs_num)
126          inputFileName = args_info.inputs[0];
# Line 334 | Line 337 | int main(int argc, char *argv []) {
337                  
338      if (writer != NULL)
339                          delete writer;
340 <                
340 >    delete simpleLat;  
341 >    cmdline_parser_free(&args_info);
342      return 0;
343   }
344  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines