diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2001-11-02 16:21:06 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2001-11-02 16:21:06 +0000 |
commit | 22c73283d0622007ea4b424725eafeeec5aa73b8 (patch) | |
tree | be5a805ac3cbbec3fcc8cbec38a1d1652ac82748 /lib/sbin/GridFuncStuff.pl | |
parent | 464ff2f4fc98557473ef26c91a0e4fc787e07e16 (diff) |
Allow the length of a vector array can to be an arithmetical combination of
parameters.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@2445 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/GridFuncStuff.pl')
-rw-r--r-- | lib/sbin/GridFuncStuff.pl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/sbin/GridFuncStuff.pl b/lib/sbin/GridFuncStuff.pl index 218d1ec0..76d61b1d 100644 --- a/lib/sbin/GridFuncStuff.pl +++ b/lib/sbin/GridFuncStuff.pl @@ -1240,8 +1240,12 @@ sub CreateThornGroupInitialisers . " \"" . $rhinterface_db->{"\U$thorn GROUP $group\E SIZE"} . "\",\n" . " \"" . $rhinterface_db->{"\U$thorn GROUP $group\E GHOSTSIZE"} . "\",\n"; + # Is it a vector group ? if(defined($rhinterface_db->{"\U$thorn GROUP $group\E VARARRAY_SIZE"})) { + # Check that the size is allowed. + &CheckArraySizes($rhinterface_db->{"\U$thorn GROUP $group\E VARARRAY_SIZE"},$thorn,$rhparameter_db,$rhinterface_db); + # Flag Cactus that it is a vector group. $line .= " -1"; } else @@ -1254,7 +1258,7 @@ sub CreateThornGroupInitialisers $line .= ",\n \"$variable\""; } - # Pass in the size of the GV array, which may be an integer or a parameter + # Pass in the size of the GV array, which may be a valid parameter expression if(defined($rhinterface_db->{"\U$thorn GROUP $group\E VARARRAY_SIZE"})) { $line .= ",\n \"" . $rhinterface_db->{"\U$thorn GROUP $group\E VARARRAY_SIZE"} . "\""; @@ -1401,9 +1405,9 @@ sub VerifyParameterExpression { my($expression,$thornname,$rhparameter_db) = @_; my($i,$count,@fields); - + # First do some global checks - if($expression !~ m%[-+*/a-zA-Z0-9_()]%) + if($expression !~ m%^[-+*/a-zA-Z0-9_()]+$%) { &CST_error(0, "Array size in $thornname is an invalid arithmatic expression \n" . " '$expression' contains invalid characters"); |