]> git.unchartedbackwaters.co.uk Git - francis/ofc.git/commitdiff
Fix reciprocal vector calculation in Laplacian.
authorFrancis Russell <francis@unchartedbackwaters.co.uk>
Sat, 19 May 2012 16:44:15 +0000 (17:44 +0100)
committerFrancis Russell <francis@unchartedbackwaters.co.uk>
Sat, 19 May 2012 16:44:15 +0000 (17:44 +0100)
src/ofc/generators/onetep/Laplacian.scala

index 445337e4b54daadd63e30c35951052c7fb77f10e..ff3ef49f70251944cfd78da9b4c30b1707565613 100644 (file)
@@ -35,7 +35,7 @@ class Laplacian(op: Field)  extends Field {
         var component : Expression[FloatType] = new FloatLiteral(0.0)
         for(vec <- 0 to 2) {
           val vector = OnetepTypes.CellInfo.public % OnetepTypes.CellInfo.latticeReciprocal(vec)
-          component = component + vector % OnetepTypes.Point.coord(dim) * new Conversion[IntType, FloatType](indices(dim))
+          component = component + vector % OnetepTypes.Point.coord(dim) * new Conversion[IntType, FloatType](indices(vec) - 1)
         }
         loops(0) += new AssignStatement(reciprocalVector(dim), component)
       }