root/src/inicont.c

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

DEFINITIONS

This source file includes following definitions.
  1. inicont

   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 <string.h>
  22 #include "CalculiX.h"
  23 
  24 void inicont(ITG * nk,ITG *ncont, ITG *ntie, char *tieset, ITG *nset, char *set,
  25                ITG *istartset, ITG *iendset, ITG *ialset, ITG **itietrip,
  26                char *lakon, ITG *ipkon, ITG *kon, ITG **koncontp,
  27                ITG *nslavs, double *tietol, ITG *ismallsliding, ITG **itiefacp,
  28                ITG **islavsurfp, ITG **islavnodep, ITG **imastnodep,
  29                ITG **nslavnodep, ITG **nmastnodep, ITG *mortar,
  30                ITG **imastopp,ITG *nkon,ITG **iponoelsp,ITG **inoelsp,
  31                ITG **ipep, ITG **imep, ITG *ne, ITG *ifacecount,
  32                ITG *nmpc, ITG *mpcfree, ITG *memmpc_,
  33                ITG **ipompcp, char **labmpcp, ITG **ikmpcp, ITG **ilmpcp,
  34                double **fmpcp, ITG **nodempcp, double **coefmpcp,
  35                ITG *iperturb, ITG *ikboun, ITG *nboun, double *co,
  36                ITG *istep,double **xnoelsp){
  37     
  38   char kind1[2]="C",kind2[2]="-",*tchar1=NULL,*tchar3=NULL,*labmpc=NULL;
  39     
  40   ITG *itietri=NULL,*koncont=NULL,*itiefac=NULL, *islavsurf=NULL,im,
  41       *islavnode=NULL,*imastnode=NULL,*nslavnode=NULL,*nmastnode=NULL,
  42       nmasts,*ipe=NULL,*ime=NULL,*imastop=NULL,
  43       *iponoels=NULL,*inoels=NULL,ifreenoels,ifreeme,*ipoface=NULL,
  44       *nodface=NULL,iface,*ipompc=NULL,*ikmpc=NULL,
  45       *ilmpc=NULL,*nodempc=NULL,nmpc_,i,j,k,ncone;
  46     
  47   double *fmpc=NULL,*coefmpc=NULL,*xnoels=NULL;
  48     
  49   itietri=*itietrip;koncont=*koncontp;itiefac=*itiefacp;islavsurf=*islavsurfp;
  50   islavnode=*islavnodep;imastnode=*imastnodep;nslavnode=*nslavnodep;
  51   nmastnode=*nmastnodep;imastop=*imastopp,iponoels=*iponoelsp;
  52   inoels=*inoelsp;ipe=*ipep;ime=*imep;xnoels=*xnoelsp;
  53 
  54   ipompc=*ipompcp;labmpc=*labmpcp;ikmpc=*ikmpcp;ilmpc=*ilmpcp;
  55   fmpc=*fmpcp;nodempc=*nodempcp;coefmpc=*coefmpcp;
  56   nmpc_=*nmpc;
  57 
  58   /* determining the number of slave entities (nodes or faces, ncone),
  59      and the number of master triangles (ncont) */
  60 
  61   FORTRAN(allocont,(ncont,ntie,tieset,nset,set,istartset,iendset,
  62           ialset,lakon,&ncone,tietol,ismallsliding,kind1,kind2,mortar,
  63           istep));
  64   if(*ncont==0) return;
  65 
  66   NNEW(itietri,ITG,2**ntie);
  67   NNEW(koncont,ITG,4**ncont);
  68   
  69   /* triangulation of the master side */
  70   
  71   FORTRAN(triangucont,(ncont,ntie,tieset,nset,set,istartset,iendset,
  72           ialset,itietri,lakon,ipkon,kon,koncont,kind1,kind2,co,nk));
  73 
  74   NNEW(ipe,ITG,*nk);
  75   NNEW(ime,ITG,12**ncont);
  76   DMEMSET(ipe,0,*nk,0.);
  77   DMEMSET(ime,0,12**ncont,0.);
  78   NNEW(imastop,ITG,3**ncont);
  79 
  80   FORTRAN(trianeighbor,(ipe,ime,imastop,ncont,koncont,
  81                         &ifreeme));
  82 
  83   if(*mortar==0){SFREE(ipe);SFREE(ime);}
  84   else{RENEW(ime,ITG,4*ifreeme);}
  85 
  86   /* catalogueing the external faces (only for node-to-face
  87      contact with a nodal slave surface */
  88 
  89   NNEW(ipoface,ITG,*nk);
  90   NNEW(nodface,ITG,5*6**ne);
  91   FORTRAN(findsurface,(ipoface,nodface,ne,ipkon,kon,lakon,ntie,
  92                  tieset));
  93     
  94   NNEW(itiefac,ITG,2**ntie);
  95   RENEW(islavsurf,ITG,2*6**ne);DMEMSET(islavsurf,0,12**ne,0);
  96   NNEW(islavnode,ITG,8*ncone);
  97   NNEW(nslavnode,ITG,*ntie+1);
  98   NNEW(iponoels,ITG,*nk);
  99   NNEW(inoels,ITG,2**nkon);
 100   NNEW(xnoels,double,*nkon);
 101   
 102   NNEW(imastnode,ITG,3**ncont);
 103   NNEW(nmastnode,ITG,*ntie+1);
 104   
 105   /* catalogueing the slave faces and slave nodes 
 106      catalogueing the master nodes (only for Mortar contact) */
 107 
 108   FORTRAN(tiefaccont,(lakon,ipkon,kon,ntie,tieset,nset,set,
 109        istartset,iendset,ialset,itiefac,islavsurf,islavnode,
 110        imastnode,nslavnode,nmastnode,nslavs,&nmasts,ifacecount,
 111        iponoels,inoels,&ifreenoels,mortar,ipoface,nodface,nk,
 112        xnoels));
 113 
 114   RENEW(islavsurf,ITG,2**ifacecount+2);
 115   RENEW(islavnode,ITG,*nslavs);
 116   RENEW(inoels,ITG,2*ifreenoels);
 117   RENEW(xnoels,double,ifreenoels);
 118   SFREE(ipoface);SFREE(nodface);
 119   
 120   RENEW(imastnode,ITG,nmasts);
 121 
 122   *itietrip=itietri;*koncontp=koncont;
 123   *itiefacp=itiefac;*islavsurfp=islavsurf;
 124   *islavnodep=islavnode;*imastnodep=imastnode;
 125   *nslavnodep=nslavnode;*nmastnodep=nmastnode;
 126   *imastopp=imastop;*iponoelsp=iponoels;*inoelsp=inoels;
 127   *ipep=ipe;*imep=ime;*xnoelsp=xnoels;
 128 
 129   *ipompcp=ipompc;*labmpcp=labmpc;*ikmpcp=ikmpc;*ilmpcp=ilmpc;
 130   *fmpcp=fmpc;*nodempcp=nodempc;*coefmpcp=coefmpc;
 131   
 132   return;
 133 }

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