root/src/storecontactdof.c

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

DEFINITIONS

This source file includes following definitions.
  1. storecontactdof

   1 /*     CalculiX - A 3-dimensional finite element program                   */
   2 /*              Copyright (C) 1998-2015 Guido Dhondt                          */
   3 /*     This program is free software; you can redistribute it and/or     */
   4 /*     modify it under the terms of the GNU General Public License as    */
   5 /*     published by the Free Software Foundation(version 2);    */
   6 /*                    */
   7 
   8 /*     This program is distributed in the hope that it will be useful,   */
   9 /*     but WITHOUT ANY WARRANTY; without even the implied warranty of    */ 
  10 /*     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the      */
  11 /*     GNU General Public License for more details.                      */
  12 
  13 /*     You should have received a copy of the GNU General Public License */
  14 /*     along with this program; if not, write to the Free Software       */
  15 /*     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.         */
  16 
  17 #include <stdio.h>
  18 #include <math.h>
  19 #include <stdlib.h>
  20 #include <string.h>
  21 #include "CalculiX.h"
  22 
  23 #ifdef SPOOLES
  24    #include "spooles.h"
  25 #endif
  26 #ifdef SGI
  27    #include "sgi.h"
  28 #endif
  29 #ifdef TAUCS
  30    #include "tau.h"
  31 #endif
  32 #ifdef PARDISO
  33    #include "pardiso.h"
  34 #endif
  35 
  36 void storecontactdof(ITG *nope,ITG *nactdof, ITG *mt, ITG *konl, ITG **ikactcontp, 
  37           ITG *nactcont,ITG *nactcont_, double *bcont, double *fnl, 
  38           ITG *ikmpc, ITG *nmpc, ITG *ilmpc,ITG *ipompc, ITG *nodempc, 
  39           double *coefmpc){
  40 
  41   ITG j,j1,jdof,id,k,l,ist,index,node,ndir,*ikactcont=*ikactcontp;
  42 
  43   for(j=0;j<*nope;j++){
  44       for(j1=0;j1<3;j1++){
  45           jdof=nactdof[*mt*(konl[j]-1)+j1+1];
  46           if(jdof!=0){
  47               
  48               jdof--;
  49               FORTRAN(nident,(ikactcont,&jdof,nactcont,&id));
  50               do{
  51                   if(id>0){
  52                       if(ikactcont[id-1]==jdof){
  53                           break;
  54                       }
  55                   }
  56                   (*nactcont)++;
  57                   if(*nactcont>*nactcont_){
  58                       *nactcont_=(ITG)(1.1**nactcont_);
  59                       RENEW(ikactcont,ITG,*nactcont_);
  60                   }
  61                   k=*nactcont-1;
  62                   l=k-1;
  63                   while(k>id){
  64                       ikactcont[k--]=ikactcont[l--];
  65                   }
  66                   ikactcont[id]=jdof;
  67                   break;
  68               }while(1);
  69               
  70               bcont[jdof]-=fnl[3*j+j1];
  71           }else{
  72               jdof=8*(konl[j]-1)+j1+1;
  73               FORTRAN(nident,(ikmpc,&jdof,nmpc,&id));
  74               if(id>0){
  75                   if(ikmpc[id-1]==jdof){
  76                       id=ilmpc[id-1];
  77                       ist=ipompc[id-1];
  78                       index=nodempc[3*ist-1];
  79                       if(index==0) continue;
  80                       do{
  81                           node=nodempc[3*index-3];
  82                           ndir=nodempc[3*index-2];
  83                           jdof=nactdof[*mt*(node-1)+ndir];
  84                           if(jdof!=0){
  85                               
  86                               jdof--;
  87                               FORTRAN(nident,(ikactcont,&jdof,nactcont,&id));
  88                               do{
  89                                   if(id>0){
  90                                       if(ikactcont[id-1]==jdof){
  91                                           break;
  92                                       }
  93                                   }
  94                                   (*nactcont)++;
  95                                   if(*nactcont>*nactcont_){
  96                                       *nactcont_=(ITG)(1.1**nactcont_);
  97                                       RENEW(ikactcont,ITG,*nactcont_);
  98                                   }
  99                                   k=*nactcont-1;
 100                                   l=k-1;
 101                                   while(k>id){
 102                                       ikactcont[k--]=ikactcont[l--];
 103                                   }
 104                                   ikactcont[id]=jdof;
 105                                   break;
 106                               }while(1);
 107                               
 108 /*                            bcont[jdof]+=coefmpc[index-1]*
 109                               fnl[3*j+j1]/coefmpc[ist-1];*/
 110                               bcont[jdof]-=coefmpc[index-1]*
 111                                   fnl[3*j+j1]/coefmpc[ist-1];
 112                           }
 113                           index=nodempc[3*index-1];
 114                           if(index==0) break;
 115                       }while(1);
 116                   }
 117               }
 118           }
 119       }
 120   }
 121 
 122   *ikactcontp=ikactcont;
 123   
 124   return;
 125 }
 126 

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