Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_ModVectorTensor.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 for vector and tensor/matrix operations
26 !
27 ! Description: None.
28 !
29 ! Notes: None.
30 !
31 ! ******************************************************************************
32 !
33 ! $Id: RFLO_ModVectorTensor.F90,v 1.3 2008/12/06 08:44:17 mtcampbe Exp $
34 !
35 ! Copyright: (c) 2004 by the University of Illinois
36 !
37 ! ******************************************************************************
38 
40 
41  USE modglobal, ONLY : t_global
42  USE moddatastruct, ONLY: t_region
43  USE modgrid, ONLY : t_grid
44  USE modbndpatch, ONLY : t_patch
45  USE modparameters
46  USE moddatatypes
47  USE moderror
48  USE modmpi
49 
50  IMPLICIT NONE
51 
52  PRIVATE
53  PUBLIC :: rflo_normcrossprod
54 
55 ! private :
56 
57 ! ******************************************************************************
58 ! Declarations and definitions
59 ! ******************************************************************************
60 
61  CHARACTER(CHRLEN) :: RCSIdentString = &
62  '$RCSfile: RFLO_ModVectorTensor.F90,v $ $Revision: 1.3 $'
63 
64 ! ******************************************************************************
65 ! Routines
66 ! ******************************************************************************
67 
68  CONTAINS
69 
70 !******************************************************************************
71 !
72 ! Purpose: perform cross product and normalize it
73 !
74 ! Description: none.
75 !
76 ! Input: s1, s2 = pair of vectors to be processed
77 !
78 ! Output: s3 = s1 x s2
79 !
80 ! Notes: none
81 !
82 !******************************************************************************
83 
84 SUBROUTINE rflo_normcrossprod( s1,s2,s3 )
85 
86  IMPLICIT NONE
87 
88 ! ... parameters
89  REAL(RFREAL) :: s1(:), s2(:), s3(:)
90 
91 ! ... loop variables
92 
93 ! ... local variables
94  REAL(RFREAL) :: smag
95 
96 !******************************************************************************
97 
98  s3(xcoord) = s1(ycoord)*s2(zcoord)-s1(zcoord)*s2(ycoord)
99  s3(ycoord) = s1(zcoord)*s2(xcoord)-s1(xcoord)*s2(zcoord)
100  s3(zcoord) = s1(xcoord)*s2(ycoord)-s1(ycoord)*s2(xcoord)
101  smag = sqrt( s3(xcoord)**2+s3(ycoord)**2+s3(zcoord)**2 )
102  s3(:) = s3(:)/smag
103 
104 END SUBROUTINE rflo_normcrossprod
105 
106 ! ******************************************************************************
107 ! End
108 ! ******************************************************************************
109 
110 END MODULE rflo_modvectortensor
111 
112 ! ******************************************************************************
113 !
114 ! RCS Revision history:
115 !
116 ! $Log: RFLO_ModVectorTensor.F90,v $
117 ! Revision 1.3 2008/12/06 08:44:17 mtcampbe
118 ! Updated license.
119 !
120 ! Revision 1.2 2008/11/19 22:17:28 mtcampbe
121 ! Added Illinois Open Source License/Copyright
122 !
123 ! Revision 1.1 2005/12/05 10:53:09 wasistho
124 ! initial import
125 !
126 !
127 !
128 ! ******************************************************************************
129 
130 
131 
132 
133 
134 
subroutine, public rflo_normcrossprod(s1, s2, s3)
double sqrt(double d)
Definition: double.h:73