aboutsummaryrefslogtreecommitdiff
path: root/src/GeneralizedPolynomial-Uniform/README
blob: 589fea7e81fb5ad5f137ff8f854d10f4826255e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
$Header$

This directory contains the interpolator registered for
   CCTK_InterpLocalUniform()
under the name
   "generalized polynomial interpolation"

This interpolator is distributed under the GNU GPL; see the file COPYRIGHT
for details.  Note that this means that if you distribute any program
using this interpolator, you must provide source code to the entire
program!



The source code files are as follows:
* startup.c registers the interpolation operator
* InterpLocalUniform.c is the top-level driver: it gets the various
  options from the parameter table, then decodes
	(N_dims, molecule_family, order, smoothing)
  and calls the appropriate subfunction to do the actual interpolation,
  then finally stores some results back in the parameter table.
* [123]d.cube.order*.smooth*.c define the individual interpolation
  subfunctions.  Each of them just #defines a whole bunch of macros,
  then #includes template.c (which has the actual code).
* template.c is the actual interpolation code.  It is written in
  terms of a large number of macros, which should be #defined
  before #including template.c.  There's a long block comment
  "Implementation notes:" at the start of the function, which
  gives an outline of how the function works.  (This is probably
  the best place to start reading if you want to understand this
  interpolator!)  All the actual interpolation is done by
  Maple-generated code fragments in the [123]d.coeffs/directories;
  template.c uses various macros to tell it which fragments to
  #include.
* [123]d.maple are the top-level Maple code files; they call
  various functions in interpolate.maple and util.maple to do
  the actual work.
* interpolate.maple contains the high-level Maple code for
  computing an interpolant and manipulating/printing it in various
  ways
* util.maple contains low-level utility routines



To add a new combination of (N_dims, molecule_family, order, smoothing),
to this interpolator, you need to
* edit the appropriate Maple script (1d.maple, 2d.maple, 3d.maple, etc)
  to generate the coefficients and write the appropriate files
* edit the makefile to create the appropriate directory or directories,
  and if necessary add any new targets
* 'make' as appropriate to create the new coefficients etc
  [note this can be rather computationally intensive -- the current
  set of {1d,2d,3d} coefficients take {4 seconds, 15 seconds, 8 minutes}
  to generate using Maple 7 on a xeon (1.7 GHz Pentium 4)]
* edit InterpLocalUniform.c to add the new case to the decoding
  switch statements
* create an appropriate "script" file which defines the right macros,
  then does a
	#include "template.c"
  to define the actual interpolation function; the best way to create
  the script file is just to copy an existing one
  (eg. 2d.cube.order3.smooth0.c)
* add the appropriate entry to all_prototypes.h to define a prototype
  for the actual interpolation function
* add the new "script" file to the list in make.code.defn



Other makefile targets:
test_molecule_posn
	This makes a standalone test driver for the
	   LocalInterp_molecule_posn()
	function defined in molecule_posn.c