From 8a4f4452ab831541437c31577dbd15ca0ad2ccd7 Mon Sep 17 00:00:00 2001 From: Francis Russell Date: Sat, 19 May 2012 18:18:34 +0100 Subject: [PATCH] Use reciprocal from FFT-box instead of cell in Laplacian. --- src/ofc/generators/onetep/Laplacian.scala | 2 +- src/ofc/generators/onetep/OnetepTypes.scala | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ofc/generators/onetep/Laplacian.scala b/src/ofc/generators/onetep/Laplacian.scala index ff3ef49..e70a165 100644 --- a/src/ofc/generators/onetep/Laplacian.scala +++ b/src/ofc/generators/onetep/Laplacian.scala @@ -34,7 +34,7 @@ class Laplacian(op: Field) extends Field { for(dim <- 0 to 2) { var component : Expression[FloatType] = new FloatLiteral(0.0) for(vec <- 0 to 2) { - val vector = OnetepTypes.CellInfo.public % OnetepTypes.CellInfo.latticeReciprocal(vec) + val vector = OnetepTypes.FFTBoxInfo.public % OnetepTypes.FFTBoxInfo.latticeReciprocal(vec) component = component + vector % OnetepTypes.Point.coord(dim) * new Conversion[IntType, FloatType](indices(vec) - 1) } loops(0) += new AssignStatement(reciprocalVector(dim), component) diff --git a/src/ofc/generators/onetep/OnetepTypes.scala b/src/ofc/generators/onetep/OnetepTypes.scala index fd990b5..dc965da 100644 --- a/src/ofc/generators/onetep/OnetepTypes.scala +++ b/src/ofc/generators/onetep/OnetepTypes.scala @@ -62,6 +62,7 @@ object OnetepTypes { object FFTBoxInfo extends StructType { val public = new NamedUnboundVarSymbol[StructType]("pub_fftbox", FFTBoxInfo) + val latticeReciprocal = for(dim <- 1 to 3) yield new FieldSymbol[StructType]("b"+dim, Point) val totalPts = {for (dim <- 1 to 3) yield new FieldSymbol[IntType]("total_pt"+dim)}.toSeq def getFortranAttributes = Set("type(FFTBOX_INFO)") } -- 2.47.3