Skip to content

Commit

Permalink
Lattice interface ok
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethassogba committed Nov 26, 2024
1 parent 86cbab6 commit 3918357
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ The physics is coded in C++, with Python as user interface for easy and fast usa
- [x] Collect source and compile.
- [x] Setup nanobind and write Python bindings for Material.
- [x] Write a python test for Material class.
- [ ] Code and test Geometry class.
- [x] Code and test Geometry class.
- [x] Cell
- [ ] Lattice.
- [x] Lattice.
- [ ] Code Solver module.
- [ ] Base solver
- [ ] Mesh.
Expand Down
16 changes: 7 additions & 9 deletions examples/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ int main() {
ArrayXd sigma_f{{0., 0.135}};
ArrayXd nu_sigma_f{{0., 0.135}};
ArrayXd chi{{1., 0.}};

Material UO2(sigma_t, sigma_s, sigma_a, sigma_f, nu_sigma_f, chi, "UO2");

sigma_t = {{0.111111, 0.444443}};
Expand All @@ -25,29 +24,28 @@ int main() {
sigma_f = {{0., 0.635}};
nu_sigma_f = {{0., 0.535}};
chi = {{1., 0.}};

Material M4(sigma_t, sigma_s, sigma_a, sigma_f, nu_sigma_f, chi, "M4");

sigma_t = {{0.11434, 0.41343}};
sigma_s = {{0.70, 0.02}, {0.50, 0.25}};
sigma_a = {{0.041340, 0.0113432}};

Material H2O(sigma_t, sigma_s, sigma_a, "H2O");

for (const auto* m : {&UO2, &M4, &H2O}) std::cout << *m << '\n';
std::cout << '\n';

double side = 1.0;

Cell UO2cell(side, {0.5}, {UO2, H2O}, "UO2");

Cell M4cell(side, {0.4, 0.6}, {M4, UO2, H2O}, "M4");
Cell H2Ocell(side, H2O, "H2O");

for (const auto* c : {&UO2cell, &H2Ocell}) std::cout << *c << '\n';
for (const auto* c : {&UO2cell, &M4cell, &H2Ocell}) std::cout << *c << '\n';
std::cout << '\n';

Lattice assm00{{UO2cell, H2Ocell, UO2cell, H2Ocell}, "assm00"};
Lattice assm01{{UO2cell, UO2cell, H2Ocell, H2Ocell}, "assm01"};
Lattice assm10{{UO2cell, H2Ocell, UO2cell, UO2cell}, "assm10"};
Lattice assm11{{UO2cell, UO2cell, H2Ocell, UO2cell}, "assm11"};
Lattice assm01{{M4cell, UO2cell, H2Ocell, H2Ocell}, "assm01"};
Lattice assm10{{UO2cell, H2Ocell, UO2cell, M4cell}, "assm10"};
Lattice assm11{{UO2cell, M4cell, H2Ocell, UO2cell}, "assm11"};

Lattice core{{assm00, assm01, assm10, assm11}, "core"};
std::cout << core << '\n';
Expand Down

0 comments on commit 3918357

Please sign in to comment.