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