Ignore:
Timestamp:
Sep 28, 2009, 6:41:52 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
01e6c5
Parents:
6f1551
git-author:
Frederik Heber <heber@…> (09/28/09 18:39:28)
git-committer:
Frederik Heber <heber@…> (09/28/09 18:41:52)
Message:

Implemenation of embedding merge, untested. LinearInterpolation now has switch for using identity map.

  • embed merge in MoleculeListClass determines the non-convex envelope and tries to fill the domain with the filler molecule everywhere outside of this domain
  • is added to MergeMolecule in builder.cpp, case 'e'
  • in molecule::LinearInterpolationBetweenConfiguration() now has additional parameter to tell whether we have to look for a mapping or use the identity.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/molecules.cpp

    r6f1551 r606dfb  
    662662{
    663663  int length = 0;
    664   char *molname = strrchr(filename, '/')+sizeof(char);  // search for filename without dirs
     664  const char *molname = strrchr(filename, '/');
     665  if (molname != NULL)
     666    molname += sizeof(char);  // search for filename without dirs
     667  else
     668    molname = filename; // contains no slashes
    665669  char *endname = strchr(molname, '.');
    666670  if ((endname == NULL) || (endname < molname))
     
    15621566 * \param endstep stating final configuration in molecule::Trajectories
    15631567 * \param &config configuration structure
     1568 * \param MapByIdentity if true we just use the identity to map atoms in start config to end config, if not we find mapping by \sa MinimiseConstrainedPotential()
    15641569 * \return true - success in writing step files, false - error writing files or only one step in molecule::Trajectories
    15651570 */
    1566 bool molecule::LinearInterpolationBetweenConfiguration(ofstream *out, int startstep, int endstep, const char *prefix, config &configuration)
     1571bool molecule::LinearInterpolationBetweenConfiguration(ofstream *out, int startstep, int endstep, const char *prefix, config &configuration, bool MapByIdentity)
    15671572{
    15681573  molecule *mol = NULL;
     
    15731578  atom **PermutationMap = NULL;
    15741579  atom *Walker = NULL, *Sprinter = NULL;
    1575   MinimiseConstrainedPotential(out, PermutationMap, startstep, endstep, configuration.GetIsAngstroem());
     1580  if (!MapByIdentity)
     1581    MinimiseConstrainedPotential(out, PermutationMap, startstep, endstep, configuration.GetIsAngstroem());
     1582  else {
     1583    PermutationMap = (atom **) Malloc(AtomCount*sizeof(atom *), "molecule::LinearInterpolationBetweenConfiguration: **PermutationMap");
     1584    Walker = start;
     1585    while (Walker->next != end) {
     1586      Walker = Walker->next;
     1587      PermutationMap[Walker->nr] = Walker;   // always pick target with the smallest distance
     1588    }
     1589  }
    15761590
    15771591  // check whether we have sufficient space in Trajectories for each atom
Note: See TracChangeset for help on using the changeset viewer.