Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 SUBROUTINE bc_enforce(numbound,numnp,id,r,slope,prop,&
54  vb, ab, v, a, d, delta, rnet, xm, dampenabled,currtime)
55 
56 !!****f* Rocfrac/Rocfrac/Source/bc_enforce.f90
57 !!
58 !! NAME
59 !! bc_enforce
60 !!
61 !! FUNCTION
62 !!
63 !! Enforces the structural boundary conditions
64 !!
65 !! INPUTS
66 !! numbound -- number of nodes with enforced boundary
67 !! conditions
68 !! numnp -- number of nodes
69 !! id -- element id
70 !! r -- imposed type of boundary condition
71 !! slope -- loading amplitude slope
72 !! prop -- proportion of amplitude for loading
73 !! vb -- imposed velocity
74 !! ab -- impoesed acceleration
75 !! delta -- time increment
76 !! Rnet -- sum of forces
77 !! xm -- lumped nodal mass matrix
78 !! DampEnabled -- flag for damping
79 !! CurrTime -- current time
80 !!
81 !! OUTPUT
82 !! v -- nodal velocity with bc
83 !! a -- nodal acceleration with bc
84 !! d -- nodal displacement with bc
85 !!****
86 
87  IMPLICIT NONE
88 
89  INTEGER :: numbound, numnp
90  INTEGER,DIMENSION(1:4,numbound) :: id
91  REAL*8, DIMENSION(1:3*numbound) :: vb, ab
92  REAL*8, DIMENSION(1:3,numbound) :: r
93  REAL*8 :: delta
94  REAL*8, DIMENSION(1:3*numnp) :: rnet
95  REAL*8, DIMENSION(1:3*numnp) :: v, a,d
96  REAL*8, DIMENSION(1:numnp) :: xm
97  REAL*8 :: slope,prop,currtime
98 
99  INTEGER :: k1, k2, k3, k4
100  INTEGER :: i, i1, i2, i3
101  REAL*8 :: a1
102  LOGICAL :: dampenabled
103 
104  IF(.NOT.(dampenabled))THEN
105 
106  DO i = 1,numbound
107  k4 = id(1,i)
108  k1 = k4*3 - 2
109  k2 = k4*3 - 1
110  k3 = k4*3
111  i1 = i*3 - 2
112  i2 = i*3 - 1
113  i3 = i*3
114  IF (id(2,i).EQ.0) THEN ! velocity imposed
115  vb(i1) = r(1,i)*currtime*slope
116  ab(i1) = r(1,i)*slope
117  ELSE ! force imposed
118  a1 = (r(1,i) + rnet(k1) )*xm(k4)
119  vb(i1) = vb(i1) + delta*(ab(i1) + a1)*0.5d0
120  ab(i1) = a1
121  ENDIF
122  IF (id(3,i).EQ.0) THEN ! velocity imposed
123  vb(i2) = r(2,i)*currtime*slope
124  ab(i2) = r(2,i)*slope
125  ELSE ! force imposed
126  a1 = (r(2,i) + rnet(k2) )*xm(k4)
127  vb(i2) = vb(i2) + delta*(ab(i2)+a1)*0.5d0
128  ab(i2) = a1
129  ENDIF
130  IF (id(4,i).EQ.0) THEN ! velocity imposed
131  vb(i3) = r(3,i)*currtime*slope
132  ab(i3) = r(3,i)*slope
133  ELSE ! force imposed
134  a1 = (r(3,i) + rnet(k3) )*xm(k4)
135  vb(i3) = vb(i3) + delta*(ab(i3)+a1)*0.5d0
136  ab(i3) = a1
137  ENDIF
138  a(k1) = ab(i1)
139  a(k2) = ab(i2)
140  a(k3) = ab(i3)
141  v(k1) = vb(i1)
142  v(k2) = vb(i2)
143  v(k3) = vb(i3)
144  ENDDO
145  ELSE
146  DO i = 1,numbound
147  k4 = id(1,i)
148  k1 = k4*3 - 2
149  k2 = k4*3 - 1
150  k3 = k4*3
151  IF (id(2,i).EQ.0) THEN
152  d(k1) = r(1,i)
153  v(k1) = r(1,i) ! only correct if = 0, otherwise i would have to store the old boundary velocity
154  ENDIF
155  IF (id(3,i).EQ.0) THEN
156  d(k2) = r(2,i)
157  v(k2) = r(2,i)
158  ENDIF
159  IF (id(4,i).EQ.0) THEN
160  d(k3) = r(3,i)
161  v(k3) = r(3,i)
162  ENDIF
163  ENDDO
164 
165  ENDIF
166 
167  RETURN
168 
169  END SUBROUTINE bc_enforce
170 
unsigned char r() const
Definition: Color.h:68
const NT & d
*********************************************************************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
blockLoc i
Definition: read.cpp:79
subroutine bc_enforce(numbound, numnp, id, r, slope, prop, vb, ab, v, a, d, delta, Rnet, xm, DampEnabled, CurrTime)
Definition: bc_enforce.f90:53
RT delta(int i) const
Definition: Direction_2.h:159
CVector & slope()
unsigned long id(const Leda_like_handle &x)
Definition: Handle.h:107
RT a() const
Definition: Line_2.h:140