Skip to content

Commit 475c738

Browse files
authored
Merge pull request #1 from scaomath/dev-0.1
Updated 0.1.0 version
2 parents 356f6a6 + 1e28b9c commit 475c738

29 files changed

+4342
-1232
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Data generation instructions are available in the [SFNO folder](./fno).
4242
## Examples
4343
- Demos of different simulation setups:
4444
- [2D simulation with a pseudo-spectral solver](./examples/Kolmogrov2d_rk4_cn_forced_turbulence.ipynb)
45+
- [2D simulation with a finite volume solver](./examples/Kolmogrov2d_rk4_fvm_forced_turbulence.ipynb)
4546
- Demos of Spatiotemporal FNO's training and evaluation using the neural operator-assisted fluid simulation pipelines
4647
- [Training of SFNO for only 15 epochs for the isotropic turbulence example](./examples/ex2_SFNO_train.ipynb)
4748
- [Training of SFNO for only ***10*** epochs with 1k samples and reach `1e-2` level of relative error](./examples/ex2_SFNO_train_fnodata.ipynb) using the data in the FNO paper, which to our best knowledge no operator learner can do this in <100 epochs in the small data regime.
@@ -56,6 +57,7 @@ The Apache 2.0 License in the root folder applies to the `torch-cfd` folder of t
5657
## Contributions
5758
PR welcome. Currently, the port of `torch-cfd` currently includes:
5859
- The pseudospectral method for vorticity uses anti-aliasing filtering techniques for nonlinear terms to maintain stability.
60+
- The finite volume method on a MAC grid for velocity, and using the projection scheme to impose the divergence free condition.
5961
- Temporal discretization: Currently only RK4 temporal discretization uses explicit time-stepping for advection and either implicit or explicit time-stepping for diffusion.
6062
- Boundary conditions: only periodic boundary conditions.
6163

examples/Kolmogrov2d_rk4_fvm_forced_turbulence.ipynb

Lines changed: 222 additions & 0 deletions
Large diffs are not rendered by default.

examples/ex2_FNO3d_train_normalized.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@
9797
},
9898
{
9999
"cell_type": "code",
100-
"execution_count": 17,
100+
"execution_count": null,
101101
"metadata": {},
102102
"outputs": [],
103103
"source": [
104-
"train_dataset = BochnerDatasetFixed(\n",
104+
"train_dataset = SpatioTemporalDatasetFixedTime(\n",
105105
" datapath=TRAIN_PATH,\n",
106106
" fields=[\"vorticity\"],\n",
107107
" n_samples=Ntrain,\n",
@@ -112,7 +112,7 @@
112112
" out_steps=T,\n",
113113
" T_start=T_start,\n",
114114
")\n",
115-
"test_dataset = BochnerDatasetFixed(\n",
115+
"test_dataset = SpatioTemporalDatasetFixedTime(\n",
116116
" datapath=VALID_PATH,\n",
117117
" fields=[\"vorticity\"],\n",
118118
" n_samples=Ntest,\n",
@@ -493,7 +493,7 @@
493493
"name": "python",
494494
"nbconvert_exporter": "python",
495495
"pygments_lexer": "ipython3",
496-
"version": "3.11.9"
496+
"version": "3.10.17"
497497
}
498498
},
499499
"nbformat": 4,

examples/ex2_SFNO_finetune_fnodata.ipynb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 3,
5+
"execution_count": null,
66
"metadata": {},
77
"outputs": [],
88
"source": [
@@ -14,11 +14,13 @@
1414
"import torch.nn.functional as F\n",
1515
"from torch.linalg import norm\n",
1616
"\n",
17-
"from sfno.utils import get_seed\n",
18-
"from sfno.pipeline import *\n",
19-
"from sfno.visualizations import *\n",
20-
"from sfno.sfno import SFNO\n",
21-
"from sfno.finetune import OutConvFT\n",
17+
"from fno.utils import get_seed\n",
18+
"from fno.pipeline import *\n",
19+
"from fno.visualizations import *\n",
20+
"from fno.datasets import *\n",
21+
"from fno.losses import *\n",
22+
"from fno.sfno import SFNO\n",
23+
"from fno.finetune import OutConvFT\n",
2224
"from torch.utils.data import DataLoader\n",
2325
"\n",
2426
"get_seed(42, printout=False)\n",
@@ -78,11 +80,11 @@
7880
},
7981
{
8082
"cell_type": "code",
81-
"execution_count": 5,
83+
"execution_count": null,
8284
"metadata": {},
8385
"outputs": [],
8486
"source": [
85-
"test_dataset = BochnerDataset(datapath=TEST_PATH, \n",
87+
"test_dataset = SpatioTemporalDataset(datapath=TEST_PATH, \n",
8688
" fields=fields,\n",
8789
" n_samples=Ntest,\n",
8890
" steps=T,\n",

0 commit comments

Comments
 (0)