Changeset eddea2


Ignore:
Timestamp:
May 30, 2010, 5:29:38 PM (15 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:
8048a4
Parents:
5d12d2
git-author:
Frederik Heber <heber@…> (05/30/10 17:03:25)
git-committer:
Frederik Heber <heber@…> (05/30/10 17:29:38)
Message:

Added case '-T' (periodic translation) to testsuite.

  • BUGFIX: Vector::WrapPeriodically() added half of the box on top which is not as intended.
    • this broke testcase '-b', which relied on the half of the box adding.
    • new function molecule::DetermineCenterOfBox()
    • is used instead to additionally add this center in molecule::CenterInBox()
  • BUGFIX: molecule::TranslatePeriodically() subtracted vector instead of adding.
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/molecule.hpp

    r5d12d2 reddea2  
    249249  Vector * DetermineCenterOfGravity();
    250250  Vector * DetermineCenterOfAll() const;
     251  Vector * DetermineCenterOfBox() const;
    251252  void SetNameFromFilename(const char *filename);
    252253  void SetBoxDimension(Vector *dim);
  • src/molecule_geometry.cpp

    r5d12d2 reddea2  
    2727  bool status = true;
    2828  const Vector *Center = DetermineCenterOfAll();
     29  const Vector *CenterBox = DetermineCenterOfBox();
    2930  double * const cell_size = World::getInstance().getDomain();
    3031  double *M = ReturnFullMatrixforSymmetric(cell_size);
     
    3334  // go through all atoms
    3435  ActOnAllVectors( &Vector::SubtractVector, *Center);
     36  ActOnAllVectors( &Vector::SubtractVector, *CenterBox);
    3537  ActOnAllVectors( &Vector::WrapPeriodically, (const double *)M, (const double *)Minv);
    3638
     
    142144};
    143145
     146/** Returns vector pointing to center of the domain.
     147 * \return pointer to center of the domain
     148 */
     149Vector * molecule::DetermineCenterOfBox() const
     150{
     151  Vector *a = new Vector(0.5,0.5,0.5);
     152
     153  const double *cell_size = World::getInstance().getDomain();
     154  double *M = ReturnFullMatrixforSymmetric(cell_size);
     155  a->MatrixMultiplication(M);
     156  Free(&M);
     157
     158  return a;
     159};
     160
    144161/** Returns vector pointing to center of gravity.
    145162 * \param *out output stream for debugging
     
    236253
    237254  // go through all atoms
    238   ActOnAllVectors( &Vector::SubtractVector, *trans);
     255  ActOnAllVectors( &Vector::AddVector, *trans);
    239256  ActOnAllVectors( &Vector::WrapPeriodically, (const double *)M, (const double *)Minv);
    240257
  • src/vector.cpp

    r5d12d2 reddea2  
    543543  // truncate to [0,1] for each axis
    544544  for (int i=0;i<NDIM;i++) {
    545     x[i] += 0.5;  // set to center of box
     545    //x[i] += 0.5;  // set to center of box
    546546    while (x[i] >= 1.)
    547547      x[i] -= 1.;
  • tests/regression/testsuite.at

    r5d12d2 reddea2  
    267267AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -t 1. 1. 1.], 0, [stdout], [stderr])
    268268AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/6/post/$file], 0, [ignore], [ignore])
     269AT_CLEANUP
     270
     271# 6. Periodic translation
     272AT_SETUP([Molecules - Periodic translation])
     273AT_KEYWORDS([Molecules])
     274AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/7/pre/test.* .], 0)
     275AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -T 12. 12. 12.], 0, [stdout], [stderr])
     276AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/7/post/$file], 0, [ignore], [ignore])
    269277AT_CLEANUP
    270278
Note: See TracChangeset for help on using the changeset viewer.