Skip to content

Commit

Permalink
Add Boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethassogba committed Nov 27, 2024
1 parent 3918357 commit b8d99a7
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ The physics is coded in C++, with Python as user interface for easy and fast usa
- [ ] Write full benchmark
- [ ] In C++.
- [ ] In Python.
- [ ] Mesh refiner, rings and sectors for cell
- [ ] Enable users to test the lib with codespace and notebooks.
- [ ] GPU offload.

Expand Down
15 changes: 15 additions & 0 deletions examples/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ int main() {

CheckOpenMP();

// Define materials
ArrayXd sigma_t{{0.222222, 0.833333}};
ArrayXXd sigma_s{{0.00, 0.02}, {0.00, 0.00}};
ArrayXd sigma_a{{0.010120, 0.080032}};
Expand All @@ -34,6 +35,7 @@ int main() {
for (const auto* m : {&UO2, &M4, &H2O}) std::cout << *m << '\n';
std::cout << '\n';

// Define cells
double side = 1.0;
Cell UO2cell(side, {0.5}, {UO2, H2O}, "UO2");
Cell M4cell(side, {0.4, 0.6}, {M4, UO2, H2O}, "M4");
Expand All @@ -42,13 +44,26 @@ int main() {
for (const auto* c : {&UO2cell, &M4cell, &H2Ocell}) std::cout << *c << '\n';
std::cout << '\n';

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

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

// Set boundary conditions
// core.BoundaryCondition(BoundarySide::xmin, BoundaryCondition::Vacuum);
// core.BoundaryCondition(BoundarySide::xmax, BoundaryCondition::Reflection);

// Define solver and solve the transport equation
// SNConfig sn(2); // SN type, order
// FEMConfig dg(2); // fem type, order
// Solver solver(sn, dg);
// solver.geometry(core);
// solver.solve();

return 0;
}
3 changes: 2 additions & 1 deletion src/demeter/model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

#include "model/cell.hpp"
#include "model/material.hpp"
#include "model/lattice.hpp"
#include "model/lattice.hpp"
#include "model/boundary.hpp"
25 changes: 25 additions & 0 deletions src/demeter/model/boundary.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#pragma once

#include "demeter/common.hpp"
#include "demeter/model/lattice.hpp"

namespace Demeter {

/**
* @brief Possible boundary condition
*/
enum class BoundaryCondition { Vacuum, Reflection };

/**
* @brief Possible side of a lattice
*/
enum class BoundarySide {
xmin,
xmax,
ymin,
ymax,
zmin,
zmax
}; // TODO diagonal

} // namespace Demeter
12 changes: 12 additions & 0 deletions src/demeter/solve/solver.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once

#include "demeter/common.hpp"
#include "demeter/model/lattice.hpp"

namespace Demeter {

class Solver {
public:

};
} // namespace Demeter

0 comments on commit b8d99a7

Please sign in to comment.