Skip to content

Commit

Permalink
Update series
Browse files Browse the repository at this point in the history
  • Loading branch information
s9latimm committed Oct 19, 2024
1 parent 251cb81 commit ef1dd54
Show file tree
Hide file tree
Showing 10 changed files with 343 additions and 228 deletions.
69 changes: 36 additions & 33 deletions .eval.ps1
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
python -m src.nse -e step --id "eval_2/000/0" -i 1 -n .01 -d cuda -pFG -N 20000 -L 2
python -m src.nse -e step --id "eval_2/000/0" -i 1 -n .01 -d cuda -pFG -N 1000 -L 2

python -m src.nse -e step --id "eval_2/025/1" -i 1 -n .01 -d cuda -pFG -N 20000 -L 25:25
python -m src.nse -e step --id "eval_2/025/2" -i 1 -n .01 -d cuda -pFG -N 20000 -L 25:25:25
python -m src.nse -e step --id "eval_2/025/3" -i 1 -n .01 -d cuda -pFG -N 20000 -L 25:25:25:25
python -m src.nse -e step --id "eval_2/025/4" -i 1 -n .01 -d cuda -pFG -N 20000 -L 25:25:25:25:25
python -m src.nse -e step --id "eval_2/025/5" -i 1 -n .01 -d cuda -pFG -N 20000 -L 25:25:25:25:25:25
python -m src.nse -e step --id "eval_2/025/6" -i 1 -n .01 -d cuda -pFG -N 20000 -L 25:25:25:25:25:25:25
python -m src.nse -e step --id "eval_2/025/7" -i 1 -n .01 -d cuda -pFG -N 20000 -L 25:25:25:25:25:25:25:25

python -m src.nse -e step --id "eval_2/050/1" -i 1 -n .01 -d cuda -pFG -N 20000 -L 50:50
python -m src.nse -e step --id "eval_2/050/2" -i 1 -n .01 -d cuda -pFG -N 20000 -L 50:50:50
python -m src.nse -e step --id "eval_2/050/3" -i 1 -n .01 -d cuda -pFG -N 20000 -L 50:50:50:50
python -m src.nse -e step --id "eval_2/050/4" -i 1 -n .01 -d cuda -pFG -N 20000 -L 50:50:50:50:50

python -m src.nse -e step --id "eval_2/075/1" -i 1 -n .01 -d cuda -pFG -N 20000 -L 75:75
python -m src.nse -e step --id "eval_2/075/2" -i 1 -n .01 -d cuda -pFG -N 20000 -L 75:75:75
python -m src.nse -e step --id "eval_2/075/3" -i 1 -n .01 -d cuda -pFG -N 20000 -L 75:75:75:75
python -m src.nse -e step --id "eval_2/025/1" -i 1 -n .01 -d cuda -pFG -N 50000 -L 25:25
# python -m src.nse -e step --id "eval_2/025/2" -i 1 -n .01 -d cuda -pFG -N 30000 -L 25:25:25
python -m src.nse -e step --id "eval_2/025/3" -i 1 -n .01 -d cuda -pFG -N 50000 -L 25:25:25:25
#
# python -m src.nse -e step --id "eval_2/050/1" -i 1 -n .01 -d cuda -pFG -N 30000 -L 50:50
# python -m src.nse -e step --id "eval_2/050/2" -i 1 -n .01 -d cuda -pFG -N 30000 -L 50:50:50
# python -m src.nse -e step --id "eval_2/050/3" -i 1 -n .01 -d cuda -pFG -N 30000 -L 50:50:50:50
#
# python -m src.nse -e step --id "eval_2/075/1" -i 1 -n .01 -d cuda -pFG -N 30000 -L 75:75
# python -m src.nse -e step --id "eval_2/075/2" -i 1 -n .01 -d cuda -pFG -N 30000 -L 75:75:75
# python -m src.nse -e step --id "eval_2/075/3" -i 1 -n .01 -d cuda -pFG -N 30000 -L 75:75:75:75
#
# python -m src.nse -e step --id "eval_2/100/1" -i 1 -n .01 -d cuda -pFG -N 30000 -L 100:100
# python -m src.nse -e step --id "eval_2/100/2" -i 1 -n .01 -d cuda -pFG -N 30000 -L 100:100:100
# python -m src.nse -e step --id "eval_2/100/3" -i 1 -n .01 -d cuda -pFG -N 30000 -L 100:100:100:100
#
# python -m src.nse -e step --id "eval_2/125/1" -i 1 -n .01 -d cuda -pFG -N 30000 -L 125:125
# python -m src.nse -e step --id "eval_2/125/2" -i 1 -n .01 -d cuda -pFG -N 30000 -L 125:125:125
# python -m src.nse -e step --id "eval_2/125/3" -i 1 -n .01 -d cuda -pFG -N 30000 -L 125:125:125:125
#
# python -m src.nse -e step --id "eval_2/150/1" -i 1 -n .01 -d cuda -pFG -N 30000 -L 150:150
# python -m src.nse -e step --id "eval_2/150/2" -i 1 -n .01 -d cuda -pFG -N 30000 -L 150:150:150
# python -m src.nse -e step --id "eval_2/150/3" -i 1 -n .01 -d cuda -pFG -N 30000 -L 150:150:150:150

python -m src.nse -e step --id "eval_2/100/1" -i 1 -n .01 -d cuda -pFG -N 20000 -L 100:100
python -m src.nse -e step --id "eval_2/100/2" -i 1 -n .01 -d cuda -pFG -N 20000 -L 100:100:100
python -m src.nse -e step --id "eval_2/100/3" -i 1 -n .01 -d cuda -pFG -N 20000 -L 100:100:100:100
# python -m src.nse -e step --id "eval_2/050/4" -i 1 -n .01 -d cuda -pFG -N 30000 -L 50:50:50:50:50
#
# python -m src.nse -e step --id "eval_2/025/4" -i 1 -n .01 -d cuda -pFG -N 30000 -L 25:25:25:25:25
# python -m src.nse -e step --id "eval_2/025/5" -i 1 -n .01 -d cuda -pFG -N 30000 -L 25:25:25:25:25:25
# python -m src.nse -e step --id "eval_2/025/6" -i 1 -n .01 -d cuda -pFG -N 30000 -L 25:25:25:25:25:25:25
# python -m src.nse -e step --id "eval_2/025/7" -i 1 -n .01 -d cuda -pFG -N 30000 -L 25:25:25:25:25:25:25:25

python -m src.nse -e step --id "eval_2/125/1" -i 1 -n .01 -d cuda -pFG -N 20000 -L 125:125
python -m src.nse -e step --id "eval_2/125/2" -i 1 -n .01 -d cuda -pFG -N 20000 -L 125:125:125
python -m src.nse -e step --id "eval_2/125/3" -i 1 -n .01 -d cuda -pFG -N 20000 -L 125:125:125:125

python -m src.nse -e step --id "eval_2/150/1" -i 1 -n .01 -d cuda -pFG -N 20000 -L 150:150
python -m src.nse -e step --id "eval_2/150/2" -i 1 -n .01 -d cuda -pFG -N 20000 -L 150:150:150
python -m src.nse -e step --id "eval_2/150/3" -i 1 -n .01 -d cuda -pFG -N 20000 -L 150:150:150:150
python -m src.nse -e step --id "eval_2/175/1" -i 1 -n .01 -d cuda -pFG -N 30000 -L 175:175
python -m src.nse -e step --id "eval_2/175/2" -i 1 -n .01 -d cuda -pFG -N 30000 -L 175:175:175
python -m src.nse -e step --id "eval_2/175/3" -i 1 -n .01 -d cuda -pFG -N 30000 -L 175:175:175:175

# python -m src.nse -e step --id "eval_2/175/1" -i 1 -n .01 -d cuda -pFG -N 20000 -L 175:175
# python -m src.nse -e step --id "eval_2/175/2" -i 1 -n .01 -d cuda -pFG -N 20000 -L 175:175:175
# python -m src.nse -e step --id "eval_2/175/3" -i 1 -n .01 -d cuda -pFG -N 20000 -L 175:175:175:175
#
# python -m src.nse -e step --id "eval_2/200/1" -i 1 -n .01 -d cuda -pFG -N 20000 -L 200:200
# python -m src.nse -e step --id "eval_2/200/2" -i 1 -n .01 -d cuda -pFG -N 20000 -L 200:200:200
# python -m src.nse -e step --id "eval_2/200/3" -i 1 -n .01 -d cuda -pFG -N 20000 -L 200:200:200:200
python -m src.nse -e step --id "eval_2/200/1" -i 1 -n .01 -d cuda -pFG -N 30000 -L 200:200
python -m src.nse -e step --id "eval_2/200/2" -i 1 -n .01 -d cuda -pFG -N 30000 -L 200:200:200
python -m src.nse -e step --id "eval_2/200/3" -i 1 -n .01 -d cuda -pFG -N 30000 -L 200:200:200:200
2 changes: 1 addition & 1 deletion resources
Submodule resources updated 2192 files
3 changes: 3 additions & 0 deletions src/base/model/algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ def save(self, path: Path) -> None:
with path.open("w", encoding="utf-8") as f:
f.write(f'{self.__value:d}\n')

def __int__(self) -> int:
return self.__value

@staticmethod
def load(path: Path) -> Integer:
if path.exists():
Expand Down
2 changes: 1 addition & 1 deletion src/base/model/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Sinus(Function):

def __init__(self, start: float, end: float, scale: float = 1.) -> None:
self.__scale = scale
self.__a = 20 / (end - start) / np.pi
self.__a = 2 * np.pi * (end - start)

def __call__(self, x: float) -> float:
return self.__scale * np.sin(self.__a * x)
Expand Down
3 changes: 1 addition & 2 deletions src/base/view/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import numpy as np
from matplotlib import colors

COLORS: list[str] = ['black'] + list(colors.TABLEAU_COLORS.keys())[1:]
DEFAULT_COLOR: str = COLORS[1]
COLORS: list[tuple[float, float, float, float]] = [plt.get_cmap('tab10')(i) for i in range(10)]

DPI: int = 1000
SCALE: float = 2.5
Expand Down
3 changes: 1 addition & 2 deletions src/base/view/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def draw_shape(ax: plt.Axes, shape: Shape, style: str = '-', width: float = 2.5)


def save_fig(fig: plt.Figure, path: Path) -> None:
fig.tight_layout()
if path is not None:
path.parent.mkdir(parents=True, exist_ok=True)
fig.savefig(path, format=path.suffix[1:], bbox_inches='tight', transparent=True, dpi=DPI / SCALE)
Expand Down Expand Up @@ -208,7 +207,7 @@ def plot_seismic(
[j.x for j in marker],
[j.y for j in marker],
marker='.',
c=COLORS[0],
color=COLORS[0],
zorder=3,
)

Expand Down
3 changes: 3 additions & 0 deletions src/nse/view/grading.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import numpy as np

from src import OUTPUT_DIR
from src.base.model.algebra import Integer
from src.base.model.mesh import Grid, Mesh
from src.base.view.plot import plot_seismic, plot_stream, plot_arrows
from src.nse.controller.simulation import Simulation
Expand Down Expand Up @@ -101,6 +102,8 @@ def export(timer: Stopwatch, experiment: Experiment, model: Simulation, identifi
prediction.save(path / 'mesh_pred.csv')
timer.save(path / 'time.csv')

Integer(len(model)).save(path / 'parameter.csv')


def grade(experiment: Experiment, identifier: str, suffix: str):
path = OUTPUT_DIR / identifier / f'{experiment.foam.name}_{suffix}'
Expand Down
Empty file removed src/nse/view/paper/__init__.py
Empty file.
Loading

0 comments on commit ef1dd54

Please sign in to comment.