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

Go to the source code of this file.

Functions

void remastruct (ITG *ipompc, double **coefmpcp, ITG **nodempcp, ITG *nmpc, ITG *mpcfree, ITG *nodeboun, ITG *ndirboun, ITG *nboun, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, char *labmpc, ITG *nk, ITG *memmpc_, ITG *icascade, ITG *maxlenmpc, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nactdof, ITG *icol, ITG *jq, ITG **irowp, ITG *isolver, ITG *neq, ITG *nzs, ITG *nmethod, double **fp, double **fextp, double **bp, double **aux2p, double **finip, double **fextinip, double **adbp, double **aubp, ITG *ithermal, ITG *iperturb, ITG *mass, ITG *mi, ITG *iexpl, ITG *mortar, char *typeboun, double **cvp, double **cvinip, ITG *iit)
 

Function Documentation

void remastruct ( ITG ipompc,
double **  coefmpcp,
ITG **  nodempcp,
ITG nmpc,
ITG mpcfree,
ITG nodeboun,
ITG ndirboun,
ITG nboun,
ITG ikmpc,
ITG ilmpc,
ITG ikboun,
ITG ilboun,
char *  labmpc,
ITG nk,
ITG memmpc_,
ITG icascade,
ITG maxlenmpc,
ITG kon,
ITG ipkon,
char *  lakon,
ITG ne,
ITG nactdof,
ITG icol,
ITG jq,
ITG **  irowp,
ITG isolver,
ITG neq,
ITG nzs,
ITG nmethod,
double **  fp,
double **  fextp,
double **  bp,
double **  aux2p,
double **  finip,
double **  fextinip,
double **  adbp,
double **  aubp,
ITG ithermal,
ITG iperturb,
ITG mass,
ITG mi,
ITG iexpl,
ITG mortar,
char *  typeboun,
double **  cvp,
double **  cvinip,
ITG iit 
)

Definition at line 24 of file remastruct.c.

35  {
36 
37  /* reconstructs the nonzero locations in the stiffness and mass
38  matrix after a change in MPC's */
39 
40  ITG *nodempc=NULL,*mast1=NULL,*ipointer=NULL,mpcend,mpcmult,
41  callfrommain,i,*irow=NULL,mt,im;
42 
43  double *coefmpc=NULL,*f=NULL,*fext=NULL,*b=NULL,*aux2=NULL,
44  *fini=NULL,*fextini=NULL,*adb=NULL,*aub=NULL,*cv=NULL,*cvini=NULL;
45 
46  nodempc=*nodempcp;coefmpc=*coefmpcp;irow=*irowp;
47  f=*fp;fext=*fextp;b=*bp;aux2=*aux2p;fini=*finip;
48  fextini=*fextinip;adb=*adbp;aub=*aubp;cv=*cvp;cvini=*cvinip;
49 
50  mt=mi[1]+1;
51 
52  /* decascading the MPC's */
53 
54  printf(" Decascading the MPC's\n\n");
55 
56  callfrommain=0;
57  cascade(ipompc,&coefmpc,&nodempc,nmpc,
58  mpcfree,nodeboun,ndirboun,nboun,ikmpc,
59  ilmpc,ikboun,ilboun,&mpcend,&mpcmult,
60  labmpc,nk,memmpc_,icascade,maxlenmpc,
61  &callfrommain,iperturb,ithermal);
62 
63  /* determining the matrix structure */
64 
65  printf(" Determining the structure of the matrix:\n");
66 
67  if(nzs[1]<10) nzs[1]=10;
68  NNEW(mast1,ITG,nzs[1]);
69  NNEW(ipointer,ITG,mt**nk);
70  RENEW(irow,ITG,nzs[1]);for(i=0;i<nzs[1];i++) irow[i]=0;
71 
72  mastruct(nk,kon,ipkon,lakon,ne,nodeboun,ndirboun,nboun,ipompc,
73  nodempc,nmpc,nactdof,icol,jq,&mast1,&irow,isolver,neq,
74  ikmpc,ilmpc,ipointer,nzs,nmethod,ithermal,
75  ikboun,ilboun,iperturb,mi,mortar,typeboun,labmpc);
76 
77  SFREE(ipointer);SFREE(mast1);
78  RENEW(irow,ITG,nzs[2]);
79 
80  *nodempcp=nodempc;*coefmpcp=coefmpc;*irowp=irow;
81 
82  /* reallocating fields the size of which depends on neq[1] or *nzs */
83 
84  RENEW(f,double,neq[1]);DMEMSET(f,0,neq[1],0.);
85  RENEW(fext,double,neq[1]);DMEMSET(fext,0,neq[1],0.);
86  RENEW(b,double,neq[1]);DMEMSET(b,0,neq[1],0.);
87  RENEW(fini,double,neq[1]);
88 
89  /* for static calculations fini has to be set to f at the
90  start of the calculation; in dynamic calculations this is
91  not needed, since the initial accelerations has already
92  been calculated */
93 
94  if((*nmethod!=4)&&(*iit==-1)) DMEMSET(fini,0,neq[1],0.);
95 
96  if(*nmethod==4){
97  RENEW(aux2,double,neq[1]);DMEMSET(aux2,0,neq[1],0.);
98  RENEW(cv,double,neq[1]);
99  RENEW(cvini,double,neq[1]);
100  RENEW(fextini,double,neq[1]);
101 // for(i=0;i<neq[1];i++) fextini[i]=0.;
102 
103  /* the mass matrix is diagonal in an explicit dynamic
104  calculation and is not changed by contact; this
105  assumes that the number of degrees of freedom does
106  not change */
107 
108  if(*iexpl<=1){
109  RENEW(adb,double,neq[1]);for(i=0;i<neq[1];i++) adb[i]=0.;
110  RENEW(aub,double,nzs[1]);for(i=0;i<nzs[1];i++) aub[i]=0.;
111  mass[0]=1;
112  }
113  }
114 
115  *fp=f;*fextp=fext;*bp=b;*aux2p=aux2;*finip=fini;
116  *fextinip=fextini;*adbp=adb;*aubp=aub;*cvp=cv;*cvinip=cvini;
117 
118  return;
119 }
void cascade(ITG *ipompc, double **coefmpcp, ITG **nodempcp, ITG *nmpc, ITG *mpcfree, ITG *nodeboun, ITG *ndirboun, ITG *nboun, ITG *ikmpc, ITG *ilmpc, ITG *ikboun, ITG *ilboun, ITG *mpcend, ITG *mpcmult, char *labmpc, ITG *nk, ITG *memmpc_, ITG *icascade, ITG *maxlenmpc, ITG *callfrommain, ITG *iperturb, ITG *ithermal)
Definition: cascade.c:34
void mastruct(ITG *nk, ITG *kon, ITG *ipkon, char *lakon, ITG *ne, ITG *nodeboun, ITG *ndirboun, ITG *nboun, ITG *ipompc, ITG *nodempc, ITG *nmpc, ITG *nactdof, ITG *icol, ITG *jq, ITG **mast1p, ITG **irowp, ITG *isolver, ITG *neq, ITG *ikmpc, ITG *ilmpc, ITG *ipointer, ITG *nzs, ITG *nmethod, ITG *ithermal, ITG *ikboun, ITG *ilboun, ITG *iperturb, ITG *mi, ITG *mortar, char *typeboun, char *labmpc)
Definition: mastruct.c:27
#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
#define ITG
Definition: CalculiX.h:51
#define NNEW(a, b, c)
Definition: CalculiX.h:39
Hosted by OpenAircraft.com, (Michigan UAV, LLC)