Ignore:
Timestamp:
May 19, 2021, 7:06:29 PM (4 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, stable
Children:
9b0dcd
Parents:
698185
git-author:
Frederik Heber <frederik.heber@…> (05/19/21 11:00:24)
git-committer:
Frederik Heber <frederik.heber@…> (05/19/21 19:06:29)
Message:

FIX: StreamFactory did not set BindingModel.

  • we streamed into a default potential instance but this does not set the BindingModel. Now, we use the particle types from that deseralized instance and instantiate a new potential that then also generates the BindingModel.
  • added output operator to BindingModel.
  • TEST: This fixes the fit-compound-potential regression test case.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Potentials/StreamFactory_EmpiricalPotential.cpp

    r698185 rc98620  
    4949    std::istream &serialized) const
    5050{
    51   EmpiricalPotential * const potential = getDefaultPotential(potentialtype);
     51  EmpiricalPotential * full_potential;
    5252  // now stream in types and parameters
    5353  try {
     54    EmpiricalPotential * const potential = getDefaultPotential(potentialtype);
    5455    potential->stream_from(serialized);
     56    // also need to generate the binding model
     57    full_potential = createInstance(potentialtype, potential->getParticleTypes());
     58    delete potential;
    5559  } catch (SerializerMissingValueException &e) {
    5660    ELOG(1, "Missing value for potential in line " << e.what());
    5761  }
    5862
    59   return potential;
     63  return full_potential;
    6064}
Note: See TracChangeset for help on using the changeset viewer.