Changeset f7f7a4 for src/molecules.cpp


Ignore:
Timestamp:
Sep 28, 2009, 6:41:52 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, Candidate_v1.7.0, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
d52e70c
Parents:
8cd903
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
  • src/molecules.cpp

    r8cd903 rf7f7a4  
    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.