Skip to content

Commit 1b6300c

Browse files
committed
updated docs
1 parent 8f151a4 commit 1b6300c

4 files changed

Lines changed: 4 additions & 7 deletions

File tree

docs/snippets/fabdyn-CDRX.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import numpy as np
22
from specfabpy import specfab as sf
3+
34
# L=8 truncation is sufficient in this case, but larger L allows a very strong fabric to
45
# develop and minimizes the effect that regularization has on low wavenumber modes (l=2,4)
56
lm, nlm_len = sf.init(8)
@@ -15,12 +16,10 @@
1516
nlm[0,:] = sf.nlm_ideal([0,0,1], 0, L) # normalized single maximum at t=0
1617

1718
### Euler integration
18-
# See Lagrangian parcel demo for more advanced (RK4) integration
1919

2020
for tt in np.arange(1,Nt):
2121

2222
nlm_prev = nlm[tt-1,:] # previous solution
2323
Lambda = 1 # CDRX rate factor magnitude
2424
M = Lambda*sf.M_CDRX(nlm) # CDRX operator
2525
nlm[tt,:] = nlm_prev + dt*np.matmul(M, nlm_prev) # Euler step
26-
nlm[tt,:] = sf.apply_bounds(nlm[tt,:]) # apply spectral bounds if needed

docs/snippets/fabdyn-DDRX.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import numpy as np
22
from specfabpy import specfab as sf
3+
34
# L=8 truncation is sufficient in this case, but larger L allows a very strong fabric to
45
# develop and minimizes the effect that regularization has on low wavenumber modes (l=2,4)
56
lm, nlm_len = sf.init(8)
@@ -19,12 +20,10 @@
1920
nlm[0,0] = 1/np.sqrt(4*np.pi) # normalized isotropic state at t=0
2021

2122
### Euler integration
22-
# See Lagrangian parcel demo for more advanced (RK4) integration
2323

2424
for tt in np.arange(1,Nt):
2525

2626
nlm_prev = nlm[tt-1,:] # previous solution
2727
Gamma0 = 10 # DDRX rate factor magnitude
2828
M = Gamma0 * sf.M_DDRX(nlm_prev, S) # DDRX operator
2929
nlm[tt,:] = nlm_prev + dt*np.matmul(M, nlm_prev) # Euler step
30-
nlm[tt,:] = sf.apply_bounds(nlm[tt,:]) # apply spectral bounds if needed

docs/snippets/fabdyn-LROT.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import numpy as np
22
from specfabpy import specfab as sf
3+
34
# L=8 truncation is sufficient in this case, but larger L allows a very strong fabric to
45
# develop and minimizes the effect that regularization has on low wavenumber modes (l=2,4)
56
lm, nlm_len = sf.init(8)
@@ -21,7 +22,6 @@
2122
nlm[0,0] = 1/np.sqrt(4*np.pi) # normalized isotropic state at t=0
2223

2324
### Euler integration
24-
# See Lagrangian parcel demo for more advanced (RK4) integration
2525

2626
for tt in np.arange(1,Nt):
2727

@@ -30,5 +30,4 @@
3030
M_LROT = sf.M_LROT(nlm_prev, D, W, iota, zeta) # lattice rotation operator
3131
M_REG = sf.M_REG(nlm_prev, D) # regularization operator
3232
M = M_LROT + M_REG
33-
nlm[tt,:] = nlm_prev + dt*np.matmul(M, nlm_prev) # euler step
34-
nlm[tt,:] = sf.apply_bounds(nlm[tt,:]) # apply spectral bounds if needed
33+
nlm[tt,:] = nlm_prev + dt*np.matmul(M, nlm_prev) # Euler step
-3.06 KB
Loading

0 commit comments

Comments
 (0)