Ignore:
Timestamp:
Oct 3, 2016, 11:13:32 AM (9 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Fix_FitPotential_needs_atomicnumbers
Children:
0b7036
Parents:
c93e58
git-author:
Frederik Heber <heber@…> (10/03/16 10:35:00)
git-committer:
Frederik Heber <heber@…> (10/03/16 11:13:32)
Message:

ParticleType_t is now an unsigned int.

  • this allows direct use of atomicNumber_t and also signed integers dont' make much sense for a particle type, i.e. an id.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Potentials/CompoundPotential.cpp

    rc93e58 rbe20db  
    7070        potential->getParticleTypes();
    7171
    72     // create charges
    73     Fragment::charges_t charges;
    74     charges.resize(types.size());
    75     std::transform(types.begin(), types.end(),
    76         charges.begin(), boost::lambda::_1);
    7772    // convert into count map
    78     Extractors::elementcounts_t counts_per_charge =
    79         Extractors::_detail::getElementCounts(charges);
    80 //    ASSERT( !counts_per_charge.empty(),
    81 //        "getFirstGraphwithSpecifiedElements() - charge counts are empty?");
    82     LOG(2, "DEBUG: counts_per_charge is " << counts_per_charge << ".");
     73    Extractors::elementcounts_t counts_per_element =
     74        Extractors::_detail::getElementCounts(types);
     75//    ASSERT( !counts_per_element.empty(),
     76//        "getFirstGraphwithSpecifiedElements() - element counts are empty?");
     77    LOG(2, "DEBUG: counts_per_element is " << counts_per_element << ".");
    8378
    8479    // check whether graph contains suitable types
    85     Extractors::elementcounts_t::const_iterator countiter = counts_per_charge.begin();
    86     for (; countiter != counts_per_charge.end(); ++countiter)
     80    Extractors::elementcounts_t::const_iterator countiter = counts_per_element.begin();
     81    for (; countiter != counts_per_element.end(); ++countiter)
    8782      if (!graph.hasGreaterEqualTimesAtomicNumber(
    8883          static_cast<size_t>(countiter->first),
     
    9186        break;
    9287    // if we have a match for every count, store model
    93     if( countiter == counts_per_charge.end()) {
     88    if( countiter == counts_per_element.end()) {
    9489      LOG(1, "INFO: Potential " << potentialiter->first << " matches with fragment.");
    9590      models.push_back(static_cast<FunctionModel*>(potential));
Note: See TracChangeset for help on using the changeset viewer.