paddle 1.1.0__tar.gz → 1.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: paddle
3
- Version: 1.1.0
3
+ Version: 1.1.1
4
4
  Summary: Canoe's utility subroutines
5
5
  Project-URL: Homepage, https://github.com/chengcli/paddle
6
6
  Project-URL: Repository, https://github.com/chengcli/paddle
7
7
  Project-URL: Issues, https://github.com/chengcli/paddle/issues
8
8
  Author-email: Cheng Li <chengcli@umich.edu>
9
9
  Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Developers
10
11
  Classifier: Intended Audience :: Science/Research
11
12
  Classifier: Programming Language :: Python
12
13
  Classifier: Programming Language :: Python :: 3
@@ -1,11 +1,10 @@
1
1
  [build-system]
2
2
  requires = ["hatchling>=1.25"]
3
3
  build-backend = "hatchling.build"
4
- #build-backend = "setuptools.build_meta"
5
4
 
6
5
  [project]
7
6
  name = "paddle"
8
- version = "1.1.0"
7
+ version = "1.1.1"
9
8
  description = "Canoe's utility subroutines"
10
9
  readme = "README.md"
11
10
  requires-python = ">=3.9"
@@ -13,6 +12,7 @@ authors = [{ name = "Cheng Li", email = "chengcli@umich.edu" }]
13
12
  keywords = []
14
13
  classifiers = [
15
14
  "Development Status :: 3 - Alpha",
15
+ "Intended Audience :: Developers",
16
16
  "Intended Audience :: Science/Research",
17
17
  "Programming Language :: Python",
18
18
  "Programming Language :: Python :: 3",
@@ -0,0 +1,10 @@
1
+ from .setup_profile import setup_profile
2
+ from .write_profile import write_profile
3
+ from .find_init_params import find_init_params
4
+ from .evolve_kinetics import evolve_kinetics
5
+
6
+ __all__ = ["setup_profile",
7
+ "write_profile",
8
+ "find_init_params",
9
+ "evolve_kinetics"]
10
+ __version__ = "1.1.1"
@@ -6,7 +6,8 @@ def evolve_kinetics(
6
6
  hydro_w: torch.Tensor,
7
7
  block: snapy.MeshBlock,
8
8
  kinet: kintera.Kinetics,
9
- thermo_x: kintera.ThermoX) -> torch.Tensor:
9
+ thermo_x: kintera.ThermoX,
10
+ dt) -> torch.Tensor:
10
11
  """
11
12
  Evolve the chemical kinetics for one time step using implicit method.
12
13
 
@@ -15,26 +16,27 @@ def evolve_kinetics(
15
16
  block (snapy.MeshBlock): The mesh block containing the simulation data.
16
17
  kinet (kintera.Kinetics): The kinetics module for chemical reactions.
17
18
  thermo_x (kintera.ThermoX): The thermodynamics module for computing properties.
19
+ dt (float): The time step for evolution.
18
20
 
19
21
  Returns:
20
22
  torch.Tensor: The change in mass density due to chemical reactions.
21
23
  """
22
- eos = block.module("hydro.eos")
23
- thermo_y = eos.named_modules()["thermo"]
24
+ eos = block.hydro.get_eos()
25
+ thermo_y = block.module("hydro.eos.thermo")
24
26
 
25
- temp = eos.compute("W->T", (w,))
26
- pres = w[index.ipr]
27
- xfrac = thermo_y.compute("Y->X", (w[ICY:],))
27
+ temp = eos.compute("W->T", (hydro_w,))
28
+ pres = hydro_w[snapy.index.ipr]
29
+ xfrac = thermo_y.compute("Y->X", (hydro_w[snapy.index.icy:],))
28
30
  conc = thermo_x.compute("TPX->V", (temp, pres, xfrac))
29
31
  cp_vol = thermo_x.compute("TV->cp", (temp, conc))
30
32
 
31
33
  conc_kinet = kinet.options.narrow_copy(conc, thermo_y.options)
32
- rate, rc_ddC, rc_ddT = kinet.forward(temp, pres, conc_kinet)
34
+ rate, rc_ddC, rc_ddT = kinet.forward_nogil(temp, pres, conc_kinet)
33
35
  jac = kinet.jacobian(temp, conc_kinet, cp_vol, rate, rc_ddC, rc_ddT)
34
36
 
35
37
  stoich = kinet.buffer("stoich")
36
38
  del_conc = kintera.evolve_implicit(rate, stoich, jac, dt)
37
39
 
38
40
  inv_mu = thermo_y.buffer("inv_mu")
39
- del_rho = del_conc / inv_mu[1:].view((1, 1, 1, -1))
40
- return del_rho.permute((3, 0, 1, 2))
41
+ del_rho = del_conc / inv_mu[1:].view(1, 1, 1, -1)
42
+ return del_rho.permute(3, 0, 1, 2)
@@ -277,7 +277,4 @@ def setup_profile(
277
277
  w[snapy.index.ipr, ..., i] = pres
278
278
  w[snapy.index.idn, ..., i] = thermo_x.compute("V->D", [conc])
279
279
  w[snapy.index.icy:, ..., i] = thermo_x.compute("X->Y", [xfrac])
280
-
281
- # initialize hydro state
282
- block.initialize({"hydro_w": w})
283
280
  return w
@@ -1,6 +0,0 @@
1
- from .setup_profile import setup_profile
2
- from .write_profile import write_profile
3
- from .find_init_params import find_init_params
4
-
5
- __all__ = ["setup_profile", "write_profile", "find_init_params"]
6
- __version__ = "1.1.0"
File without changes
File without changes
File without changes