HƯỚNG DẪN DOWNLOAD TÀI LIỆU

Bước 1:Tại trang tài liệu slideshare.vn bạn muốn tải, click vào nút Download màu xanh lá cây ở phía trên.

Bước 2: Tại liên kết tải về, bạn chọn liên kết để tải File về máy tính. Tại đây sẽ có lựa chọn tải File được lưu trên slideshare.vn

Bước 3: Một thông báo xuất hiện ở phía cuối trình duyệt, hỏi bạn muốn lưu . - Nếu click vào Save, file sẽ được lưu về máy (Quá trình tải file nhanh hay chậm phụ thuộc vào đường truyền internet, dung lượng file bạn muốn tải)

Có nhiều phần mềm hỗ trợ việc download file về máy tính với tốc độ tải file nhanh như: Internet Download Manager (IDM), Free Download Manager, ... Tùy vào sở thích của từng người mà người dùng chọn lựa phần mềm hỗ trợ download cho máy tính của mình

Nuclear Engineering and Technology 49 (2017) 1189e1198
Contents lists available at ScienceDirect
Nuclear Engineering and Technology
journal homepage: www.elsevier.com/locate/net
Original Article
Particle tracking acceleration via signed distance ﬁelds in direct-accelerated geometry Monte Carlo
Patrick C. Shriwise*, Andrew Davis, Lucas J. Jacobson, Paul P.H. Wilson
CNERG Research Group, University of Wisconsin - Madison, Madison, WI, USA
a r t i c l e i n f o a b s t r a c t
Article history: Received 3 June 2017
Accepted 7 August 2017 Available online 26 August 2017
Keywords: Monte Carlo
Radiation Transport CAD
DAGMC
1. Introduction
Computer-aided design (CAD)-based Monte Carlo radiation transport is of value to the nuclear engi-neering community for its ability to conduct transport on high-ﬁdelity models of nuclear systems, but it is more computationally expensive than native geometry representations. This work describes the adaptation of a rendering data structure, the signed distance ﬁeld, as a geometric query tool for accel-erating CAD-based transport in the direct-accelerated geometry Monte Carlo toolkit. Demonstrations of its effectiveness are shown for several problems. The beginnings of a predictive model for the data structure's utilization based on various problem parameters is also introduced.
© 2017 Korean Nuclear Society, Published by Elsevier Korea LLC. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
signed distance ﬁeld data structureintendedfor rendering dynamic
surfaces is introduced. The remaining content describes this data
The direct-accelerated geometry Monte Carlo (DAGMC) [1] toolkit provides the capability for robust radiation transport on CAD geometries. This allows nuclear analysis to be performed on the same models that are used in other engineering domains. The toolkit also has the capability to convert native Monte Carlo models to computer-aided design (CAD) for further development, modiﬁ-cation, and analysis.
DAGMC tracks particles on discretized representations of ana-lytic CAD surfaces as triangle meshes, such that all points on any given triangle are within a speciﬁed tolerance of the analytic rep-resentation. This mesh representation of the model is then stored in the mesh oriented database (MOAB) [2] inwhich geometric queries such as next surface intersection, point containment, and nearest to boundary are performed.
It has been shown that DAGMC can achieve robust transport equal to that of the native codes with which it communicates [3], but that it currently takes much longer [4]. This additional time occurs despite the acceleration techniques that DAGMC uses to avoid searching over the large number of triangles ( 106e107). Those acceleration techniques, implemented within MOAB, will be brieﬂy discussed to motivate this work, which aims to further accelerate geometry queries within DAGMC.
To begin, this article gives a brief overview of the employed acceleration techniques in DAGMC for particle tracking. Next, the
* Corresponding author.
E-mail address: shriwise@wisc.edu (P.C. Shriwise).
structure's adaptation for use in accelerated particle tracking for CAD-based Monte Carlo simulations. The application of this data structure and associated tracking methods are then demonstrated as a new method for particle tracking acceleration in DAGMC. Included demonstrations of this method are shown to greatly reduce run times in a few test problems for commonly encountered conditions during transport. Next, some studies involving the data structure's effectiveness for various problem parameters are investigated and discussed. Finally, conclusions, current limita-tions, and future extensions of this work are discussed.
2. Background
2.1. Acceleration techniques in DAGMC
Particle tracking in DAGMC relies on the capability to robustly perform geometric queries on the triangle surface meshes which represent the problem geometry. The most common form of geo-metric query in particle tracking is a next surface crossing query. This is called to determine if a particle within the current cell will reach its nextevent location orcross a surface of the cell, potentially entering a new medium with different physical characteristics, based on the particle's current position and trajectory. Geometry kernels in native Monte Carlo codes perform analytic calculations for the nearest intersection along the particle's trajectory from its current location. In DAGMC, a similar operation is performed, but
on the triangle surfaces that compose the current cell (or volume).
http://dx.doi.org/10.1016/j.net.2017.08.008
1738-5733/© 2017 Korean Nuclear Society, Published by Elsevier Korea LLC. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/ licenses/by-nc-nd/4.0/).
1190 P.C. Shriwise et al. / Nuclear Engineering and Technology 49 (2017) 1189e1198
The determination of the nearest triangle intersection with a tra-jectory from a starting position is a well-researched problem in the ﬁeld of ray tracing. As such, a ray tracing data structure, the
bounding volume hierarchy (BVH) [5], is applied within MOAB to
over the R3 domain as:
U R3 /R (1)
accelerate these queries. More speciﬁcally, MOAB utilizes an ori-ented bounding box (OBB) BVH [6,7] to bound sets of triangles so that they may be rapidly excluded from the query in large groups via intersection checks with these OBBs.
This process begins by bounding all triangles with a single OBB. The triangles are then split into two sets based on which side of the splitting plane they are on. The splitting plane is chosen as the current OBBs median plane which divides the number of triangles into equal parts. OBBs are then generated for these subsets of tri-angles. Concurrently, the new OBBs are linked tothe original OBB as children. This process recurs until OBBs are bounding small sets of triangles. A hierarchical structure is created along the way which can then be traversed to rapidly isolate sets of triangles in space. A two-dimensional (2D) visualization of this process using curve segments rather than triangles is provided in Fig. 1. Queries are satisﬁed using data structure by performing ray-box intersection checks with the root OBB. If an intersection with the root OBB is found, then the children of that OBB will also be checked for an intersection. If the OBB has no children, it is considered a leaf node and the triangles it bounds are then checked for an intersection with the ray. During traversal, each time an OBB is missed by the ray, all triangles bounded by that box are ignored. It is in this way that the search for an intersection is rapidly limited to a small number of triangles with a high chance of intersecting with the ray. This results in an algorithm with OðlogðNÞÞ complexity where N is the number of entities (triangles) in the data structure. MOAB's OBB tree can be used to satisfy point containment and closest inter-section queries as well. Many variations of this data structure exist, and research is in progress to further accelerate particle tracking with these methods [4].
2.2. Signed distance ﬁelds and implicit surfaces
Signed distance ﬁelds are commonly derived from implicit surface functions, and variations on these functions are known as level-set functions. Both offer a rich and versatile representation of closed manifolds that can be used for modeling, simulation, and rendering. The constructive solid geometry (CSG) representations seen in native Monte Carlo codes are usually formed from Boolean combinations of predeﬁned implicit surfaces at their core. While these predeﬁned surfaces do not give the freedom of model crea-tion and manipulation found in many CAD systems, important geometric information required for visualization and simulation can be readily recovered from these implicit surfaces which may be of value in CAD-based radiation transport simulations.
Implicit surface functions are multivariate functions deﬁned
Fig. 1. Two-dimensional example of a bounding volume hierarchy using oriented
bounding boxes on a discretized curve.
where an isocontour of value, v, of the implicit surface can be described as
Uð x Þ v ¼ 0 (2)
for all points x satisfying that equation. For simplicity, the surface isocontour value is typically deﬁned as 0.
By recognizing that the magnitude of Uð x Þ is in fact a minimum interface distance function, one can construct a signed distance function, SDVð x Þ, using the isocontour representation and the magnitude of the function as seen in Eq. 3 [8].
SDVð x Þ ¼ jUð x Þj (3)
Signed distance function generation from implicit surfaces is a particularly valuable property of implicit surfaces. A signed dis-tance function, SDVð x Þ, meets the following requirements for any point x :
SDVð x Þ ¼ 0 for all x on the surface boundary,
SDVð x Þ<0 for all x inside the surface boundary, and SDVð x Þ>0 for all x outside the surface boundary.
Implicit surfaces and level-set methods are easily extended to represent dynamic geometries by including a time dependence in the function, making them powerful tools for populating signed distance ﬁelds in simulation and rendering of ﬂuids, smoke, ﬁre, etc. In these applications the data structure is populated with signed distance values for a given time in the rendering. The signed distance ﬁeld can then be used to determine point containment queries and trace rays at any time via a method in which the ray length is repeatedly clipped using signed distance values to approach a surface in a process called ray marching [9]. This work establishes the potential use of signed distance ﬁelds in static CAD-based Monte Carlo radiation transport, with possible future extension to dynamic geometries.
3. Signed distance ﬁeld implementation in DAGMC
As an initial implementation, one signed distance ﬁeld is generated for each volume in DAGMC with extents matching the axis-aligned bounding box of the volume. The signed distance ﬁeld is represented as a uniform structured mesh with a signed distance value at each vertex in the mesh as indicated in Fig. 2. (Altering the sign convention when populating the data structure rather than incurring the additional computational cost of altering the sign of values for each operation is preferable.) It is mentioned above that signed distance ﬁelds are typically generated using an implicit, analytic representation, but a suitable data structure for populating the structured mesh with signed distance values is already in place in the form of DAGMC's bounding volume hierarchy. It is a more straightforward process to simply use DAGMC's current closest to location algorithm to generate signed distance values than to create an implicit surface approximation of the triangle mesh. Though the latter may be faster, performance improvements didn't seem to be impeded greatly by using this method to populate the data struc-ture. This method also maintains a consistency between the in-tersections found by the ray tracing kernel and the signed distance ﬁeld values.
DAGMC's closest to boundary algorithm returns, among other
pieces of information, the nearest intersection location and the
P.C. Shriwise et al. / Nuclear Engineering and Technology 49 (2017) 1189e1198 1191
Signed distance field
Fig. 2. 2D visualization of the signed distance ﬁeld with sign conventions reversed for use in radiation transport.
triangle on which this intersection exists. For each point in the signed distance ﬁeld mesh, this algorithm is used to determine the magnitude of the distance value. To determine the sign of the distance value, a ray is constructed from query location and the intersection location. The dot product of this ray vector with the triangle's outward normal vector is used to determine the sign of the distance value. DAGMC maintains enough information to consistently orient triangle normals such that they point outward from the volume they represent. In the rare cases for which the dot product of these vectors is ambiguous, or zero, DAGMC's point containment algorithm is used to disambiguate the value's sign.
The initial implementation of the signed distance ﬁeld employs MOAB's structured mesh interface and data tagging for storage. This interface maintains a representation of the structured mesh with vertex coordinates and handles at each point along with hex elements for each mesh voxel. These vertex coordinates and hex elements can be accessed using * indexing. While this format is somewhat memory intensive, it provides a fast path for veriﬁcation, visualization, and proof of concept in the transport test cases for demonstration. One can imagine a much less memory intensive implementation inwhich only a box corner, grid step size, dimensions, and the signed distance value data are stored. A transition to an implementation like this will likely occur before application to production work.
Signed distance values can be retrieved from the structured mesh by determining which mesh voxel the point lies within. The point's element is accessed by determining an ** index using the point's x, y, and z values divided by the structured mesh step size. A trilinear interpolation of the 8-element vertex coordinates and their signed distance values is then used to provide the signed distance value for the location of interest. As a result, the complexity of a signed distance value lookup from the signed dis-tance ﬁeld is Oð1Þ. Performance improvements for geometric queries are based upon using this process in place of the OðlogðNÞÞ
ray tracing process.
3.1. Signed distance ﬁeld application in DAGMC
The signed distance ﬁeld can be used to accelerate common Monte Carlo geometry queries by providing information about the nearest surface crossing in any direction in a very similar manner to the way this is accomplished in CSG representations.
Three types of geometric queries are common among the various Monte Carlo codes that DAGMC supports. These include next surface intersection, point containment, and closest boundary intersection queries. Typically, a ray is ﬁred to satisfy any of these queries in DAGMC with OðlogðNÞÞcomplexity, but it is hypothesized that these queries can be accelerated in many cases by ﬁrst per-forming an Oð1Þ signed distance value lookup to precondition ray ﬁre calls and make sure they are necessary.
Point containment queries can be performed by examining the signed distance value for the point. If the point's value is negative (or outside of the signed distance ﬁeld data structure), then the point is not contained within the volume. If the point's value is positive, then the point is determined to be inside the volume. Given that there is error associated with each of these interpolated values, the point containment using a signed distance ﬁeld should only be trustedif the absolute value of the signed distance is greater than the expected error associated with the value. If this is not the case, then a ray must be ﬁred to determine the particle's contain-ment with respect to the volume in question.
Closest to boundary queries can be performed in a similar manner to the point containment queries, but they are more dependent on the native code's intent for their use. Some Monte Carlo codes query for the nearest volume surface intersection to determine whether the particle will exit the volume before reaching its next physics event location. Signed distance ﬁelds are designed for exactly this operation. In similar fashion to the point contain-ment case, the signed distance value should only be trusted if it is greater than the error associated with the value. Additionally, the error should be subtracted from the value, returning to the code a conservative value for the nearest intersection.If the signed distance value's magnitude is not greater than its error evaluation, or if the value is negative, then a ray should be ﬁred to determine the exact location of the nearest boundary crossing for the particle's location. Next surface intersections are called by native Monte Carlo codes to determine if a particle will cross a surface before reaching its next physics event location. This is the most common geometry query in an average Monte Carlo simulation. Normally in DAGMC a ray is ﬁred each time this query is called. This can be avoided by using the signed distance ﬁeld to exclude the possibility of a surface crossing without explicitly determining the next surface intersec-tion. If the sum of the signed distance values for both the current particle position and the next physics event location is greater than the distance between the two, then no surface crossing will occur and the particle can safely advance to the next physics event location. For robustness, the error for each interpolation should be subtracted from the sum of the signed distance values as a con-servative measure. If the expanse between the particle's current location and its next physics event interaction cannot be accounted for by the signed distance values of the two points, then a ray will be ﬁred to determine the particle's next surface intersection along that trajectory. Fig. 4 shows a graphic representation of this process. Not all Monte Carlo codes provide the next physics event location along with the particle's current location to their geometry kernels.
In this case, preconditioning of these queries will not be possible. Using these methods, the storage of signed distances ﬁeld for
volumes in DAGMC could provide a way to accelerate the Monte Carlo queries listed above by using a Oð1Þ process to establish that the conditions of a geometric queryare such that a more robust and
computationally expensive ray is necessary before performing the
1192 P.C. Shriwise et al. / Nuclear Engineering and Technology 49 (2017) 1189e1198
ray tracing operation. It is hypothesized that in many cases during radiation transport, this process can be used to subvert many ray tracing calls and a large number of these OðlogðNÞÞ searches can be avoided. The application of the signed distance ﬁeld data structure in several test problems indicates that this is true.
3.2. Signed distance value error estimation
A critical component of using a sampled signed distance function as a ray ﬁring preconditioner is the evaluation of an error limit for the interpolated signed distance values that allow DAGMC to maintain its robust particle tracking. The failure mode of concern is the scenario inwhich aninaccurate signed distance value resultsina particle being numerically moved outside of the current volume without logicallyleavingthevolume. Thiswillresult ina lostparticle or incorrect tallying of the particle's history caused by the decou-pling of the particle's logical position within the model with the numerical position in space. Such a scenario would arise from sit-uations such as that shown in Fig. 4C, in which the interpolation error is underestimated. However, overly conservative values of the errorestimationwillresult inlower utilizationof thepreconditioner, so it is importantnot to overestimate the error by too large a margin.
The errorof linear interpolation is well understood when derived from continuous functions with nonzero second-order derivatives. The formula for the errorof a bilinear interpolation is providedinEq. 4. Extending this representation to 3D and examining the dominant terms of this formulation, the error of the trilinear interpolation is nominally Oðh3Þ where h is the step size of the structured mesh. Considering only these terms, the signed distance value can be found to a high degree of accuracy fora relativelycoarse mesh, but it would be unwise to ignore the remaining terms representing the principal curvature of the surface, particularly given the geometric complexity of the models commonly analyzed using DAGMC. Un-fortunately, triangulated surfaces do not provide a continuous function fromwhich this principle curvature can be evaluated, nor is there a simple way to determine the second-order derivative of the mesh at a given point without encountering a secondary error es-
timate for that value as well.
structure was implemented for a simple single-volume sphere model to test its utilization and demonstrate performance im-provements. The model consists of a single 10-cm-radius sphere
ﬁlled with hydrogen of density 1 cm3 and a 5-MeV neutron point source at the sphere's origin. Flux and energy deposition tallies
were applied to this volume for result veriﬁcation between MCNP5, DAG-MCNP5, and DAG-MCNP5 with the signed distance ﬁeld pre-conditioner applied. Fig. 3 shows the signed distance ﬁeld (w/SDF) for a sphere of radius 10 cm using MOAB's structured mesh inter-face with a step size of 0.5 cm. The design intent in this test was for the particles to have an average mean free path signiﬁcantly smaller than the size of the sphere. This highly scattering medium is expected to provide a good problem scenario for the precondi-tioner as it is most effective when particle interactions are frequently occurring far from surface interfaces. Simulations of 100 million histories were run for each implementation listed above. Signed distance ﬁeld preconditioning was only implemented for next surface intersection queries.
A simple sphere presents a worst case for DAG-MCNP5 in comparison to a CSG implementation such as the one that exists in MCNP5. Analytic geometry queries are very simple even in com-parison to other CSG objects, let alone in comparison to a sphere representation composed of hundreds of thousands of triangles, even with DAGMC's existing accelerations.
The results of this initial test can be seen in Table 1. This initial test case indicates that signed distance ﬁeld preconditioning was quite effectivedaccelerating the simulation in comparison to a normal DAGMC run by a factor of 3.5. It should be noted that no differencewas found in either the ﬂuxor energy tallies between the two DAG-MCNP5 runs.
5. Signed distance ﬁeld preconditioner utilization
In effect, the preconditioner is attempting to check whether the particle will cross a surface before explicitly searching for the par-ticle's intersection with a surface along its current trajectory. If the result of this preconditioning check is always false and a ray is al-
ways ﬁred, then these checks are only adding to the computational
1 v2u 1 v2u 2 vx2 2 vy2
h mesh interval size (cm)
Dx x distance to interpolation point from data point (cm) Dy y distance to interpolation point from data point (cm) u(x,y) sampled function on mesh (cm)
ε error (cm)
cost of the problem. This will always occur in volumes ﬁlled with
(4) void, for example, as particles immediately travel from one surface to another. As a result, the signed distance ﬁeld may need to be
applied selectively depending on each volume's geometric and material properties for optimal performance and high utilization of the preconditioning methods. Ideally, this method will only be applied tovolumes inwhich the data structure canprecondition ray ﬁre calls often or with high utilization of the data structure. The signed distance ﬁeld is expected to have the biggest impact in
performance when preconditioning next surface intersection
Until a better solution is settled upon to account for the second-order terms, a more aggressive error estimate has been employed. For the work presented here, the error is evaluated as the length of
a mesh element's longest diagonal (3 h). This represents an upper
queries, as they are most frequently called in Monte Carlo codes when tracking particles through the geometry. As such, this type of query is the focus of utilization measurement for the remainder of
this section.
bound on the error of the signed distance value, as this is the farthest a location can possibly be from any of the data points while
still being contained by that mesh element. This evaluation of the
Rays Avoided w= SDF
Number of Geometry Queries
(5)
error has the effect of removing any data in mesh elements which intersect with a volume's surface. This provides a robust manner of using the signed distance ﬁeld even if utilization could be higher for a more optimistic approach to calculating the interpolation error.
4. Initial performance results
The signed distance ﬁeld (SDF) was ﬁrst applied to DAGMC
coupled with MCNP5 v1.6 [10] known as DAG-MCNP5. This data
The utilization, U, of the signed distance ﬁeld as a ray ﬁre pre-conditioner can be described as the number of ray ﬁre calls related to the next surface intersection queries that are avoided, divided by the total number of next surface intersection queries made by the Monte Carlo code. This value is described in Eq. 5 and can be quantiﬁed using this deﬁnition using debugging tools, such as Valgrind, during DAGMC simulations. It is expected that in most cases, as the utilization of preconditioning methods goes up, the
performance of the simulation will also improve.
P.C. Shriwise et al. / Nuclear Engineering and Technology 49 (2017) 1189e1198 1193
Fig. 3. A visual of a signed distance ﬁeld with step size 0.5 cm surrounding the spherical volume of test case with a radius of 10 cm.
f
Table 1
Initial results of a signed distance ﬁeld query preconditioner in DAGMC for a 5-MeV
point source at the center of a single 10-cm-radius hydrogen-ﬁlled sphere (1 cm3) test case. One hundred million histories were run in each implementation.
p Implementation
MCNP5
DAG-MCNP5
DAG-MCNP5 w/SDF
ctme (min)
2.75 25.04
7.15
wall time (min)
2.75 25.13
7.3
time precond. ratio utilization
1 N/A 9.13 N/A
2.65 0.97
l
f
without the signed distance ﬁeld and another with the signed distance ﬁeld and preconditioning enabled. Fig. 6 shows the results of this study.
Utilization of the data structure in this study remains high until
the hydrogen density falls to 0.1 cm3 at which point a distinct knee appears and the utilization falls off quickly. Even at the lowest
density reached in the study of 0.01 cm3, the utilization of the signed distance ﬁeld to avoid ray ﬁre calls is 0.54. It is difﬁcult to judge the
impact on the performance of this simulation for these low-density values due to the limited size of the geometry and the short-lived histories. As the material density decreases, particles quickly leave the geometry after very few collisions, but Fig. 5 provides an impression of the performance of these three implementations converge as the densityof the hydrogen is varied. The application of the signed distance ﬁeld allows for signiﬁcantly improved perfor-
mance until the density drops below 0.1 cm3 in agreement with utilization plot. To have more control over a simulation's physical
Fig. 4. Visualization of ray preconditioning scenarios. The ε here represents the associated error of the signed distance value interpolation.
To understand this utilization more deeply with respect to material parameters, the hydrogen density was varied from 0 to 1
cm3 in the single-volume sphere test problemwith a 5-MeV neutron point source. For each density, one simulation was performed
parameters, subsequent experiments were performed using a simple simulation tool.
6. Signed distance ﬁeld utilization modeling
To characterize utilization of a signed distance ﬁeld as a next surface intersection query preconditioner for ray ﬁre calls in
DAGMC, a pseudo Monte Carlosimulation toolwas developed using
1194 P.C. Shriwise et al. / Nuclear Engineering and Technology 49 (2017) 1189e1198
Fig. 5. Performance results for a 5-MeV neutron source at the origin of a 10-cm-radius sphere. Hydrogen density was varied from 0 to 1 cm3. Simulations of 100 million histories at each density were performed using native MCNP5, DAG-MCNP5 without the signed distance ﬁeld, and DAG-MCNP5 with the signed distance ﬁeld.
*