Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IntegralCheck.f90
Go to the documentation of this file.
1 !*********************************************************************
2 !* Illinois Open Source License *
3 !* *
4 !* University of Illinois/NCSA *
5 !* Open Source License *
6 !* *
7 !* Copyright@2008, University of Illinois. All rights reserved. *
8 !* *
9 !* Developed by: *
10 !* *
11 !* Center for Simulation of Advanced Rockets *
12 !* *
13 !* University of Illinois *
14 !* *
15 !* www.csar.uiuc.edu *
16 !* *
17 !* Permission is hereby granted, free of charge, to any person *
18 !* obtaining a copy of this software and associated documentation *
19 !* files (the "Software"), to deal with the Software without *
20 !* restriction, including without limitation the rights to use, *
21 !* copy, modify, merge, publish, distribute, sublicense, and/or *
22 !* sell copies of the Software, and to permit persons to whom the *
23 !* Software is furnished to do so, subject to the following *
24 !* conditions: *
25 !* *
26 !* *
27 !* @ Redistributions of source code must retain the above copyright *
28 !* notice, this list of conditions and the following disclaimers. *
29 !* *
30 !* @ Redistributions in binary form must reproduce the above *
31 !* copyright notice, this list of conditions and the following *
32 !* disclaimers in the documentation and/or other materials *
33 !* provided with the distribution. *
34 !* *
35 !* @ Neither the names of the Center for Simulation of Advanced *
36 !* Rockets, the University of Illinois, nor the names of its *
37 !* contributors may be used to endorse or promote products derived *
38 !* from this Software without specific prior written permission. *
39 !* *
40 !* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
41 !* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
42 !* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
43 !* NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
44 !* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
45 !* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
46 !* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
47 !* USE OR OTHER DEALINGS WITH THE SOFTWARE. *
48 !*********************************************************************
49 !* Please acknowledge The University of Illinois Center for *
50 !* Simulation of Advanced Rockets in works and publications *
51 !* resulting from this software or its derivatives. *
52 !*********************************************************************
54 
55 CONTAINS
56 
57  SUBROUTINE checkintegral(glb, IntegralArray)
58 
59 !!****f* Rocfrac/Rocfrac/Source/IntegralCheck.f90
60 !!
61 !! NAME
62 !! CheckIntegral
63 !!
64 !! FUNCTION
65 !! Sums the conservation quantities over all the
66 !! processors. MPI_REDUCE
67 !!
68 !! INPUTS
69 !! glb -- global array
70 !!
71 !! OUTPUT
72 !! IntegralArray -- Conservation term:
73 !! 1. Volume - Deformed
74 !! 2. Mass
75 !! 3. x-momentum
76 !! 4. y-momentum
77 !! 5. z-momentum
78 !! 6. energy
79 !! 7. burning area
80 !! 8. non-burning area
81 !! 9. Volume - Undeformed
82 !!***
83  USE rocstar_rocfrac
84 
85  IMPLICIT NONE
86 
87  include 'mpif.h'
88  include 'rocmanf90.h'
89 
90  TYPE(rocfrac_global), POINTER :: glb
91  INTEGER :: ierr
92  REAL*8 :: integralarray(man_integ_size)
93 
94  REAL*8, dimension(1:3) :: tmpsnd, tmprcv
95 
96  tmpsnd(1)= glb%TotalGeomVolp
97  tmpsnd(2)= glb%TotalGeomUndefVolp
98  tmpsnd(3)= glb%TotalMassSolidp
99 
100  CALL mpi_reduce(tmpsnd,tmprcv,3,mpi_double_precision, &
101  mpi_sum,0,glb%MPI_COMM_ROCFRAC,ierr)
102 
103  integralarray(man_integ_vol) = tmprcv(1)
104  integralarray(man_integ_mass) = tmprcv(3)
105  integralarray(man_integ_xmom) = 0.d0
106  integralarray(man_integ_ymom) = 0.d0
107  integralarray(man_integ_zmom) = 0.d0
108  integralarray(man_integ_ener) = 0.d0
109  integralarray(man_integ_ibarea) = 0.d0
110  integralarray(man_integ_inbarea) = 0.d0
111  integralarray(man_integ_vol_und) = tmprcv(2)
112  RETURN
113 
114  END SUBROUTINE checkintegral
115 END MODULE integralcheck
116 
117 
subroutine checkintegral(glb, IntegralArray)