Cores
torchfsm.operator.generic._biharmonic._BiharmonicCore
¤
Bases: LinearCoef
Implementation of the Biharmonic operator.
Source code in torchfsm/operator/generic/_biharmonic.py
8 9 10 11 12 13 14 15 16 |
|
__call__
¤
__call__(
f_mesh: FourierMesh, n_channel: int
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/generic/_biharmonic.py
13 14 15 16 |
|
nonlinear_like
¤
nonlinear_like(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Calculate the result out based on the linear coefficient. It is designed to have same pattern as the nonlinear function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
FourierTensor |
FourierTensor['B C H ...']
|
Nonlinear-like tensor. |
Source code in torchfsm/operator/_base.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
torchfsm.operator.generic._conservative_convection._ConservativeConvectionCore
¤
Bases: NonlinearFunc
Implementation of the Conservative Convection operator.
Source code in torchfsm/operator/generic/_conservative_convection.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
__init__
¤
__init__()
Source code in torchfsm/operator/generic/_conservative_convection.py
14 15 |
|
__call__
¤
__call__(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/generic/_conservative_convection.py
17 18 19 20 21 22 23 24 25 26 27 |
|
spatial_value
¤
spatial_value(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> SpatialTensor["B C H ..."]
Return the result of the nonlinear function in spatial domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
SpatialTensor |
SpatialTensor['B C H ...']
|
Result of the nonlinear function in spatial domain. |
Source code in torchfsm/operator/_base.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
torchfsm.operator.generic._convection._ConvectionCore
¤
Bases: NonlinearFunc
Implementation of the Convection operator.
Source code in torchfsm/operator/generic/_convection.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 43 44 45 46 47 48 |
|
__init__
¤
__init__()
Source code in torchfsm/operator/generic/_convection.py
15 16 |
|
__call__
¤
__call__(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/generic/_convection.py
18 19 20 21 22 23 24 |
|
spatial_value
¤
spatial_value(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> SpatialTensor["B C H ..."]
Return the result of the nonlinear function in spatial domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
SpatialTensor |
SpatialTensor['B C H ...']
|
Result of the nonlinear function in spatial domain. |
Source code in torchfsm/operator/generic/_convection.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
torchfsm.operator.generic._curl._Curl2DCore
¤
Bases: NonlinearFunc
Implementation of the Curl operator for 2D vector fields.
Source code in torchfsm/operator/generic/_curl.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
__init__
¤
__init__()
Source code in torchfsm/operator/generic/_curl.py
15 16 |
|
__call__
¤
__call__(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/generic/_curl.py
18 19 20 21 22 23 24 25 26 27 |
|
spatial_value
¤
spatial_value(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> SpatialTensor["B C H ..."]
Return the result of the nonlinear function in spatial domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
SpatialTensor |
SpatialTensor['B C H ...']
|
Result of the nonlinear function in spatial domain. |
Source code in torchfsm/operator/_base.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
torchfsm.operator.generic._curl._Curl3DCore
¤
Bases: NonlinearFunc
Implementation of the Curl operator for 3D vector fields.
Source code in torchfsm/operator/generic/_curl.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|
__init__
¤
__init__()
Source code in torchfsm/operator/generic/_curl.py
36 37 |
|
__call__
¤
__call__(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/generic/_curl.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|
spatial_value
¤
spatial_value(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> SpatialTensor["B C H ..."]
Return the result of the nonlinear function in spatial domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
SpatialTensor |
SpatialTensor['B C H ...']
|
Result of the nonlinear function in spatial domain. |
Source code in torchfsm/operator/_base.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
torchfsm.operator.generic._div._DivCore
¤
Bases: NonlinearFunc
Implementation of the Divergence operator.
Source code in torchfsm/operator/generic/_div.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
__init__
¤
__init__()
Source code in torchfsm/operator/generic/_div.py
14 15 16 17 18 19 20 |
|
__call__
¤
__call__(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/generic/_div.py
22 23 24 25 26 27 28 |
|
spatial_value
¤
spatial_value(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> SpatialTensor["B C H ..."]
Return the result of the nonlinear function in spatial domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
SpatialTensor |
SpatialTensor['B C H ...']
|
Result of the nonlinear function in spatial domain. |
Source code in torchfsm/operator/_base.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
torchfsm.operator.generic._dispersion._DispersionCore
¤
Bases: LinearCoef
Implementation of the Dispersion operator.
Source code in torchfsm/operator/generic/_dispersion.py
6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
__call__
¤
__call__(
f_mesh: FourierMesh, n_channel: int
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/generic/_dispersion.py
11 12 13 14 15 16 17 18 |
|
nonlinear_like
¤
nonlinear_like(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Calculate the result out based on the linear coefficient. It is designed to have same pattern as the nonlinear function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
FourierTensor |
FourierTensor['B C H ...']
|
Nonlinear-like tensor. |
Source code in torchfsm/operator/_base.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
torchfsm.operator.generic._grad._GradCore
¤
Bases: LinearCoef
Implementation of the Grad operator.
Source code in torchfsm/operator/generic/_grad.py
6 7 8 9 10 11 12 13 14 15 |
|
__call__
¤
__call__(
f_mesh: FourierMesh, n_channel: int
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/generic/_grad.py
12 13 14 15 |
|
nonlinear_like
¤
nonlinear_like(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Calculate the result out based on the linear coefficient. It is designed to have same pattern as the nonlinear function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
FourierTensor |
FourierTensor['B C H ...']
|
Nonlinear-like tensor. |
Source code in torchfsm/operator/_base.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
torchfsm.operator._base._ExplicitSourceCore
¤
Bases: NonlinearFunc
Implementation of the explicit source term for the operator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source
|
SpatialTensor['B C H ...']
|
Source term in spatial domain. This is a tensor that represents the source term in the spatial domain. |
required |
Source code in torchfsm/operator/_base.py
992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 |
|
__init__
¤
__init__(source: SpatialTensor['B C H ...']) -> None
Source code in torchfsm/operator/_base.py
1000 1001 1002 1003 |
|
__call__
¤
__call__(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/_base.py
1005 1006 1007 1008 1009 1010 1011 1012 1013 |
|
spatial_value
¤
spatial_value(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> SpatialTensor["B C H ..."]
Return the result of the nonlinear function in spatial domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
SpatialTensor |
SpatialTensor['B C H ...']
|
Result of the nonlinear function in spatial domain. |
Source code in torchfsm/operator/_base.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
torchfsm.operator.generic._source._ImplicitUnitSourceCore
¤
Bases: LinearCoef
Implementation of the ImplicitSource operator with unit form.
Source code in torchfsm/operator/generic/_source.py
9 10 11 12 13 14 15 16 17 |
|
__call__
¤
__call__(
f_mesh: FourierMesh, n_channel: int
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/generic/_source.py
14 15 16 17 |
|
nonlinear_like
¤
nonlinear_like(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Calculate the result out based on the linear coefficient. It is designed to have same pattern as the nonlinear function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
FourierTensor |
FourierTensor['B C H ...']
|
Nonlinear-like tensor. |
Source code in torchfsm/operator/_base.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
torchfsm.operator.generic._source._ImplicitFuncSourceCore
¤
Bases: NonlinearFunc
Implementation of the ImplicitSource operator with function form.
Source code in torchfsm/operator/generic/_source.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
__init__
¤
__init__(
source_func: Callable[[Tensor], Tensor],
non_linear: bool = True,
) -> None
Source code in torchfsm/operator/generic/_source.py
25 26 27 28 29 30 31 |
|
__call__
¤
__call__(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/generic/_source.py
33 34 35 36 37 38 39 40 41 |
|
spatial_value
¤
spatial_value(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> SpatialTensor["B C H ..."]
Return the result of the nonlinear function in spatial domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
SpatialTensor |
SpatialTensor['B C H ...']
|
Result of the nonlinear function in spatial domain. |
Source code in torchfsm/operator/_base.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
torchfsm.operator.generic._hyper_diffusion._HyperDiffusionCore
¤
Bases: LinearCoef
Implementation of the Hyper Diffusion operator.
Source code in torchfsm/operator/generic/_hyper_diffusion.py
6 7 8 9 10 11 12 13 14 |
|
__call__
¤
__call__(
f_mesh: FourierMesh, n_channel: int
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/generic/_hyper_diffusion.py
11 12 13 14 |
|
nonlinear_like
¤
nonlinear_like(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Calculate the result out based on the linear coefficient. It is designed to have same pattern as the nonlinear function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
FourierTensor |
FourierTensor['B C H ...']
|
Nonlinear-like tensor. |
Source code in torchfsm/operator/_base.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
torchfsm.operator.generic._laplacian._LaplacianCore
¤
Bases: LinearCoef
Implementation of the Laplacian operator.
Source code in torchfsm/operator/generic/_laplacian.py
7 8 9 10 11 12 13 14 15 |
|
__call__
¤
__call__(
f_mesh: FourierMesh, n_channel: int
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/generic/_laplacian.py
12 13 14 15 |
|
nonlinear_like
¤
nonlinear_like(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Calculate the result out based on the linear coefficient. It is designed to have same pattern as the nonlinear function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
FourierTensor |
FourierTensor['B C H ...']
|
Nonlinear-like tensor. |
Source code in torchfsm/operator/_base.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
torchfsm.operator.generic._spatial_derivative._SpatialDerivativeCore
¤
Bases: LinearCoef
Implementation of the SpatialDerivative operator.
Source code in torchfsm/operator/generic/_spatial_derivative.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
__init__
¤
__init__(dim_index, order) -> None
Source code in torchfsm/operator/generic/_spatial_derivative.py
12 13 14 15 |
|
__call__
¤
__call__(
f_mesh: FourierMesh, n_channel: int
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/generic/_spatial_derivative.py
17 18 19 20 |
|
nonlinear_like
¤
nonlinear_like(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Calculate the result out based on the linear coefficient. It is designed to have same pattern as the nonlinear function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
FourierTensor |
FourierTensor['B C H ...']
|
Nonlinear-like tensor. |
Source code in torchfsm/operator/_base.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
torchfsm.operator.dedicated._ks_convection._KSConvectionCore
¤
Bases: NonlinearFunc
Implementation of the KSConvection operator.
Source code in torchfsm/operator/dedicated/_ks_convection.py
8 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 |
|
__init__
¤
__init__(remove_mean: bool) -> None
Source code in torchfsm/operator/dedicated/_ks_convection.py
14 15 16 |
|
__call__
¤
__call__(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
n_channel: int,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/dedicated/_ks_convection.py
18 19 20 21 22 23 24 25 |
|
spatial_value
¤
spatial_value(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> SpatialTensor["B C H ..."]
Source code in torchfsm/operator/dedicated/_ks_convection.py
27 28 29 30 31 32 33 34 35 36 37 38 |
|
torchfsm.operator.dedicated._navier_stokes._vorticity_convection._VorticityConvectionCore
¤
Bases: NonlinearFunc
Implementation of the VorticityConvection operator.
Source code in torchfsm/operator/dedicated/_navier_stokes/_vorticity_convection.py
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 |
|
__init__
¤
__init__() -> None
Source code in torchfsm/operator/dedicated/_navier_stokes/_vorticity_convection.py
19 20 |
|
__call__
¤
__call__(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/dedicated/_navier_stokes/_vorticity_convection.py
22 23 24 25 26 27 28 |
|
spatial_value
¤
spatial_value(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> SpatialTensor["B C H ..."]
Source code in torchfsm/operator/dedicated/_navier_stokes/_vorticity_convection.py
30 31 32 33 34 35 36 37 38 39 40 41 |
|
torchfsm.operator.dedicated._navier_stokes._value_transformation._Vorticity2VelocityCore
¤
Bases: LinearCoef
Implementation of the Vorticity2Velocity operator.
Source code in torchfsm/operator/dedicated/_navier_stokes/_value_transformation.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
__call__
¤
__call__(f_mesh, n_channel) -> FourierTensor['B C H ...']
Source code in torchfsm/operator/dedicated/_navier_stokes/_value_transformation.py
23 24 25 26 27 28 29 30 31 32 33 34 |
|
nonlinear_like
¤
nonlinear_like(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Calculate the result out based on the linear coefficient. It is designed to have same pattern as the nonlinear function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
FourierTensor |
FourierTensor['B C H ...']
|
Nonlinear-like tensor. |
Source code in torchfsm/operator/_base.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
torchfsm.operator.dedicated._navier_stokes._value_transformation._Vorticity2PressureCore
¤
Bases: NonlinearFunc
Implementation of the Vorticity2Pressure operator.
Source code in torchfsm/operator/dedicated/_navier_stokes/_value_transformation.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
|
__init__
¤
__init__(
external_force: Optional[OperatorLike] = None,
) -> None
Source code in torchfsm/operator/dedicated/_navier_stokes/_value_transformation.py
66 67 68 69 70 71 |
|
__call__
¤
__call__(u_fft, f_mesh, u) -> FourierTensor['B C H ...']
Source code in torchfsm/operator/dedicated/_navier_stokes/_value_transformation.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
|
spatial_value
¤
spatial_value(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> SpatialTensor["B C H ..."]
Return the result of the nonlinear function in spatial domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
SpatialTensor |
SpatialTensor['B C H ...']
|
Result of the nonlinear function in spatial domain. |
Source code in torchfsm/operator/_base.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
torchfsm.operator.dedicated._navier_stokes._value_transformation._Velocity2PressureCore
¤
Bases: NonlinearFunc
Implementation of the Velocity2Pressure operator.
Source code in torchfsm/operator/dedicated/_navier_stokes/_value_transformation.py
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 |
|
__init__
¤
__init__(
external_force: Optional[OperatorLike] = None,
) -> None
Source code in torchfsm/operator/dedicated/_navier_stokes/_value_transformation.py
122 123 124 125 126 |
|
__call__
¤
__call__(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/dedicated/_navier_stokes/_value_transformation.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
|
spatial_value
¤
spatial_value(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> SpatialTensor["B C H ..."]
Return the result of the nonlinear function in spatial domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
SpatialTensor |
SpatialTensor['B C H ...']
|
Result of the nonlinear function in spatial domain. |
Source code in torchfsm/operator/_base.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
torchfsm.operator.dedicated._navier_stokes._ns_pressure_convection._NSPressureConvectionCore
¤
Bases: NonlinearFunc
Implementation of the Navier-Stokes pressure convection operator.
Source code in torchfsm/operator/dedicated/_navier_stokes/_ns_pressure_convection.py
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 43 44 45 46 47 |
|
__init__
¤
__init__(
external_force: Optional[OperatorLike] = None,
) -> None
Source code in torchfsm/operator/dedicated/_navier_stokes/_ns_pressure_convection.py
19 20 21 22 |
|
__call__
¤
__call__(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> torch.Tensor
Source code in torchfsm/operator/dedicated/_navier_stokes/_ns_pressure_convection.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
spatial_value
¤
spatial_value(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> SpatialTensor["B C H ..."]
Return the result of the nonlinear function in spatial domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
SpatialTensor |
SpatialTensor['B C H ...']
|
Result of the nonlinear function in spatial domain. |
Source code in torchfsm/operator/_base.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
torchfsm.operator.dedicated._navier_stokes._leray._LerayCore
¤
Bases: NonlinearFunc
Implementation of the Leray projection operator.
Source code in torchfsm/operator/dedicated/_navier_stokes/_leray.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
__init__
¤
__init__()
Source code in torchfsm/operator/dedicated/_navier_stokes/_leray.py
14 15 16 17 18 19 20 |
|
__call__
¤
__call__(u_fft, f_mesh, u=None)
Source code in torchfsm/operator/dedicated/_navier_stokes/_leray.py
22 23 24 25 |
|
spatial_value
¤
spatial_value(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> SpatialTensor["B C H ..."]
Return the result of the nonlinear function in spatial domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
SpatialTensor |
SpatialTensor['B C H ...']
|
Result of the nonlinear function in spatial domain. |
Source code in torchfsm/operator/_base.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
torchfsm.operator.dedicated._gray_scott._ChannelWisedDiffusionCore
¤
Bases: LinearCoef
Implementation of the ChannelWisedDiffusion operator.
Source code in torchfsm/operator/dedicated/_gray_scott.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
__init__
¤
__init__(
viscosities: Sequence[Union[Tensor, float]],
) -> None
Source code in torchfsm/operator/dedicated/_gray_scott.py
13 14 15 16 |
|
__call__
¤
__call__(
f_mesh: FourierMesh, n_channel: int
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/dedicated/_gray_scott.py
19 20 21 22 |
|
nonlinear_like
¤
nonlinear_like(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Calculate the result out based on the linear coefficient. It is designed to have same pattern as the nonlinear function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
FourierTensor |
FourierTensor['B C H ...']
|
Nonlinear-like tensor. |
Source code in torchfsm/operator/_base.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
torchfsm.operator.dedicated._gray_scott._GrayScottSourceCore
¤
Bases: NonlinearFunc
Implementation of the Gray-Scott source term.
Source code in torchfsm/operator/dedicated/_gray_scott.py
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__(
feed_rate: Union[Tensor, float],
kill_rate: Union[Tensor, float],
) -> None
Source code in torchfsm/operator/dedicated/_gray_scott.py
55 56 57 58 59 60 |
|
__call__
¤
__call__(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> FourierTensor["B C H ..."]
Source code in torchfsm/operator/dedicated/_gray_scott.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
spatial_value
¤
spatial_value(
u_fft: FourierTensor["B C H ..."],
f_mesh: FourierMesh,
u: Optional[SpatialTensor["B C H ..."]] = None,
) -> SpatialTensor["B C H ..."]
Return the result of the nonlinear function in spatial domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft
|
FourierTensor
|
Fourier-transformed input tensor. |
required |
f_mesh
|
FourierMesh
|
Fourier mesh object. |
required |
u
|
Optional[SpatialTensor]
|
Corresponding tensor of u_fft in spatial domain. This option aims to avoid repeating the inverse FFT operation in operators. |
None
|
Returns:
Name | Type | Description |
---|---|---|
SpatialTensor |
SpatialTensor['B C H ...']
|
Result of the nonlinear function in spatial domain. |
Source code in torchfsm/operator/_base.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|