Ignore:
Timestamp:
Jan 2, 2012, 1:34:42 PM (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:
54f3d1
Parents:
e776dc
git-author:
Frederik Heber <heber@…> (12/20/11 14:28:33)
git-committer:
Frederik Heber <heber@…> (01/02/12 13:34:42)
Message:

Added new class LinkedCellArrayCache that performs the lazy updates on a LinkedCellArray.

  • basically, we cache all write operations and perform them first when there is a read operation that requires an up-to-date structure.
  • we cannot do this via the Cacheable pattern was there we always have a return value of the update structure. It is currently unknown how to initialize a cached pointer (apart from always checking for this in the update function).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/LinkedCell/unittests/LinkedCell_ModelUnitTest.cpp

    re776dc r8c31865  
    3232#include "LinkedCell/LinkedCell.hpp"
    3333#include "LinkedCell/LinkedCell_Model.hpp"
     34#include "LinkedCell/LinkedCell_Model_LinkedCellArrayCache.hpp"
    3435#include "LinkedCell/PointCloudAdaptor.hpp"
    3536#include "LinkedCell/unittests/defs.hpp"
     
    99100  LinkedCell::tripleIndex index;
    100101  index[0] = index[1] = index[2] = 0;
    101   CPPUNIT_ASSERT(LC->N(index) != NULL);
     102  CPPUNIT_ASSERT(LC->N->getN()(index) != NULL);
    102103
    103104  // check that very last cell is allocated
    104105  index[0] = index[1] = index[2] = (size_t)floor(NUMBERCELLS)-1;
    105   CPPUNIT_ASSERT(LC->N(index) != NULL);
     106  CPPUNIT_ASSERT(LC->N->getN()(index) != NULL);
    106107
    107108}
     
    146147    index[0] = index[1] = index[2] = i;
    147148    // assert that in the destined cell we have one Walker
    148     CPPUNIT_ASSERT_EQUAL((size_t)1, LC->N(index)->size());
     149    CPPUNIT_ASSERT_EQUAL((size_t)1, LC->N->getN()(index)->size());
    149150  }
    150151  index[0] = 9;
    151152  index[1] = index[2] = 0;
    152153  // assert that in the destined cell we have one Walker
    153   CPPUNIT_ASSERT_EQUAL((size_t)0, LC->N(index)->size());
    154 
    155 }
    156 
    157 /** UnitTest for insertPointCloud()
     154  CPPUNIT_ASSERT_EQUAL((size_t)0, LC->N->getN()(index)->size());
     155
     156}
     157
     158/** UnitTest for setPartition()
    158159 */
    159160void LinkedCell_ModelTest::setPartitionTest()
     
    173174}
    174175
    175 /** UnitTest for insertPointCloud()
     176/** UnitTest for getStep()
    176177 */
    177178void LinkedCell_ModelTest::getStepTest()
     
    197198}
    198199
    199 /** UnitTest for insertPointCloud()
     200/** UnitTest for getIndexToVector()
    200201 */
    201202void LinkedCell_ModelTest::getIndexToVectorTest()
     
    221222}
    222223
    223 /** UnitTest for insertPointCloud()
     224/** UnitTest for updating nodes
    224225 */
    225226void LinkedCell_ModelTest::nodeTest()
Note: See TracChangeset for help on using the changeset viewer.