You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CUDA and OpenCL-enabled fullspace triangle dislocation elements. Benchmarked at 130 million TDEs per second. Based on the [original MATLAB code from Nikhoo and Walter 2015.](https://volcanodeformation.com/software).
10
+
CUDA and OpenCL-enabled fullspace triangle dislocation elements. Benchmarked at 130 million TDEs per second. Based on the [original MATLAB code from Nikhoo and Walter 2015.](https://volcanodeformation.com/software)
13
11
14
12
See below for usage and installation instructions.
15
13
16
-
### An example
14
+
<!--ts-->
15
+
*[Python + CUDA TDEs from Nikkhoo and Walter 2015](#python--cuda-tdes-from-nikkhoo-and-walter-2015)
16
+
*[Usage documentation](#usage-documentation)
17
+
*[I want stress.](#i-want-stress)
18
+
*[All pairs](#all-pairs)
19
+
*[Installation](#installation)
20
+
*[PyCUDA](#pycuda)
21
+
*[Mac OS X](#mac-os-x)
22
+
*[Ubuntu + PyOpenCL/PoCL](#ubuntu--pyopenclpocl)
23
+
*[Ubuntu + PyOpenCL with system drivers**](#ubuntu--pyopencl-with-system-drivers)
24
+
*[Windows](#windows)
25
+
*[Something else](#something-else)
26
+
*[Why can't I use Apple CPU OpenCL?](#why-cant-i-use-apple-cpu-opencl)
@@ -72,7 +88,7 @@ IMPORTANT: N should be the same for all these arrays. There is exactly one trian
72
88
* The output `disp` is a `(N, 3)` array with displacement components in the x, y, z directions.
73
89
* The output `strain` is a `(N, 6)` array representing a symmetric tensor. `strain[:,0]` is the xx component of strain, 1 is yy, 2 is zz, 3 is xy, 4 is xz, and 5 is yz.
to convert from stress to strain assuming isotropic linear elasticity. `sm` is the shear modulus and `nu` is the Poisson ratio.
84
100
85
-
###All pairs
101
+
## All pairs
86
102
87
103
If, instead, you want to create a matrix representing the interaction between every observation point and every source triangle, there is a different interface:
Note that to use the `strain_to_stress` function, you'll need to reshape the output strain to be `(N_OBS_PTS * N_SRC_TRIS, 6)`.
104
120
105
-
###Installation
121
+
# Installation
106
122
107
123
To install `cutde` itself run:
108
124
```
109
125
pip install cutde
110
126
```
111
127
112
-
Next, make sure you are using `conda-forge` with:
113
-
```
114
-
conda config --prepend channels conda-forge
115
-
```
116
-
117
128
Then, install either PyCUDA or PyOpenCL following the directions below.
118
129
119
-
**PyCUDA** If you have an NVIDIA GPU, install PyCUDA with:
130
+
## PyCUDA
131
+
If you have an NVIDIA GPU, install PyCUDA with:
120
132
```
133
+
conda config --prepend channels conda-forge
121
134
conda install -c conda-forge pycuda
122
135
```
123
136
124
-
**PyOpenCL on Mac OS X** Install PyOpenCL and the PoCL OpenCL driver with:
137
+
## Mac OS X
138
+
Install PyOpenCL and the PoCL OpenCL driver with:
125
139
```
140
+
conda config --prepend channels conda-forge
126
141
conda install pocl pyopencl
127
142
```
128
143
129
-
**PyOpenCL on Ubuntu with PoCL** Just like on a Mac:
144
+
## Ubuntu + PyOpenCL/PoCL
145
+
146
+
Just like on a Mac:
130
147
```
148
+
conda config --prepend channels conda-forge
131
149
conda install pocl pyopencl
132
150
```
133
151
134
-
**PyOpenCL on Ubuntu with system drivers**
152
+
153
+
## Ubuntu + PyOpenCL with system drivers**
135
154
```
136
155
conda install pyopencl ocl-icd ocl-icd-system
137
156
```
138
157
You will need to install the system OpenCL drivers yourself depending on the hardware you have. See the "Something else" section below.
139
158
140
-
**Windows** I'm not aware of anyone testing cutde on Windows yet. It should not be difficult to install. I would expect that you install pyopencl via conda and then install the OpenCL libraries and drivers that are provided by your hardware vendor. See the "Something else" section below.
141
-
```
142
-
conda install pyopencl
143
-
```
159
+
## Windows
160
+
161
+
I'm not aware of anyone testing cutde on Windows yet. It should not be difficult to install. I would expect that you install pyopencl via conda and then install the OpenCL libraries and drivers that are provided by your hardware vendor. See the "Something else" section below.
144
162
145
-
**Something else** I'd suggest starting by trying the instructions for the system most similar to yours above. If that doesn't work, never fear! OpenCL should be installable on almost all recent hardware and typical operating systems. [These directions can be helpful.](https://documen.tician.de/pyopencl/misc.html#installing-from-conda-forge). I am happy to try to help if you have OpenCL installation issues, but I can't promise to be useful.
163
+
## Something else
164
+
I'd suggest starting by trying the instructions for the system most similar to yours above. If that doesn't work, never fear! OpenCL should be installable on almost all recent hardware and typical operating systems. [These directions can be helpful.](https://documen.tician.de/pyopencl/misc.html#installing-from-conda-forge). I am happy to try to help if you have OpenCL installation issues, but I can't promise to be useful.
146
165
147
-
###Why can't I use Apple CPU OpenCL?
166
+
## Why can't I use Apple CPU OpenCL?
148
167
149
168
You might have gotten the message: `cutde does not support the Apple CPU OpenCL implementation and no other platform or device was found. Please consult the cutde README.`
150
169
151
170
The Apple OpenCL implementation for Intel CPUs has very poor support for the OpenCL standard and causes lots of difficult-to-resolve errors. Instead, please use [the PoCL implementation](http://portablecl.org/). You can install it with `conda install -c conda-forge pocl`.
152
171
153
-
###Development
172
+
# Development
154
173
155
174
For developing `cutde`, clone the repo and set up your conda environment based on the `environment.yml` with:
CUDA and OpenCL-enabled fullspace triangle dislocation elements. Benchmarked at 130 million TDEs per second. Based on the [original MATLAB code from Nikhoo and Walter 2015.](https://volcanodeformation.com/software).
11
+
CUDA and OpenCL-enabled fullspace triangle dislocation elements. Benchmarked at 130 million TDEs per second. Based on the [original MATLAB code from Nikhoo and Walter 2015.](https://volcanodeformation.com/software)
13
12
14
13
See below for usage and installation instructions.
15
14
16
-
### An example
15
+
<!--ts-->
16
+
<!--te-->
17
17
18
-
```
18
+
```python
19
19
<%
20
20
withopen('docs/example.py', 'r') as f:
21
21
example_contents = f.read()
22
22
%>
23
-
${example_contents}}
23
+
${example_contents}
24
24
```
25
25
26
26

27
27
28
-
###Usage documentation
28
+
# Usage documentation
29
29
30
30
Usage is really simple:
31
31
@@ -46,7 +46,7 @@ IMPORTANT: N should be the same for all these arrays. There is exactly one trian
46
46
* The output `disp` is a `(N, 3)` array with displacement components in the x, y, z directions.
47
47
* The output `strain` is a `(N, 6)` array representing a symmetric tensor. `strain[:,0]` is the xx component of strain, 1 is yy, 2 is zz, 3 is xy, 4 is xz, and 5 is yz.
to convert from stress to strain assuming isotropic linear elasticity. `sm` is the shear modulus and `nu` is the Poisson ratio.
58
58
59
-
###All pairs
59
+
## All pairs
60
60
61
61
If, instead, you want to create a matrix representing the interaction between every observation point and every source triangle, there is a different interface:
Note that to use the `strain_to_stress` function, you'll need to reshape the output strain to be `(N_OBS_PTS * N_SRC_TRIS, 6)`.
78
78
79
-
###Installation
79
+
# Installation
80
80
81
81
To install `cutde` itself run:
82
82
```
83
83
pip install cutde
84
84
```
85
85
86
-
Next, make sure you are using `conda-forge` with:
87
-
```
88
-
conda config --prepend channels conda-forge
89
-
```
90
-
91
86
Then, install either PyCUDA or PyOpenCL following the directions below.
92
87
93
-
**PyCUDA** If you have an NVIDIA GPU, install PyCUDA with:
88
+
## PyCUDA
89
+
If you have an NVIDIA GPU, install PyCUDA with:
94
90
```
91
+
conda config --prepend channels conda-forge
95
92
conda install -c conda-forge pycuda
96
93
```
97
94
98
-
**PyOpenCL on Mac OS X** Install PyOpenCL and the PoCL OpenCL driver with:
95
+
## Mac OS X
96
+
Install PyOpenCL and the PoCL OpenCL driver with:
99
97
```
98
+
conda config --prepend channels conda-forge
100
99
conda install pocl pyopencl
101
100
```
102
101
103
-
**PyOpenCL on Ubuntu with PoCL** Just like on a Mac:
102
+
## Ubuntu + PyOpenCL/PoCL
103
+
104
+
Just like on a Mac:
104
105
```
106
+
conda config --prepend channels conda-forge
105
107
conda install pocl pyopencl
106
108
```
107
109
108
-
**PyOpenCL on Ubuntu with system drivers**
110
+
111
+
## Ubuntu + PyOpenCL with system drivers**
109
112
```
110
113
conda install pyopencl ocl-icd ocl-icd-system
111
114
```
112
115
You will need to install the system OpenCL drivers yourself depending on the hardware you have. See the "Something else" section below.
113
116
114
-
**Windows** I'm not aware of anyone testing cutde on Windows yet. It should not be difficult to install. I would expect that you install pyopencl via conda and then install the OpenCL libraries and drivers that are provided by your hardware vendor. See the "Something else" section below.
115
-
```
116
-
conda install pyopencl
117
-
```
117
+
## Windows
118
+
119
+
I'm not aware of anyone testing cutde on Windows yet. It should not be difficult to install. I would expect that you install pyopencl via conda and then install the OpenCL libraries and drivers that are provided by your hardware vendor. See the "Something else" section below.
118
120
119
-
**Something else** I'd suggest starting by trying the instructions for the system most similar to yours above. If that doesn't work, never fear! OpenCL should be installable on almost all recent hardware and typical operating systems. [These directions can be helpful.](https://documen.tician.de/pyopencl/misc.html#installing-from-conda-forge). I am happy to try to help if you have OpenCL installation issues, but I can't promise to be useful.
121
+
## Something else
122
+
I'd suggest starting by trying the instructions for the system most similar to yours above. If that doesn't work, never fear! OpenCL should be installable on almost all recent hardware and typical operating systems. [These directions can be helpful.](https://documen.tician.de/pyopencl/misc.html#installing-from-conda-forge). I am happy to try to help if you have OpenCL installation issues, but I can't promise to be useful.
120
123
121
-
###Why can't I use Apple CPU OpenCL?
124
+
## Why can't I use Apple CPU OpenCL?
122
125
123
126
You might have gotten the message: `cutde does not support the Apple CPU OpenCL implementation and no other platform or device was found. Please consult the cutde README.`
124
127
125
128
The Apple OpenCL implementation for Intel CPUs has very poor support for the OpenCL standard and causes lots of difficult-to-resolve errors. Instead, please use [the PoCL implementation](http://portablecl.org/). You can install it with `conda install -c conda-forge pocl`.
126
129
127
-
###Development
130
+
# Development
128
131
129
132
For developing `cutde`, clone the repo and set up your conda environment based on the `environment.yml` with:
0 commit comments