Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
implicit_initialize.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 !*********************************************************************
53 
54 !!****
55 !!
56 !! NAME
57 !! implicit_initialize
58 !!
59 !! FUNCTION
60 !! Creates all of the data structures and matrices needed
61 !! by the implicit solids solver
62 !!
63 !! INPUTS
64 !! none
65 !!
66 !! OUTPUTS
67 !! none
68 !!
69 !! USES
70 !! MPI
71 !!
72 !!****
73 
74 SUBROUTINE implicit_initialize(global)
75 
76  USE implicit_global
78 
79  IMPLICIT NONE
80 
81  TYPE(rocfrac_global) :: global
82  INTEGER :: i, j, m
83 
84 
85 !
86 ! Let the code know it will need to initialize the acceleration array
87 !
88  initaccel = .true.
89 
90 !
91 ! Set up the global to local node mapping
92 !
93  ALLOCATE(global2local(1:gnumnp))
94  global2local(:) = -1
95  DO i = 1, global%NumNP
96  global2local(local2global(i)) = i
97  ENDDO
98 
99 
100 !
101 ! Initialize MPI communications
102 !
103  IF(myid==0) print*,'INITIALIZING COMMUNICATIONS'
104  IF (nprocs > 1) THEN
105  CALL initcomm1(global)
106  CALL initcomm2(global)
107  ENDIF
108 
109 
110 !
111 ! Set up some constants
112 !
113  nstart_km = gnumnp
114  DO m = 1, gnumnp
115  DO i = 1, global%NumNp
116  IF (local2global(i) == m) THEN
117  IF (nodeproc(i) == myid) THEN
118  nstart_km = min(nstart_km,local2global(i))
119  ENDIF
120  ENDIF
121  ENDDO
122  ENDDO
123  nstart_km = 3 * (nstart_km - 1) + 1
124  nrows_km = 3*lnumnp
125 
126 
127 !
128 ! Set up the nodal DOF vectors
129 !
130  ALLOCATE(node_flag(1:global%NumNp,1:3))
131  ALLOCATE(boundary_value(1:global%NumNp,1:3))
132  node_flag(1:global%NumNp,1:3) = 0
133  DO i = 1, global%NumNdsBC
134  DO j = 1, 3
135  IF ( global%BCFlag(j+1,i) == 0 ) THEN
136  node_flag(global%BCFlag(1,i),j) = 8
137  boundary_value(global%BCFlag(1,i),j) = global%BCvalue(j,i)
138  ENDIF
139  IF ( global%BCFlag(j+1,i) == 1 ) THEN
140  node_flag(global%BCFlag(1,i),j) = 7
141  boundary_value(global%BCFlag(1,i),j) = global%BCvalue(j,i)
142  ENDIF
143  ENDDO
144  ENDDO
145 
146 
147 !
148 ! Create the mass matrix
149 !
150  CALL createm(global)
151 
152 
153 !
154 ! Create the stiffness matrix
155 !
156  CALL createk(global)
157 
158 
159 END SUBROUTINE implicit_initialize
160 
FT m(int i, int j) const
subroutine initcomm1(global)
Definition: InitComm.f90:74
subroutine implicit_initialize(global)
subroutine initcomm2(global)
Definition: InitComm.f90:265
subroutine createk(global)
Definition: createK.f90:53
subroutine createm(global)
Definition: createM.f90:53
blockLoc i
Definition: read.cpp:79
virtual std::ostream & print(std::ostream &os) const
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
j indices j
Definition: Indexing.h:6