70 |
|
|
71 |
|
//register force fields |
72 |
|
registerForceFields(); |
73 |
+ |
registerLattice(); |
74 |
|
|
75 |
|
gengetopt_args_info args_info; |
76 |
|
std::string latticeType; |
81 |
|
std::string outGeomFileName; |
82 |
|
|
83 |
|
|
84 |
< |
BaseLattice *simpleLat; |
84 |
> |
Lattice *simpleLat; |
85 |
|
int numMol; |
86 |
|
double latticeConstant; |
87 |
|
std::vector<double> lc; |
112 |
|
//get lattice type |
113 |
|
latticeType = UpperCase(args_info.latticetype_arg); |
114 |
|
|
114 |
– |
if (!LatticeFactory::getInstance()->hasLatticeCreator(latticeType)) { |
115 |
– |
std::cerr << latticeType << " is an invalid lattice type" << std::endl; |
116 |
– |
std::cerr << LatticeFactory::getInstance()->toString() << std::endl; |
117 |
– |
exit(1); |
118 |
– |
} |
115 |
|
|
116 |
< |
|
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 |
> |
|
124 |
|
//get input file name |
125 |
|
if (args_info.inputs_num) |
126 |
|
inputFileName = args_info.inputs[0]; |
337 |
|
|
338 |
|
if (writer != NULL) |
339 |
|
delete writer; |
340 |
< |
|
340 |
> |
delete simpleLat; |
341 |
> |
|
342 |
|
return 0; |
343 |
|
} |
344 |
|
|