Skip to content

Commit c0dbe29

Browse files
authored
Merge pull request #63 from flatironinstitute/stokes-rotlet-doublet
Stokes update
2 parents 3766fef + 2cb4aef commit c0dbe29

25 files changed

+2097
-649
lines changed

docs/fortran-c.rst

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ denote the Stokeslet given by
330330
(x_{3}-y_{3})^2 + \|x-y \|^2
331331
\end{bmatrix} \, ,
332332
333-
and $\mathcal{T}^{\textrm{stok}}(x,y)$ denote the Stresslet whose action on
333+
let $\mathcal{T}^{\textrm{stok}}(x,y)$ denote the Stresslet whose action on
334334
a vector $v$ is given by
335335

336336
.. math::
@@ -343,19 +343,60 @@ a vector $v$ is given by
343343
(x_{2}-y_{2})(x_{3}-y_{3}) \\
344344
(x_{3}-y_{3})(x_{1}-y_{1}) & (x_{3}-y_{3})(x_{2}-y_{2}) &
345345
(x_{3}-y_{3})^2
346-
\end{bmatrix} \, .
346+
\end{bmatrix} \, ,
347+
348+
let $\mathcal{R}^{\textrm{stok}}(x,y)$ denote the Rotlet whose action on
349+
a vector $v$ is given by
350+
351+
.. math::
352+
v\cdot \mathcal{R}^{\textrm{stok}}(x,y) =
353+
\frac{v \cdot (x-y)}{4\pi\|x-y \|^3}
354+
\begin{bmatrix}
355+
1 & 0 & 0 \\
356+
0 & 1 & 0 \\
357+
0 & 0 & 1
358+
\end{bmatrix} \, ,
359+
360+
and $\mathcal{D}^{\textrm{stok}}(x,y)$ denote the symmetric part of Doublet whose action on
361+
a vector $v$ is given by
362+
363+
.. math::
364+
v\cdot \mathcal{D}^{\textrm{stok}}(x,y) =
365+
\frac{3 v \cdot (x-y)}{4\pi\|x-y \|^5}
366+
\begin{bmatrix}
367+
(x_{1}-y_{1})^2 & (x_{1}-y_{1})(x_{2}-y_{2}) &
368+
(x_{1}-y_{1})(x_{3}-y_{3}) \\
369+
(x_{2}-y_{2})(x_{1}-y_{1}) & (x_{2}-y_{2})^2 &
370+
(x_{2}-y_{2})(x_{3}-y_{3}) \\
371+
(x_{3}-y_{3})(x_{1}-y_{1}) & (x_{3}-y_{3})(x_{2}-y_{2}) &
372+
(x_{3}-y_{3})^2
373+
\end{bmatrix} - \\
374+
\frac{1}{4\pi\|x-y \|^3}
375+
\begin{bmatrix}
376+
v_1(x_{1}-y_{1}) & v_2(x_{1}-y_{1}) & v_3(x_{1}-y_{1}) \\
377+
v_2(x_{2}-y_{2}) & v_2(x_{2}-y_{2}) & v_3(x_{2}-y_{2}) \\
378+
v_3(x_{3}-y_{3}) & v_3(x_{3}-y_{3}) & v_3(x_{3}-y_{3})
379+
\end{bmatrix} \, .
347380
348381
The Stokes FMM evaluates the following velocity, its gradient
349382
and the associated pressure
350383

351384
.. math::
352385
353-
u(x) = \sum_{m=1}^{N} \mathcal{G}^{\textrm{stok}}(x,x_{j}) \sigma_{j} + \nu_{j} \cdot \mathcal{T}^{\textrm{stok}}(x,x_{j}) \cdot \mu_{j} \, .
386+
u(x) = \sum_{m=1}^{N} \mathcal{G}^{\textrm{stok}}(x,x_{j}) \sigma_{j} + \nu_{j} \cdot \mathcal{T}^{\textrm{stok}}(x,x_{j}) \cdot \mu_{j} +
387+
\nu^{r}_{j} \cdot \mathcal{R}^{\textrm{stok}}(x,x_{j}) \cdot \mu^{r}_{j} - \mu^{r}_{j} \cdot \mathcal{R}^{\textrm{stok}}(x,x_{j}) \cdot \nu^{r}_{j} + \\
388+
\nu^{d}_{j} \cdot \mathcal{R}^{\textrm{stok}}(x,x_{j}) \cdot \mu^{d}_{j} - \mu^{d}_{j} \cdot \mathcal{R}^{\textrm{stok}}(x,x_{j}) \cdot \nu^{d}_{j} +
389+
\nu^{d}_{j} \cdot \mathcal{D}^{\textrm{stok}}(x,x_{j}) \cdot \mu^{d}_{j} \, .
354390
355391
Here $x_{j}$ are the source locations,
356392
$\sigma_{j}$ are the Stokeslet densities,
357393
$\nu_{j}$ are the stresslet orientation vectors, $\mu_{j}$
358-
are the stresslet densities, and the locations $x$
394+
are the stresslet densities,
395+
$\nu^{r}_{j}$ are the rotlet orientation vectors, $\mu^{r}_{j}$
396+
are the rotlet densities,
397+
$\nu^{d}_{j}$ are the doublet orientation vectors, $\mu^{d}_{j}$
398+
are the doublet densities,
399+
and the locations $x$
359400
at which the velocity and its gradient are evaluated are referred to
360401
as the evaluation points.
361402

@@ -370,7 +411,7 @@ gradients at the evaluation points.
370411

371412
.. code::
372413
373-
subroutine stfmm3d(nd,eps,nsource,source,ifstoklet,stoklet,ifstrslet,strslet,strsvec,ifppreg,pot,pre,grad,ntarg,targ,ifppregtarg,pottarg,pretarg,gradtarg,ier)
414+
subroutine stfmm3d(nd,eps,nsource,source,ifstoklet,stoklet,ifstrslet,strslet,strsvec,ifrotlet,rotlet,rotvec,ifdoublet,doublet,doubvec,ifppreg,pot,pre,grad,ntarg,targ,ifppregtarg,pottarg,pretarg,gradtarg,ier)
374415
375416
Input arguments:
376417

@@ -396,6 +437,22 @@ Input arguments:
396437
Stresslet strengths, $\mu_{j}$
397438
- strsvec: double precision(nd,3,nsource)
398439
Stresslet orientation vectors, $\nu_{j}$
440+
- ifrotlet: integer
441+
Flag for including Rotlet ($\mu^{r}_{j},\nu^{r}_{j}$) term in interaction kernel
442+
Rotlet term will be included if ifrotlet
443+
= 1
444+
- rotlet: double precision(nd,3,nsource)
445+
Rotlet strengths, $\mu^{r}_{j}$
446+
- rotvec: double precision(nd,3,nsource)
447+
Rotlet orientation vectors, $\nu^{r}_{j}$
448+
- ifdoublet: integer
449+
Flag for including Doublet ($\mu^{d}_{j},\nu^{d}_{j}$) term in interaction kernel
450+
Doublet term will be included if ifdoublet
451+
= 1
452+
- doublet: double precision(nd,3,nsource)
453+
Doublet strengths, $\mu^{d}_{j}$
454+
- doubvec: double precision(nd,3,nsource)
455+
Doublet orientation vectors, $\nu^{d}_{j}$
399456
- ifppreg: integer
400457
| Flag for computing velocity, pressure and/or gradients at source locations
401458
| ifppreg = 1, compute velocity

docs/genpdfmanual.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# Barnett 12/6/17
44

55
make latexpdf
6-
mv _build/latex/finufft.pdf ../finufft-manual.pdf
6+
mv _build/latex/fmm3d.pdf ../fmm3d_manual.pdf

docs/julia.rst

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ denote the Stokeslet given by
204204
(x_{3}-y_{3})^2 + \|x-y \|^2
205205
\end{bmatrix} \, ,
206206
207-
and $\mathcal{T}^{\textrm{stok}}(x,y)$ denote the Stresslet whose action on
207+
let $\mathcal{T}^{\textrm{stok}}(x,y)$ denote the Stresslet whose action on
208208
a vector $v$ is given by
209209

210210
.. math::
@@ -217,27 +217,69 @@ a vector $v$ is given by
217217
(x_{2}-y_{2})(x_{3}-y_{3}) \\
218218
(x_{3}-y_{3})(x_{1}-y_{1}) & (x_{3}-y_{3})(x_{2}-y_{2}) &
219219
(x_{3}-y_{3})^2
220-
\end{bmatrix} \, .
220+
\end{bmatrix} \, ,
221+
222+
let $\mathcal{R}^{\textrm{stok}}(x,y)$ denote the Rotlet whose action on
223+
a vector $v$ is given by
224+
225+
.. math::
226+
v\cdot \mathcal{R}^{\textrm{stok}}(x,y) =
227+
\frac{v \cdot (x-y)}{4\pi\|x-y \|^3}
228+
\begin{bmatrix}
229+
1 & 0 & 0 \\
230+
0 & 1 & 0 \\
231+
0 & 0 & 1
232+
\end{bmatrix} \, ,
233+
234+
and $\mathcal{D}^{\textrm{stok}}(x,y)$ denote the symmetric part of Doublet whose action on
235+
a vector $v$ is given by
236+
237+
.. math::
238+
v\cdot \mathcal{D}^{\textrm{stok}}(x,y) =
239+
\frac{3 v \cdot (x-y)}{4\pi\|x-y \|^5}
240+
\begin{bmatrix}
241+
(x_{1}-y_{1})^2 & (x_{1}-y_{1})(x_{2}-y_{2}) &
242+
(x_{1}-y_{1})(x_{3}-y_{3}) \\
243+
(x_{2}-y_{2})(x_{1}-y_{1}) & (x_{2}-y_{2})^2 &
244+
(x_{2}-y_{2})(x_{3}-y_{3}) \\
245+
(x_{3}-y_{3})(x_{1}-y_{1}) & (x_{3}-y_{3})(x_{2}-y_{2}) &
246+
(x_{3}-y_{3})^2
247+
\end{bmatrix} - \\
248+
\frac{1}{4\pi\|x-y \|^3}
249+
\begin{bmatrix}
250+
v_1(x_{1}-y_{1}) & v_2(x_{1}-y_{1}) & v_3(x_{1}-y_{1}) \\
251+
v_2(x_{2}-y_{2}) & v_2(x_{2}-y_{2}) & v_3(x_{2}-y_{2}) \\
252+
v_3(x_{3}-y_{3}) & v_3(x_{3}-y_{3}) & v_3(x_{3}-y_{3})
253+
\end{bmatrix} \, .
221254
222255
This subroutine computes the N-body Stokes
223256
interactions, its gradients and the corresponding pressure
224257
in three dimensions given by
225258

226259
.. math::
227260
228-
u(x) = \sum_{m=1}^{N} \mathcal{G}^{\textrm{stok}}(x,x_{j}) \sigma_{j} + \nu_{j} \cdot \mathcal{T}^{\textrm{stok}}(x,x_{j}) \cdot \mu_{j}
261+
u(x) = \sum_{m=1}^{N} \mathcal{G}^{\textrm{stok}}(x,x_{j}) \sigma_{j} + \nu_{j} \cdot \mathcal{T}^{\textrm{stok}}(x,x_{j}) \cdot \mu_{j} +
262+
\nu^{r}_{j} \cdot \mathcal{R}^{\textrm{stok}}(x,x_{j}) \cdot \mu^{r}_{j} - \mu^{r}_{j} \cdot \mathcal{R}^{\textrm{stok}}(x,x_{j}) \cdot \nu^{r}_{j} + \\
263+
\nu^{d}_{j} \cdot \mathcal{R}^{\textrm{stok}}(x,x_{j}) \cdot \mu^{d}_{j} - \mu^{d}_{j} \cdot \mathcal{R}^{\textrm{stok}}(x,x_{j}) \cdot \nu^{d}_{j} +
264+
\nu^{d}_{j} \cdot \mathcal{D}^{\textrm{stok}}(x,x_{j}) \cdot \mu^{d}_{j} \, .
265+
229266
230267
where $\sigma_{j}$ are the Stokeslet densities,
231268
$\nu_{j}$ are the stresslet orientation vectors, $\mu_{j}$
232-
are the stresslet densities, and
269+
are the stresslet densities,
270+
$\nu^{r}_{j}$ are the rotlet orientation vectors, $\mu^{r}_{j}$
271+
are the rotlet densities,
272+
$\nu^{d}_{j}$ are the doublet orientation vectors, $\mu^{d}_{j}$
273+
are the doublet densities, and
233274
$x_{j}$ are the source locations.
234275
When $x=x_{j}$, the term corresponding to $x_{j}$ is dropped
235276
from the sum.
236277

237278
.. code:: julia
238279
239280
vals = stfmm3d(eps,sources;stoklet=nothing,strslet=nothing,
240-
strsvec=nothing,targets=nothing,ppreg=0,
281+
strsvec=nothing,rotlet=nothing,rotvec=nothing,
282+
doublet=nothing,doubvec=nothing,targets=nothing,ppreg=0,
241283
ppregt=0,nd=1)
242284
243285
Wrapper for fast multipole implementation for Stokes N-body
@@ -255,6 +297,14 @@ Args:
255297
stresslet strengths ($mu_{j}$ above)
256298
- strsvec: float(nd,3,n) or float(3,n)
257299
stresslet orientations ($nu_{j}$ above)
300+
- rotlet: float(nd,3,n) or float(3,n)
301+
rotlet strengths ($mu^{r}_{j}$ above)
302+
- rotvec: float(nd,3,n) or float(3,n)
303+
rotlet orientations ($nu^{r}_{j}$ above)
304+
- doublet: float(nd,3,n) or float(3,n)
305+
doublet strengths ($mu^{d}_{j}$ above)
306+
- doubvec: float(nd,3,n) or float(3,n)
307+
doublet orientations ($nu^{d}_{j}$ above)
258308
- targets: float(3,nt)
259309
target locations (x)
260310
- ifppreg: integer
@@ -286,7 +336,8 @@ target locations.
286336
.. code:: julia
287337
288338
vals = st3ddir(sources,targets;stoklet=nothing,strslet=nothing,
289-
strsvec=nothing,ppregt=0,nd=1,thresh=1e-16)
339+
strsvec=nothing,rotlet=nothing,rotvec=nothing,
340+
doublet=nothing,doubvec=nothing,ppregt=0,nd=1,thresh=1e-16)
290341
291342
------------------------------------------------------------------
292343

docs/matlab.rst

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ denote the Stokeslet given by
205205
(x_{3}-y_{3})^2 + \|x-y \|^2
206206
\end{bmatrix} \, ,
207207
208-
and $\mathcal{T}^{\textrm{stok}}(x,y)$ denote the Stresslet whose action on
208+
let $\mathcal{T}^{\textrm{stok}}(x,y)$ denote the Stresslet whose action on
209209
a vector $v$ is given by
210210

211211
.. math::
@@ -218,19 +218,59 @@ a vector $v$ is given by
218218
(x_{2}-y_{2})(x_{3}-y_{3}) \\
219219
(x_{3}-y_{3})(x_{1}-y_{1}) & (x_{3}-y_{3})(x_{2}-y_{2}) &
220220
(x_{3}-y_{3})^2
221-
\end{bmatrix} \, .
221+
\end{bmatrix} \, ,
222+
223+
let $\mathcal{R}^{\textrm{stok}}(x,y)$ denote the Rotlet whose action on
224+
a vector $v$ is given by
225+
226+
.. math::
227+
v\cdot \mathcal{R}^{\textrm{stok}}(x,y) =
228+
\frac{v \cdot (x-y)}{4\pi\|x-y \|^3}
229+
\begin{bmatrix}
230+
1 & 0 & 0 \\
231+
0 & 1 & 0 \\
232+
0 & 0 & 1
233+
\end{bmatrix} \, ,
234+
235+
and $\mathcal{D}^{\textrm{stok}}(x,y)$ denote the symmetric part of Doublet whose action on
236+
a vector $v$ is given by
237+
238+
.. math::
239+
v\cdot \mathcal{D}^{\textrm{stok}}(x,y) =
240+
\frac{3 v \cdot (x-y)}{4\pi\|x-y \|^5}
241+
\begin{bmatrix}
242+
(x_{1}-y_{1})^2 & (x_{1}-y_{1})(x_{2}-y_{2}) &
243+
(x_{1}-y_{1})(x_{3}-y_{3}) \\
244+
(x_{2}-y_{2})(x_{1}-y_{1}) & (x_{2}-y_{2})^2 &
245+
(x_{2}-y_{2})(x_{3}-y_{3}) \\
246+
(x_{3}-y_{3})(x_{1}-y_{1}) & (x_{3}-y_{3})(x_{2}-y_{2}) &
247+
(x_{3}-y_{3})^2
248+
\end{bmatrix} - \\
249+
\frac{1}{4\pi\|x-y \|^3}
250+
\begin{bmatrix}
251+
v_1(x_{1}-y_{1}) & v_2(x_{1}-y_{1}) & v_3(x_{1}-y_{1}) \\
252+
v_2(x_{2}-y_{2}) & v_2(x_{2}-y_{2}) & v_3(x_{2}-y_{2}) \\
253+
v_3(x_{3}-y_{3}) & v_3(x_{3}-y_{3}) & v_3(x_{3}-y_{3})
254+
\end{bmatrix} \, .
222255
223256
This subroutine computes the N-body Stokes
224-
interactions, its gradients and the corresponding pressure
225-
in three dimensions given by
226-
257+
interactions, its gradients and the corresponding pressure
258+
in three dimensions given by
259+
227260
.. math::
228261
229-
u(x) = \sum_{m=1}^{N} \mathcal{G}^{\textrm{stok}}(x,x_{j}) \sigma_{j} + \nu_{j} \cdot \mathcal{T}^{\textrm{stok}}(x,x_{j}) \cdot \mu_{j}
262+
u(x) = \sum_{m=1}^{N} \mathcal{G}^{\textrm{stok}}(x,x_{j}) \sigma_{j} + \nu_{j} \cdot \mathcal{T}^{\textrm{stok}}(x,x_{j}) \cdot \mu_{j} +
263+
\nu^{r}_{j} \cdot \mathcal{R}^{\textrm{stok}}(x,x_{j}) \cdot \mu^{r}_{j} - \mu^{r}_{j} \cdot \mathcal{R}^{\textrm{stok}}(x,x_{j}) \cdot \nu^{r}_{j} + \\
264+
\nu^{d}_{j} \cdot \mathcal{R}^{\textrm{stok}}(x,x_{j}) \cdot \mu^{d}_{j} - \mu^{d}_{j} \cdot \mathcal{R}^{\textrm{stok}}(x,x_{j}) \cdot \nu^{d}_{j} +
265+
\nu^{d}_{j} \cdot \mathcal{D}^{\textrm{stok}}(x,x_{j}) \cdot \mu^{d}_{j} \, .
230266
231267
where $\sigma_{j}$ are the Stokeslet densities,
232268
$\nu_{j}$ are the stresslet orientation vectors, $\mu_{j}$
233-
are the stresslet densities, and
269+
are the stresslet densities,
270+
$\nu^{r}_{j}$ are the rotlet orientation vectors, $\mu^{r}_{j}$
271+
are the rotlet densities,
272+
$\nu^{d}_{j}$ are the doublet orientation vectors, $\mu^{d}_{j}$
273+
are the doublet densities, and
234274
$x_{j}$ are the source locations.
235275
When $x=x_{j}$, the term corresponding to $x_{j}$ is dropped
236276
from the sum.
@@ -263,6 +303,19 @@ Args:
263303
* srcinfo.strsvec: double(nd,3,n)
264304
Stresslet orientiation vectors, $\nu_{j}$ (optional
265305
default - term corresponding to stresslet dropped)
306+
* srcinfo.rotlet: double(nd,3,n)
307+
Rotlet densities, $\mu^{r}_{j}$ (optional
308+
default - term corresponding to rotlet dropped)
309+
* srcinfo.rotvec: double(nd,3,n)
310+
Rotlet orientiation vectors, $\nu^{r}_{j}$ (optional
311+
default - term corresponding to rotlet dropped)
312+
* srcinfo.doublet: double(nd,3,n)
313+
Doublet densities, $\mu^{d}_{j}$ (optional
314+
default - term corresponding to doublet dropped)
315+
* srcinfo.doubvec: double(nd,3,n)
316+
Doublet orientiation vectors, $\nu^{d}_{j}$ (optional
317+
default - term corresponding to doublet dropped)
318+
266319

267320
- ifppreg: integer
268321
| source eval flag

0 commit comments

Comments
 (0)