Changeset 8d56a6 for src/Parser


Ignore:
Timestamp:
Jun 21, 2018, 8:31:25 AM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.6.1, ChemicalSpaceEvaluator
Children:
d83d64, f5ea10
Parents:
3e334e (diff), 4fc0ea (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 'TremoloParser_IncreasedPrecision' into Candidate_v1.6.1

Conflicts:

tests/Python/ForceAnnealing/post/five_carbon_test_bondgraph.data
tests/Python/ForceAnnealing/post/five_carbon_test_no-bondgraph.data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TremoloParser.cpp

    r3e334e r8d56a6  
    510510      << currentAtom->GetTrueFather()->getId() << " at time step " << _timestep);
    511511
     512  // note down default precision
     513  std::streamsize defaultprecision=file->precision();
     514  std::streamsize highprecision=10;
     515
    512516  for (usedFields_t::iterator it = usedFields_save.begin(); it != usedFields_save.end(); it++) {
    513517    currentField = knownKeys[it->substr(0, it->find("="))];
     
    516520        // for the moment, assume there are always three dimensions
    517521        LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getPositionAtStep(_timestep));
     522        file->precision(highprecision);
    518523        *file << currentAtom->atStep(0, _timestep) << "\t";
    519524        *file << currentAtom->atStep(1, _timestep) << "\t";
    520525        *file << currentAtom->atStep(2, _timestep) << "\t";
     526        file->precision(defaultprecision);
    521527        break;
    522528      case TremoloKey::u :
    523529        // for the moment, assume there are always three dimensions
    524530        LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getAtomicVelocityAtStep(_timestep));
     531        file->precision(highprecision);
    525532        *file << currentAtom->getAtomicVelocityAtStep(_timestep)[0] << "\t";
    526533        *file << currentAtom->getAtomicVelocityAtStep(_timestep)[1] << "\t";
    527534        *file << currentAtom->getAtomicVelocityAtStep(_timestep)[2] << "\t";
     535        file->precision(defaultprecision);
    528536        break;
    529537      case TremoloKey::F :
    530538        // for the moment, assume there are always three dimensions
    531539        LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getAtomicForceAtStep(_timestep));
     540        file->precision(highprecision);
    532541        *file << currentAtom->getAtomicForceAtStep(_timestep)[0] << "\t";
    533542        *file << currentAtom->getAtomicForceAtStep(_timestep)[1] << "\t";
    534543        *file << currentAtom->getAtomicForceAtStep(_timestep)[2] << "\t";
     544        file->precision(defaultprecision);
    535545        break;
    536546      case TremoloKey::type :
Note: See TracChangeset for help on using the changeset viewer.