Changeset a8aac8d for src


Ignore:
Timestamp:
Apr 28, 2008, 7:16:42 AM (17 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:
08f1a0
Parents:
f3cba6
Message:

OutputConfigForListOfFragments(): various ofstream gathered into a single one: output

Preparation for adding "AdjacencyFile" next

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/moleculelist.cpp

    rf3cba6 ra8aac8d  
    313313  char *FragmentNumber;
    314314  int FragmentCounter = 0;
    315   ofstream TEFile;
    316   ofstream ForcesFile;
    317   ofstream KeySetFile;
     315  ofstream output;
    318316  element *runner = NULL;
    319317 
     
    388386  // open file for the total energy factor
    389387  sprintf(TEFilename, "%s/%s%s", PathBackup, prefix, "TE-Factors.dat");
    390   TEFile.open(TEFilename, ios::out);
     388  output.open(TEFilename, ios::out);
    391389  // output TEList (later to file AtomicTEList.dat)
    392390  cout << Verbose(2) << "Saving " << prefix << " energy factors ...";
    393391  //cout << Verbose(1) << "Final ATEList: ";
    394   //less TEFile << prefix << "TE\t";
     392  //less output << prefix << "TE\t";
    395393  for(int i=0;i<NumberOfMolecules;i++) {
    396394    //cout << TEList[i] << "\t";
    397395    //if (TEList[i] != 0)
    398       TEFile << TEList[i] << "\t";
     396      output << TEList[i] << "\t";
    399397  }
    400398  //cout << endl;
    401   TEFile << endl;
    402   TEFile.close();
     399  output << endl;
     400  output.close();
    403401  cout << " done." << endl;
    404402 
    405403  // open file for the force factors
    406404  sprintf(TEFilename, "%s/%s%s", PathBackup, prefix, "Forces-Factors.dat");
    407   ForcesFile.open(TEFilename, ios::out);
     405  output.open(TEFilename, ios::out);
    408406  //cout << Verbose(1) << "Final AtomicForcesList: ";
    409407  cout << Verbose(2) << "Saving " << prefix << " force factors ...";
    410   //ForcesFile << prefix << "Forces" << endl;
     408  //output << prefix << "Forces" << endl;
    411409  for(int j=0;j<NumberOfMolecules;j++) {
    412410    //if (TEList[j] != 0) {
     
    421419            if ((Walker->GetTrueFather() != NULL) && (Walker->GetTrueFather() != Walker)) {// if there is a real father, prints its index
    422420              cerr << "Walker is " << *Walker << " with true father " << *( Walker->GetTrueFather()) << ", its number " << Walker->GetTrueFather()->nr << " and index " << SortIndex[Walker->GetTrueFather()->nr] << "." << endl; 
    423               ForcesFile <<  SortIndex[Walker->GetTrueFather()->nr] << "\t";
     421              output <<  SortIndex[Walker->GetTrueFather()->nr] << "\t";
    424422            } else  // otherwise a -1 to indicate an added saturation hydrogen
    425               ForcesFile << "-1\t";
     423              output << "-1\t";
    426424          }
    427425        }
     
    429427    }
    430428    //cout << endl << endl;
    431     ForcesFile << endl;
    432   }
    433   ForcesFile.close();
     429    output << endl;
     430  }
     431  output.close();
    434432  cout << " done." << endl;
    435433
    436434  // open KeySet file
    437435  sprintf(TEFilename, "%s/%s%s", PathBackup, prefix, "KeySets.dat");
    438   KeySetFile.open(TEFilename, ios::out);
     436  output.open(TEFilename, ios::out);
    439437  cout << Verbose(2) << "Saving " << prefix << " key sets of each subgraph ...";
    440438  for(int j=0;j<NumberOfMolecules;j++) {
     
    448446        if ((Walker->GetTrueFather() != NULL)) // if there is a real father, prints its index
    449447#endif
    450           KeySetFile <<  Walker->GetTrueFather()->nr << "\t";
     448          output <<  Walker->GetTrueFather()->nr << "\t";
    451449#ifdef ADDHYDROGEN
    452450        else  // otherwise a -1 to indicate an added saturation hydrogen
    453           KeySetFile << "-1\t";
     451          output << "-1\t";
    454452#endif
    455453      }
    456454      //cout << endl << endl;
    457       KeySetFile << endl;
    458     }
    459   KeySetFile.close();
     455      output << endl;
     456    }
     457  output.close();
    460458  cout << " done." << endl;
    461459 
Note: See TracChangeset for help on using the changeset viewer.