Changeset 59f86c
- Timestamp:
- Oct 18, 2008, 2:03:57 PM (17 years ago)
- Children:
- ae21a39, d87482
- Parents:
- f5d7e1
- Location:
- molecuilder/src
- Files:
-
- 3 edited
-
boundary.cpp (modified) (5 diffs)
-
boundary.hpp (modified) (1 diff)
-
builder.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/boundary.cpp
rf5d7e1 r59f86c 456 456 * Determines first the convex envelope, then tesselates it and calculates its volume. 457 457 * \param *out output stream for debugging 458 * \param *tecplot output stream for tecplot data 458 459 * \param *configuration needed for path to store convex envelope file 459 460 * \param *BoundaryPoints NDIM set of boundary points on the projected plane per axis, on return if desired 460 461 * \param *mol molecule structure representing the cluster 462 * \return determined volume of the cluster in cubed config:GetIsAngstroem() 461 463 */ 462 double VolumeOfConvexEnvelope(ofstream *out, config *configuration, Boundaries *BoundaryPtr, molecule *mol)464 double VolumeOfConvexEnvelope(ofstream *out, ofstream *tecplot, config *configuration, Boundaries *BoundaryPtr, molecule *mol) 463 465 { 464 466 bool IsAngstroem = configuration->GetIsAngstroem(); … … 501 503 *out << Verbose(2) << "I found " << TesselStruct->PointsOnBoundaryCount << " points on the convex boundary." << endl; 502 504 // now we have the whole set of edge points in the BoundaryList 503 504 505 505 506 // listing for debugging … … 547 548 Walker->x.Translate(CenterOfGravity); 548 549 } 550 551 // 8. Store triangles in tecplot file 552 if (tecplot != NULL) { 553 *tecplot << "TITLE = \"3D CONVEX SHELL\"" << endl; 554 *tecplot << "VARIABLES = \"X\" \"Y\" \"Z\"" << endl; 555 *tecplot << "ZONE T=\"TRIANGLES\", N=" << TesselStruct->PointsOnBoundaryCount << ", E=" << TesselStruct->TrianglesOnBoundaryCount << ", DATAPACKING=POINT, ZONETYPE=FETRIANGLE" << endl; 556 int *LookupList = new int[mol->AtomCount]; 557 for (int i=0;i<mol->AtomCount;i++) 558 LookupList[i] = -1; 559 560 // print atom coordinates 561 *out << Verbose(2) << "The following triangles were created:"; 562 int Counter = 1; 563 atom *Walker = NULL; 564 for (PointMap::iterator target = TesselStruct->PointsOnBoundary.begin(); target != TesselStruct->PointsOnBoundary.end(); target++) { 565 Walker = target->second->node; 566 LookupList[Walker->nr] = Counter++; 567 *tecplot << Walker->x.x[0] << " " << Walker->x.x[1] << " " << Walker->x.x[2] << " " << endl; 568 } 569 *tecplot << endl; 570 // print connectivity 571 for (TriangleMap::iterator runner = TesselStruct->TrianglesOnBoundary.begin(); runner != TesselStruct->TrianglesOnBoundary.end(); runner++) { 572 *out << " " << runner->second->endpoints[0]->node->Name << "<->" << runner->second->endpoints[1]->node->Name << "<->" << runner->second->endpoints[2]->node->Name; 573 *tecplot << LookupList[runner->second->endpoints[0]->node->nr] << " " << LookupList[runner->second->endpoints[1]->node->nr] << " " << LookupList[runner->second->endpoints[2]->node->nr] << endl; 574 } 575 delete[](LookupList); 576 *out << endl; 577 } 549 578 550 579 // free reference lists … … 574 603 double clustervolume; 575 604 if (ClusterVolume == 0) 576 clustervolume = VolumeOfConvexEnvelope(out, configuration, BoundaryPoints, mol);605 clustervolume = VolumeOfConvexEnvelope(out, NULL, configuration, BoundaryPoints, mol); 577 606 else 578 607 clustervolume = ClusterVolume; … … 952 981 } while (flag); 953 982 954 stringstream line;955 line << configuration->configpath << "/" << CONVEXENVELOPE;956 *out << Verbose(1) << "Storing convex envelope in tecplot data file " << line.str() << "." << endl;957 ofstream output(line.str().c_str());958 output << "TITLE = \"3D CONVEX SHELL\"" << endl;959 output << "VARIABLES = \"X\" \"Y\" \"Z\"" << endl;960 output << "ZONE T=\"TRIANGLES\", N=" << PointsOnBoundaryCount << ", E=" << TrianglesOnBoundaryCount << ", DATAPACKING=POINT, ZONETYPE=FETRIANGLE" << endl;961 int *LookupList = new int[mol->AtomCount];962 for (int i=0;i<mol->AtomCount;i++)963 LookupList[i] = -1;964 965 // print atom coordinates966 *out << Verbose(2) << "The following triangles were created:";967 int Counter = 1;968 atom *Walker = NULL;969 for (PointMap::iterator target = PointsOnBoundary.begin(); target != PointsOnBoundary.end(); target++) {970 Walker = target->second->node;971 LookupList[Walker->nr] = Counter++;972 output << Walker->x.x[0] << " " << Walker->x.x[1] << " " << Walker->x.x[2] << " " << endl;973 }974 output << endl;975 // print connectivity976 for (TriangleMap::iterator runner = TrianglesOnBoundary.begin(); runner != TrianglesOnBoundary.end(); runner++) {977 *out << " " << runner->second->endpoints[0]->node->Name << "<->" << runner->second->endpoints[1]->node->Name << "<->" << runner->second->endpoints[2]->node->Name;978 output << LookupList[runner->second->endpoints[0]->node->nr] << " " << LookupList[runner->second->endpoints[1]->node->nr] << " " << LookupList[runner->second->endpoints[2]->node->nr] << endl;979 }980 output.close();981 delete[](LookupList);982 *out << endl;983 983 }; 984 984 -
molecuilder/src/boundary.hpp
rf5d7e1 r59f86c 99 99 100 100 101 double VolumeOfConvexEnvelope(ofstream *out, config *configuration, Boundaries *BoundaryPoints, molecule *mol);101 double VolumeOfConvexEnvelope(ofstream *out, ofstream *tecplot, config *configuration, Boundaries *BoundaryPoints, molecule *mol); 102 102 double * GetDiametersOfCluster(ofstream *out, Boundaries *BoundaryPtr, molecule *mol, bool IsAngstroem); 103 103 void PrepareClustersinWater(ofstream *out, config *configuration, molecule *mol, double ClusterVolume, double celldensity); -
molecuilder/src/builder.cpp
rf5d7e1 r59f86c 569 569 case 'e': 570 570 cout << Verbose(0) << "Evaluating volume of the convex envelope."; 571 VolumeOfConvexEnvelope((ofstream *)&cout, configuration, NULL, mol);571 VolumeOfConvexEnvelope((ofstream *)&cout, NULL, configuration, NULL, mol); 572 572 break; 573 573 case 'f': … … 1168 1168 case 'o': 1169 1169 ExitFlag = 1; 1170 SaveFlag = true; 1171 cout << Verbose(0) << "Evaluating volume of the convex envelope."; 1172 VolumeOfConvexEnvelope((ofstream *)&cout, &configuration, NULL, mol); 1170 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1171 ExitFlag = 255; 1172 cerr << "Not enough or invalid arguments given for convex envelope: -o <tecplot output file>" << endl; 1173 } else { 1174 cout << Verbose(0) << "Evaluating volume of the convex envelope."; 1175 cout << Verbose(1) << "Storing tecplot data in " << argv[argptr] << "." << endl; 1176 ofstream *output = new ofstream(argv[argptr], ios::trunc); 1177 VolumeOfConvexEnvelope((ofstream *)&cout, output, &configuration, NULL, mol); 1178 output->close(); 1179 delete(output); 1180 argptr+=1; 1181 } 1173 1182 break; 1174 1183 case 'U':
Note:
See TracChangeset
for help on using the changeset viewer.
