Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/moleculelist.cpp

    • Property mode changed from 100644 to 100755
    redcda5 r2746be  
    378378 * \param *configuration standard configuration to attach atoms in fragment molecule to.
    379379 * \param *SortIndex Index to map from the BFS labeling to the sequence how of Ion_Type in the config
    380  * \param DoPeriodic true - call ScanForPeriodicCorrection, false - don't
    381  * \param DoCentering true - call molecule::CenterEdge(), false - don't
    382380 * \return true - success (each file was written), false - something went wrong.
    383381 */
    384 bool MoleculeListClass::OutputConfigForListOfFragments(ofstream *out, const char *fragmentprefix, config *configuration, int *SortIndex, bool DoPeriodic, bool DoCentering)
     382bool MoleculeListClass::OutputConfigForListOfFragments(ofstream *out, config *configuration, int *SortIndex)
    385383{
    386384  ofstream outputFragment;
     
    395393  int FragmentCounter = 0;
    396394  ofstream output;
     395  string basis("3-21G");
    397396 
    398397  // store the fragments as config and as xyz
     
    406405
    407406    // correct periodic
    408     if (DoPeriodic)
    409       ListOfMolecules[i]->ScanForPeriodicCorrection(out);
     407    //ListOfMolecules[i]->ScanForPeriodicCorrection(out);
    410408
    411409    // output xyz file
    412410    FragmentNumber = FixedDigitNumber(NumberOfMolecules, FragmentCounter++);
    413     sprintf(FragmentName, "%s/%s%s.conf.xyz", configuration->configpath, fragmentprefix, FragmentNumber);
     411    sprintf(FragmentName, "%s/%s%s.conf.xyz", configuration->configpath, FRAGMENTPREFIX, FragmentNumber);
    414412    outputFragment.open(FragmentName, ios::out);
    415     *out << Verbose(2) << "Saving " << fragmentprefix << " No. " << FragmentNumber << "/" << FragmentCounter-1 << " as XYZ ...";
     413    *out << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter-1 << " as XYZ ...";
    416414    if ((intermediateResult = ListOfMolecules[i]->OutputXYZ(&outputFragment)))
    417415      *out << " done." << endl;
     
    432430   
    433431    // center on edge
    434     if (DoCentering) {
    435       ListOfMolecules[i]->CenterEdge(out, &BoxDimension);
    436       ListOfMolecules[i]->SetBoxDimension(&BoxDimension);  // update Box of atoms by boundary
    437       int j = -1;
    438       for (int k=0;k<NDIM;k++) {
    439         j += k+1;
    440         BoxDimension.x[k] = 2.5* (configuration->GetIsAngstroem() ? 1. : 1./AtomicLengthToAngstroem);
    441         ListOfMolecules[i]->cell_size[j] += BoxDimension.x[k]*2.;
    442       }
    443       ListOfMolecules[i]->Translate(&BoxDimension);
    444     }
     432    ListOfMolecules[i]->CenterEdge(out, &BoxDimension);
     433    ListOfMolecules[i]->SetBoxDimension(&BoxDimension);  // update Box of atoms by boundary
     434    int j = -1;
     435    for (int k=0;k<NDIM;k++) {
     436      j += k+1;
     437      BoxDimension.x[k] = 2.5* (configuration->GetIsAngstroem() ? 1. : 1./AtomicLengthToAngstroem);
     438      ListOfMolecules[i]->cell_size[j] += BoxDimension.x[k]*2.;
     439    }
     440    ListOfMolecules[i]->Translate(&BoxDimension);
    445441
    446442    // also calculate necessary orbitals
     
    450446    // change path in config
    451447    //strcpy(PathBackup, configuration->configpath);
    452     sprintf(FragmentName, "%s/%s%s/", PathBackup, fragmentprefix, FragmentNumber);
     448    sprintf(FragmentName, "%s/%s%s/", PathBackup, FRAGMENTPREFIX, FragmentNumber);
    453449    configuration->SetDefaultPath(FragmentName);
    454450   
    455451    // and save as config
    456     sprintf(FragmentName, "%s/%s%s.conf", configuration->configpath, fragmentprefix, FragmentNumber);
    457     outputFragment.open(FragmentName, ios::out);
    458     *out << Verbose(2) << "Saving " << fragmentprefix << " No. " << FragmentNumber << "/" << FragmentCounter-1 << " as config ...";
    459     if ((intermediateResult = configuration->Save(&outputFragment, ListOfMolecules[i]->elemente, ListOfMolecules[i])))
     452    sprintf(FragmentName, "%s/%s%s.conf", configuration->configpath, FRAGMENTPREFIX, FragmentNumber);
     453    *out << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter-1 << " as config ...";
     454    if ((intermediateResult = configuration->Save(FragmentName, ListOfMolecules[i]->elemente, ListOfMolecules[i])))
    460455      *out << " done." << endl;
    461456    else
    462457      *out << " failed." << endl;
     458    result = result && intermediateResult;
    463459
    464460    // restore old config
    465461    configuration->SetDefaultPath(PathBackup);
    466462
    467     result = result && intermediateResult;
    468     outputFragment.close();
    469     outputFragment.clear();
    470463
    471464    // and save as mpqc input file
    472     sprintf(FragmentName, "%s/%s%s.in", configuration->configpath, fragmentprefix, FragmentNumber);
    473     outputFragment.open(FragmentName, ios::out);
    474     *out << Verbose(2) << "Saving " << fragmentprefix << " No. " << FragmentNumber << "/" << FragmentCounter-1 << " as mpqc input ...";
    475     if ((intermediateResult = configuration->SaveMPQC(&outputFragment, ListOfMolecules[i])))
     465    sprintf(FragmentName, "%s/%s%s.conf", configuration->configpath, FRAGMENTPREFIX, FragmentNumber);
     466    *out << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter-1 << " as mpqc input ...";
     467    if ((intermediateResult = configuration->SaveMPQC(FragmentName, ListOfMolecules[i])))
    476468      *out << " done." << endl;
    477469    else
     
    479471       
    480472    result = result && intermediateResult;
    481     outputFragment.close();
    482     outputFragment.clear();
     473    //outputFragment.close();
     474    //outputFragment.clear();
    483475    delete(FragmentNumber);
    484476    //Free((void **)&FragmentNumber, "MoleculeListClass::OutputConfigForListOfFragments: *FragmentNumber");
Note: See TracChangeset for help on using the changeset viewer.