Difference between revisions of "Relative position of a particle in a cell"
From MohidWiki
Paulochambel (talk | contribs) (New page: A fundamental in the "MOHID system" lagrangian approach is to know the relative position of the tracer in the hydrodynamic cell to speed up the interpolation procedure. This is quite easy ...) |
|||
Line 4: | Line 4: | ||
− | < | + | <mathtex> y_1 = a_1 + b_1 x_1 \wedge a_1 = {{x_d y_c - x_c y_d } \over {x_d - x_c }} \wedge b_1 = {{y_d - y{}_c} \over {x_d - x_c }} </mathtex> |
<math> y_2 = a_2 + b_2 x_2 \wedge a_2 = {{x_b y_a - x_a y_b } \over {x_b - x_a }} \wedge b_2 = {{y_b - y{}_a} \over {x_b - x_a }} </math> | <math> y_2 = a_2 + b_2 x_2 \wedge a_2 = {{x_b y_a - x_a y_b } \over {x_b - x_a }} \wedge b_2 = {{y_b - y{}_a} \over {x_b - x_a }} </math> |
Revision as of 16:19, 4 May 2011
A fundamental in the "MOHID system" lagrangian approach is to know the relative position of the tracer in the hydrodynamic cell to speed up the interpolation procedure. This is quite easy for square cells however this not the case for cells of curvilinear grids . In this case was develop a subroutine that is able to compute the generic position of a tracer in a generic cell (see subroutine RelativePosition4VertPolygon in module functions). The algorithm used is described below.
<mathtex> y_1 = a_1 + b_1 x_1 \wedge a_1 = {{x_d y_c - x_c y_d } \over {x_d - x_c }} \wedge b_1 = {{y_d - y{}_c} \over {x_d - x_c }} </mathtex>
if (b1==b2) then else endif
if (b3==b4) then else endif