]> git.unchartedbackwaters.co.uk Git - francis/ofc.git/commitdiff
Correctly scale inner product integral.
authorFrancis Russell <francis@unchartedbackwaters.co.uk>
Tue, 8 May 2012 16:18:54 +0000 (17:18 +0100)
committerFrancis Russell <francis@unchartedbackwaters.co.uk>
Tue, 8 May 2012 16:18:54 +0000 (17:18 +0100)
src/ofc/generators/onetep/InnerProduct.scala
src/ofc/generators/onetep/OnetepTypes.scala

index a07e8121d5cb857bcc9c7c708e3d6d291389a01a..9d7143b68c2ceee9585a9ef3443720a2f4b2565f 100644 (file)
@@ -41,7 +41,8 @@ class InnerProduct(left: Field, right: Field) extends Scalar {
 
       loops(0) += new AssignStatement(result, (result : Expression[FloatType]) + 
         leftDense.getBuffer.at(leftIndex: _*) * 
-        rightDense.getBuffer.at(rightIndex: _*))
+        rightDense.getBuffer.at(rightIndex: _*) *
+        (OnetepTypes.CellInfo.public % OnetepTypes.CellInfo.weight))
 
       leftDense.teardown(context)
       rightDense.teardown(context)
index 455db5cddcc62817d7b68c852646952c562c05a2..fd990b5959f0e350d7ed05de1f22df89cb5ff0d4 100644 (file)
@@ -48,6 +48,7 @@ object OnetepTypes {
     val numPPDs = {for (dim <- 1 to 3) yield new FieldSymbol[IntType]("n_ppds_a"+dim)}.toSeq
     val pointsInPPD = new FieldSymbol[IntType]("n_pts")
     val latticeReciprocal = for(dim <- 1 to 3) yield new FieldSymbol[StructType]("b"+dim, Point)
+    val weight = new FieldSymbol[FloatType]("weight")
     def getFortranAttributes = Set("type(CELL_INFO)")
   }