Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReflectVector.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: Reflect vector about plane.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! nx x-component of normal vector of plane
31 ! ny y-component of normal vector of plane
32 ! nz z-component of normal vector of plane
33 ! xComp x-component of vector
34 ! yComp y-component of vector
35 ! zComp z-component of vector
36 !
37 ! Output:
38 ! xComp x-component of reflected vector
39 ! yComp y-component of reflected vector
40 ! zComp z-component of reflected vector
41 !
42 ! Notes: None.
43 !
44 ! ******************************************************************************
45 !
46 ! $Id: ReflectVector.F90,v 1.5 2008/12/06 08:44:10 mtcampbe Exp $
47 !
48 ! Copyright: (c) 2004 by the University of Illinois
49 !
50 ! ******************************************************************************
51 
52 SUBROUTINE reflectvector(nx,ny,nz,xComp,yComp,zComp)
53 
54  USE moddatatypes
55  USE modparameters
56 
57  IMPLICIT NONE
58 
59 ! ******************************************************************************
60 ! Declarations
61 ! ******************************************************************************
62 
63 ! ==============================================================================
64 ! Arguments
65 ! ==============================================================================
66 
67  REAL(RFREAL), INTENT(IN) :: nx,ny,nz
68  REAL(RFREAL), INTENT(INOUT) :: xcomp,ycomp,zcomp
69 
70 ! ==============================================================================
71 ! Locals
72 ! ==============================================================================
73 
74  CHARACTER(CHRLEN) :: rcsidentstring
75  REAL(RFREAL) :: term
76 
77 ! ******************************************************************************
78 ! Start
79 ! ******************************************************************************
80 
81  rcsidentstring = '$RCSfile: ReflectVector.F90,v $ $Revision: 1.5 $'
82 
83 ! ******************************************************************************
84 ! Reflect vector
85 ! ******************************************************************************
86 
87  term = 2.0_rfreal*(xcomp*nx + ycomp*ny + zcomp*nz)
88 
89  xcomp = xcomp - term*nx
90  ycomp = ycomp - term*ny
91  zcomp = zcomp - term*nz
92 
93 ! ******************************************************************************
94 ! End
95 ! ******************************************************************************
96 
97 END SUBROUTINE reflectvector
98 
99 ! ******************************************************************************
100 !
101 ! RCS Revision history:
102 !
103 ! $Log: ReflectVector.F90,v $
104 ! Revision 1.5 2008/12/06 08:44:10 mtcampbe
105 ! Updated license.
106 !
107 ! Revision 1.4 2008/11/19 22:17:23 mtcampbe
108 ! Added Illinois Open Source License/Copyright
109 !
110 ! Revision 1.3 2006/04/07 15:19:15 haselbac
111 ! Removed tabs
112 !
113 ! Revision 1.2 2004/05/05 20:37:03 fnajjar
114 ! Fixed bug: Vector reflection does not need rc
115 !
116 ! Revision 1.1 2004/04/08 01:32:31 haselbac
117 ! Initial revision
118 !
119 ! ******************************************************************************
120 
121 
122 
123 
124 
125 
subroutine reflectvector(nx, ny, nz, xComp, yComp, zComp)