Changes in molecuilder/src/builder.cpp [48cd93:66ce7a]
- File:
-
- 1 edited
-
molecuilder/src/builder.cpp (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/builder.cpp
r48cd93 r66ce7a 188 188 // remove the projection onto the rotation plane of the second angle 189 189 n.CopyVector(&y); 190 n.Scale(first->x. Projection(&y));190 n.Scale(first->x.ScalarProduct(&y)); 191 191 cout << "N1: ", 192 192 n.Output((ofstream *)&cout); … … 197 197 cout << endl; 198 198 n.CopyVector(&z); 199 n.Scale(first->x. Projection(&z));199 n.Scale(first->x.ScalarProduct(&z)); 200 200 cout << "N2: ", 201 201 n.Output((ofstream *)&cout); … … 584 584 LinkedCell LCList(mol, 10.); 585 585 class Tesselation *TesselStruct = NULL; 586 Find ConvexBorder((ofstream *)&cout, mol, &LCList, NULL);586 Find_convex_border((ofstream *)&cout, mol, &LCList, NULL); 587 587 double clustervolume = VolumeOfConvexEnvelope((ofstream *)&cout, TesselStruct, configuration); 588 588 cout << Verbose(0) << "The tesselated surface area is " << clustervolume << "." << endl; … … 644 644 Vector x,y,z,n; // coordinates for absolute point in cell volume 645 645 double *factor; // unit factor if desired 646 double bond, min Bond;646 double bond, min_bond; 647 647 char choice; // menu choice char 648 648 bool valid; … … 683 683 first = mol->AskAtom("Enter first (fixed) atom: "); 684 684 second = mol->AskAtom("Enter second (shifting) atom: "); 685 min Bond = 0.;685 min_bond = 0.; 686 686 for (int i=NDIM;i--;) 687 min Bond += (first->x.x[i]-second->x.x[i])*(first->x.x[i] - second->x.x[i]);688 min Bond = sqrt(minBond);689 cout << Verbose(0) << "Current Bond length between " << first->type->name << " Atom " << first->nr << " and " << second->type->name << " Atom " << second->nr << ": " << min Bond << " a.u." << endl;687 min_bond += (first->x.x[i]-second->x.x[i])*(first->x.x[i] - second->x.x[i]); 688 min_bond = sqrt(min_bond); 689 cout << Verbose(0) << "Current Bond length between " << first->type->name << " Atom " << first->nr << " and " << second->type->name << " Atom " << second->nr << ": " << min_bond << " a.u." << endl; 690 690 cout << Verbose(0) << "Enter new bond length [a.u.]: "; 691 691 cin >> bond; 692 692 for (int i=NDIM;i--;) { 693 second->x.x[i] -= (second->x.x[i]-first->x.x[i])/min Bond*(minBond-bond);693 second->x.x[i] -= (second->x.x[i]-first->x.x[i])/min_bond*(min_bond-bond); 694 694 } 695 695 //cout << Verbose(0) << "New coordinates of Atom " << second->nr << " are: "; … … 1325 1325 int j; 1326 1326 double volume = 0.; 1327 enum ConfigStatus config Present = absent;1327 enum ConfigStatus config_present = absent; 1328 1328 clock_t start,end; 1329 1329 int argptr; … … 1425 1425 if (output == NULL) { 1426 1426 cout << Verbose(1) << "Specified config file " << argv[1] << " not found." << endl; 1427 config Present = absent;1427 config_present = absent; 1428 1428 } else { 1429 1429 cout << "Empty configuration file." << endl; 1430 1430 ConfigFileName = argv[1]; 1431 config Present = empty;1431 config_present = empty; 1432 1432 output.close(); 1433 1433 } … … 1440 1440 cout << "new syntax." << endl; 1441 1441 configuration.Load(ConfigFileName, periode, mol); 1442 config Present = present;1442 config_present = present; 1443 1443 break; 1444 1444 case 0: 1445 1445 cout << "old syntax." << endl; 1446 1446 configuration.LoadOld(ConfigFileName, periode, mol); 1447 config Present = present;1447 config_present = present; 1448 1448 break; 1449 1449 default: 1450 1450 cout << "Unknown syntax or empty, yet present file." << endl; 1451 config Present = empty;1451 config_present = empty; 1452 1452 } 1453 1453 } 1454 1454 } else 1455 config Present = absent;1455 config_present = absent; 1456 1456 // 4. parse again through options, now for those depending on elements db and config presence 1457 1457 argptr = 1; … … 1460 1460 if (argv[argptr][0] == '-') { 1461 1461 argptr++; 1462 if ((config Present == present) || (configPresent == empty)) {1462 if ((config_present == present) || (config_present == empty)) { 1463 1463 switch(argv[argptr-1][1]) { 1464 1464 case 'p': … … 1474 1474 else { 1475 1475 cout << Verbose(2) << "File found and parsed." << endl; 1476 config Present = present;1476 config_present = present; 1477 1477 } 1478 1478 } … … 1494 1494 if (first->type != NULL) { 1495 1495 mol->AddAtom(first); // add to molecule 1496 if ((config Present == empty) && (mol->AtomCount != 0))1497 config Present = present;1496 if ((config_present == empty) && (mol->AtomCount != 0)) 1497 config_present = present; 1498 1498 } else 1499 1499 cerr << Verbose(1) << "Could not find the specified element." << endl; … … 1505 1505 } 1506 1506 } 1507 if (config Present == present) {1507 if (config_present == present) { 1508 1508 switch(argv[argptr-1][1]) { 1509 1509 case 'M': … … 1627 1627 start = clock(); 1628 1628 LinkedCell LCList(mol, atof(argv[argptr])*2.); 1629 Find NonConvexBorder((ofstream *)&cout, mol, &LCList, argv[argptr+1], atof(argv[argptr]));1629 Find_non_convex_border((ofstream *)&cout, mol, &LCList, argv[argptr+1], atof(argv[argptr])); 1630 1630 //FindDistributionOfEllipsoids((ofstream *)&cout, &T, &LCList, N, number, filename.c_str()); 1631 1631 end = clock(); … … 1871 1871 cout << Verbose(1) << "Storing tecplot data in " << argv[argptr] << "." << endl; 1872 1872 LinkedCell LCList(mol, 10.); 1873 //Find ConvexBorder((ofstream *)&cout, mol, &LCList, argv[argptr]);1874 Find NonConvexBorder((ofstream *)&cout, mol, &LCList, argv[argptr], 10.);1873 //Find_convex_border((ofstream *)&cout, mol, &LCList, argv[argptr]); 1874 Find_non_convex_border((ofstream *)&cout, mol, &LCList, argv[argptr], 10.); 1875 1875 1876 1876 double volumedifference = ConvexizeNonconvexEnvelope((ofstream *)&cout, mol->TesselStruct, mol, argv[argptr]);
Note:
See TracChangeset
for help on using the changeset viewer.
