Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_ModBilinearPatch.F90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 ! ******************************************************************************
24 !
25 ! Purpose: Suite of routines related to bilinear patches.
26 !
27 ! Description: None.
28 !
29 ! Notes: None.
30 !
31 ! ******************************************************************************
32 !
33 ! $Id: RFLU_ModBilinearPatch.F90,v 1.5 2008/12/06 08:44:20 mtcampbe Exp $
34 !
35 ! Copyright: (c) 2005 by the University of Illinois
36 !
37 ! ******************************************************************************
38 
40 
41  USE modglobal, ONLY: t_global
42  USE modparameters
43  USE moddatatypes
44  USE moderror
45  USE modbndpatch, ONLY: t_patch
46  USE moddatastruct, ONLY: t_region
47  USE modgrid, ONLY: t_grid
48  USE modmpi
49 
50  IMPLICIT NONE
51 
52  PRIVATE
53  PUBLIC :: rflu_blin_computenormal, &
56 
57 ! ******************************************************************************
58 ! Declarations and definitions
59 ! ******************************************************************************
60 
61  CHARACTER(CHRLEN), PRIVATE :: &
62  RCSIdentString = '$RCSfile: RFLU_ModBilinearPatch.F90,v $ $Revision: 1.5 $'
63 
64 ! ******************************************************************************
65 ! Routines
66 ! ******************************************************************************
67 
68  CONTAINS
69 
70 
71 
72 
73 
74 
75 ! ******************************************************************************
76 !
77 ! Purpose: Compute normal vector of bilinear patch at given (u,v) coordinates.
78 !
79 ! Description: None.
80 !
81 ! Input:
82 ! global Pointer to global data
83 ! ax,ay,az Components of bilinear patch parametric representation
84 ! bx,by,bz Components of bilinear patch parametric representation
85 ! cx,cy,cz Components of bilinear patch parametric representation
86 ! dx,dy,dz Components of bilinear patch parametric representation
87 ! u u-coordinate
88 ! v v-coordinate
89 !
90 ! Output:
91 ! nx x-component of normal vector
92 ! ny y-component of normal vector
93 ! nz z-component of normal vector
94 !
95 ! Notes: None.
96 !
97 ! ******************************************************************************
98 
99 SUBROUTINE rflu_blin_computenormal(global,ax,ay,az,bx,by,bz,cx,cy,cz,dx,dy,dz, &
100  u,v,nx,ny,nz)
101 
102  IMPLICIT NONE
103 
104 ! ******************************************************************************
105 ! Declarations and definitions
106 ! ******************************************************************************
107 
108 ! ==============================================================================
109 ! Parameters
110 ! ==============================================================================
111 
112  REAL(RFREAL), INTENT(IN) :: ax,ay,az,bx,by,bz,cx,cy,cz,dx,dy,dz,u,v
113  REAL(RFREAL), INTENT(OUT) :: nx,ny,nz
114  TYPE(t_global), POINTER :: global
115 
116 ! ==============================================================================
117 ! Locals
118 ! ==============================================================================
119 
120  REAL(RFREAL) :: imag
121 
122 ! ******************************************************************************
123 ! Start
124 ! ******************************************************************************
125 
126  CALL registerfunction(global,'RFLU_BLIN_ComputeNormal',&
127  'RFLU_ModBilinearPatch.F90')
128 
129 ! ******************************************************************************
130 ! Compute normal
131 ! ******************************************************************************
132 
133  nx = v*(ay*cz - az*cy) - u*(ay*bz - az*by) + by*cz - bz*cy
134  ny = v*(az*cx - ax*cz) - u*(az*bx - ax*bz) + bz*cx - bx*cz
135  nz = v*(ax*cy - ay*cx) - u*(ax*by - ay*bx) + bx*cy - by*cx
136 
137  imag = 1.0_rfreal/sqrt(nx*nx + ny*ny + nz*nz)
138 
139  nx = imag*nx
140  ny = imag*ny
141  nz = imag*nz
142 
143 ! ******************************************************************************
144 ! End
145 ! ******************************************************************************
146 
147  CALL deregisterfunction(global)
148 
149 END SUBROUTINE rflu_blin_computenormal
150 
151 
152 
153 
154 
155 
156 
157 
158 
159 
160 ! ******************************************************************************
161 !
162 ! Purpose: Compute intersection distance of given location along given line
163 ! vector and bilinear face.
164 !
165 ! Description: None.
166 !
167 ! Input:
168 ! pRegion Pointer to region data
169 ! xLoc,yLoc,zLoc x-, y-, and z-coordinates of location in question
170 ! ex,ey,ez x-, y-, and z-components of unit line vector
171 ! iPatch Face location
172 ! ifg Face index
173 !
174 ! Output:
175 ! nt Number of intersections
176 ! t Array of intersection distances
177 !
178 ! Notes:
179 ! 1. The line vector MUST be a unit line vector. If that is not correct, the
180 ! distance between the given point and the intersection of the line with
181 ! the faces of the given cell will not be computed correctly.
182 ! 2. For details on derivation, see: S.D. Ramsey, K. Potter, and C. Hansen,
183 ! Ray Bilinear Patch Intersection, ACM J. Graphics Tools, Vol. 9, No. 3,
184 ! pp. 41-47, 2004.
185 !
186 ! ******************************************************************************
187 
188 SUBROUTINE rflu_blin_computexsectline(pRegion,xLoc,yLoc,zLoc,ex,ey,ez,icg, &
189  ipatch,ifg,nt,t)
190 
191  USE modtools, ONLY: swaprfreals
192 
193  IMPLICIT NONE
194 
195 ! ******************************************************************************
196 ! Declarations and definitions
197 ! ******************************************************************************
198 
199 ! ==============================================================================
200 ! Arguments
201 ! ==============================================================================
202 
203  INTEGER, INTENT(IN) :: icg,ifg,ipatch
204  INTEGER, INTENT(INOUT) :: nt
205  REAL(RFREAL), INTENT(IN) :: ex,ey,ez
206  REAL(RFREAL), INTENT(IN) :: xloc,yloc,zloc
207  REAL(RFREAL), INTENT(OUT) :: t(2)
208  TYPE(t_region), POINTER :: pregion
209 
210 ! ==============================================================================
211 ! Locals
212 ! ==============================================================================
213 
214  INTEGER :: iv,nv,v1g,v1l,v2g,v2l,v3g,v3l,v4g,v4l
215  REAL(RFREAL) :: a,ae,ax,ay,az,a1,a2,b,be,bx,by,bz,b1,b2,c,ce,cx,cy,cz,c1, &
216  c2,d,de,denom1,denom2,disc,dotp,dx,dy,dz,d1,d2, &
217  fuzzytolerance,px,py,pz,q,re,u,xcofg,x1,x2,x3,x4, &
218  ycofg,y1,y2,y3,y4,zcofg,z1,z2,z3,z4
219  REAL(RFREAL), DIMENSION(2) :: v
220  TYPE(t_global), POINTER :: global
221  TYPE(t_grid), POINTER :: pgrid
222  TYPE(t_patch), POINTER :: ppatch
223 
224 ! DEBUG
225  INTEGER :: ivg
226  REAL(RFREAL) :: nx,ny,nz,a3,b3,c3,d3
227 ! END DEBUG
228 
229 ! ******************************************************************************
230 ! Start
231 ! ******************************************************************************
232 
233  global => pregion%global
234 
235  CALL registerfunction(global,'RFLU_BLIN_ComputeXSectLine',&
236  'RFLU_ModBilinearPatch.F90')
237 
238 ! ==============================================================================
239 ! Set grid pointer and initialize variables
240 ! ==============================================================================
241 
242  pgrid => pregion%grid
243 
244  nt = 0
245 
246  fuzzytolerance = -pregion%mixtInput%tolerICT
247 
248  t(1:2) = REAL(crazy_value_int,kind=rfreal)
249 
250 ! ******************************************************************************
251 ! Get face vertices and coordinates
252 ! ******************************************************************************
253 
254 ! DEBUG
255  WRITE(0,*) '###100',pregion%iRegionGlobal,ipatch,ifg
256  WRITE(0,*) '###110',pregion%iRegionGlobal,xloc,yloc,zloc
257  WRITE(0,*) '###120',pregion%iRegionGlobal,ex,ey,ez
258 
259 ! DO ivg = 1,pGrid%nVert
260 ! WRITE(*,'(1X,I2,3(1X,E13.6))') ivg,pGrid%xyz(:,ivg)
261 ! END DO ! ivg
262 ! END DEBUG
263 
264  IF ( ipatch == 0 ) THEN
265  v1g = pgrid%f2v(1,ifg)
266  v2g = pgrid%f2v(2,ifg)
267  v3g = pgrid%f2v(3,ifg)
268  v4g = pgrid%f2v(4,ifg)
269 
270  IF ( v4g == vert_none ) THEN
271  CALL errorstop(global,err_reached_default,__line__)
272  END IF ! v4g
273  ELSE IF ( ipatch > 0 ) THEN
274  ppatch => pregion%patches(ipatch)
275 
276  v1l = ppatch%bf2v(1,ifg)
277  v2l = ppatch%bf2v(2,ifg)
278  v3l = ppatch%bf2v(3,ifg)
279  v4l = ppatch%bf2v(4,ifg)
280 
281  IF ( v4l == vert_none ) THEN
282  CALL errorstop(global,err_reached_default,__line__)
283  END IF ! v4l
284 
285  v1g = ppatch%bv(v1l)
286  v2g = ppatch%bv(v2l)
287  v3g = ppatch%bv(v3l)
288  v4g = ppatch%bv(v4l)
289  ELSE
290  CALL errorstop(global,err_reached_default,__line__)
291  END IF ! iPatch
292 
293 ! DEBUG
294  WRITE(0,*) '###130',pregion%iRegionGlobal,v1g,v2g,v3g,v4g
295 ! END DEBUG
296 
297  x1 = pgrid%xyz(xcoord,v1g)
298  x2 = pgrid%xyz(xcoord,v2g)
299  x3 = pgrid%xyz(xcoord,v3g)
300  x4 = pgrid%xyz(xcoord,v4g)
301 
302  y1 = pgrid%xyz(ycoord,v1g)
303  y2 = pgrid%xyz(ycoord,v2g)
304  y3 = pgrid%xyz(ycoord,v3g)
305  y4 = pgrid%xyz(ycoord,v4g)
306 
307  z1 = pgrid%xyz(zcoord,v1g)
308  z2 = pgrid%xyz(zcoord,v2g)
309  z3 = pgrid%xyz(zcoord,v3g)
310  z4 = pgrid%xyz(zcoord,v4g)
311 
312 ! DEBUG
313  WRITE(0,*) '@@@131a',pregion%iRegionGlobal,x1,x2,x3,x4
314  WRITE(0,*) '@@@131b',pregion%iRegionGlobal,y1,y2,y3,y4
315  WRITE(0,*) '@@@131c',pregion%iRegionGlobal,z1,z2,z3,z4
316 ! END DEBUG
317 
318 ! ******************************************************************************
319 ! Compute geometric terms
320 ! ******************************************************************************
321 
322  re = xloc*ex + yloc*ey + zloc*ez
323 
324  ax = x3 - x2 - x4 + x1
325  ay = y3 - y2 - y4 + y1
326  az = z3 - z2 - z4 + z1
327  ae = ax*ex + ay*ey + az*ez
328 
329  bx = x2 - x1
330  by = y2 - y1
331  bz = z2 - z1
332  be = bx*ex + by*ey + bz*ez
333 
334  cx = x4 - x1
335  cy = y4 - y1
336  cz = z4 - z1
337  ce = cx*ex + cy*ey + cz*ez
338 
339  dx = x1
340  dy = y1
341  dz = z1
342  de = dx*ex + dy*ey + dz*ez
343 
344  a1 = az - ay - ae*(ez - ey)
345  a2 = az - ax - ae*(ez - ex)
346  a3 = a2 - a1
347 
348  b1 = bz - by - be*(ez - ey)
349  b2 = bz - bx - be*(ez - ex)
350  b3 = b2 - b1
351 
352  c1 = cz - cy - ce*(ez - ey)
353  c2 = cz - cx - ce*(ez - ex)
354  c3 = c2 - c1
355 
356  d1 = dz - dy - (zloc - yloc) - (de - re)*(ez - ey)
357  d2 = dz - dx - (zloc - xloc) - (de - re)*(ez - ex)
358  d3 = d2 - d1
359 
360  a = a1*c2 - a2*c1
361  b = a1*d2 - a2*d1 + b1*c2 - b2*c1
362  c = b1*d2 - b2*d1
363 
364 ! DEBUG
365  WRITE(0,*) 'a:',ax,ay,az,ae
366  WRITE(0,*) 'b:',bx,by,bz,be
367  WRITE(0,*) 'c:',cx,cy,cz,ce
368  WRITE(0,*) 'd:',dx,dy,dz,de
369  WRITE(0,*) 'A-D1:',a1,b1,c1,d1
370  WRITE(0,*) 'A-D2:',a2,b2,c2,d2
371  WRITE(0,*) 'A-D3:',a3,b3,c3,d3
372  WRITE(0,*) 'a-c:',a,b,c
373 ! END DEBUG
374 
375 ! ******************************************************************************
376 ! Compute v
377 ! ******************************************************************************
378 
379  IF ( abs(a) > 0.0_rfreal ) THEN ! Quadratic equation
380  disc = b*b - 4.0_rfreal*a*c
381 
382 ! DEBUG
383  WRITE(0,*) 'disc=',disc
384 ! END DEBUG
385 
386  IF ( disc > 0.0_rfreal ) THEN
387  nv = 2
388 
389  IF ( abs(c) > 0.0_rfreal ) THEN
390  q = -0.5_rfreal*(b + sign(1.0_rfreal,b)*sqrt(disc))
391 
392  v(1) = q/a
393  v(2) = c/q
394  ELSE
395  v(1) = 0.0_rfreal
396  v(2) = -b/a
397  END IF ! nv
398  ELSE IF ( disc < 0.0_rfreal ) THEN
399  nv = 0
400 
401  v(1) = REAL(CRAZY_VALUE_INT,KIND=RFREAL)
402  v(2) = REAL(CRAZY_VALUE_INT,KIND=RFREAL)
403  ELSE
404  nv = 1
405 
406  v(1) = -0.5_rfreal*b/a
407  v(2) = REAL(crazy_value_int,kind=rfreal)
408  END IF ! disc
409  ELSE IF ( abs(b) > 0.0_rfreal ) THEN ! Linear equation
410  nv = 1
411 
412  v(1) = -c/b
413  ELSE
414  nv = 0
415  END IF ! ABS(a)
416 
417 ! DEBUG
418  WRITE(0,*) '###132',pregion%iRegionGlobal,v(:)
419 ! END DEBUG
420 
421 
422 ! ******************************************************************************
423 ! Compute intersection distance
424 ! ******************************************************************************
425 
426  DO iv = 1,nv
427 
428 ! ==============================================================================
429 ! Check value of v, proceed only if within range [0,1]
430 ! ==============================================================================
431 
432  IF ( (v(iv) < 0.0_rfreal) .OR. (v(iv) > 1.0_rfreal) ) THEN
433  cycle
434  END IF ! v(iv)
435 
436 ! ==============================================================================
437 ! Compute u, proceed only if within range [0,1]
438 ! ==============================================================================
439 
440  denom1 = v(iv)*a2 + b2
441  denom2 = denom1 - (v(iv)*a1 + b1)
442 
443  IF ( abs(denom2) > abs(denom1) ) THEN
444  u = (v(iv)*(c1 - c2) + d1 - d2)/denom2
445  ELSE
446  u = -(v(iv)*c2 + d2)/denom1
447  END IF ! ABS(denom1)
448 
449 ! DEBUG
450  WRITE(0,*) '###134',pregion%iRegionGlobal,iv,v(iv),u
451 ! END DEBUG
452 
453  IF ( (u < 0.0_rfreal) .OR. (u > 1.0_rfreal) ) THEN
454  cycle
455  END IF ! u
456 
457 ! ==============================================================================
458 ! Compute intersection point
459 ! ==============================================================================
460 
461  px = u*v(iv)*ax + u*bx + v(iv)*cx + dx
462  py = u*v(iv)*ay + u*by + v(iv)*cy + dy
463  pz = u*v(iv)*az + u*bz + v(iv)*cz + dz
464 
465 ! DEBUG
466  WRITE(0,*) '###135',pregion%iRegionGlobal,px,py,pz
467 ! END DEBUG
468 
469 ! ==============================================================================
470 ! Compute normal at intersection point and ensure it is an outward normal
471 ! ==============================================================================
472 
473  CALL rflu_blin_computenormal(global,ax,ay,az,bx,by,bz,cx,cy,cz, &
474  dx,dy,dz,u,v(iv),nx,ny,nz)
475 
476  xcofg = pgrid%cofg(xcoord,icg)
477  ycofg = pgrid%cofg(ycoord,icg)
478  zcofg = pgrid%cofg(zcoord,icg)
479 
480  dotp = (px - xcofg)*nx + (py - ycofg)*ny + (pz - zcofg)*nz
481 
482 ! DEBUG
483  WRITE(0,*) '###136',pregion%iRegionGlobal,nx,ny,nz,dotp
484 ! END DEBUG
485 
486  IF ( dotp < 0.0_rfreal ) THEN
487  nx = -nx
488  ny = -ny
489  nz = -nz
490  END IF ! dotp
491 
492 ! ==============================================================================
493 ! Compute intersection distance. NOTE expression for intersection
494 ! distance differs from that in the paper - it avoids IFs and divisions.
495 ! ==============================================================================
496 
497  dotp = (px - xloc)*nx + (py - yloc)*ny + (pz - zloc)*nz
498 
499 ! DEBUG
500  WRITE(0,*) '###137',pregion%iRegionGlobal,dotp
501 ! END DEBUG
502 
503  IF ( dotp > fuzzytolerance ) THEN ! Inside cell
504 ! DEBUG
505  WRITE(0,*) '###138',pregion%iRegionGlobal,ex*nx + ey*ny + ez*nz
506 ! END DEBUG
507 
508  IF ( ex*nx + ey*ny + ez*nz > 0.0_rfreal ) THEN ! In direction of traj
509  nt = nt + 1
510 
511  t(nt) = (px - xloc)*ex + (py - yloc)*ey + (pz - zloc)*ez
512  END IF ! ex*nx
513  END IF ! dotp
514  END DO ! iv
515 
516 ! ******************************************************************************
517 ! Swap so first entry is that with smaller intersection distance
518 ! ******************************************************************************
519 
520  IF ( nt > 0 ) THEN
521  IF ( abs(t(2)) < abs(t(1)) ) THEN
522  CALL swaprfreals(t(1),t(2))
523  END IF ! ABS(t(2))
524  END IF ! nt
525 
526 ! DEBUG
527  WRITE(0,*) '###140',pregion%iRegionGlobal,nt,t(1:2)
528 ! END DEBUG
529 
530 ! ******************************************************************************
531 ! End
532 ! ******************************************************************************
533 
534  CALL deregisterfunction(global)
535 
536 END SUBROUTINE rflu_blin_computexsectline
537 
538 
539 
540 
541 
542 
543 
544 
545 ! ******************************************************************************
546 !
547 ! Purpose: Given a point, compute closest point on bilinear patch.
548 !
549 ! Description: None.
550 !
551 ! Input:
552 ! global Pointer to global data
553 ! ax,ay,az Components of bilinear patch parametric representation
554 ! bx,by,bz Components of bilinear patch parametric representation
555 ! cx,cy,cz Components of bilinear patch parametric representation
556 ! dx,dy,dz Components of bilinear patch parametric representation
557 ! xq,yq,zq Coordinates of point
558 !
559 ! Output:
560 ! u,v Parametric coordinates of closest point on bilinear patch
561 ! x,y,z Coordinates of closest point on bilinear patch
562 !
563 ! Notes:
564 ! 1. Use Newton-Raphson method to solve non-linear system for (u,v).
565 ! 2. This routine does NOT check that the closest point lies in the patch,
566 ! i.e., that the (u,v) coordinates are in the range [0,1].
567 !
568 ! ******************************************************************************
569 
570  SUBROUTINE rflu_blin_findclosestpoint(global,ax,ay,az,bx,by,bz,cx,cy,cz, &
571  dx,dy,dz,xq,yq,zq,u,v,x,y,z)
572 
573  IMPLICIT NONE
574 
575 ! ******************************************************************************
576 ! Declarations and definitions
577 ! ******************************************************************************
578 
579 ! ==============================================================================
580 ! Parameters
581 ! ==============================================================================
582 
583  REAL(RFREAL), INTENT(OUT) :: u,v,x,y,z
584  REAL(RFREAL), INTENT(IN) :: ax,ay,az,bx,by,bz,cx,cy,cz,dx,dy,dz,xq,yq,zq
585  TYPE(t_global), POINTER :: global
586 
587 ! ==============================================================================
588 ! Locals
589 ! ==============================================================================
590 
591  INTEGER :: loopcounter
592  REAL(RFREAL) :: dfdu,dfdv,dgdu,dgdv,du,dv,dxdu,dxdv,dydu,dydv,dzdu,dzdv, &
593  d2,d2xduv,d2yduv,d2zduv,f,g,idet,tol
594 
595 ! ******************************************************************************
596 ! Start
597 ! ******************************************************************************
598 
599  CALL registerfunction(global,'RFLU_BLIN_FindClosestPoint',&
600  'RFLU_ModBilinearPatch.F90')
601 
602 
603 ! ******************************************************************************
604 ! Initialize
605 ! ******************************************************************************
606 
607  loopcounter = 0
608 
609  tol = 1.0e-6_rfreal
610 
611  u = 0.5_rfreal ! Initial guess
612  v = 0.5_rfreal
613 
614 ! ******************************************************************************
615 ! Newton-Raphson iteration to compute closest point
616 ! ******************************************************************************
617 
618  emptyloop: DO
619  loopcounter = loopcounter + 1
620 
621  x = u*v*ax + u*bx + v*cx + dx
622  y = u*v*ay + u*by + v*cy + dy
623  z = u*v*az + u*bz + v*cz + dz
624 
625  dxdu = v*ax + bx
626  dydu = v*ay + by
627  dzdu = v*az + bz
628 
629  dxdv = u*ax + cx
630  dydv = u*ay + cy
631  dzdv = u*az + cz
632 
633  d2xduv = ax
634  d2yduv = ay
635  d2zduv = az
636 
637  d2 = (x-xq)*(x-xq) + (y-yq)*(y-yq) + (z-zq)*(z-zq)
638 
639  f = (x-xq)*dxdu + (y-yq)*dydu + (z-zq)*dzdu
640  g = (x-xq)*dxdv + (y-yq)*dydv + (z-zq)*dzdv
641 
642  dfdu = dxdu*dxdu + dydu*dydu + dzdu*dzdu
643  dfdv = dxdu*dxdv + dydu*dydv + dzdu*dzdv &
644  + (x-xq)*d2xduv + (y-yq)*d2yduv + (z-zq)*d2zduv
645 
646  dgdu = dfdv
647  dgdv = dxdv*dxdv + dydv*dydv + dzdv*dzdv
648 
649  idet = 1.0_rfreal/(dfdu*dgdv - dfdv*dgdu)
650 
651  du = -idet*(dgdv*f - dgdu*g)
652  dv = -idet*(dfdu*g - dfdv*f)
653 
654  IF ( abs(du) < tol .AND. abs(dv) < tol ) THEN
655  EXIT emptyloop
656  ELSE IF ( loopcounter > limit_infinite_loop ) THEN
657  CALL errorstop(global,err_infinite_loop,__line__)
658  END IF ! ABS(du)
659 
660  u = u + du
661  v = v + dv
662  END DO emptyloop
663 
664 ! ******************************************************************************
665 ! End
666 ! ******************************************************************************
667 
668  CALL deregisterfunction(global)
669 
670  END SUBROUTINE rflu_blin_findclosestpoint
671 
672 
673 
674 
675 
676 
677 ! ******************************************************************************
678 ! End
679 ! ******************************************************************************
680 
681 END MODULE rflu_modbilinearpatch
682 
683 
684 ! ******************************************************************************
685 !
686 ! RCS Revision history:
687 !
688 ! $Log: RFLU_ModBilinearPatch.F90,v $
689 ! Revision 1.5 2008/12/06 08:44:20 mtcampbe
690 ! Updated license.
691 !
692 ! Revision 1.4 2008/11/19 22:17:31 mtcampbe
693 ! Added Illinois Open Source License/Copyright
694 !
695 ! Revision 1.3 2006/04/07 15:19:18 haselbac
696 ! Removed tabs
697 !
698 ! Revision 1.2 2006/03/25 21:49:14 haselbac
699 ! Renamed SwapFloats to SwapRFREALs
700 !
701 ! Revision 1.1 2005/12/24 21:17:50 haselbac
702 ! Initial revision
703 !
704 ! ******************************************************************************
705 
706 
707 
708 
709 
710 
711 
712 
713 
714 
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed by
Definition: roccomf90.h:7
subroutine, public rflu_blin_computenormal(global, ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, u, v, nx, ny, nz)
static SURF_BEGIN_NAMESPACE double sign(double x)
const NT & d
void int int REAL REAL * y
Definition: read.cpp:74
NT dx
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
unsigned char b() const
Definition: Color.h:70
double sqrt(double d)
Definition: double.h:73
RT c() const
Definition: Line_2.h:150
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
subroutine, public rflu_blin_computexsectline(pRegion, xLoc, yLoc, zLoc, ex, ey, ez, icg, iPatch, ifg, nt, t)
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
subroutine, public rflu_blin_findclosestpoint(global, ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, xq, yq, zq, u, v, x, y, z)
RT dz() const
Definition: Direction_3.h:133
NT dy
NT q
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine swaprfreals(a, b)
Definition: ModTools.F90:69
subroutine deregisterfunction(global)
Definition: ModError.F90:469
RT a() const
Definition: Line_2.h:140
unsigned char g() const
Definition: Color.h:69