Changeset 95e6b1 for src


Ignore:
Timestamp:
Aug 10, 2010, 7:25:28 PM (15 years ago)
Author:
Frederik Heber <heber@…>
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.
Message:

Merge branch 'SmallFixes' into stable

Location:
src
Files:
2 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/QT4/QTStatusBar.cpp

    r7aa3cf r95e6b1  
    2121  QStatusBar(_parent),
    2222  Observer("QTStatusBar"),
    23   parent(_parent),
    2423  atomCount(World::getInstance().numAtoms()),
    25   moleculeCount(World::getInstance().numMolecules())
     24  moleculeCount(World::getInstance().numMolecules()),
     25  parent(_parent)
    2626{
    2727  World::getInstance().signOn(this);
  • src/UIElements/Views/QT4/QTWorldView.cpp

    r7aa3cf r95e6b1  
    2020// these attributes are skiped so far
    2121const int QTWorldView::COLUMNCOUNT = COLUMNTYPES_MAX;
    22 const char *QTWorldView::COLUMNNAMES[QTWorldView::COLUMNCOUNT]={"Name","Atoms"/*,"Formula"*/,"Center"/*,"Size"*/};
     22const char *QTWorldView::COLUMNNAMES[QTWorldView::COLUMNCOUNT]={"Name","Atoms"/*,"Formula"*//*,"Size"*/};
    2323
    2424QTWorldView::QTWorldView(QWidget * _parent) :
     
    8181    setItem(i,ATOMS,countWidget);
    8282
    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 
    9183    molSelection[i]=nameWidget->isSelected();
    9284  }
  • src/UIElements/Views/QT4/QTWorldView.hpp

    r7aa3cf r95e6b1  
    2828
    2929  static const int COLUMNCOUNT;
    30   enum {NAME,ATOMS,CENTER,COLUMNTYPES_MAX} COLUMNTYPES;
     30  enum {NAME,ATOMS,COLUMNTYPES_MAX} COLUMNTYPES;
    3131  static const char *COLUMNNAMES[];
    3232
  • src/boundary.cpp

    r7aa3cf r95e6b1  
    804804  // Center filler at origin
    805805  filler->CenterEdge(&Inserter);
    806   filler->Center.Zero();
    807806  const int FillerCount = filler->getAtomCount();
    808807  DoLog(2) && (Log() << Verbose(2) << "INFO: Filler molecule has the following bonds:" << endl);
  • src/config.cpp

    r7aa3cf r95e6b1  
    15861586    for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) {
    15871587      src[N++] = (*ListRunner)->IndexNr;
    1588       (*ListRunner)->Translate(&(*ListRunner)->Center);
    15891588    }
    15901589    mol = World::getInstance().createMolecule();
    15911590    mol->SetNameFromFilename(ConfigFileName);
    1592     molecules->SimpleMultiMerge(mol, src, N);
    15931591    //mol->CalculateOrbitals(*this);
    15941592    delete[](src);
  • src/molecule.hpp

    r7aa3cf r95e6b1  
    104104    double BondDistance;  //!< typical bond distance used in CreateAdjacencyList() and furtheron
    105105    bool ActiveFlag;    //!< in a MoleculeListClass used to discern active from inactive molecules
    106     Vector Center;      //!< Center of molecule in a global box
     106    //Vector Center;      //!< Center of molecule in a global box
    107107    int IndexNr;        //!< index of molecule in a MoleculeListClass
    108108    char name[MAXSTRINGSIZE];         //!< arbitrary name
     
    379379  void eraseMolecule();
    380380
    381 
    382   // merging of molecules
    383   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 
    390381  private:
    391382  World *world; //!< The world this List belongs to. Needed to avoid deadlocks in the destructor
  • src/molecule_geometry.cpp

    r7aa3cf r95e6b1  
    104104    (*max) += (*min);
    105105    Translate(min);
    106     Center.Zero();
    107106  }
    108107  delete(min);
     
    118117  int Num = 0;
    119118  molecule::const_iterator iter = begin();  // start at first in list
     119  Vector Center;
    120120
    121121  Center.Zero();
    122 
    123122  if (iter != end()) {   //list not empty?
    124123    for (; iter != end(); ++iter) {  // continue with second if present
     
    128127    Center.Scale(-1./(double)Num); // divide through total number (and sign for direction)
    129128    Translate(&Center);
    130     Center.Zero();
    131129  }
    132130};
     
    197195void molecule::CenterPeriodic()
    198196{
    199   DeterminePeriodicCenter(Center);
     197  Vector NewCenter;
     198  DeterminePeriodicCenter(NewCenter);
     199  // go through all atoms
     200  BOOST_FOREACH(atom* iter, atoms){
     201    *iter -= NewCenter;
     202  }
    200203};
    201204
     
    207210void molecule::CenterAtVector(Vector *newcenter)
    208211{
    209   Center = *newcenter;
     212  // go through all atoms
     213  BOOST_FOREACH(atom* iter, atoms){
     214    *iter -= *newcenter;
     215  }
    210216};
    211217
     
    277283  bool flag;
    278284  Vector Testvector, Translationvector;
     285  Vector Center;
    279286
    280287  do {
     
    322329
    323330  Center.Scale(1./static_cast<double>(getAtomCount()));
     331  CenterAtVector(&Center);
    324332};
    325333
  • src/moleculelist.cpp

    r7aa3cf r95e6b1  
    193193      }
    194194      // 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);
    196198    }
    197199  }
     
    210212};
    211213
    212 /** Simple merge of two molecules into one.
    213  * \param *mol destination molecule
    214  * \param *srcmol source molecule
    215  * \return true - merge successful, false - merge failed (probably due to non-existant indices
    216  */
    217 bool MoleculeListClass::SimpleMerge(molecule *mol, molecule *srcmol)
    218 {
    219   if (srcmol == NULL)
    220     return false;
    221 
    222   // put all molecules of src into mol
    223   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 src
    230   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 molecule
    237  * \param *srcmol source molecule
    238  * \return true - merge successful, false - merge failed (probably due to non-existant indices
    239  */
    240 bool MoleculeListClass::SimpleAdd(molecule *mol, molecule *srcmol)
    241 {
    242   if (srcmol == NULL)
    243     return false;
    244 
    245   // put all molecules of src into mol
    246   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 molecule
    257  * \param *src index of set of source molecule
    258  * \param N number of source molecules
    259  * \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 molecules
    265   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 molecule
    275  * \param *src index of set of source molecule
    276  * \param N number of source molecules
    277  * \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 molecules
    283   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 molecule
    293  * \param *src index of set of source molecule
    294  * \param N number of source molecules
    295  * \return true - merge successful, false - merge failed (probably due to non-existant indices
    296  * \TODO find scatter center for each src molecule
    297  */
    298 bool MoleculeListClass::ScatterMerge(molecule *mol, int *src, int N)
    299 {
    300   // check presence of all source molecules
    301   for (int i=0;i<N;i++) {
    302     // get pointer to src molecule
    303     molecule *srcmol = ReturnIndex(src[i]);
    304     if (srcmol == NULL)
    305       return false;
    306   }
    307   // adapt each Center
    308   for (int i=0;i<N;i++) {
    309     // get pointer to src molecule
    310     molecule *srcmol = ReturnIndex(src[i]);
    311     //srcmol->Center.Zero();
    312     srcmol->Translate(&srcmol->Center);
    313   }
    314   // perform a simple multi merge
    315   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 *mol
    336   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 bonds
    346   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 atom
    351   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 nothing
    360     }
    361   }
    362   DoLog(1) && (Log() << Verbose(1) << nr << " of " << srcmol->getAtomCount() << " atoms have been merged.");
    363 
    364   // go through all bonds and add as well
    365   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 };
    374214
    375215/** Simple output of the pointers in ListOfMolecules.
  • src/periodentafel.cpp

    r7aa3cf r95e6b1  
    295295    getline(input,header1tmp);
    296296    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;
    299299    DoLog(0) && (Log() << Verbose(0) <<  "Parsed elements:");
    300300    while (!input.eof()) {
Note: See TracChangeset for help on using the changeset viewer.