From 32d0ab3bffed254af57e5842eebe8a264bce9421 Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Fri, 13 Sep 2013 18:31:38 +0200 Subject: KrancThorn.m: Move input parameter checking earlier in CreateKrancThorn --- Tools/CodeGen/KrancThorn.m | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Tools/CodeGen/KrancThorn.m b/Tools/CodeGen/KrancThorn.m index 20f8550..5125290 100644 --- a/Tools/CodeGen/KrancThorn.m +++ b/Tools/CodeGen/KrancThorn.m @@ -93,9 +93,12 @@ CreateKrancThorn[groupsOrig_, parentDirectory_, thornName_, opts:OptionsPattern[ Read named arguments and apply nontrivial defaults ------------------------------------------------------------------------ *) + InfoMessage[Terse, "Verifying arguments"]; cktCheckNamedArgs[{opts}]; - CheckGroups[groupsOrig]; + VerifyGroups[groupsOrig]; + VerifyString[parentDirectory]; + VerifyString[thornName]; c = NewObject[ Code, @@ -115,6 +118,10 @@ CreateKrancThorn[groupsOrig_, parentDirectory_, thornName_, opts:OptionsPattern[ "PartialDerivatives" -> OptionValue[PartialDerivatives], "Sources" -> {}}]; + VerifyString[GetObjectField[c, "Implementation"]]; + VerifyGroupNames[GetObjectField[c, "DeclaredGroups"]]; + VerifyGroupNames[GetObjectField[c, "ODEGroups"]]; + (* ------------------------------------------------------------------------ GenericFD ------------------------------------------------------------------------ *) @@ -186,14 +193,6 @@ CreateKrancThorn[groupsOrig_, parentDirectory_, thornName_, opts:OptionsPattern[ Check input parameters ------------------------------------------------------------------------ *) - InfoMessage[Terse, "Verifying arguments"]; - VerifyGroups[GetObjectField[c, "Groups"]]; - VerifyString[parentDirectory]; - VerifyString[GetObjectField[c, "Name"]]; - VerifyString[GetObjectField[c, "Implementation"]]; - VerifyGroupNames[GetObjectField[c, "DeclaredGroups"]]; - VerifyGroupNames[GetObjectField[c, "ODEGroups"]]; - If[OptionValue[UseJacobian], JacobianCheckGroups[GetObjectField[c, "Groups"]]]; (* ------------------------------------------------------------------------ -- cgit v1.2.3