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

Go to the source code of this file.

Functions/Subroutines

subroutine networkmpc_lhs (i, ipompc, nodempc, coefmpc, labmpc, v, nactdog, ac, j, mi, nteq)
 

Function/Subroutine Documentation

◆ networkmpc_lhs()

subroutine networkmpc_lhs ( integer, intent(in)  i,
integer, dimension(*), intent(in)  ipompc,
integer, dimension(3,*), intent(in)  nodempc,
real*8, dimension(*), intent(in)  coefmpc,
character*20, dimension(*), intent(in)  labmpc,
real*8, dimension(0:mi(2),*), intent(in)  v,
integer, dimension(0:3,*), intent(in)  nactdog,
real*8, dimension(nteq,*), intent(inout)  ac,
integer, intent(in)  j,
integer, dimension(*), intent(in)  mi,
integer, intent(in)  nteq 
)
23 !
24 ! user defined network mpc: calculation of the left hand
25 ! side
26 !
27 ! INPUT:
28 !
29 ! i MPC number
30 ! ipompc(1..nmpc)) ipompc(i) points to the first term of
31 ! MPC i in field nodempc
32 ! nodempc(1,*) node number of a MPC term
33 ! nodempc(2,*) coordinate direction of a MPC term
34 ! nodempc(3,*) if not 0: points towards the next term
35 ! of the MPC in field nodempc
36 ! if 0: MPC definition is finished
37 ! coefmpc(*) coefficient of a MPC term
38 ! labmpc(*) label of the MPC. For user-defined
39 ! network MPC's it starts with NETWORK;
40 ! the remaining 13 characters can be used
41 ! to distinguish between different kinds of
42 ! network user MPC's
43 ! v(0..mi(2),1..nk) solution field in all nodes
44 ! 0: total temperature
45 ! 1: mass flow
46 ! 2: total pressure
47 ! nactdog(j,i) determines the network equation corresponding
48 ! to degree of freedom j in node i;
49 ! if zero the degree of freedom is not active
50 ! j network equation corresponding to the
51 ! present MPC (i.e. MPC i)
52 ! mi(*) field with global information; mi(2) is the
53 ! highest variable number
54 ! nteq number of network equations
55 !
56 ! OUTPUT:
57 !
58 ! ac(*) left hand side of the system of network
59 ! equations; this routines should return the
60 ! derivative of the network MPC at stake w.r.t.
61 ! all active degrees of freedom occurring in the
62 ! MPC and store them in row j of matrix ac.
63 !
64  implicit none
65 !
66  character*20 labmpc(*)
67 !
68  integer mi(*),i,ipompc(*),nodempc(3,*),j,index,node,idir,
69  & nactdog(0:3,*),nteq
70 !
71  real*8 coefmpc(*),v(0:mi(2),*),ac(nteq,*)
72 !
73  intent(in) i,ipompc,nodempc,coefmpc,
74  & labmpc,v,nactdog,j,mi,nteq
75 !
76  intent(inout) ac
77 !
78  if(labmpc(i)(8:16).eq.'QUADRATIC') then
79 !
80 ! example equation of the form
81 ! f:=a*v(idir1,node1)+b*v(idir2,node2)**2=0
82 !
83 ! a,idir1,node1,b,idir2,node2 are given in the input deck
84 ! using the *NETWORK MPC keyword
85 ! to be calculated: a*df/d(v(idir1,node1))
86 ! b*df/d(v(idir2,node2))
87 !
88  index=ipompc(i)
89  node=nodempc(1,index)
90  idir=nodempc(2,index)
91  ac(j,nactdog(idir,node))=coefmpc(index)
92 !
93  index=nodempc(3,index)
94  node=nodempc(1,index)
95  idir=nodempc(2,index)
96 !
97 ! if nactdog(idir,node) is zero the degree of freedom is
98 ! not active
99 !
100  if(nactdog(idir,node).ne.0) then
101  ac(j,nactdog(idir,node))=2.d0*coefmpc(index)*v(idir,node)
102  endif
103  else
104  write(*,*) '*ERROR in networkmpc_lhs:'
105  write(*,*) ' unknown MPC: ',labmpc(i)
106  endif
107 !
108  return
Hosted by OpenAircraft.com, (Michigan UAV, LLC)