Skip to content

Commit

Permalink
KrancThorn.m: Move input parameter checking earlier in CreateKrancThorn
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhinder committed Sep 13, 2013
1 parent 5a2501a commit 32d0ab3
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions Tools/CodeGen/KrancThorn.m
Expand Up @@ -93,9 +93,12 @@ Thorn generation (main entry point for non-tensorial thorns)
Read named arguments and apply nontrivial defaults
------------------------------------------------------------------------ *)

InfoMessage[Terse, "Verifying arguments"];
cktCheckNamedArgs[{opts}];

CheckGroups[groupsOrig];
VerifyGroups[groupsOrig];
VerifyString[parentDirectory];
VerifyString[thornName];

c = NewObject[
Code,
Expand All @@ -115,6 +118,10 @@ Thorn generation (main entry point for non-tensorial thorns)
"PartialDerivatives" -> OptionValue[PartialDerivatives],
"Sources" -> {}}];

VerifyString[GetObjectField[c, "Implementation"]];
VerifyGroupNames[GetObjectField[c, "DeclaredGroups"]];
VerifyGroupNames[GetObjectField[c, "ODEGroups"]];

(* ------------------------------------------------------------------------
GenericFD
------------------------------------------------------------------------ *)
Expand Down Expand Up @@ -186,14 +193,6 @@ Thorn generation (main entry point for non-tensorial thorns)
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"]]];

(* ------------------------------------------------------------------------
Expand Down

0 comments on commit 32d0ab3

Please sign in to comment.