makeclean / csg2csg

Tools to translate between different CSG geometry types
European Union Public License 1.2
35 stars 24 forks source link

Serpent does not allow UNION for cell surfaces #52

Open gvozdila opened 4 years ago

gvozdila commented 4 years ago

I can cite Serpent-1.1.7 user manual obtained from OECD, p.28 :

  1. Only the intersection operator is available for cell definitions. This means that a point is inside the cell if and only if it is inside (or outside if defined by a negative surface number) all the boundary surfaces in the list.

May be it would be possible to build some decomposition from UNIONs to INTERSECTIONs. First time even warning printing could be helpful.

gvozdila commented 3 years ago

Ok. I have some something about it. CSG is not a "real" boolean algebra over macro-bodies, only over basis macro-bodies. So we cannot use algebra directly. For example: A AND B = not ( not A OR not B) -- one can use #cell_id in MCNP, but there is no way like this in Serpent or KENO-VI (SCALE)

But we can use some other simple rules like this : a1) is equal a2) i will use MCNP notation here a1) 1 1 1.0 10: 20 u=0 imp:n=1

a2)101 1 1.0 -10 20 u=0 imp:n=1 102 1 1.0 10 -20 u=0 imp:n=1 103 1 1.0 -10 -20 u=0 imp:n=1

b) not (A and B) == (not A) or (not B) c) not (A or B) == (not A) and (not B)

For me it seems like we need some basic "expand" procedure in class InputDeck. And we are not really need to destroy original cell_list. Should we use self.create_cell_list_without_union() to build no_union_cell_list[] ?