CalculiX  2.8
A Free Software Three-Dimensional Structural Finite Element Program
 All Classes Files Functions Variables Macros
tiedcontact.c File Reference
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include "CalculiX.h"
Include dependency graph for tiedcontact.c:

Go to the source code of this file.

Functions

void tiedcontact (ITG *ntie, char *tieset, ITG *nset, char *set, ITG *istartset, ITG *iendset, ITG *ialset, char *lakon, ITG *ipkon, ITG *kon, double *tietol, ITG *nmpc, ITG *mpcfree, ITG *memmpc_, ITG **ipompcp, char **labmpcp, ITG **ikmpcp, ITG **ilmpcp, double **fmpcp, ITG **nodempcp, double **coefmpcp, ITG *ithermal, double *co, double *vold, ITG *cfd, ITG *nmpc_, ITG *mi, ITG *nk, ITG *istep, ITG *ikboun, ITG *nboun, char *kind1, char *kind2)
 

Function Documentation

void tiedcontact ( ITG ntie,
char *  tieset,
ITG nset,
char *  set,
ITG istartset,
ITG iendset,
ITG ialset,
char *  lakon,
ITG ipkon,
ITG kon,
double *  tietol,
ITG nmpc,
ITG mpcfree,
ITG memmpc_,
ITG **  ipompcp,
char **  labmpcp,
ITG **  ikmpcp,
ITG **  ilmpcp,
double **  fmpcp,
ITG **  nodempcp,
double **  coefmpcp,
ITG ithermal,
double *  co,
double *  vold,
ITG cfd,
ITG nmpc_,
ITG mi,
ITG nk,
ITG istep,
ITG ikboun,
ITG nboun,
char *  kind1,
char *  kind2 
)

Definition at line 23 of file tiedcontact.c.

32  {
33 
34  char *labmpc=NULL;
35 
36  ITG *itietri=NULL,*koncont=NULL,nconf,i,k,*nx=NULL,im,
37  *ny=NULL,*nz=NULL,*ifaceslave=NULL,*istartfield=NULL,
38  *iendfield=NULL,*ifield=NULL,ntrimax,index,
39  ncont,ncone,*ipompc=NULL,*ikmpc=NULL,
40  *ilmpc=NULL,*nodempc=NULL,ismallsliding=0,neq,neqterms,
41  nmpctied,mortar=0,*ipe=NULL,*ime=NULL,*imastop=NULL,ifreeme;
42 
43  double *xo=NULL,*yo=NULL,*zo=NULL,*x=NULL,*y=NULL,*z=NULL,
44  *cg=NULL,*straight=NULL,*fmpc=NULL,*coefmpc=NULL;
45 
46  ipompc=*ipompcp;labmpc=*labmpcp;ikmpc=*ikmpcp;ilmpc=*ilmpcp;
47  fmpc=*fmpcp;nodempc=*nodempcp;coefmpc=*coefmpcp;
48 
49  /* identifying the slave surfaces as nodal or facial surfaces */
50 
51  NNEW(ifaceslave,ITG,*ntie);
52 
53  FORTRAN(identifytiedface,(tieset,ntie,set,nset,ifaceslave,kind1));
54 
55  /* determining the number of triangles of the triangulation
56  of the master surface and the number of entities on the
57  slave side */
58 
59  FORTRAN(allocont,(&ncont,ntie,tieset,nset,set,istartset,iendset,
60  ialset,lakon,&ncone,tietol,&ismallsliding,kind1,
61  kind2,&mortar,istep));
62 
63  if(ncont==0){
64  SFREE(ifaceslave);return;
65  }
66 
67  /* allocation of space for the triangulation;
68  koncont(1..3,i): nodes belonging to triangle i
69  koncont(4,i): face label to which the triangle belongs =
70  10*element+side number */
71 
72  NNEW(itietri,ITG,2**ntie);
73  NNEW(koncont,ITG,4*ncont);
74 
75  /* triangulation of the master surface */
76 
77  FORTRAN(triangucont,(&ncont,ntie,tieset,nset,set,istartset,iendset,
78  ialset,itietri,lakon,ipkon,kon,koncont,kind1,kind2,co,nk));
79 
80  /* catalogueing the neighbors of the master triangles */
81 
82  RENEW(ipe,ITG,*nk);
83  RENEW(ime,ITG,12*ncont);
84  DMEMSET(ipe,0,*nk,0.);
85  DMEMSET(ime,0,12*ncont,0.);
86  NNEW(imastop,ITG,3*ncont);
87 
88  FORTRAN(trianeighbor,(ipe,ime,imastop,&ncont,koncont,
89  &ifreeme));
90 
91  SFREE(ipe);SFREE(ime);
92 
93  /* allocation of space for the center of gravity of the triangles
94  and the 4 describing planes */
95 
96  NNEW(cg,double,3*ncont);
97  NNEW(straight,double,16*ncont);
98 
99  FORTRAN(updatecont,(koncont,&ncont,co,vold,cg,straight,mi));
100 
101  /* determining the nodes belonging to the slave face surfaces */
102 
103  NNEW(istartfield,ITG,*ntie);
104  NNEW(iendfield,ITG,*ntie);
105  NNEW(ifield,ITG,8*ncone);
106 
107  FORTRAN(nodestiedface,(tieset,ntie,ipkon,kon,lakon,set,istartset,
108  iendset,ialset,nset,ifaceslave,istartfield,iendfield,ifield,
109  &nconf,&ncone,kind1));
110 
111  /* determining the maximum number of equations neq */
112 
113  if(*cfd==1){
114  if(ithermal[1]<=1){
115  neq=4;
116  }else{
117  neq=5;
118  }
119  }else{
120  if(ithermal[1]<=1){
121  neq=3;
122  }else if(ithermal[1]==2){
123  neq=1;
124  }else{
125  neq=4;
126  }
127  }
128  neq*=(ncone+nconf);
129 
130  /* reallocating the MPC fields for the new MPC's
131  ncone: number of MPC'S due to nodal slave surfaces
132  nconf: number of MPC's due to facal slave surfaces */
133 
134  RENEW(ipompc,ITG,*nmpc_+neq);
135  RENEW(labmpc,char,20*(*nmpc_+neq)+1);
136  RENEW(ikmpc,ITG,*nmpc_+neq);
137  RENEW(ilmpc,ITG,*nmpc_+neq);
138  RENEW(fmpc,double,*nmpc_+neq);
139 
140  /* determining the maximum number of terms;
141  expanding nodempc and coefmpc to accommodate
142  those terms */
143 
144  neqterms=9*neq;
145  index=*memmpc_;
146  (*memmpc_)+=neqterms;
147  RENEW(nodempc,ITG,3**memmpc_);
148  RENEW(coefmpc,double,*memmpc_);
149  for(k=index;k<*memmpc_;k++){
150  nodempc[3*k-1]=k+1;
151  }
152  nodempc[3**memmpc_-1]=0;
153 
154  /* determining the size of the auxiliary fields */
155 
156  ntrimax=0;
157  for(i=0;i<*ntie;i++){
158  if(itietri[2*i+1]-itietri[2*i]+1>ntrimax)
159  ntrimax=itietri[2*i+1]-itietri[2*i]+1;
160  }
161  NNEW(xo,double,ntrimax);
162  NNEW(yo,double,ntrimax);
163  NNEW(zo,double,ntrimax);
164  NNEW(x,double,ntrimax);
165  NNEW(y,double,ntrimax);
166  NNEW(z,double,ntrimax);
167  NNEW(nx,ITG,ntrimax);
168  NNEW(ny,ITG,ntrimax);
169  NNEW(nz,ITG,ntrimax);
170 
171  /* generating the tie MPC's */
172 
173  FORTRAN(gentiedmpc,(tieset,ntie,itietri,ipkon,kon,
174  lakon,set,istartset,iendset,ialset,cg,straight,
175  koncont,co,xo,yo,zo,x,y,z,nx,ny,nz,nset,
176  ifaceslave,istartfield,iendfield,ifield,
177  ipompc,nodempc,coefmpc,nmpc,&nmpctied,mpcfree,ikmpc,ilmpc,
178  labmpc,ithermal,tietol,cfd,&ncont,imastop,ikboun,nboun,kind1));
179 
180  (*nmpc_)+=nmpctied;
181 
182  SFREE(xo);SFREE(yo);SFREE(zo);SFREE(x);SFREE(y);SFREE(z);SFREE(nx);
183  SFREE(ny);SFREE(nz);SFREE(imastop);
184 
185  SFREE(ifaceslave);SFREE(istartfield);SFREE(iendfield);SFREE(ifield);
186  SFREE(itietri);SFREE(koncont);SFREE(cg);SFREE(straight);
187 
188  /* reallocating the MPC fields */
189 
190  /* RENEW(ipompc,ITG,nmpc_);
191  RENEW(labmpc,char,20*nmpc_+1);
192  RENEW(ikmpc,ITG,nmpc_);
193  RENEW(ilmpc,ITG,nmpc_);
194  RENEW(fmpc,double,nmpc_);*/
195 
196  *ipompcp=ipompc;*labmpcp=labmpc;*ikmpcp=ikmpc;*ilmpcp=ilmpc;
197  *fmpcp=fmpc;*nodempcp=nodempc;*coefmpcp=coefmpc;
198 
199  /* for(i=0;i<*nmpc;i++){
200  j=i+1;
201  FORTRAN(writempc,(ipompc,nodempc,coefmpc,labmpc,&j));
202  }*/
203 
204  return;
205 }
subroutine triangucont(ncont, ntie, tieset, nset, set, istartset, iendset, ialset, itietri, lakon, ipkon, kon, koncont, kind1, kind2, co, nk)
Definition: triangucont.f:19
void FORTRAN(addimdnodecload,(ITG *nodeforc, ITG *i, ITG *imdnode, ITG *nmdnode, double *xforc, ITG *ikmpc, ITG *ilmpc, ITG *ipompc, ITG *nodempc, ITG *nmpc, ITG *imddof, ITG *nmddof, ITG *nactdof, ITG *mi, ITG *imdmpc, ITG *nmdmpc, ITG *imdboun, ITG *nmdboun, ITG *ikboun, ITG *nboun, ITG *ilboun, ITG *ithermal))
#define DMEMSET(a, b, c, d)
Definition: CalculiX.h:45
#define RENEW(a, b, c)
Definition: CalculiX.h:40
#define SFREE(a)
Definition: CalculiX.h:41
subroutine gentiedmpc(tieset, ntie, itietri, ipkon, kon, lakon, set, istartset, iendset, ialset, cg, straight, koncont, co, xo, yo, zo, x, y, z, nx, ny, nz, nset, ifaceslave, istartfield, iendfield, ifield, ipompc, nodempc, coefmpc, nmpc, nmpctied, mpcfree, ikmpc, ilmpc, labmpc, ithermal, tietol, cfd, ncont, imastop, ikboun, nboun, kind)
Definition: gentiedmpc.f:19
subroutine trianeighbor(ipe, ime, imastop, ncont, koncont, ifreeme)
Definition: trianeighbor.f:19
subroutine updatecont(koncont, ncont, co, vold, cg, straight, mi)
Definition: updatecont.f:19
subroutine allocont(ncont, ntie, tieset, nset, set, istartset, iendset, ialset, lakon, ncone, tietol, ismallsliding, kind1, kind2, mortar, istep)
Definition: allocont.f:19
subroutine identifytiedface(tieset, ntie, set, nset, ifaceslave, kind)
Definition: identifytiedface.f:19
#define ITG
Definition: CalculiX.h:51
subroutine nodestiedface(tieset, ntie, ipkon, kon, lakon, set, istartset, iendset, ialset, nset, ifaceslave, istartfield, iendfield, ifield, nconf, ncone, kind)
Definition: nodestiedface.f:19
#define NNEW(a, b, c)
Definition: CalculiX.h:39
Hosted by OpenAircraft.com, (Michigan UAV, LLC)