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

Go to the source code of this file.

Functions

void precontact (ITG *ncont, ITG *ntie, char *tieset, ITG *nset, char *set, ITG *istartset, ITG *iendset, ITG *ialset, ITG *itietri, char *lakon, ITG *ipkon, ITG *kon, ITG *koncont, ITG *ne, double *cg, double *straight, double *co, double *vold, ITG *istep, ITG *iinc, ITG *iit, ITG *itiefac, ITG *islavsurf, ITG *islavnode, ITG *imastnode, ITG *nslavnode, ITG *nmastnode, ITG *imastop, ITG *mi, ITG *ipe, ITG *ime, double *tietol, ITG *iflagact, ITG *nintpoint, double **pslavsurfp, double *xmastnor, double *cs, ITG *mcs, ITG *ics, double *clearini, ITG *nslavs)
 

Function Documentation

void precontact ( ITG ncont,
ITG ntie,
char *  tieset,
ITG nset,
char *  set,
ITG istartset,
ITG iendset,
ITG ialset,
ITG itietri,
char *  lakon,
ITG ipkon,
ITG kon,
ITG koncont,
ITG ne,
double *  cg,
double *  straight,
double *  co,
double *  vold,
ITG istep,
ITG iinc,
ITG iit,
ITG itiefac,
ITG islavsurf,
ITG islavnode,
ITG imastnode,
ITG nslavnode,
ITG nmastnode,
ITG imastop,
ITG mi,
ITG ipe,
ITG ime,
double *  tietol,
ITG iflagact,
ITG nintpoint,
double **  pslavsurfp,
double *  xmastnor,
double *  cs,
ITG mcs,
ITG ics,
double *  clearini,
ITG nslavs 
)

Definition at line 24 of file precontact.c.

33  {
34 
35  /* authors: S. Rakotonanahary, S. Sitzmann and J. Hokkanen */
36 
37  ITG i,j,ntrimax,*nx=NULL,*ny=NULL,*nz=NULL,im,
38  l,nstart,kflag,ntri,ii;
39 
40  double *xo=NULL,*yo=NULL,*zo=NULL,*x=NULL,*y=NULL,*z=NULL,
41  *pslavsurf=NULL,*clearslavnode=NULL;
42 
43  pslavsurf=*pslavsurfp;
44 
45  /* update the location of the center of gravity of
46  the master triangles and the coefficients of their
47  bounding planes */
48 
49  DMEMSET(xmastnor,0,3*nmastnode[*ntie],0.);
50 
51  FORTRAN(updatecontpen,(koncont,ncont,co,vold,
52  cg,straight,mi,imastnode,nmastnode,xmastnor,
53  ntie,tieset,nset,set,istartset,
54  iendset,ialset,ipkon,lakon,kon,cs,mcs,ics));
55 
56  /* determining the size of the auxiliary fields
57  (needed for the master triangle search for any
58  given location on the slave faces */
59 
60  ntrimax=0;
61  for(i=0;i<*ntie;i++){
62  if(itietri[2*i+1]-itietri[2*i]+1>ntrimax)
63  ntrimax=itietri[2*i+1]-itietri[2*i]+1;
64  }
65 
66  /* only at the start of a new step */
67 
68  if ((*istep==1)&&(*iinc==1)&&(*iit<=0)){
69  NNEW(xo,double,ntrimax);
70  NNEW(yo,double,ntrimax);
71  NNEW(zo,double,ntrimax);
72  NNEW(x,double,ntrimax);
73  NNEW(y,double,ntrimax);
74  NNEW(z,double,ntrimax);
75  NNEW(nx,ITG,ntrimax);
76  NNEW(ny,ITG,ntrimax);
77  NNEW(nz,ITG,ntrimax);
78 
79  NNEW(clearslavnode,double,3**nslavs);
80 
81  FORTRAN(adjustcontactnodes,(tieset,ntie,itietri,cg,straight,
82  co,vold,xo,yo,zo,x,y,z,nx,ny,nz,istep,iinc,iit,
83  mi,imastop,nslavnode,islavnode,set,nset,istartset,
84  iendset,ialset,tietol,clearini,clearslavnode,itiefac,
85  ipkon,kon,lakon,islavsurf));
86 
87  SFREE(clearslavnode);
88  SFREE(xo);SFREE(yo);SFREE(zo);SFREE(x);SFREE(y);SFREE(z);SFREE(nx);
89  SFREE(ny);SFREE(nz);
90  }
91 
92  NNEW(xo,double,ntrimax);
93  NNEW(yo,double,ntrimax);
94  NNEW(zo,double,ntrimax);
95  NNEW(x,double,ntrimax);
96  NNEW(y,double,ntrimax);
97  NNEW(z,double,ntrimax);
98  NNEW(nx,ITG,ntrimax);
99  NNEW(ny,ITG,ntrimax);
100  NNEW(nz,ITG,ntrimax);
101 
102  /* Calculating the location of the matched slave/master
103  integration points */
104 
105  RENEW(pslavsurf,double,198);
106 
107  /* pointer of islavsurf into field pslavsurf and
108  pmastsurf */
109 
110  islavsurf[1]=0;
111 
112  /* loop over all ties */
113 
114  for(i=0;i<*ntie;i++){
115  ii=i+1;
116 
117  /* only active contact ties are treated */
118 
119  if(tieset[i*(81*3)+80]=='C'){
120  nstart=itietri[2*i]-1;
121  ntri=itietri[2*i+1]-nstart;
122  for(j=0;j<ntri;j++){
123  xo[j]=cg[(nstart+j)*3];
124  x[j]=xo[j];
125  nx[j]=j+1;
126  yo[j]=cg[(nstart+j)*3+1];
127  y[j]=yo[j];
128  ny[j]=j+1;
129  zo[j]=cg[(nstart+j)*3+2];
130  z[j]=zo[j];
131  nz[j]=j+1;
132  }
133  kflag=2;
134  FORTRAN(dsort,(x,nx,&ntri,&kflag));
135  FORTRAN(dsort,(y,ny,&ntri,&kflag));
136  FORTRAN(dsort,(z,nz,&ntri,&kflag));
137 
138  /* loop over all slave faces belonging to the tie */
139 
140  for(l=itiefac[2*i];l<=itiefac[2*i+1];l++){
141  RENEW(pslavsurf,double,3*(*nintpoint+ntri*66));
142  FORTRAN(slavintpoints,(ntie,itietri,ipkon,kon,
143  lakon,straight,nintpoint,koncont,co,vold,
144  xo,yo,zo,x,y,z,nx,ny,nz,islavsurf,
145  islavnode,nslavnode,imastop,
146  mi,ncont,ipe,ime,pslavsurf,&ii,&l,&ntri));
147  }
148  }
149  }
150  SFREE(xo);SFREE(yo);SFREE(zo);SFREE(x);SFREE(y);SFREE(z);SFREE(nx);
151  SFREE(ny);SFREE(nz);
152 
153  *pslavsurfp=pslavsurf;
154 
155  return;
156 }
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))
subroutine updatecontpen(koncont, ncont, co, vold, cg, straight, mi, imastnode, nmastnode, xmastnor, ntie, tieset, nset, set, istartset, iendset, ialset, ipkon, lakon, kon, cs, mcs, ics)
Definition: updatecontpen.f:19
subroutine adjustcontactnodes(tieset, ntie, itietri, cg, straight, co, vold, xo, yo, zo, x, y, z, nx, ny, nz, istep, iinc, iit, mi, imastop, nslavnode, islavnode, set, nset, istartset, iendset, ialset, tietol, clearini, clearslavnode, itiefac, ipkon, kon, lakon, islavsurf)
Definition: adjustcontactnodes.f:19
subroutine slavintpoints(ntie, itietri, ipkon, kon, lakon, straight, nintpoint, koncont, co, vold, xo, yo, zo, x, y, z, nx, ny, nz, islavsurf, islavnode, nslavnode, imastop, mi, ncont, ipe, ime, pslavsurf, i, l, ntri)
Definition: slavintpoints.f:25
#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 dsort(dx, iy, n, kflag)
Definition: dsort.f:5
#define ITG
Definition: CalculiX.h:51
#define NNEW(a, b, c)
Definition: CalculiX.h:39
Hosted by OpenAircraft.com, (Michigan UAV, LLC)