Skip to content

Commit

Permalink
updated docs and website
Browse files Browse the repository at this point in the history
  • Loading branch information
thchang committed May 31, 2022
1 parent ad3442a commit bd2881c
Show file tree
Hide file tree
Showing 38 changed files with 50,360 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ The physical organization is as follows.
A test file `test_install.c` can be used for usage examples. This
directory's internal README also contains best practices when calling
Fortran from C/C++.
* `docs` contains the html source for generating the DelaunaySparse website.
* `USAGE` provides additional detailed user information.
* DelaunaySparse is shared under the MIT Software License, in the `LICENSE`
file.
Expand Down
2 changes: 1 addition & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Usage Information for using DELAUNAYSPARSE.
# Usage Information for DELAUNAYSPARSE.

DELAUNAYSPARSE solves the multivariate interpolation problem:

Expand Down
22 changes: 22 additions & 0 deletions c_binding/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2020 Tyler H. Chang, Layne T. Watson, Thomas C. H. Lux,
Ali R. Butt, Kirk W. Cameron, and Yili Hong.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
25 changes: 25 additions & 0 deletions c_binding/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FORT = gfortran
CC = gcc
CFLAGS = -c
OPTS = -fopenmp
LIBS = blas.f lapack.f
LEGACY = -std=legacy

all: test_install.o delsparse_bind_c.o delsparse.o slatec.o delsparse.h
$(FORT) $(OPTS) test_install.o delsparse_bind_c.o delsparse.o slatec.o $(LIBS) -o test_install
./test_install

test_install.o: test_install.c
$(CC) $(CFLAGS) test_install.c -o test_install.o

delsparse_bind_c.o: delsparse_bind_c.f90 delsparse.o
$(FORT) $(CFLAGS) $(OPTS) delsparse_bind_c.f90 -o delsparse_bind_c.o

delsparse.o: delsparse.f90
$(FORT) $(CFLAGS) $(OPTS) delsparse.f90 -o delsparse.o

slatec.o : slatec.f
$(FORT) $(CFLAGS) $(OPTS) $(LEGACY) slatec.f -o slatec.o

clean:
rm -f *.o *.mod test_install
42 changes: 42 additions & 0 deletions c_binding/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
C bindings for the DELAUNAYSPARSE Fortran package.


REQUIREMENTS:

A Fortran compiler that supports BIND(C).

USAGE:

Use the C bindings in delsparse_bind_c.f90 to call DELAUNAYSPARSE from
inside a C/C++ program.

Because C does not support optional arguments, there are 4 variations of
DELAUNAYSPARSE{S|P}:
* c_delaunaysparse{s|p} accepts none of the optional arguments;
* c_delaunaysparse{s|p}_interp accepts an integer ir for specifying the
dimension of the response variables, plus the two variables needed
for computing the value of the interpolant, interp_in and interp_out;
* c_delaunaysparse{s|p}_opts accepts all of the optional arguments
EXCEPT interp_in and interp_out;
* c_delaunaysparse{s|p}_interp_opts accepts all of the optional arguments,
plus the response dimension ir, which cannot be inferred as it is by
the Fortran subroutines.

When using the 4 subroutines above, keep in mind the following:
* C passes by copy and Fortran passes by reference. Therefore, any non-array
type variable must be manually passed by address (i.e., by using the `&`
character);
* C matrices are stored in row major ordering, while Fortran stores in
column major ordering. Therefore, your data may need to be transposed
before calling any of the above subroutines;
* In C, a double-indexed array is treated as an array of pointers, whereas
Fortran expects a contiguous chunk of memory. Often, it is better to
allocate a one-dimensional array and manually index it, then pass this
"flat" array to the Fortran subroutine.

Usage examples are provided in the sample file, test_install.c.

CONTRIBUTORS:

Tyler Chang, [email protected]

Loading

0 comments on commit bd2881c

Please sign in to comment.