Changeset 5887ed for molecuilder


Ignore:
Timestamp:
Sep 5, 2008, 5:09:39 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
f9cd68
Parents:
dfc1c7
Message:

SaveConfig() now also stores an MPQC input file.

MoleculeListClass::OutputConfigForListOfFragments() did this already, but it was missing for SaveConfig(). We do the same regarding filenames and output, only we call config::SaveMPQC().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/builder.cpp

    rdfc1c7 r5887ed  
    686686      output.open(DEFAULTCONFIG, ios::trunc);
    687687    }
     688  cout << Verbose(0) << "Saving of config file ";
    688689  if (configuration->Save(&output, periode, mol))
    689     cout << Verbose(0) << "Saving of config file successful." << endl;
     690    cout << "successful." << endl;
    690691  else
    691     cout << Verbose(0) << "Saving of config file failed." << endl;
     692    cout << "failed." << endl;
    692693  output.close();
    693694  output.clear();
     695 
    694696  // and save to xyz file
    695697  if (ConfigFileName != NULL) {
     
    703705    output.open(filename, ios::trunc);
    704706  }
     707  cout << Verbose(0) << "Saving of XYZ file ";
    705708  if (mol->MDSteps <= 1) {
    706709    if (mol->OutputXYZ(&output))
    707       cout << Verbose(0) << "Saving of XYZ file successful." << endl;
     710      cout << "successful." << endl;
    708711    else
    709       cout << Verbose(0) << "Saving of XYZ file failed." << endl;
     712      cout << "failed." << endl;
    710713  } else {
    711714    if (mol->OutputTrajectoriesXYZ(&output))
    712       cout << Verbose(0) << "Saving of XYZ file successful." << endl;
     715      cout << "successful." << endl;
    713716    else
    714       cout << Verbose(0) << "Saving of XYZ file failed." << endl;
     717      cout << "failed." << endl;
    715718  }
     719  output.close();
     720  output.clear();
     721 
     722  // and save as MPQC configuration
     723  if (ConfigFileName != NULL) {
     724    strcpy(filename, ConfigFileName);
     725    strcat(filename, ".in");
     726    output.open(filename, ios::trunc);
     727  }
     728  if (output == NULL) {
     729    strcpy(filename,"main_pcp_linux");
     730    strcat(filename, ".in");
     731    output.open(filename, ios::trunc);
     732  }
     733  cout << Verbose(0) << "Saving as mpqc input ";
     734  if (configuration->SaveMPQC(&output, mol))
     735    cout << "done." << endl;
     736  else
     737    cout << "failed." << endl;
    716738  output.close();
    717739  output.clear();
Note: See TracChangeset for help on using the changeset viewer.