- Timestamp:
- Aug 10, 2010, 7:25:28 PM (15 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:
- fa1830
- Parents:
- 7aa3cf (diff), 61951b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 2 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/QT4/QTStatusBar.cpp
r7aa3cf r95e6b1 21 21 QStatusBar(_parent), 22 22 Observer("QTStatusBar"), 23 parent(_parent),24 23 atomCount(World::getInstance().numAtoms()), 25 moleculeCount(World::getInstance().numMolecules()) 24 moleculeCount(World::getInstance().numMolecules()), 25 parent(_parent) 26 26 { 27 27 World::getInstance().signOn(this); -
src/UIElements/Views/QT4/QTWorldView.cpp
r7aa3cf r95e6b1 20 20 // these attributes are skiped so far 21 21 const int QTWorldView::COLUMNCOUNT = COLUMNTYPES_MAX; 22 const char *QTWorldView::COLUMNNAMES[QTWorldView::COLUMNCOUNT]={"Name","Atoms"/*,"Formula"*/ ,"Center"/*,"Size"*/};22 const char *QTWorldView::COLUMNNAMES[QTWorldView::COLUMNCOUNT]={"Name","Atoms"/*,"Formula"*//*,"Size"*/}; 23 23 24 24 QTWorldView::QTWorldView(QWidget * _parent) : … … 81 81 setItem(i,ATOMS,countWidget); 82 82 83 const Vector center = (*iter)->Center;84 QTableWidgetItem *centerWidget = new QTableWidgetItem();85 stringstream centersstr;86 centersstr << center;87 centerWidget->setText(QString(centersstr.str().c_str()));88 setItem(i,CENTER,centerWidget);89 centerWidget->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);90 91 83 molSelection[i]=nameWidget->isSelected(); 92 84 } -
src/UIElements/Views/QT4/QTWorldView.hpp
r7aa3cf r95e6b1 28 28 29 29 static const int COLUMNCOUNT; 30 enum {NAME,ATOMS,C ENTER,COLUMNTYPES_MAX} COLUMNTYPES;30 enum {NAME,ATOMS,COLUMNTYPES_MAX} COLUMNTYPES; 31 31 static const char *COLUMNNAMES[]; 32 32 -
src/boundary.cpp
r7aa3cf r95e6b1 804 804 // Center filler at origin 805 805 filler->CenterEdge(&Inserter); 806 filler->Center.Zero();807 806 const int FillerCount = filler->getAtomCount(); 808 807 DoLog(2) && (Log() << Verbose(2) << "INFO: Filler molecule has the following bonds:" << endl); -
src/config.cpp
r7aa3cf r95e6b1 1586 1586 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 1587 1587 src[N++] = (*ListRunner)->IndexNr; 1588 (*ListRunner)->Translate(&(*ListRunner)->Center);1589 1588 } 1590 1589 mol = World::getInstance().createMolecule(); 1591 1590 mol->SetNameFromFilename(ConfigFileName); 1592 molecules->SimpleMultiMerge(mol, src, N);1593 1591 //mol->CalculateOrbitals(*this); 1594 1592 delete[](src); -
src/molecule.hpp
r7aa3cf r95e6b1 104 104 double BondDistance; //!< typical bond distance used in CreateAdjacencyList() and furtheron 105 105 bool ActiveFlag; //!< in a MoleculeListClass used to discern active from inactive molecules 106 Vector Center; //!< Center of molecule in a global box106 //Vector Center; //!< Center of molecule in a global box 107 107 int IndexNr; //!< index of molecule in a MoleculeListClass 108 108 char name[MAXSTRINGSIZE]; //!< arbitrary name … … 379 379 void eraseMolecule(); 380 380 381 382 // merging of molecules383 bool SimpleMerge(molecule *mol, molecule *srcmol);384 bool SimpleAdd(molecule *mol, molecule *srcmol);385 bool SimpleMultiMerge(molecule *mol, int *src, int N);386 bool SimpleMultiAdd(molecule *mol, int *src, int N);387 bool ScatterMerge(molecule *mol, int *src, int N);388 bool EmbedMerge(molecule *mol, molecule *srcmol);389 390 381 private: 391 382 World *world; //!< The world this List belongs to. Needed to avoid deadlocks in the destructor -
src/molecule_geometry.cpp
r7aa3cf r95e6b1 104 104 (*max) += (*min); 105 105 Translate(min); 106 Center.Zero();107 106 } 108 107 delete(min); … … 118 117 int Num = 0; 119 118 molecule::const_iterator iter = begin(); // start at first in list 119 Vector Center; 120 120 121 121 Center.Zero(); 122 123 122 if (iter != end()) { //list not empty? 124 123 for (; iter != end(); ++iter) { // continue with second if present … … 128 127 Center.Scale(-1./(double)Num); // divide through total number (and sign for direction) 129 128 Translate(&Center); 130 Center.Zero();131 129 } 132 130 }; … … 197 195 void molecule::CenterPeriodic() 198 196 { 199 DeterminePeriodicCenter(Center); 197 Vector NewCenter; 198 DeterminePeriodicCenter(NewCenter); 199 // go through all atoms 200 BOOST_FOREACH(atom* iter, atoms){ 201 *iter -= NewCenter; 202 } 200 203 }; 201 204 … … 207 210 void molecule::CenterAtVector(Vector *newcenter) 208 211 { 209 Center = *newcenter; 212 // go through all atoms 213 BOOST_FOREACH(atom* iter, atoms){ 214 *iter -= *newcenter; 215 } 210 216 }; 211 217 … … 277 283 bool flag; 278 284 Vector Testvector, Translationvector; 285 Vector Center; 279 286 280 287 do { … … 322 329 323 330 Center.Scale(1./static_cast<double>(getAtomCount())); 331 CenterAtVector(&Center); 324 332 }; 325 333 -
src/moleculelist.cpp
r7aa3cf r95e6b1 193 193 } 194 194 // Center and size 195 (*out) << "\t" << (*ListRunner)->Center << "\t" << sqrt(size) << endl; 195 Vector *Center = (*ListRunner)->DetermineCenterOfAll(); 196 (*out) << "\t" << *Center << "\t" << sqrt(size) << endl; 197 delete(Center); 196 198 } 197 199 } … … 210 212 }; 211 213 212 /** Simple merge of two molecules into one.213 * \param *mol destination molecule214 * \param *srcmol source molecule215 * \return true - merge successful, false - merge failed (probably due to non-existant indices216 */217 bool MoleculeListClass::SimpleMerge(molecule *mol, molecule *srcmol)218 {219 if (srcmol == NULL)220 return false;221 222 // put all molecules of src into mol223 for (molecule::iterator iter = srcmol->begin(); !srcmol->empty(); iter=srcmol->begin()) {224 atom * const Walker = *iter;225 srcmol->UnlinkAtom(Walker);226 mol->AddAtom(Walker);227 }228 229 // remove src230 ListOfMolecules.remove(srcmol);231 World::getInstance().destroyMolecule(srcmol);232 return true;233 };234 235 /** Simple add of one molecules into another.236 * \param *mol destination molecule237 * \param *srcmol source molecule238 * \return true - merge successful, false - merge failed (probably due to non-existant indices239 */240 bool MoleculeListClass::SimpleAdd(molecule *mol, molecule *srcmol)241 {242 if (srcmol == NULL)243 return false;244 245 // put all molecules of src into mol246 atom *Walker = NULL;247 for (molecule::iterator iter = srcmol->begin(); iter != srcmol->end(); ++iter) {248 Walker = mol->AddCopyAtom((*iter));249 Walker->father = Walker;250 }251 252 return true;253 };254 255 /** Simple merge of a given set of molecules into one.256 * \param *mol destination molecule257 * \param *src index of set of source molecule258 * \param N number of source molecules259 * \return true - merge successful, false - some merges failed (probably due to non-existant indices)260 */261 bool MoleculeListClass::SimpleMultiMerge(molecule *mol, int *src, int N)262 {263 bool status = true;264 // check presence of all source molecules265 for (int i=0;i<N;i++) {266 molecule *srcmol = ReturnIndex(src[i]);267 status = status && SimpleMerge(mol, srcmol);268 }269 insert(mol);270 return status;271 };272 273 /** Simple add of a given set of molecules into one.274 * \param *mol destination molecule275 * \param *src index of set of source molecule276 * \param N number of source molecules277 * \return true - merge successful, false - some merges failed (probably due to non-existant indices)278 */279 bool MoleculeListClass::SimpleMultiAdd(molecule *mol, int *src, int N)280 {281 bool status = true;282 // check presence of all source molecules283 for (int i=0;i<N;i++) {284 molecule *srcmol = ReturnIndex(src[i]);285 status = status && SimpleAdd(mol, srcmol);286 }287 return status;288 };289 290 /** Scatter merge of a given set of molecules into one.291 * Scatter merge distributes the molecules in such a manner that they don't overlap.292 * \param *mol destination molecule293 * \param *src index of set of source molecule294 * \param N number of source molecules295 * \return true - merge successful, false - merge failed (probably due to non-existant indices296 * \TODO find scatter center for each src molecule297 */298 bool MoleculeListClass::ScatterMerge(molecule *mol, int *src, int N)299 {300 // check presence of all source molecules301 for (int i=0;i<N;i++) {302 // get pointer to src molecule303 molecule *srcmol = ReturnIndex(src[i]);304 if (srcmol == NULL)305 return false;306 }307 // adapt each Center308 for (int i=0;i<N;i++) {309 // get pointer to src molecule310 molecule *srcmol = ReturnIndex(src[i]);311 //srcmol->Center.Zero();312 srcmol->Translate(&srcmol->Center);313 }314 // perform a simple multi merge315 SimpleMultiMerge(mol, src, N);316 return true;317 };318 319 /** Embedding merge of a given set of molecules into one.320 * Embedding merge inserts one molecule into the other.321 * \param *mol destination molecule (fixed one)322 * \param *srcmol source molecule (variable one, where atoms are taken from)323 * \return true - merge successful, false - merge failed (probably due to non-existant indices)324 * \TODO linked cell dimensions for boundary points has to be as big as inner diameter!325 */326 bool MoleculeListClass::EmbedMerge(molecule *mol, molecule *srcmol)327 {328 LinkedCell *LCList = NULL;329 Tesselation *TesselStruct = NULL;330 if ((srcmol == NULL) || (mol == NULL)) {331 DoeLog(1) && (eLog()<< Verbose(1) << "Either fixed or variable molecule is given as NULL." << endl);332 return false;333 }334 335 // calculate envelope for *mol336 LCList = new LinkedCell(mol, 8.);337 FindNonConvexBorder(mol, TesselStruct, (const LinkedCell *&)LCList, 4., NULL);338 if (TesselStruct == NULL) {339 DoeLog(1) && (eLog()<< Verbose(1) << "Could not tesselate the fixed molecule." << endl);340 return false;341 }342 delete(LCList);343 LCList = new LinkedCell(TesselStruct, 8.); // re-create with boundary points only!344 345 // prepare index list for bonds346 atom ** CopyAtoms = new atom*[srcmol->getAtomCount()];347 for(int i=0;i<srcmol->getAtomCount();i++)348 CopyAtoms[i] = NULL;349 350 // for each of the source atoms check whether we are in- or outside and add copy atom351 int nr=0;352 for (molecule::const_iterator iter = srcmol->begin(); iter != srcmol->end(); ++iter) {353 DoLog(2) && (Log() << Verbose(2) << "INFO: Current Walker is " << **iter << "." << endl);354 if (!TesselStruct->IsInnerPoint((*iter)->getPosition(), LCList)) {355 CopyAtoms[(*iter)->nr] = (*iter)->clone();356 mol->AddAtom(CopyAtoms[(*iter)->nr]);357 nr++;358 } else {359 // do nothing360 }361 }362 DoLog(1) && (Log() << Verbose(1) << nr << " of " << srcmol->getAtomCount() << " atoms have been merged.");363 364 // go through all bonds and add as well365 for(molecule::iterator AtomRunner = srcmol->begin(); AtomRunner != srcmol->end(); ++AtomRunner)366 for(BondList::iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); BondRunner != (*AtomRunner)->ListOfBonds.end(); ++BondRunner)367 if ((*BondRunner)->leftatom == *AtomRunner) {368 DoLog(3) && (Log() << Verbose(3) << "Adding Bond between " << *CopyAtoms[(*BondRunner)->leftatom->nr] << " and " << *CopyAtoms[(*BondRunner)->rightatom->nr]<< "." << endl);369 mol->AddBond(CopyAtoms[(*BondRunner)->leftatom->nr], CopyAtoms[(*BondRunner)->rightatom->nr], (*BondRunner)->BondDegree);370 }371 delete(LCList);372 return true;373 };374 214 375 215 /** Simple output of the pointers in ListOfMolecules. -
src/periodentafel.cpp
r7aa3cf r95e6b1 295 295 getline(input,header1tmp); 296 296 getline(input,header2tmp); // skip first two header lines 297 cout << "First header: " << header1tmp << endl;298 cout << "Second header: " << header2tmp << endl;297 //cout << "First header: " << header1tmp << endl; 298 //cout << "Second header: " << header2tmp << endl; 299 299 DoLog(0) && (Log() << Verbose(0) << "Parsed elements:"); 300 300 while (!input.eof()) {
Note:
See TracChangeset
for help on using the changeset viewer.