aboutsummaryrefslogtreecommitdiff
path: root/src/GeneralizedPolynomial-Uniform/README
blob: 15c6d27940051cdf6c8dcf85ff5cce8ef8261834 (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
$Header$

This directory contains the interpolator registered for
   CCTK_InterpLocalUniform()
under the names
   "Lagrange polynomial interpolation"	# a synonym for the next one...
   "Lagrange polynomial interpolation (tensor product)"
   "Lagrange polynomial interpolation (maximum degree)"
   "Hermite polynomial interpolation"


The source code files are as follows:
* startup.c registers the interpolation operators
* InterpLocalUniform.h is an overall header file for the whole interpolator
* 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.h defines a prototype for the function defined by template.c
* 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.
* molecule_posn.c contains the  LocalInterp_molecule_posn()  function
  to compute where in the grid each (an) interpolation molecule should
  be centered for each (a given) interpolation point.
* util.c contains some low-level utility routines
* [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
* makefile is a makefile for...
* test_molecule_posn.c is a standalone test driver for the code
  in  molecule_posn.c .  By default it runs a large set of (around 100)
  test cases stored in a table in the code.

The subdirectories are as follows:
* Lagrange/ and [123]d.coeffs/ are empty directory trees left-over
  from previous versions of this interpolator (CVS doesn't have any
  easy way to remove directories)
* Lagrange-tensor-product/ contains the code for the Lagrange polynomial
  interpolator using tensor-product bases for multiple dimensions.
* Lagrange-maximum-degree/ contains the code for the Lagrange polynomial
  interpolator using maximum-degree bases for multiple dimensions.
* Hermite/ contains the code for the Hermite polynomial interpolator.
* common/ contains low-level code common to both the Lagrange and
  the Hermite interpolators.


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 -- for example,
  the set of {1d,2d,3d} Lagrange-tensor-product coefficients take about
  {4 seconds, 40 seconds, 20 minutes} to generate using Maple 7 on
  an AEI xeon (1.7 GHz Pentium 4 with 1GB memory)]
* 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



Copyright
=========

This interpolator is copyright (C) 2001-2003
by Jonathan Thornburg <jthorn@aei.mpg.de>.

This interpolator is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This interpolator is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this thorn (see the file COPYING in this directory);
if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA  02111-1307  USA