- Timestamp:
- Oct 17, 2009, 7:46:28 PM (15 years ago)
- 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:
- b8b75d
- Parents:
- 44a59b
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/linkedcell.cpp
r44a59b r07051c 202 202 }; 203 203 204 /** Checks whether LinkedCell::n[] plus relative offset is each within [0,N[]]. 205 * \param relative[NDIM] relative offset to current cell 206 * \return if all in intervals - true, else -false 207 */ 208 bool LinkedCell::CheckBounds(int relative[NDIM]) 209 { 210 bool status = true; 211 for(int i=0;i<NDIM;i++) 212 status = status && ((n[i]+relative[i] >=0) && (n[i]+relative[i] < N[i])); 213 if (!status) 214 cerr << "ERROR: indices are out of bounds!" << endl; 215 return status; 216 }; 217 204 218 205 219 /** Returns a pointer to the current cell. … … 210 224 if (CheckBounds()) { 211 225 index = n[0] * N[1] * N[2] + n[1] * N[2] + n[2]; 226 return (&(LC[index])); 227 } else { 228 return NULL; 229 } 230 }; 231 232 /** Returns a pointer to the current cell. 233 * \param relative[NDIM] offset for each axis with respect to the current cell LinkedCell::n[NDIM] 234 * \return LinkedAtoms pointer to current cell, NULL if LinkedCell::n[]+relative[] are out of bounds. 235 */ 236 LinkedNodes* LinkedCell::GetRelativeToCurrentCell(int relative[NDIM]) 237 { 238 if (CheckBounds(relative)) { 239 index = (n[0]+relative[0]) * N[1] * N[2] + (n[1]+relative[1]) * N[2] + (n[2]+relative[2]); 212 240 return (&(LC[index])); 213 241 } else { -
src/linkedcell.hpp
r44a59b r07051c 54 54 ~LinkedCell(); 55 55 LinkedNodes* GetCurrentCell(); 56 LinkedNodes* GetRelativeToCurrentCell(int relative[NDIM]); 56 57 bool SetIndexToNode(const TesselPoint *Walker); 57 58 bool SetIndexToVector(const Vector *x); 58 59 bool CheckBounds(); 60 bool CheckBounds(int relative[NDIM]); 59 61 void GetNeighbourBounds(int lower[NDIM], int upper[NDIM]); 60 62
Note:
See TracChangeset
for help on using the changeset viewer.