diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-04-17 15:04:46 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-04-17 15:04:46 +0000 |
commit | ad783baf35ad861a5c27926c37264350dc30940e (patch) | |
tree | 5ea25335bf3030490b83bb48a5f0b6a12e1c2d92 /src/maple | |
parent | fe6abb59ed03b1daee38da469d1e837748e9a2e9 (diff) |
now do separate Diff() simplifications for ./maple/ and ./gr/,
with only the latter knowing about partial_d_g_dd gridfn defin
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@531 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/maple')
-rw-r--r-- | src/maple/Diff.maple | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/maple/Diff.maple b/src/maple/Diff.maple index 3ffec13..820ac86 100644 --- a/src/maple/Diff.maple +++ b/src/maple/Diff.maple @@ -104,7 +104,8 @@ local var_list, f, g, x, x_car, x_cdr, temp, n, inner_operand, inner_var_list, k, - sorted_var_list; + sorted_var_list, + operand2, var_seq2; var_list := [args[2..nargs]]; @@ -218,23 +219,31 @@ if (type(operand, function) and (op(0, operand) = 'Diff')) ); end if; -# get to here -# ==> no other transformations to make -# ==> canonicalize ordering of variables and return reconstructed Diff() call +# canonicalize ordering of derivatives sorted_var_list := sort_var_list(var_list); -return `Diff/gridfn`(operand, op(sorted_var_list)); +# simplifications based on gridfn properties known here... +temp := `Diff/gridfn`(operand, op(sorted_var_list)); + +# more simplifications based on gridfn properties known in other directories +if ( type(`Diff/gridfn2`, procedure) + and type(temp, function) and (op(0,temp) = 'Diff') ) + then operand2 := op(1,temp); + var_seq2 := op(2..nops(temp), temp); + temp := `Diff/gridfn2`(operand2, var_seq2); +fi; + +return temp; end proc; ################################################################################ # # This function implements further simplification rules for Diff() -# based on gridfn properties. +# based on gridfn properties (or at least those known here). # # It currently knows about the following simplifications: # - Diff(X_ud[u,i], x_xyz[j]) --> X_udd[u,i,j] -# - Diff(g_dd[i,j], x_xyz[k]) --> partial_d_g_dd[k,i,j] # # Anything else is returned unchanged. (To avoid infinite recursion, # such a return is *unevaluated*.) @@ -260,11 +269,6 @@ if ( type(operand, indexed) and (op(0,operand) = 'X_ud') then return X_udd[op(operand), posn]; end if; -if ( type(operand, indexed) and (op(0,operand) = 'g_dd') - and (nops(var_list) = 1) and member(var_list[1],x_xyz_list,'posn') ) - then return partial_d_g_dd[op(operand), posn]; -end if; - # unevaluated return to avoid infinite recursion return 'Diff'(operand, op(var_list)); end proc; |