Ignore:
Timestamp:
Mar 30, 2012, 9:18:26 AM (13 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, 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:
48ab414
Parents:
e32fa6
git-author:
Frederik Heber <heber@…> (03/21/12 10:13:39)
git-committer:
Frederik Heber <heber@…> (03/30/12 09:18:26)
Message:

FIX: Filler::operator() now shifts filler cluster out of domain before evaluating predicates.

  • Note, we only move the atoms outside, not the shape.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Filling/Filler.cpp

    re32fa6 r4fbc4eb  
    3333
    3434#include "Atom/atom.hpp"
     35#include "Box.hpp"
    3536#include "ClusterInterface.hpp"
    3637#include "Descriptors/AtomIdDescriptor.hpp"
    3738#include "Inserter/Inserter.hpp"
     39#include "LinearAlgebra/RealSpaceMatrix.hpp"
    3840#include "LinearAlgebra/Vector.hpp"
    3941#include "NodeTypes.hpp"
     
    8486  NodeSet FillNodes(nodes.size(), zeroVec);
    8587
     88  // move filler cluster's atoms out of domain such that it does not disturb the predicate.
     89  // we only move the atoms as otherwise two translate ShapeOps will be on top of the Shape
     90  // which is subsequently copied to all other cloned Clusters ...
     91  Vector BoxDiagonal;
     92  {
     93    const RealSpaceMatrix &M = World::getInstance().getDomain().getM();
     94    BoxDiagonal = (M * Vector(1.,1.,1.));
     95    BoxDiagonal -= cluster->getShape().getCenter();
     96    BoxDiagonal *= 1. + 2.*cluster->getShape().getRadius()/BoxDiagonal.Norm(); // extend it a little further
     97    AtomIdSet atoms = cluster->getAtoms();
     98    for (AtomIdSet::iterator iter = atoms.begin(); iter != atoms.end(); ++iter)
     99      (*iter)->setPosition( (*iter)->getPosition() + BoxDiagonal );
     100    LOG(1, "INFO: Translating original cluster's atoms by " << BoxDiagonal << ".");
     101  }
     102
    86103  // evaluate predicate and gather into new set
    87104  NodeSet::iterator transform_end  =
    88105      std::remove_copy_if(nodes.begin(), nodes.end(), FillNodes.begin(), predicate );
    89106  FillNodes.erase(transform_end, FillNodes.end());
     107
     108  // shift cluster back to original place
     109  {
     110    AtomIdSet atoms = cluster->getAtoms();
     111    for (AtomIdSet::iterator iter = atoms.begin(); iter != atoms.end(); ++iter)
     112      (*iter)->setPosition( (*iter)->getPosition() - BoxDiagonal );
     113    LOG(1, "INFO: Translating original cluster's atoms back.");
     114  }
    90115
    91116  if (FillNodes.size() == 0) {
Note: See TracChangeset for help on using the changeset viewer.