root/src/contact.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. contact

   1 /*     CalculiX - A 3-dimensional finite element program                 */
   2 /*              Copyright (C) 1998-2007 Guido Dhondt                     */
   3 
   4 /*     This program is free software; you can redistribute it and/or     */
   5 /*     modify it under the terms of the GNU General Public License as    */
   6 /*     published by the Free Software Foundation(version 2);    */
   7 /*                    */
   8 
   9 /*     This program is distributed in the hope that it will be useful,   */
  10 /*     but WITHOUT ANY WARRANTY; without even the implied warranty of    */ 
  11 /*     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the      */
  12 /*     GNU General Public License for more details.                      */
  13 
  14 /*     You should have received a copy of the GNU General Public License */
  15 /*     along with this program; if not, write to the Free Software       */
  16 /*     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.         */
  17 
  18 #include <stdio.h>
  19 #include <math.h>
  20 #include <stdlib.h>
  21 #include "CalculiX.h"
  22 
  23 void contact(ITG *ncont, ITG *ntie, char *tieset,ITG *nset,char *set,
  24              ITG *istartset, ITG *iendset, ITG *ialset,ITG *itietri,
  25              char *lakon, ITG *ipkon, ITG *kon, ITG *koncont, ITG *ne,
  26              double *cg, double *straight, ITG *ifree, double *co,
  27              double *vold, ITG *ielmat, double *cs, double *elcon,
  28              ITG *istep,ITG *iinc,ITG *iit,ITG *ncmat_,ITG *ntmat_,
  29              ITG *ne0, double *vini,
  30              ITG *nmethod, ITG *nmpc, ITG *mpcfree, ITG *memmpc_,
  31              ITG **ipompcp, char **labmpcp, ITG **ikmpcp, ITG **ilmpcp,
  32              double **fmpcp, ITG **nodempcp, double **coefmpcp,
  33              ITG *iperturb, ITG *ikboun, ITG *nboun, ITG *mi,
  34              ITG *imastop,ITG *nslavnode,ITG *islavnode,ITG *islavsurf,
  35              ITG *itiefac,double *areaslav,ITG *iponoels,ITG *inoels,
  36              double *springarea, double *tietol, double *reltime,
  37              ITG *imastnode, ITG *nmastnode, double *xmastnor,
  38              char *filab, ITG *mcs, ITG *ics,
  39              ITG *nasym,double *xnoels,ITG *mortar,double *pslavsurf,
  40              double *pmastsurf,double *clearini,double *theta){
  41     
  42     char *labmpc=NULL;
  43 
  44     ITG i,ntrimax,*nx=NULL,*ny=NULL,*nz=NULL,*ipompc=NULL,*ikmpc=NULL,
  45         *ilmpc=NULL,*nodempc=NULL,nmpc_,im;
  46     
  47     double *xo=NULL,*yo=NULL,*zo=NULL,*x=NULL,*y=NULL,*z=NULL,
  48         *fmpc=NULL, *coefmpc=NULL;
  49 
  50     ipompc=*ipompcp;labmpc=*labmpcp;ikmpc=*ikmpcp;ilmpc=*ilmpcp;
  51     fmpc=*fmpcp;nodempc=*nodempcp;coefmpc=*coefmpcp;
  52     nmpc_=*nmpc;
  53 
  54     /* next call is only for node-to-face penalty contact
  55        setting up bordering planes for the master triangles;
  56        these planes are common between neighboring traingles */
  57 
  58     if(*mortar==0){
  59 
  60         DMEMSET(xmastnor,0,3*nmastnode[*ntie],0.);
  61     
  62         FORTRAN(updatecontpen,(koncont,ncont,co,vold,
  63                         cg,straight,mi,imastnode,nmastnode,xmastnor,
  64                         ntie,tieset,nset,set,istartset,
  65                         iendset,ialset,ipkon,lakon,kon,cs,mcs,ics));
  66     }
  67     
  68     /* determining the size of the auxiliary fields */
  69     
  70     ntrimax=0;
  71     for(i=0;i<*ntie;i++){
  72         if(itietri[2*i+1]-itietri[2*i]+1>ntrimax)
  73             ntrimax=itietri[2*i+1]-itietri[2*i]+1;
  74     }
  75     NNEW(xo,double,ntrimax);
  76     NNEW(yo,double,ntrimax);
  77     NNEW(zo,double,ntrimax);
  78     NNEW(x,double,ntrimax);
  79     NNEW(y,double,ntrimax);
  80     NNEW(z,double,ntrimax);
  81     NNEW(nx,ITG,ntrimax);
  82     NNEW(ny,ITG,ntrimax);
  83     NNEW(nz,ITG,ntrimax);
  84     
  85     if(*mortar==0){
  86     
  87         FORTRAN(gencontelem_n2f,(tieset,ntie,itietri,ne,ipkon,kon,lakon,
  88           cg,straight,ifree,koncont,
  89           co,vold,xo,yo,zo,x,y,z,nx,ny,nz,ielmat,elcon,istep,
  90           iinc,iit,ncmat_,ntmat_,nmethod,mi,
  91           imastop,nslavnode,islavnode,islavsurf,itiefac,areaslav,iponoels,
  92           inoels,springarea,
  93           set,nset,istartset,iendset,ialset,tietol,reltime,
  94           imastnode,nmastnode,filab,nasym,xnoels));
  95 
  96     }else if(*mortar==1){
  97 
  98         FORTRAN(gencontelem_f2f,(tieset,ntie,itietri,ne,ipkon,kon,
  99           lakon,cg,straight,ifree,koncont,co,vold,xo,yo,zo,x,y,z,nx,ny,nz,
 100           ielmat,elcon,istep,iinc,iit,ncmat_,ntmat_,mi,imastop,islavsurf,
 101           itiefac,springarea,tietol,reltime,filab,nasym,pslavsurf,pmastsurf,
 102           clearini,theta));
 103 
 104     }
 105 
 106     SFREE(xo);SFREE(yo);SFREE(zo);SFREE(x);SFREE(y);SFREE(z);SFREE(nx);
 107     SFREE(ny);SFREE(nz);
 108 
 109     *ipompcp=ipompc;*labmpcp=labmpc;*ikmpcp=ikmpc;*ilmpcp=ilmpc;
 110     *fmpcp=fmpc;*nodempcp=nodempc;*coefmpcp=coefmpc;
 111   
 112     return;
 113 }

/* [<][>][^][v][top][bottom][index][help] */