]> git.unchartedbackwaters.co.uk Git - francis/ofc.git/commitdiff
Validate degree of spatial derivatives.
authorFrancis Russell <francis@unchartedbackwaters.co.uk>
Wed, 19 Sep 2012 15:32:18 +0000 (16:32 +0100)
committerFrancis Russell <francis@unchartedbackwaters.co.uk>
Wed, 19 Sep 2012 15:32:18 +0000 (16:32 +0100)
src/TopLevel.hs

index 8cd8ea27571ba680c7ab8a19cd6befbce8061a82..9d1e0f594b5e389f0498e0495fb2f0530d7e255f 100644 (file)
@@ -275,7 +275,11 @@ validateExpression ofl (PositionComponent i) = do
   indexExists ofl i
   indexIsType ofl i SpatialIndex
 
-validateExpression ofl (SpatialDerivative e d _) = do
+validateExpression ofl (SpatialDerivative e d n) = do
   validateExpression ofl e
+  isFunction ofl e
   indexExists ofl d
+  if n > 0
+    then validationSuccess
+    else validationFailure $ "Degree of derivative of " ++ show e ++ " must be greater than 0."
   indexIsType ofl d SpatialIndex