CalculiX  2.13
A Free Software Three-Dimensional Structural Finite Element Program
normals.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine normals (inpc, textpart, iponor, xnor, ixfree, ipkon, kon, nk, nk_, ne, lakon, istep, istat, n, iline, ipol, inl, ipoinp, inp, ipoinpc)
 

Function/Subroutine Documentation

◆ normals()

subroutine normals ( character*1, dimension(*)  inpc,
character*132, dimension(16)  textpart,
integer, dimension(2,*)  iponor,
real*8, dimension(*)  xnor,
integer  ixfree,
integer, dimension(*)  ipkon,
integer, dimension(*)  kon,
integer  nk,
integer  nk_,
integer  ne,
character*8, dimension(*)  lakon,
integer  istep,
integer  istat,
integer  n,
integer  iline,
integer  ipol,
integer  inl,
integer, dimension(2,*)  ipoinp,
integer, dimension(3,*)  inp,
integer, dimension(0:*)  ipoinpc 
)
22 !
23 ! reading the input deck: *NORMAL
24 !
25  implicit none
26 !
27  character*1 inpc(*)
28  character*8 lakon(*)
29  character*132 textpart(16)
30 !
31  integer iponor(2,*),ixfree,ipkon(*),kon(*),nk,ipoinpc(0:*),
32  & nk_,ne,istep,istat,n,ielement,node,j,indexe,i,
33  & key,iline,ipol,inl,ipoinp(2,*),inp(3,*)
34 !
35  real*8 xnor(*),x,y,z,dd
36 !
37  if(istep.gt.0) then
38  write(*,*) '*ERROR in normals: *NORMAL should be placed'
39  write(*,*) ' before all step definitions'
40  call exit(201)
41  endif
42 !
43  do i=2,n
44  write(*,*)
45  & '*WARNING in normals: parameter not recognized:'
46  write(*,*) ' ',
47  & textpart(i)(1:index(textpart(i),' ')-1)
48  call inputwarning(inpc,ipoinpc,iline,
49  &"*NORMAL%")
50  enddo
51 !
52  loop:do
53  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
54  & ipoinp,inp,ipoinpc)
55  if((istat.lt.0).or.(key.eq.1)) exit
56 !
57  read(textpart(1)(1:10),'(i10)',iostat=istat) ielement
58  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
59  &"*NORMAL%")
60  read(textpart(2)(1:10),'(i10)',iostat=istat) node
61  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
62  &"*NORMAL%")
63  read(textpart(3)(1:20),'(f20.0)',iostat=istat) x
64  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
65  &"*NORMAL%")
66  if(n.le.3) then
67  y=0.d0
68  else
69  read(textpart(4)(1:20),'(f20.0)',iostat=istat) y
70  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
71  &"*NORMAL%")
72  endif
73  if(n.le.4) then
74  z=0.d0
75  else
76  read(textpart(5)(1:20),'(f20.0)',iostat=istat) z
77  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
78  &"*NORMAL%")
79  endif
80 !
81 ! normalizing the normal
82 !
83  dd=dsqrt(x*x+y*y+z*z)
84  x=x/dd
85  y=y/dd
86  z=z/dd
87 !
88  if(ielement.gt.ne) then
89  write(*,*) '*ERROR in normals: element number',ielement
90  write(*,*) ' exceeds ne'
91  call exit(201)
92  endif
93 !
94  indexe=ipkon(ielement)
95  do j=1,8
96  if(kon(indexe+j).eq.node) then
97  iponor(1,indexe+j)=ixfree
98  if(lakon(ielement)(1:1).eq.'B') then
99  xnor(ixfree+4)=x
100  xnor(ixfree+5)=y
101  xnor(ixfree+6)=z
102  ixfree=ixfree+6
103  elseif(lakon(ielement)(1:2).ne.'C3') then
104  xnor(ixfree+1)=x
105  xnor(ixfree+2)=y
106  xnor(ixfree+3)=z
107  ixfree=ixfree+3
108  else
109  write(*,*) '*WARNING in normals: specifying a normal'
110  write(*,*) ' 3-D element does not make sense'
111  endif
112  cycle loop
113  endif
114  enddo
115  write(*,*) '*WARNING: node ',node,' does not belong to'
116  write(*,*) ' element ',ielement
117  write(*,*) ' normal definition discarded'
118 !
119  enddo loop
120 !
121  return
subroutine inputwarning(inpc, ipoinpc, iline, text)
Definition: inputwarning.f:20
subroutine getnewline(inpc, textpart, istat, n, key, iline, ipol, inl, ipoinp, inp, ipoinpc)
Definition: getnewline.f:21
subroutine inputerror(inpc, ipoinpc, iline, text)
Definition: inputerror.f:20
Hosted by OpenAircraft.com, (Michigan UAV, LLC)