@@ -39,6 +39,9 @@ class Surface {
3939 std::string name_; // !< User-defined name
4040 unique_ptr<BoundaryCondition> bc_; // !< Boundary condition
4141 bool surf_source_ {false }; // !< Activate source banking for the surface?
42+ int triso_base_index_;
43+ int triso_particle_index_ = -1 ;
44+ bool is_triso_surface_ = false ;
4245
4346 explicit Surface (pugi::xml_node surf_node);
4447 Surface ();
@@ -78,6 +81,15 @@ class Surface {
7881 // ! exactly on the surface.
7982 virtual double distance (Position r, Direction u, bool coincident) const = 0;
8083
84+ virtual bool triso_in_mesh (
85+ vector<double > mesh_center, vector<double > lattice_pitch) const
86+ {
87+ return {};
88+ };
89+ virtual void connect_to_triso_base (int triso_index, std::string key) {};
90+ virtual vector<double > get_center () const { return {}; };
91+ virtual double get_radius () const { return {}; };
92+
8193 // ! Compute the local outward normal direction of the surface.
8294 // ! \param r A 3D Cartesian coordinate.
8395 // ! \return Normal direction
@@ -116,6 +128,8 @@ class SurfaceXPlane : public Surface {
116128 double distance (Position r, Direction u, bool coincident) const override ;
117129 Direction normal (Position r) const override ;
118130 void to_hdf5_inner (hid_t group_id) const override ;
131+ bool triso_in_mesh (
132+ vector<double > mesh_center, vector<double > lattice_pitch) const override ;
119133 BoundingBox bounding_box (bool pos_side) const override ;
120134
121135 double x0_;
@@ -134,6 +148,8 @@ class SurfaceYPlane : public Surface {
134148 double distance (Position r, Direction u, bool coincident) const override ;
135149 Direction normal (Position r) const override ;
136150 void to_hdf5_inner (hid_t group_id) const override ;
151+ bool triso_in_mesh (
152+ vector<double > mesh_center, vector<double > lattice_pitch) const override ;
137153 BoundingBox bounding_box (bool pos_side) const override ;
138154
139155 double y0_;
@@ -152,6 +168,8 @@ class SurfaceZPlane : public Surface {
152168 double distance (Position r, Direction u, bool coincident) const override ;
153169 Direction normal (Position r) const override ;
154170 void to_hdf5_inner (hid_t group_id) const override ;
171+ bool triso_in_mesh (
172+ vector<double > mesh_center, vector<double > lattice_pitch) const override ;
155173 BoundingBox bounding_box (bool pos_side) const override ;
156174
157175 double z0_;
@@ -169,6 +187,8 @@ class SurfacePlane : public Surface {
169187 double evaluate (Position r) const override ;
170188 double distance (Position r, Direction u, bool coincident) const override ;
171189 Direction normal (Position r) const override ;
190+ bool triso_in_mesh (
191+ vector<double > mesh_center, vector<double > lattice_pitch) const override ;
172192 void to_hdf5_inner (hid_t group_id) const override ;
173193
174194 double A_, B_, C_, D_;
@@ -188,6 +208,8 @@ class SurfaceXCylinder : public Surface {
188208 double distance (Position r, Direction u, bool coincident) const override ;
189209 Direction normal (Position r) const override ;
190210 void to_hdf5_inner (hid_t group_id) const override ;
211+ bool triso_in_mesh (
212+ vector<double > mesh_center, vector<double > lattice_pitch) const override ;
191213 BoundingBox bounding_box (bool pos_side) const override ;
192214
193215 double y0_, z0_, radius_;
@@ -207,6 +229,8 @@ class SurfaceYCylinder : public Surface {
207229 double distance (Position r, Direction u, bool coincident) const override ;
208230 Direction normal (Position r) const override ;
209231 void to_hdf5_inner (hid_t group_id) const override ;
232+ bool triso_in_mesh (
233+ vector<double > mesh_center, vector<double > lattice_pitch) const override ;
210234 BoundingBox bounding_box (bool pos_side) const override ;
211235
212236 double x0_, z0_, radius_;
@@ -226,6 +250,8 @@ class SurfaceZCylinder : public Surface {
226250 double distance (Position r, Direction u, bool coincident) const override ;
227251 Direction normal (Position r) const override ;
228252 void to_hdf5_inner (hid_t group_id) const override ;
253+ bool triso_in_mesh (
254+ vector<double > mesh_center, vector<double > lattice_pitch) const override ;
229255 BoundingBox bounding_box (bool pos_side) const override ;
230256
231257 double x0_, y0_, radius_;
@@ -245,9 +271,12 @@ class SurfaceSphere : public Surface {
245271 double distance (Position r, Direction u, bool coincident) const override ;
246272 Direction normal (Position r) const override ;
247273 void to_hdf5_inner (hid_t group_id) const override ;
274+ bool triso_in_mesh (
275+ vector<double > mesh_center, vector<double > lattice_pitch) const override ;
248276 BoundingBox bounding_box (bool pos_side) const override ;
249277
250278 double x0_, y0_, z0_, radius_;
279+ // int triso_base_index_ = -1;
251280};
252281
253282// ==============================================================================
@@ -264,6 +293,8 @@ class SurfaceXCone : public Surface {
264293 double distance (Position r, Direction u, bool coincident) const override ;
265294 Direction normal (Position r) const override ;
266295 void to_hdf5_inner (hid_t group_id) const override ;
296+ bool triso_in_mesh (
297+ vector<double > mesh_center, vector<double > lattice_pitch) const override ;
267298
268299 double x0_, y0_, z0_, radius_sq_;
269300};
@@ -282,6 +313,8 @@ class SurfaceYCone : public Surface {
282313 double distance (Position r, Direction u, bool coincident) const override ;
283314 Direction normal (Position r) const override ;
284315 void to_hdf5_inner (hid_t group_id) const override ;
316+ bool triso_in_mesh (
317+ vector<double > mesh_center, vector<double > lattice_pitch) const override ;
285318
286319 double x0_, y0_, z0_, radius_sq_;
287320};
@@ -300,6 +333,8 @@ class SurfaceZCone : public Surface {
300333 double distance (Position r, Direction u, bool coincident) const override ;
301334 Direction normal (Position r) const override ;
302335 void to_hdf5_inner (hid_t group_id) const override ;
336+ bool triso_in_mesh (
337+ vector<double > mesh_center, vector<double > lattice_pitch) const override ;
303338
304339 double x0_, y0_, z0_, radius_sq_;
305340};
@@ -318,6 +353,8 @@ class SurfaceQuadric : public Surface {
318353 double distance (Position r, Direction u, bool coincident) const override ;
319354 Direction normal (Position r) const override ;
320355 void to_hdf5_inner (hid_t group_id) const override ;
356+ bool triso_in_mesh (
357+ vector<double > mesh_center, vector<double > lattice_pitch) const override ;
321358
322359 // Ax^2 + By^2 + Cz^2 + Dxy + Eyz + Fxz + Gx + Hy + Jz + K = 0
323360 double A_, B_, C_, D_, E_, F_, G_, H_, J_, K_;
@@ -336,6 +373,8 @@ class SurfaceXTorus : public Surface {
336373 double distance (Position r, Direction u, bool coincident) const override ;
337374 Direction normal (Position r) const override ;
338375 void to_hdf5_inner (hid_t group_id) const override ;
376+ bool triso_in_mesh (
377+ vector<double > mesh_center, vector<double > lattice_pitch) const override ;
339378
340379 double x0_, y0_, z0_, A_, B_, C_;
341380};
@@ -353,6 +392,8 @@ class SurfaceYTorus : public Surface {
353392 double distance (Position r, Direction u, bool coincident) const override ;
354393 Direction normal (Position r) const override ;
355394 void to_hdf5_inner (hid_t group_id) const override ;
395+ bool triso_in_mesh (
396+ vector<double > mesh_center, vector<double > lattice_pitch) const override ;
356397
357398 double x0_, y0_, z0_, A_, B_, C_;
358399};
@@ -370,6 +411,8 @@ class SurfaceZTorus : public Surface {
370411 double distance (Position r, Direction u, bool coincident) const override ;
371412 Direction normal (Position r) const override ;
372413 void to_hdf5_inner (hid_t group_id) const override ;
414+ bool triso_in_mesh (
415+ vector<double > mesh_center, vector<double > lattice_pitch) const override ;
373416
374417 double x0_, y0_, z0_, A_, B_, C_;
375418};
0 commit comments