Changeset 0a08df for molecuilder/src/builder.cpp
- Timestamp:
- Aug 6, 2008, 8:59:06 AM (17 years ago)
- Children:
- 8f8621
- Parents:
- e8dd4d
- File:
-
- 1 edited
-
molecuilder/src/builder.cpp (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/builder.cpp
re8dd4d r0a08df 147 147 third->Output(1,2,(ofstream *)&cout); 148 148 fourth->Output(1,3,(ofstream *)&cout); 149 n.MakeNormal Vector((const vector *)&second->x, (const vector *)&third->x, (const vector *)&fourth->x);150 x.Copy Vector(&second->x);149 n.MakeNormalvector((const vector *)&second->x, (const vector *)&third->x, (const vector *)&fourth->x); 150 x.Copyvector(&second->x); 151 151 x.SubtractVector(&third->x); 152 x.Copy Vector(&fourth->x);152 x.Copyvector(&fourth->x); 153 153 x.SubtractVector(&third->x); 154 154 … … 359 359 } while ((param.type = periode->FindElement(shorthand)) == NULL); 360 360 cout << Verbose(0) << "Element is " << param.type->name << endl; 361 mol->GetAlign Vector(¶m);361 mol->GetAlignvector(¶m); 362 362 for (int i=NDIM;i--;) { 363 363 x.x[i] = gsl_vector_get(param.x,i); … … 761 761 cout << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl; 762 762 cout << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl; 763 cout << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA mannerand stores config files in same dir as config." << endl;763 cout << "\t-f/F <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config." << endl; 764 764 cout << "\t-h/-H/-?\tGive this help screen." << endl; 765 765 cout << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl; … … 767 767 cout << "\t-o\tGet volume of the convex envelope (and store to tecplot file)." << endl; 768 768 cout << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl; 769 cout << "\t-P <file> <delta_t>\tParse given forces file and append as an MD step with width delta_t to config file via Verlet." << endl; 769 770 cout << "\t-r\t\tConvert file from an old pcp syntax." << endl; 770 771 cout << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl; … … 863 864 if (!mol->AddXYZFile(argv[argptr])) 864 865 cout << Verbose(2) << "File not found." << endl; 865 else 866 else { 866 867 cout << Verbose(2) << "File found and parsed." << endl; 867 868 config_present = present; 869 } 868 870 break; 869 871 default: // no match? Don't step on (this is done in next switch's default) … … 873 875 if (config_present == present) { 874 876 switch(argv[argptr-1][1]) { 877 case 'P': 878 ExitFlag = 1; 879 cout << Verbose(1) << "Parsing forces file and Verlet integrating." << endl; 880 if (!mol->VerletForceIntegration(argv[argptr], atof(argv[argptr+1]))) 881 cout << Verbose(2) << "File not found." << endl; 882 else 883 cout << Verbose(2) << "File found and parsed." << endl; 884 argptr+=2; 885 break; 875 886 case 't': 876 887 ExitFlag = 1; … … 959 970 cout << Verbose(1) << "Converting config file from supposed old to new syntax." << endl; 960 971 break; 972 case 'F': 961 973 case 'f': 962 974 if (ExitFlag ==0) ExitFlag = 2; // only set if not already by other command line switch … … 1022 1034 int count; 1023 1035 element ** Elements; 1024 vector ** Vectors;1036 vector ** vectors; 1025 1037 if (faktor < 1) { 1026 1038 cerr << Verbose(0) << "ERROR: Repetition faktor mus be greater than 1!" << endl; … … 1031 1043 count = mol->AtomCount; // is changed becausing of adding, thus has to be stored away beforehand 1032 1044 Elements = new element *[count]; 1033 Vectors = new vector *[count];1045 vectors = new vector *[count]; 1034 1046 j = 0; 1035 1047 first = mol->start; … … 1037 1049 first = first->next; 1038 1050 Elements[j] = first->type; 1039 Vectors[j] = &first->x;1051 vectors[j] = &first->x; 1040 1052 j++; 1041 1053 } … … 1049 1061 for (int k=count;k--;) { // go through every atom of the original cell 1050 1062 first = new atom(); // create a new body 1051 first->x.CopyVector( Vectors[k]); // use coordinate of original atom1063 first->x.CopyVector(vectors[k]); // use coordinate of original atom 1052 1064 first->x.AddVector(&x); // translate the coordinates 1053 1065 first->type = Elements[k]; // insert original element … … 1057 1069 // free memory 1058 1070 delete[](Elements); 1059 delete[]( Vectors);1071 delete[](vectors); 1060 1072 // correct cell size 1061 1073 if (axis < 0) { // if sign was negative, we have to translate everything … … 1120 1132 clock_t start,end; 1121 1133 element **Elements; 1122 vector ** Vectors;1134 vector **vectors; 1123 1135 1124 1136 // =========================== PARSE COMMAND LINE OPTIONS ==================================== … … 1219 1231 count = mol->AtomCount; // is changed becausing of adding, thus has to be stored away beforehand 1220 1232 Elements = new element *[count]; 1221 Vectors = new vector *[count];1233 vectors = new vector *[count]; 1222 1234 j = 0; 1223 1235 first = mol->start; … … 1225 1237 first = first->next; 1226 1238 Elements[j] = first->type; 1227 Vectors[j] = &first->x;1239 vectors[j] = &first->x; 1228 1240 j++; 1229 1241 } … … 1237 1249 for (int k=count;k--;) { // go through every atom of the original cell 1238 1250 first = new atom(); // create a new body 1239 first->x.CopyVector( Vectors[k]); // use coordinate of original atom1251 first->x.CopyVector(vectors[k]); // use coordinate of original atom 1240 1252 first->x.AddVector(&x); // translate the coordinates 1241 1253 first->type = Elements[k]; // insert original element … … 1247 1259 // free memory 1248 1260 delete[](Elements); 1249 delete[]( Vectors);1261 delete[](vectors); 1250 1262 // correct cell size 1251 1263 if (axis < 0) { // if sign was negative, we have to translate everything
Note:
See TracChangeset
for help on using the changeset viewer.
