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

Go to the source code of this file.

Functions/Subroutines

subroutine calcspringforc (imat, elcon, nelcon, ncmat_, ntmat_, t1l, kode, plicon, nplicon, npmat_, senergy, nener, fk, val)
 

Function/Subroutine Documentation

◆ calcspringforc()

subroutine calcspringforc ( integer, intent(in)  imat,
real*8, dimension(0:ncmat_,ntmat_,*), intent(in)  elcon,
integer, dimension(2,*), intent(in)  nelcon,
integer, intent(in)  ncmat_,
integer, intent(in)  ntmat_,
real*8, intent(in)  t1l,
integer, intent(in)  kode,
real*8, dimension(0:2*npmat_,ntmat_,*), intent(in)  plicon,
integer, dimension(0:ntmat_,*), intent(in)  nplicon,
integer, intent(in)  npmat_,
real*8, intent(inout)  senergy,
integer, intent(in)  nener,
real*8, intent(inout)  fk,
real*8, intent(in)  val 
)
21 !
22 ! calculates the spring forc and the spring energy (node-to-face penalty)
23 !
24  implicit none
25 !
26  integer i,imat,ncmat_,ntmat_,kode,niso,id,nplicon(0:ntmat_,*),
27  & npmat_,nelcon(2,*),nener
28 !
29  real*8 t1l,elcon(0:ncmat_,ntmat_,*),elconloc(21),plconloc(802),
30  & xk,fk,val,xiso(200),yiso(200),plicon(0:2*npmat_,ntmat_,*),
31  & senergy
32 !
33  intent(in) imat,elcon,nelcon,ncmat_,ntmat_,t1l,val,
34  & kode,plicon,nplicon,npmat_,nener
35 !
36  intent(inout) senergy,fk
37 !
38 ! interpolating the material data
39 !
40  call materialdata_sp(elcon,nelcon,imat,ntmat_,i,t1l,
41  & elconloc,kode,plicon,nplicon,npmat_,plconloc,ncmat_)
42 !
43 ! calculating the spring force and the spring constant
44 !
45  if(kode.eq.2)then
46  xk=elconloc(1)
47  fk=xk*val
48  if(nener.eq.1) then
49  senergy=fk*val/2.d0
50  endif
51  else
52  niso=int(plconloc(801))
53  do i=1,niso
54  xiso(i)=plconloc(2*i-1)
55  yiso(i)=plconloc(2*i)
56  enddo
57  call ident(xiso,val,niso,id)
58  if(id.eq.0) then
59  xk=0.d0
60  fk=yiso(1)
61  if(nener.eq.1) then
62  senergy=fk*val
63  endif
64  elseif(id.eq.niso) then
65  xk=0.d0
66  fk=yiso(niso)
67  if(nener.eq.1) then
68  senergy=yiso(1)*xiso(1)
69  do i=2,niso
70  senergy=senergy+(xiso(i)-xiso(i-1))*
71  & (yiso(i)+yiso(i-1))/2.d0
72  enddo
73  senergy=senergy+(val-xiso(niso))*yiso(niso)
74  endif
75  else
76  xk=(yiso(id+1)-yiso(id))/(xiso(id+1)-xiso(id))
77  fk=yiso(id)+xk*(val-xiso(id))
78  if(nener.eq.1) then
79  senergy=yiso(1)*xiso(1)
80  do i=2, id
81  senergy=senergy+(xiso(i)-xiso(i-1))*
82  & (yiso(i)+yiso(i-1))/2.d0
83  enddo
84  senergy=senergy+(val-xiso(id))*(fk+yiso(id))/2.d0
85  endif
86  endif
87  endif
88 !
89  return
subroutine ident(x, px, n, id)
Definition: ident.f:26
subroutine materialdata_sp(elcon, nelcon, imat, ntmat_, i, t1l, elconloc, kode, plicon, nplicon, npmat_, plconloc, ncmat_)
Definition: materialdata_sp.f:20
Hosted by OpenAircraft.com, (Michigan UAV, LLC)