Changeset 2f9faf


Ignore:
Timestamp:
Mar 24, 2017, 10:12:21 AM (8 years ago)
Author:
Frederik Heber <heber@…>
Branches:
FitPartialCharges_GlobalError
Children:
a3d08c
Parents:
407d2c
git-author:
Frederik Heber <heber@…> (10/09/16 21:28:59)
git-committer:
Frederik Heber <heber@…> (03/24/17 10:12:21)
Message:

Added FitFragmentPartialChargesAction that fits partial charges to fragments in result container.

Files:
8 added
6 edited

Legend:

Unmodified
Added
Removed
  • doc/userguide/userguide.xml

    r407d2c r2f9faf  
    19001900          <note>Again, only the <productname>TREMOLO</productname>potential format is understood currently and is written.</note>
    19011901        </section>
     1902        <section xml:id="potentials.fit-fragment-partial-charges">
     1903          <title xml:id="potentials.fit-fragment-partial-charges.title">Fitting partial particle charges</title>
     1904          <para>There are two ways at the moment of fitting partial charges: One
     1905          of them uses the FragmentationResultContainer and the other uses the
     1906          HomologyContainer. The first, which is this action, only works for
     1907          a single time step, while the latter may use the fragment results
     1908          obtained from many time steps.
     1909          </para>
     1910          <programlisting>
     1911  ... --fit-fragment-partial-charges \
     1912      --enforce-net-zero-charge 1 \
     1913      --radius 1.5
     1914   </programlisting>
     1915          <para>The function call will fit partial charges to all selected
     1916          atoms whose fragment results are currently contained in the container.
     1917          It will mask the potential around each atom with a radius of 1.5.
     1918          Note that this is important because of the smearing of nuclei charges
     1919          via the "near-field-cells" parameter. Essentially, the masking radius
     1920          should be as large as the b-spline diameter.
     1921          </para>
     1922        </section>
    19021923        <section xml:id="potentials.fit-partial-charges">
    19031924          <title xml:id="potentials.fit-partial-charges.title">Fitting partial particle charges</title>
     
    19271948          <programlisting>
    19281949  ... --fit-partial-charges \
    1929       --potential-file water.particles \
    19301950      --radius 1.5
    19311951   </programlisting>
     
    19351955          from the homologies container. For each of the atoms then an average
    19361956          partial charge is computed by fitting their respective Coulomb
    1937           potential to the obtained from the fragment calculations. Resulting
    1938           values are stored in <filename>water.particles</filename>. The
     1957          potential to the obtained from the fragment calculations. The
    19391958          radius is used to mask a certain region directly around the nuclei
    19401959          from the fit procedure. As here the charges of the core electrons and
    19411960          the nuclei itself dominate, we however are only interested in a good
    19421961          approximation to the long-range potential, this mask radius allows
    1943           to give the range of the excluded zone.</para>
     1962          to give the range of the excluded zone. Also, it is important to
     1963          remove the smeared nuclei charges via cardinal b-splines whose
     1964          broadened peaks are artifically and only become valid in the
     1965          far-field.</para>
    19441966        </section>
    19451967        <section xml:id="potentials.parse-particle-parameters">
  • src/Actions/GlobalListOfActions.hpp

    r407d2c r2f9faf  
    9292  (MoleculeTranslate) \
    9393  (MoleculeVerletIntegration) \
     94  (PotentialFitFragmentPartialCharges) \
    9495  (PotentialFitPartialCharges) \
    9596  (PotentialParseAtomFragments) \
  • src/Actions/Makefile.am

    r407d2c r2f9faf  
    380380
    381381POTENTIALACTIONSOURCE = \
     382        Actions/PotentialAction/FitFragmentPartialChargesAction.cpp \
    382383  Actions/PotentialAction/FitPartialChargesAction.cpp \
    383384  Actions/PotentialAction/ParseAtomFragmentsAction.cpp \
     
    390391  Actions/PotentialAction/SavePotentialsAction.cpp
    391392POTENTIALACTIONHEADER = \
     393        Actions/PotentialAction/FitFragmentPartialChargesAction.hpp \
    392394  Actions/PotentialAction/FitPartialChargesAction.hpp \
    393395  Actions/PotentialAction/ParseAtomFragmentsAction.hpp \
     
    400402  Actions/PotentialAction/SavePotentialsAction.hpp
    401403POTENTIALACTIONDEFS = \
     404        Actions/PotentialAction/FitFragmentPartialChargesAction.def \
    402405  Actions/PotentialAction/FitPartialChargesAction.def  \
    403406  Actions/PotentialAction/ParseAtomFragmentsAction.def \
  • src/Actions/PotentialAction/FitPartialChargesAction.cpp

    r407d2c r2f9faf  
    184184}
    185185
    186 inline SerializablePotential::ParticleTypes_t
    187 getParticleTypesForAtomIdSet(const AtomIdSet &_atoms)
    188 {
    189   SerializablePotential::ParticleTypes_t particletypes;
    190   particletypes.resize(_atoms.size());
    191   std::transform(
    192       _atoms.begin(), _atoms.end(),
    193       particletypes.begin(),
    194       boost::bind(&atom::getElementNo, _1));
    195   return particletypes;
    196 }
    197 
    198186static
    199187std::set<KeySet> accumulateKeySetsForAtoms(
     
    282270}
    283271
    284 const atom * getNonHydrogenSurrogate(const atom * const _walker)
     272static const atom * getNonHydrogenSurrogate(const atom * const _walker)
    285273{
    286274  const atom * surrogate = _walker;
     
    298286}
    299287
    300 double fitAverageChargeToAtom(
     288static double fitAverageChargeToAtom(
    301289    const atom * const _walker,
    302290    const AtomFragmentsMap &_atomfragments,
     
    361349}
    362350
    363 void addToParticleRegistry(
     351static void addToParticleRegistry(
    364352    const ParticleFactory &factory,
    365353    const periodentafel &periode,
     
    400388}
    401389
    402 bool isNotHydrogen(const atom * const _atom)
     390static bool isNotHydrogen(const atom * const _atom)
    403391{
    404392  return (_atom->getElementNo() != (atomicNumber_t) 1);
    405393}
    406394
    407 struct KeySetSizeComp {
     395static struct KeySetSizeComp {
    408396  bool operator() (const KeySet &a, const KeySet &b) { return a.size()<b.size(); }
    409397} keyset_comparator;
  • tests/regression/Makefile.am

    r407d2c r2f9faf  
    187187        $(srcdir)/Parser/Xyz/testsuite-parser-xyz-save.at \
    188188        $(srcdir)/Potential/testsuite-potential.at \
     189        $(srcdir)/Potential/FitFragmentPartialCharges/testsuite-potential-fit-fragment-partial-charges.at \
    189190        $(srcdir)/Potential/FitPartialCharges/testsuite-potential-fit-partial-charges.at \
    190191        $(srcdir)/Potential/FitPotential/testsuite-potential-fit-potential.at \
  • tests/regression/Potential/testsuite-potential.at

    r407d2c r2f9faf  
    2828m4_include([Potential/SaveParseParticleParameters/testsuite-potential-save-parse-particle-parameters.at])
    2929
     30# fitting particle charges to homologous graphs
     31m4_include([Potential/FitPartialCharges/testsuite-potential-fit-partial-charges.at])
     32
    3033# fitting particle charges to fragment results
    31 m4_include([Potential/FitPartialCharges/testsuite-potential-fit-partial-charges.at])
     34m4_include([Potential/FitFragmentPartialCharges/testsuite-potential-fit-fragment-partial-charges.at])
Note: See TracChangeset for help on using the changeset viewer.