SETDRK Integrator
The implementation of SETDRK method is modified from exponax
StableETDRK¤
torchfsm.integrator._stable_etdrk.SETDRKIntegrator
¤
Bases: Enum
Stable ETDRK Integrator Provides a unified interface for all ETDRK methods.
Source code in torchfsm/integrator/_stable_etdrk/__init__.py
96 97 98 99 100 101 102 103 104 105 |
|
Wrappers¤
torchfsm.integrator._stable_etdrk.SETDRK1Wrapper
¤
Source code in torchfsm/integrator/_stable_etdrk/__init__.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
__call__
¤
__call__(
dt: float,
linear_coef: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
n_integration_points: int = 16,
integration_radius: float = 1.0,
cpu_cached: bool = False,
)
Source code in torchfsm/integrator/_stable_etdrk/__init__.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
torchfsm.integrator._stable_etdrk.SETDRK2Wrapper
¤
Source code in torchfsm/integrator/_stable_etdrk/__init__.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
__call__
¤
__call__(
dt: float,
linear_coef: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
n_integration_points: int = 16,
integration_radius: float = 1.0,
cpu_cached: bool = False,
)
Source code in torchfsm/integrator/_stable_etdrk/__init__.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
torchfsm.integrator._stable_etdrk.SETDRK3Wrapper
¤
Source code in torchfsm/integrator/_stable_etdrk/__init__.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
__call__
¤
__call__(
dt: float,
linear_coef: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
n_integration_points: int = 16,
integration_radius: float = 1.0,
cpu_cached: bool = False,
)
Source code in torchfsm/integrator/_stable_etdrk/__init__.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
torchfsm.integrator._stable_etdrk.SETDRK4Wrapper
¤
Source code in torchfsm/integrator/_stable_etdrk/__init__.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
__call__
¤
__call__(
dt: float,
linear_coef: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
n_integration_points: int = 16,
integration_radius: float = 1.0,
cpu_cached: bool = False,
)
Source code in torchfsm/integrator/_stable_etdrk/__init__.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
Integration steps¤
torchfsm.integrator._stable_etdrk._setdrk_step.setdrk1_step
¤
setdrk1_step(
u_hat: Tensor,
exp_term: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
coef_1: Tensor,
)
Source code in torchfsm/integrator/_stable_etdrk/_setdrk_step.py
5 6 7 8 9 10 11 |
|
torchfsm.integrator._stable_etdrk._setdrk_step.setdrk2_step
¤
setdrk2_step(
u_hat: Tensor,
exp_term: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
coef_1: Tensor,
coef_2: Tensor,
)
Source code in torchfsm/integrator/_stable_etdrk/_setdrk_step.py
14 15 16 17 18 19 20 21 22 23 24 25 |
|
torchfsm.integrator._stable_etdrk._setdrk_step.setdrk3_step
¤
setdrk3_step(
u_hat: Tensor,
exp_term: Tensor,
half_exp_term: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
coef_1: Tensor,
coef_2: Tensor,
coef_3: Tensor,
coef_4: Tensor,
coef_5: Tensor,
)
Source code in torchfsm/integrator/_stable_etdrk/_setdrk_step.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
torchfsm.integrator._stable_etdrk._setdrk_step.setdrk4_step
¤
setdrk4_step(
u_hat: Tensor,
exp_term: Tensor,
half_exp_term: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
coef_1: Tensor,
coef_2: Tensor,
coef_3: Tensor,
coef_4: Tensor,
coef_5: Tensor,
coef_6: Tensor,
)
Source code in torchfsm/integrator/_stable_etdrk/_setdrk_step.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
Cached SETDRK¤
torchfsm.integrator._stable_etdrk._cached._CachedSETDRKBase
¤
Bases: ABC
Source code in torchfsm/integrator/_stable_etdrk/_cached.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
__init__
¤
__init__(
dt: float,
linear_coef: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
n_integration_points: int = 16,
integration_radius: float = 1.0,
)
Source code in torchfsm/integrator/_stable_etdrk/_cached.py
11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
step
abstractmethod
¤
step(u_hat)
Advance the state in Fourier space.
Source code in torchfsm/integrator/_stable_etdrk/_cached.py
34 35 36 37 38 39 40 41 42 |
|
torchfsm.integrator._stable_etdrk._cached.CachedSETDRK1
¤
Bases: _CachedSETDRKBase
First-order CachedSETDRK method.
Source code in torchfsm/integrator/_stable_etdrk/_cached.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
__init__
¤
__init__(
dt: float,
linear_coef: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
n_integration_points: int = 16,
integration_radius: float = 1.0,
)
Source code in torchfsm/integrator/_stable_etdrk/_cached.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
step
¤
step(u_hat)
Source code in torchfsm/integrator/_stable_etdrk/_cached.py
66 67 68 69 70 71 72 73 74 75 |
|
torchfsm.integrator._stable_etdrk._cached.CachedSETDRK2
¤
Bases: _CachedSETDRKBase
Second-order CachedSETDRK method.
Source code in torchfsm/integrator/_stable_etdrk/_cached.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
|
__init__
¤
__init__(
dt: float,
linear_coef: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
n_integration_points: int = 16,
integration_radius: float = 1.0,
)
Source code in torchfsm/integrator/_stable_etdrk/_cached.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
step
¤
step(u_hat)
Source code in torchfsm/integrator/_stable_etdrk/_cached.py
102 103 104 105 106 107 108 109 110 111 112 |
|
torchfsm.integrator._stable_etdrk._cached.CachedSETDRK3
¤
Bases: _CachedSETDRKBase
Third-order CachedSETDRK method.
Source code in torchfsm/integrator/_stable_etdrk/_cached.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
|
__init__
¤
__init__(
dt: float,
linear_coef: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
n_integration_points: int = 16,
integration_radius: float = 1.0,
)
Source code in torchfsm/integrator/_stable_etdrk/_cached.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
step
¤
step(u_hat)
Source code in torchfsm/integrator/_stable_etdrk/_cached.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
|
torchfsm.integrator._stable_etdrk._cached.CachedSETDRK4
¤
Bases: _CachedSETDRKBase
Fourth-order CachedSETDRK method.
Source code in torchfsm/integrator/_stable_etdrk/_cached.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
|
__init__
¤
__init__(
dt: float,
linear_coef: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
n_integration_points: int = 16,
integration_radius: float = 1.0,
)
Source code in torchfsm/integrator/_stable_etdrk/_cached.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
step
¤
step(u_hat)
Source code in torchfsm/integrator/_stable_etdrk/_cached.py
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
|
Uncached SETDRK¤
torchfsm.integrator._stable_etdrk._uncached._UnCachedSETDRKBase
¤
Bases: ABC
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
__init__
¤
__init__(
dt: float,
linear_coef: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
n_integration_points: int = 16,
integration_radius: float = 1.0,
)
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
step
abstractmethod
¤
step(u_hat)
Advance the state in Fourier space.
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
45 46 47 48 49 50 51 52 |
|
torchfsm.integrator._stable_etdrk._uncached.UnCachedSETDRK1
¤
Bases: _UnCachedSETDRKBase
First-order UnCachedSETDRK method.
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
__init__
¤
__init__(
dt: float,
linear_coef: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
n_integration_points: int = 16,
integration_radius: float = 1.0,
)
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
60 61 62 63 64 65 66 67 68 69 70 71 72 |
|
step
¤
step(u_hat)
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
74 75 76 77 78 79 80 81 82 83 |
|
torchfsm.integrator._stable_etdrk._uncached.UnCachedSETDRK2
¤
Bases: _UnCachedSETDRKBase
Second-order UnCachedSETDRK method.
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
__init__
¤
__init__(
dt: float,
linear_coef: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
n_integration_points: int = 16,
integration_radius: float = 1.0,
)
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
step
¤
step(u_hat)
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
106 107 108 109 110 111 112 113 114 115 116 |
|
torchfsm.integrator._stable_etdrk._uncached.UnCachedSETDRK3
¤
Bases: _UnCachedSETDRKBase
Third-order UnCachedSETDRK method.
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
__init__
¤
__init__(
dt: float,
linear_coef: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
n_integration_points: int = 16,
integration_radius: float = 1.0,
)
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
step
¤
step(u_hat)
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
torchfsm.integrator._stable_etdrk._uncached.UnCachedSETDRK4
¤
Bases: _UnCachedSETDRKBase
Fourth-order UnCachedSETDRK method.
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
|
__init__
¤
__init__(
dt: float,
linear_coef: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
n_integration_points: int = 16,
integration_radius: float = 1.0,
)
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
|
step
¤
step(u_hat)
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
|
torchfsm.integrator._stable_etdrk._uncached.UnCachedSETDRK4
¤
Bases: _UnCachedSETDRKBase
Fourth-order UnCachedSETDRK method.
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
|
__init__
¤
__init__(
dt: float,
linear_coef: Tensor,
nonlinear_func: Callable[[Tensor], Tensor],
n_integration_points: int = 16,
integration_radius: float = 1.0,
)
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
|
step
¤
step(u_hat)
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
|
torchfsm.integrator._stable_etdrk._uncached.roots_of_unity
¤
roots_of_unity(
M: int, device=None, dtype=None
) -> torch.Tensor
Return (complex-valued) array with M roots of unity.
Source code in torchfsm/integrator/_stable_etdrk/_uncached.py
8 9 10 11 12 13 14 15 |
|