deriving Show
data ValueType =
+ ScalarT ScalarType |
+ PositionT PositionFieldType |
+ MomentumT MomentumFieldType
+ deriving Show
+
+data ScalarType =
RealType |
ComplexType |
- IntegerType |
+ IntegerType
+ deriving Show
+
+data PositionFieldType =
Psinc Integer |
+ AnalyticPositionType
+ deriving Show
+
+data MomentumFieldType =
PsincReciprocal Integer |
- PositionFunction |
- MomentumFunction
+ AnalyticMomentumType
deriving Show
data PsincE
indexTypes = TopLevel.getIndices ofl name
getTargetValueType :: TM.TargetType -> ValueType
-getTargetValueType (TM.PPDFunctionSet _) = Psinc 1
+getTargetValueType (TM.PPDFunctionSet _) = PositionT $ Psinc 1
getTargetValueType (TM.FortranParameter properties) = case TM.findSpace properties of
- Just (TM.CoarsePsinc _) -> Psinc 1
- Just (TM.FinePsinc _) -> Psinc 2
+ Just (TM.CoarsePsinc _) -> PositionT $ Psinc 1
+ Just (TM.FinePsinc _) -> PositionT $ Psinc 2
Nothing -> case TM.findParamType properties of
Just fortranType -> fortranToValueType fortranType
Nothing -> error $ "Unable to infer type from supplied properties: " ++ show properties
where
- fortranToValueType TM.SPAM3 = RealType
- fortranToValueType TM.Double = RealType
+ fortranToValueType TM.SPAM3 = ScalarT $ RealType
+ fortranToValueType TM.Double = ScalarT $ RealType
fortranToValueType TM.FunctionBasis = error "ONETEP function basis cannot be mapped to value types."
- fortranToValueType TM.Integer = IntegerType
+ fortranToValueType TM.Integer = ScalarT $ IntegerType
fortranToValueType (TM.Array t _) = fortranToValueType t
buildAssignment :: OFL -> OFL2 -> TopLevel.Assignment -> Assignment