Skip to content

Commit f3ffef0

Browse files
authored
Merge pull request #7 from vtopt/develop
Develop
2 parents 7b985e8 + bd2881c commit f3ffef0

File tree

20 files changed

+2036
-207
lines changed

20 files changed

+2036
-207
lines changed

README.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,34 @@ Delaunay triangulation. In addition to the original Fortran source code,
77
this repository contains a wrapper for Python 3.6+ and C bindings.
88
Command line drivers are also provided with the original Fortran code.
99

10-
## Organization and Usage
10+
## Usage
1111

12-
The physical organization is as follows. Note that each of the following
13-
directories could be independently downloaded.
12+
`DELAUNAYSPARSE` contains several modes of operation.
13+
14+
In the original ACM TOMS release, two Fortran driver subroutines were provided:
15+
* `DELAUNAYSPARSES` runs the serial driver to identify the vertices
16+
of the simplex/simplices containing one or more interpolation points.
17+
Can also (optionally) be set to compute and return the value of the
18+
Delaunay interpolant.
19+
* `DELAUNAYSPARSEP` runs the parallel driver to identify the vertices
20+
of the simplex/simplices containing one or more interpolation points.
21+
Can also (optionally) be set to compute and return the value of the
22+
Delaunay interpolant (must set the `OMP_NUM_THREADS` environment
23+
variable).
24+
25+
Additionally, two command-line drivers are provided, which read input
26+
from files:
27+
* `delsparses` (uses the serial driver), and
28+
* `delsparsep` (uses the parallel driver).
29+
30+
In this repository, two additional interfaces are provided for calling
31+
from C/C++ (`c_binding`) and Python 3 (`python`).
32+
33+
Further detailed user information is documented in the `USAGE` document.
34+
35+
## Organization
36+
37+
The physical organization is as follows.
1438

1539
* `src` contains the original unmodified Fortran source code, as published
1640
in ACM TOMS Algorithm 1012. This includes 2 command line drivers
@@ -30,6 +54,10 @@ directories could be independently downloaded.
3054
A test file `test_install.c` can be used for usage examples. This
3155
directory's internal README also contains best practices when calling
3256
Fortran from C/C++.
57+
* `docs` contains the html source for generating the DelaunaySparse website.
58+
* `USAGE` provides additional detailed user information.
59+
* DelaunaySparse is shared under the MIT Software License, in the `LICENSE`
60+
file.
3361

3462
## Citation
3563

USAGE.md

Lines changed: 549 additions & 0 deletions
Large diffs are not rendered by default.

c_binding/Makefile

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ FORT = gfortran
22
CC = gcc
33
CFLAGS = -c
44
OPTS = -fopenmp
5+
LIBS = blas.f lapack.f
56
LEGACY = -std=legacy
67

7-
all: test_install.o delsparse_bind_c.o delsparse.o slatec.o lapack.o blas.o
8-
$(FORT) $(OPTS) test_install.o delsparse_bind_c.o delsparse.o slatec.o lapack.o blas.o -o test_install
8+
all: test_install.o delsparse_bind_c.o delsparse.o slatec.o delsparse.h
9+
$(FORT) $(OPTS) test_install.o delsparse_bind_c.o delsparse.o slatec.o $(LIBS) -o test_install
910
./test_install
1011

1112
test_install.o: test_install.c
12-
$(CC) $(CFLAGS) $(OPTS) test_install.c -o test_install.o
13+
$(CC) $(CFLAGS) test_install.c -o test_install.o
1314

1415
delsparse_bind_c.o: delsparse_bind_c.f90 delsparse.o
1516
$(FORT) $(CFLAGS) $(OPTS) delsparse_bind_c.f90 -o delsparse_bind_c.o
@@ -20,11 +21,5 @@ delsparse.o: delsparse.f90
2021
slatec.o : slatec.f
2122
$(FORT) $(CFLAGS) $(OPTS) $(LEGACY) slatec.f -o slatec.o
2223

23-
lapack.o : lapack.f
24-
$(FORT) $(CFLAGS) $(OPTS) lapack.f -o lapack.o
25-
26-
blas.o : blas.f
27-
$(FORT) $(CFLAGS) $(OPTS) blas.f -o blas.o
28-
2924
clean:
3025
rm -f *.o *.mod test_install

c_binding/delsparse.h

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#ifndef DELSPARSEC
2+
#define DELSPARSEC
3+
4+
// serial subroutine: no optional arguments
5+
extern void c_delaunaysparses(int *d, int *n, double pts[], int *m, double q[],
6+
int simps[], double weights[], int ierr[]);
7+
8+
// serial: compute interpolant values
9+
extern void c_delaunaysparses_interp(int *d, int *n, double pts[], int *m,
10+
double q[], int simps[], double weights[],
11+
int ierr[], int *ir, double interp_in[],
12+
double interp_out[]);
13+
14+
// serial: optional arguments, no interpolant values
15+
extern void c_delaunaysparses_opts(int *d, int *n, double pts[], int *m,
16+
double q[],int simps[], double weights[],
17+
int ierr[], double *eps, double *extrap,
18+
double rnorm[], int *ibudget, bool *chain,
19+
bool *exact);
20+
21+
// serial: optional arguments and compute interpolant values
22+
extern void c_delaunaysparses_interp_opts(int *d, int *n, double pts[], int *m,
23+
double q[],int simps[],
24+
double weights[], int ierr[],
25+
int *ir, double interp_in[],
26+
double interp_out[], double *eps,
27+
double *extrap, double rnorm[],
28+
int *ibudget, bool *chain,
29+
bool *exact);
30+
31+
32+
// parallel: no optional arguments
33+
extern void c_delaunaysparsep(int *d, int *n, double pts[], int *m, double q[],
34+
int simps[], double weights[], int ierr[]);
35+
36+
// parallel: compute interpolant values
37+
extern void c_delaunaysparsep_interp(int *d, int *n, double pts[], int *m,
38+
double q[], int simps[], double weights[],
39+
int ierr[], int *ir, double interp_in[],
40+
double interp_out[]);
41+
42+
// parallel: optional arguments, no interpolant values
43+
extern void c_delaunaysparsep_opts(int *d, int *n, double pts[], int *m,
44+
double q[],int simps[], double weights[],
45+
int ierr[], double *eps, double *extrap,
46+
double rnorm[], int *ibudget, bool *chain,
47+
bool *exact, int *pmode);
48+
49+
// parallel: optional arguments and compute interpolant values
50+
extern void c_delaunaysparsep_interp_opts(int *d, int *n, double pts[], int *m,
51+
double q[],int simps[],
52+
double weights[], int ierr[],
53+
int *ir, double interp_in[],
54+
double interp_out[], double *eps,
55+
double *extrap, double rnorm[],
56+
int *ibudget, bool *chain,
57+
bool *exact, int *pmode);
58+
59+
#endif

0 commit comments

Comments
 (0)