From: Francis Russell Date: Tue, 8 May 2012 16:18:54 +0000 (+0100) Subject: Correctly scale inner product integral. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=d6adf7f3e5afbefe9ec2e731405c42b1d2a4fe09;p=francis%2Fofc.git Correctly scale inner product integral. --- diff --git a/src/ofc/generators/onetep/InnerProduct.scala b/src/ofc/generators/onetep/InnerProduct.scala index a07e812..9d7143b 100644 --- a/src/ofc/generators/onetep/InnerProduct.scala +++ b/src/ofc/generators/onetep/InnerProduct.scala @@ -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) diff --git a/src/ofc/generators/onetep/OnetepTypes.scala b/src/ofc/generators/onetep/OnetepTypes.scala index 455db5c..fd990b5 100644 --- a/src/ofc/generators/onetep/OnetepTypes.scala +++ b/src/ofc/generators/onetep/OnetepTypes.scala @@ -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)") }