@@ -88,6 +88,9 @@ class Surface {
8888 std::shared_ptr<BoundaryCondition> bc_ {nullptr }; // !< Boundary condition
8989 GeometryType geom_type_; // !< Geometry type indicator (CSG or DAGMC)
9090 bool surf_source_ {false }; // !< Activate source banking for the surface?
91+ int triso_base_index_;
92+ int triso_particle_index_ = -1 ;
93+ bool is_triso_surface_ = false ;
9194
9295 explicit Surface (pugi::xml_node surf_node);
9396 Surface ();
@@ -126,6 +129,11 @@ class Surface {
126129 // ! exactly on the surface.
127130 virtual double distance (Position r, Direction u, bool coincident) const = 0;
128131
132+ virtual bool triso_in_mesh (vector<double > mesh_center, vector<double > lattice_pitch) const { return {}; };
133+ virtual void connect_to_triso_base (int triso_index, std::string key) {};
134+ virtual vector<double > get_center () const { return {}; };
135+ virtual double get_radius () const { return {}; };
136+
129137 // ! Compute the local outward normal direction of the surface.
130138 // ! \param r A 3D Cartesian coordinate.
131139 // ! \return Normal direction
@@ -164,6 +172,7 @@ class SurfaceXPlane : public CSGSurface {
164172 double distance (Position r, Direction u, bool coincident) const ;
165173 Direction normal (Position r) const ;
166174 void to_hdf5_inner (hid_t group_id) const ;
175+ bool triso_in_mesh (vector<double > mesh_center, vector<double > lattice_pitch) const ;
167176 BoundingBox bounding_box (bool pos_side) const ;
168177
169178 double x0_;
@@ -182,6 +191,7 @@ class SurfaceYPlane : public CSGSurface {
182191 double distance (Position r, Direction u, bool coincident) const ;
183192 Direction normal (Position r) const ;
184193 void to_hdf5_inner (hid_t group_id) const ;
194+ bool triso_in_mesh (vector<double > mesh_center, vector<double > lattice_pitch) const ;
185195 BoundingBox bounding_box (bool pos_side) const ;
186196
187197 double y0_;
@@ -200,6 +210,7 @@ class SurfaceZPlane : public CSGSurface {
200210 double distance (Position r, Direction u, bool coincident) const ;
201211 Direction normal (Position r) const ;
202212 void to_hdf5_inner (hid_t group_id) const ;
213+ bool triso_in_mesh (vector<double > mesh_center, vector<double > lattice_pitch) const ;
203214 BoundingBox bounding_box (bool pos_side) const ;
204215
205216 double z0_;
@@ -218,6 +229,7 @@ class SurfacePlane : public CSGSurface {
218229 double distance (Position r, Direction u, bool coincident) const ;
219230 Direction normal (Position r) const ;
220231 void to_hdf5_inner (hid_t group_id) const ;
232+ bool triso_in_mesh (vector<double > mesh_center, vector<double > lattice_pitch) const ;
221233
222234 double A_, B_, C_, D_;
223235};
@@ -237,6 +249,7 @@ class SurfaceXCylinder : public CSGSurface {
237249 Direction normal (Position r) const ;
238250 void to_hdf5_inner (hid_t group_id) const ;
239251 BoundingBox bounding_box (bool pos_side) const ;
252+ bool triso_in_mesh (vector<double > mesh_center, vector<double > lattice_pitch) const ;
240253
241254 double y0_, z0_, radius_;
242255};
@@ -256,6 +269,7 @@ class SurfaceYCylinder : public CSGSurface {
256269 Direction normal (Position r) const ;
257270 void to_hdf5_inner (hid_t group_id) const ;
258271 BoundingBox bounding_box (bool pos_side) const ;
272+ bool triso_in_mesh (vector<double > mesh_center, vector<double > lattice_pitch) const ;
259273
260274 double x0_, z0_, radius_;
261275};
@@ -275,6 +289,7 @@ class SurfaceZCylinder : public CSGSurface {
275289 Direction normal (Position r) const ;
276290 void to_hdf5_inner (hid_t group_id) const ;
277291 BoundingBox bounding_box (bool pos_side) const ;
292+ bool triso_in_mesh (vector<double > mesh_center, vector<double > lattice_pitch) const ;
278293
279294 double x0_, y0_, radius_;
280295};
@@ -291,11 +306,16 @@ class SurfaceSphere : public CSGSurface {
291306 explicit SurfaceSphere (pugi::xml_node surf_node);
292307 double evaluate (Position r) const ;
293308 double distance (Position r, Direction u, bool coincident) const ;
309+ bool triso_in_mesh (vector<double > mesh_center, vector<double > lattice_pitch) const ;
310+ vector<double > get_center () const ;
311+ double get_radius () const ;
312+ void connect_to_triso_base (int triso_index, std::string key);
294313 Direction normal (Position r) const ;
295314 void to_hdf5_inner (hid_t group_id) const ;
296315 BoundingBox bounding_box (bool pos_side) const ;
297316
298317 double x0_, y0_, z0_, radius_;
318+ // int triso_base_index_ = -1;
299319};
300320
301321// ==============================================================================
@@ -312,6 +332,7 @@ class SurfaceXCone : public CSGSurface {
312332 double distance (Position r, Direction u, bool coincident) const ;
313333 Direction normal (Position r) const ;
314334 void to_hdf5_inner (hid_t group_id) const ;
335+ bool triso_in_mesh (vector<double > mesh_center, vector<double > lattice_pitch) const ;
315336
316337 double x0_, y0_, z0_, radius_sq_;
317338};
@@ -330,6 +351,7 @@ class SurfaceYCone : public CSGSurface {
330351 double distance (Position r, Direction u, bool coincident) const ;
331352 Direction normal (Position r) const ;
332353 void to_hdf5_inner (hid_t group_id) const ;
354+ bool triso_in_mesh (vector<double > mesh_center, vector<double > lattice_pitch) const ;
333355
334356 double x0_, y0_, z0_, radius_sq_;
335357};
@@ -348,6 +370,7 @@ class SurfaceZCone : public CSGSurface {
348370 double distance (Position r, Direction u, bool coincident) const ;
349371 Direction normal (Position r) const ;
350372 void to_hdf5_inner (hid_t group_id) const ;
373+ bool triso_in_mesh (vector<double > mesh_center, vector<double > lattice_pitch) const ;
351374
352375 double x0_, y0_, z0_, radius_sq_;
353376};
@@ -366,6 +389,7 @@ class SurfaceQuadric : public CSGSurface {
366389 double distance (Position r, Direction u, bool coincident) const ;
367390 Direction normal (Position r) const ;
368391 void to_hdf5_inner (hid_t group_id) const ;
392+ bool triso_in_mesh (vector<double > mesh_center, vector<double > lattice_pitch) const ;
369393
370394 // Ax^2 + By^2 + Cz^2 + Dxy + Eyz + Fxz + Gx + Hy + Jz + K = 0
371395 double A_, B_, C_, D_, E_, F_, G_, H_, J_, K_;
@@ -384,6 +408,7 @@ class SurfaceXTorus : public CSGSurface {
384408 double distance (Position r, Direction u, bool coincident) const ;
385409 Direction normal (Position r) const ;
386410 void to_hdf5_inner (hid_t group_id) const ;
411+ bool triso_in_mesh (vector<double > mesh_center, vector<double > lattice_pitch) const ;
387412
388413 double x0_, y0_, z0_, A_, B_, C_;
389414};
@@ -401,6 +426,7 @@ class SurfaceYTorus : public CSGSurface {
401426 double distance (Position r, Direction u, bool coincident) const ;
402427 Direction normal (Position r) const ;
403428 void to_hdf5_inner (hid_t group_id) const ;
429+ bool triso_in_mesh (vector<double > mesh_center, vector<double > lattice_pitch) const ;
404430
405431 double x0_, y0_, z0_, A_, B_, C_;
406432};
@@ -417,6 +443,7 @@ class SurfaceZTorus : public CSGSurface {
417443 double evaluate (Position r) const ;
418444 double distance (Position r, Direction u, bool coincident) const ;
419445 Direction normal (Position r) const ;
446+ bool triso_in_mesh (vector<double > mesh_center, vector<double > lattice_pitch) const ;
420447 void to_hdf5_inner (hid_t group_id) const ;
421448
422449 double x0_, y0_, z0_, A_, B_, C_;
0 commit comments