-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #213 from stoiver/anuga_py3
Anuga py3 CI installs
- Loading branch information
Showing
12 changed files
with
923 additions
and
2,117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
anuga/abstract_2d_finite_volumes/neighbour_table_interface.pyx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# cython: boundscheck=False | ||
# cython: wraparound=False | ||
import cython | ||
|
||
# import both numpy and the Cython declarations for numpy | ||
import numpy as np | ||
cimport numpy as np | ||
|
||
ctypedef long keyint | ||
|
||
# declare the interface to the C code | ||
cdef extern from "neighbour_table_ext.cpp": | ||
int _build_neighbour_structure(keyint N, keyint M, long* triangles, long* neighbours, long* neighbour_edges, long* number_of_boundaries) | ||
|
||
def build_neighbour_structure(keyint N,\ | ||
np.ndarray[long, ndim=2, mode="c"] triangles not None,\ | ||
np.ndarray[long, ndim=2, mode="c"] neighbours not None,\ | ||
np.ndarray[long, ndim=2, mode="c"] neighbour_edges not None,\ | ||
np.ndarray[long, ndim=1, mode="c"] number_of_boundaries not None): | ||
|
||
cdef keyint M | ||
cdef int err | ||
|
||
M = triangles.shape[0] | ||
|
||
err = _build_neighbour_structure(N, M, &triangles[0,0], &neighbours[0,0], &neighbour_edges[0,0], &number_of_boundaries[0]) | ||
|
||
assert err == 0, "Duplicate Edge" | ||
|
||
|
||
|
Oops, something went wrong.