diff --git a/GrandBrownTown.cuh b/GrandBrownTown.cuh index fb701140aba0367fadea9650d4e4b6177f3e4dcf..e30079ff4e5ca03229f87482070c7ab768065f14 100644 --- a/GrandBrownTown.cuh +++ b/GrandBrownTown.cuh @@ -34,13 +34,13 @@ void updateKernel(Vector3 pos[], Vector3 forceInternal[], Vector3 forceExternal = Vector3(0.0f, 0.0f, pt.charge * electricField); // Compute PMF - ForceEnergy fe = pt.pmf->interpolateForceD(p); + ForceEnergy fe = pt.pmf->interpolateForceDLinearly(p); #ifndef FORCEGRIDOFF // Add a force defined via 3D FORCE maps (not 3D potential maps) - if (pt.forceXGrid != NULL) fe.f.x += pt.forceXGrid->interpolatePotential(p); - if (pt.forceYGrid != NULL) fe.f.y += pt.forceYGrid->interpolatePotential(p); - if (pt.forceZGrid != NULL) fe.f.z += pt.forceZGrid->interpolatePotential(p); + if (pt.forceXGrid != NULL) fe.f.x += pt.forceXGrid->interpolatePotentialLinearly(p); + if (pt.forceYGrid != NULL) fe.f.y += pt.forceYGrid->interpolatePotentialLinearly(p); + if (pt.forceZGrid != NULL) fe.f.z += pt.forceZGrid->interpolatePotentialLinearly(p); #endif // Compute total force: @@ -53,14 +53,15 @@ void updateKernel(Vector3 pos[], Vector3 forceInternal[], forceInternal[idx] = force; // write it back out for force0 in run() // Get local kT value - float kTlocal = (tGridLength == 0) ? kT : kTGrid->interpolatePotential(p); + float kTlocal = (tGridLength == 0) ? kT : kTGrid->interpolatePotentialLinearly(p); // Update the particle's position using the calculated values for time, force, etc. if (pt.diffusionGrid == NULL) { p = step(p, kTlocal, force, pt.diffusion, timestep, sys, randoGen, num); } else { - float diffusion = pt.diffusionGrid->interpolatePotential(p); - Vector3 diffGrad = (pt.diffusionGrid->interpolateForceD(p)).f; + ForceEnergy diff = pt.diffusionGrid->interpolateForceDLinearly(p); + float& diffusion = diff.e; + Vector3& diffGrad = diff.f; p = step(p, kTlocal, force, diffusion, -diffGrad, timestep, sys, randoGen, num); } } diff --git a/notes.org b/notes.org index d1454830fff9f20476a75819ef62ad3563b3e910..6feeb1a0b3513b35559ae2308d475ccf0dd8ccb8 100644 --- a/notes.org +++ b/notes.org @@ -1,11 +1,16 @@ - - * TODO active +** fix segfaults +** move to efficient linear interpolation everywhere +** update pairlists +** statistical tests of results * TODO eventually -** +** increase cells/cutoff + +** improve pairlist algorithm +http://arxiv.org/pdf/1306.1737.pdf ** RB periodic boundaries? ** RB read restart file ** RB throw exception if an RB type uses a grid key multiple times