Changeset 450d63
- Timestamp:
- Oct 18, 2008, 2:03:57 PM (16 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 51695c, 5621c3, 674220, 85d278
- Parents:
- 65de9b
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/boundary.cpp
r65de9b r450d63 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 -
src/boundary.hpp
r65de9b r450d63 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); -
src/builder.cpp
r65de9b r450d63 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.