Skip to content

Commit

Permalink
Test Material Class in python
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethassogba committed Nov 24, 2024
1 parent a34cfa5 commit 1f8d203
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ The physics is coded in C++, with Python as user interface for easy and fast usa

- [x] Setup Cmake.
- [x] Add and test Eigen.
- [x] Setup directory structure vector-of-bool/pitchfork.
- [x] Setup directory structure.
- [x] Code and test Material class.
- [x] Collect source and compile.
- [x] Setup nanobind and write Python bindings for Material.
- [ ] Write a python test for Material class.
- [x] Write a python test for Material class.
- [ ] Code and test Geometry class.
- [ ] Cell
- [ ] PinCell
Expand All @@ -38,7 +38,7 @@ The physics is coded in C++, with Python as user interface for easy and fast usa
- [x] Setup clang-tidy.
- [x] Fix how to launch clang-tidy locally and on action.
- [ ] Add a Logger (spdlog, or nanolog or fmtlog) and std::format.
- [ ] Use docstest unit tests.
- [ ] Use doctest for unit tests in c++ and python.
- [ ] Maybe switch to include/demeter, src, src/binding, test, extra directory structure
- [ ] Add -Werror flag
- [ ] Setup gcc analizer.
Expand Down
18 changes: 13 additions & 5 deletions tests/regress/test00.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,26 @@
import numpy as np
import matplotlib.pyplot as plt

# "sigma_t"_a, "sigma_s"_a, "sigma_a"_a, "sigma_f"_a, "nu_sigma_f"_a,
# "chi"_a, "name"_a
# Create materials
sigma_t = np.array([0.1, 0.2, 0.3])
sigma_f = np.array([0.01, 0.02, 0.03]),
sigma_a = np.array([0.001, 0.002, 0.003])
uO2 = Material(sigma_t, sigma_f, sigma_a, name= 'uO2')
sigma_t = np.array([0.222222, 0.833333])
sigma_s = np.array([[0.00, 0.02],
[0.00, 0.00]])
sigma_a = np.array([0.010120, 0.080032])
sigma_f = np.array([0., 0.135])
nu_sigma_f = np.array([0., 0.135])
chi = np.array([1., 0.])

uO2 = Material(sigma_t, sigma_s, sigma_a, sigma_f, nu_sigma_f, chi, name= 'uO2')

"""
sigma_t = np.array([0.1, 0.2, 0.3])
sigma_f = np.array([0.01, 0.02, 0.03]),
sigma_a = np.array([0.001, 0.002, 0.003])
h20 = Material(sigma_t, sigma_f, sigma_a, name= 'H20')
"""
# Create pin cells
uO2_cell = PinCell(0.5, uO2)
h2O_cell = PinCell(0.5, h20)
Expand Down

0 comments on commit 1f8d203

Please sign in to comment.