Hexagon and truncated hexagon#205
Conversation
Added in the BEAVRS model with the D-bank partially inserted. Also fixed a flaw in the geometry where the outermost cell was defined such that there could be a rare particle lost between it and the geometry boundary.
valeriaRaffuzzi
left a comment
There was a problem hiding this comment.
All looks good! I am approving it despite some comments because they are all related to the documentation and comments in the code, rather than changes or suggestions to the code itself. So feel free to merge directly after fixing the comments :)
Thanks for the implementation!
| xY for the three types, respectively) while the first axis is perpendicular to the flat surfaces. Likewise, | ||
| choosing ``2`` is flat-topped. Can have periodic and vacuum boundaries, but not reflective. | ||
|
|
||
| - origin: (x y z) position of the centre of the hexagon. [cm] |
There was a problem hiding this comment.
Add: 'the entry in the axis along the cylinder direction is ignored'.
| !! | ||
| !! Errors: | ||
| !! fatalError for -ve id or meaningful halfspace. | ||
| !! fatalError for unrecognised oritnetation |
| !! See surface_inter for more details | ||
| !! | ||
| !! Errors: | ||
| !! fatalError for -ve id or meaningful halfspace. |
There was a problem hiding this comment.
What does meaningful halfspace mean?
|
|
||
| ! Load id | ||
| call dict % get(id,'id') | ||
| if (id <= 0) call fatalError(Here, 'ID must be <= 0. Is: '//numToChar(id)) |
| !! Works by: | ||
| !! 1) Determine a plane in which direction is the closest | ||
| !! 2) Use normal for this plane and project distance | ||
| !! 3) Determinie halfspace based on sign of the projection |
| !! fatalError for -ve id or meaningful halfspace. | ||
| !! fatalError for unrecognised oritnetation |
There was a problem hiding this comment.
As above:
meaningful halfspace?
orientation*
| !! Works by: | ||
| !! 1) Determine a plane in which direction is the closest | ||
| !! 2) Use normal for this plane and project distance | ||
| !! 3) Determinie halfspace based on sign of the projection |
| real(defReal), dimension(2) :: rl, e, v1, v2, n, nBest | ||
| character(100), parameter :: Here = 'explicitBC (truncHexagon_class.f90)' | ||
|
|
||
| ! Get position in the plane & direction |
| real(defReal) :: hw | ||
| integer(shortInt) :: orient | ||
|
|
||
| ! Select type of squareCylinder and axis |
There was a problem hiding this comment.
comment: type of hexagon
| ! Reflective | ||
| !BC = REFLECTIVE_BC | ||
| !call this % surf % setBC(BC) | ||
|
|
||
| ! Shift left by one lattice starting just off centre | ||
| !r([ax, p1, p2]) = [ZERO, -5.5_defReal, 1.5_defReal] |
There was a problem hiding this comment.
Are these commented lines leftover from squareCylinder, or is the test actually correct and just waiting for the implementation to be uncommented?
I've developed an axis-parallel hexagon. It is regular in all directions, i.e., has the same width. Its main limitation is that it can't handle reflective boundaries. This is due to the difficulty of handling reflective boundaries by transform. However, I imagine for most cases of interest where this is used as a boundary that periodic boundaries will be sufficient. I have added unit tests and modified the documentation. I have also added a truncated hexagon, which does allow any boundary conditions along the perpendicular direction.