Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
implicit_bc_enforce.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_bc_enforce
58 !!
59 !! FUNCTION
60 !! Enforces imposed displacement, velocity, and acceleration boundary
61 !! conditions. Code may be added for time-dependant boundary conditions.
62 !!
63 !! INPUTS
64 !! NumNp -- Total number of nodes that this proc knows about
65 !! LocNumNp -- Total number of nodes assigned to this processor
66 !! disp -- Local displacment vector
67 !! v -- Local velocity vector
68 !! a -- Local acceleration vector
69 !! node_flag -- Flags for each dof at each node as to what kind of BC is imposed
70 !! boundary_value -- The magnitudes of the imposed boundary conditions
71 !! t -- Simulation time. Used for time-dependant boundary conditions.
72 !! myid -- The rank of this processor. Mainly used for debugging purposes.
73 !!
74 !! OUTPUTS
75 !! none
76 !!
77 !! USES
78 !! none
79 !!
80 !!****
81 
82 
83 SUBROUTINE implicit_bc_enforce(NumNp,LocNumNp,disp,v,a,node_flag,boundary_value,t,myid)
84 
85 USE precision
87 
88 ! Input variables
89 INTEGER :: numnp
90 REAL(kind=wp) :: t
91 REAL(kind=wp),DIMENSION(1:3*LocNumNp) :: disp, v, a
92 INTEGER,DIMENSION(1:NumNp,1:3) :: node_flag
93 REAL(kind=wp),DIMENSION(1:NumNp,1:3) :: boundary_value
94 INTEGER :: myid
95 
96 ! Internal variables
97 INTEGER :: i,j,counter,m
98 
99 ! Impose displacement boundary conditions
100 counter = 0
101 DO m = 1, gnumnp
102  DO i = 1, numnp
103  IF (local2global(i) == m) THEN
104  IF (nodeproc(i)==myid) THEN
105  DO j = 1, 3
106  counter = counter + 1
107  IF(node_flag(i,j) == 8) THEN ! Imposed constant nodal displacement
108  disp(counter) = boundary_value(i,j)
109  v(counter) = 0.0
110  a(counter) = 0.0
111  ENDIF
112  ENDDO
113  ENDIF
114  ENDIF
115  ENDDO
116 ENDDO
117 
118 
119 !
120 ! Add code here for special conditions such as time dependant BC's
121 !
122 
123 !!$print*,'NOTE: APPLYING TIME-DEPENDANT BOUNDARY CONDITIONS'
124 
125 !!$IF (t < 5) THEN
126 !!$ DO i = 1, 4
127 !!$ disp(3*(i-1)+3) = 0.0
128 !!$ v(3*(i-1)+3) = 0.0
129 !!$ a(3*(i-1)+3) = 0.0
130 !!$ ENDDO
131 !!$ELSEIF (t < 10) THEN
132 !!$ DO i = 1, 4
133 !!$ disp(3*(i-1)+3) = 0.1 * (t-5)
134 !!$ v(3*(i-1)+3) = 0.1
135 !!$ a(3*(i-1)+3) = 0.0
136 !!$ ENDDO
137 !!$ELSE
138 !!$ DO i = 1, 4
139 !!$ disp(3*(i-1)+3) = 0.5
140 !!$ v(3*(i-1)+3) = 0.0
141 !!$ a(3*(i-1)+3) = 0.0
142 !!$ ENDDO
143 !!$ENDIF
144 
145 !!$IF (t < 5) THEN
146 !!$ DO i = 1, 4
147 !!$ disp(3*(i-1)+3) = 0.0
148 !!$ v(3*(i-1)+3) = 0.0
149 !!$ a(3*(i-1)+3) = 0.0
150 !!$ ENDDO
151 !!$ELSEIF (t < 10) THEN
152 !!$ DO i = 1, 4
153 !!$ disp(3*(i-1)+3) = 0.1 * (t-5) * (t-5)
154 !!$ v(3*(i-1)+3) = 0.1 * (t-5)
155 !!$ a(3*(i-1)+3) = 0.1
156 !!$ ENDDO
157 !!$ELSE
158 !!$ DO i = 1, 4
159 !!$ disp(3*(i-1)+3) = 0.5 * (t-5)
160 !!$ v(3*(i-1)+3) = 0.5
161 !!$ a(3*(i-1)+3) = 0.0
162 !!$ ENDDO
163 !!$ENDIF
164 
165 
166 END SUBROUTINE implicit_bc_enforce
167 
FT m(int i, int j) const
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
subroutine implicit_bc_enforce(NumNp, LocNumNp, disp, v, a, node_flag, boundary_value, t, myid)
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6
RT a() const
Definition: Line_2.h:140